首页 > 解决方案 > Verilog - 模拟时处于未知状态的模块的输出

问题描述

当我尝试使用 Quartus prime 的 Simulation Waveform 编辑器模拟模块时,模块的输出保持在未知状态或无关状态 ('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

这是模拟:

在此处输入图像描述

标签: verilogfpgahdlquartus

解决方案


我找到了解决方案...

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


推荐阅读