verilog - 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
这是模拟:
解决方案
我找到了解决方案...
我不知道为什么,但是每当我更改顶级实体时,我都需要创建一个新的 .vwf。
推荐阅读
- python - 如何使用 python 在现有 mongoDB 文档中添加具有特定数据类型(列表、对象)的字段
- python - 如何在类的递归方法中使用参数
- python-3.7 - 为什么表格不适用于数字 10、11 和 12?
- mule - 如何定义 RAML 规范以接受遵循特定路径的所有 URI 参数
- css - Bootstrap 4 - 容器填充整个屏幕,滚动后显示页脚
- git - Invoke-Expression,并非所有输出都返回到变量
- amazon-web-services - 如何一起使用 Fn::Include 和 Fn::Sub?
- c - 将联合传递给函数无法识别参数名称
- java - 在控制器方法签名处处理异常
- javascript - 页面重新加载后如何使代码在已挂载的生命周期挂钩中运行