当我尝试使用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
这是模拟:
我找到了解决方案......
我不知道为什么,但每当我更改顶级实体时,我都需要创建一个新的.vwf。