Verilog - 模拟时模块的输出保持未知状态

问题描述 投票:-1回答:1

当我尝试使用Quartus prime的模拟波形编辑器模拟模块时,模块的输出保持未知状态或不关心状态('X')。该模块是项目中唯一与.vwf文件一起使用的模块。

这是模块:

module pc (input clk, reset_n, branch, increment, input [7:0] newpc,
            output reg [7:0] pc);


parameter RESET_LOCATION = 8'h00;

    initial pc = 8'h00;

    always @(posedge clk or posedge reset_n) begin

        if (reset_n) begin

            pc <= RESET_LOCATION;

        end else begin

            if (increment) begin
                pc <= pc + 1;
            end else if (branch) begin 
                pc <= newpc;
            end 

        end

    end

endmodule

这是模拟:

enter image description here

verilog fpga hdl quartus
1个回答
0
投票

我找到了解决方案......

我不知道为什么,但每当我更改顶级实体时,我都需要创建一个新的.vwf。

© www.soinside.com 2019 - 2024. All rights reserved.