【发布时间】:2015-11-08 17:05:41
【问题描述】:
我的verilog 代码是一个只使用assign sum = a+b 的加法器。问题是,在使用 cocotb 运行它时,sum 仍然未知,尽管 a 和 b 具有有效值。当我将 sum 设为 reg 类型时,它可以工作。
`timescale 1 ns / 1 ps
module adder(input [7:0] a,
input [7:0] b,
output reg [7:0] sum,
output [7:0] sum2);
assign sum2=a+b; //Trouble is here
always@(a,b) begin
sum=a+b; //This works
end
`ifdef COCOTB_SIM
initial begin
$dumpfile("adder.vcd");
$dumpvars();
end
`endif
endmodule
【问题讨论】:
标签: python verilog fpga asic cocotb