verilog - 红色输出线 - Verilog 模拟
问题描述
我尝试在 Modelsim 中模拟我在 Verilog 上的代码。当我模拟它时,它会显示 X(red) 输出线。这是我的代码和测试台:
module alu64bit (
input wire [63:0] a, // Input bit a
input wire [63:0] b, // Input bit b
input wire cin, // Carry in
input wire [1:0] op, // Operation
output wire [63:0] s, // Output S
output wire cout // Carry out
);
wire [63:0] cin_out;
assign cout = cin_out[63];
assign cin = cin_out[0];
genvar i;
generate
for(i=0; i <= 63; i = i + 1) begin
alu1bit alu (.s(s[i]),.cout(cin_out[i+1]),.a(a[i]),.b(b[i]),.cin(cin_out[i]),.op(op));
end
endgenerate
// End of your code
endmodule
结核病:
module alu64bit_test;
reg [63:0] a;
reg [63:0] b;
reg [1:0] op;
reg cin;
wire [63:0] s;
wire cout;
alu64bit uut (
.a(a),
.b(b),
.cin(cin),
.op(op),
.s(s),
.cout(cout)
);
initial begin
a = 64'hffffffffffffffff;
b = 64'h0000000000000000;
cin = 0;
op[1] = 1;
op[0] = 0;
#100;
end
endmodule
有人可以帮我解决这个问题吗?谢谢你!
解决方案
推荐阅读
- xcode - 如何将 Mac App Store 的“兼容性”设置为旧版本的 macOS?
- android - 是否可以在 QEMU-AARCH64 上安装 Android 通用系统映像 (GSI)
- javascript - 如何使用 requirejs 正确实现 Cookiebot?
- python-3.x - 在诗歌中将依赖转移到 --dev
- laravel - 在我的本地环境中,env 值有时会在 laravel 5.8 中返回 null
- r - Brms:在序数回归中绘制三向交互
- javascript - 发送表单后将带逗号的更改字符串切割为不带逗号的字符串
- java - 使用 JDK11 从 2.2.2 升级后的 Spring boot 2.3.3 停止在 Apache HTTP/1.1 上使用 AJP
- php - Wordpress 自定义帖子类型正在重写所有其他帖子类型、页面和帖子的 URL
- node.js - 如何避免节点 child_process exec 中的命令注入