Verilog Tips 1:TestBench编写注意事项【concurrent assignment to a non-net ‘xxxx‘ is not permitted】解决

一个案例:
待测试模块输入输出为:
Verilog Tips 1:TestBench编写注意事项【concurrent assignment to a non-net ‘xxxx‘ is not permitted】解决_第1张图片
TestBench测试文件为:
Verilog Tips 1:TestBench编写注意事项【concurrent assignment to a non-net ‘xxxx‘ is not permitted】解决_第2张图片

一仿真,报错 concurrent assignment to a non-net ‘xxxx’ is not permittedVerilog Tips 1:TestBench编写注意事项【concurrent assignment to a non-net ‘xxxx‘ is not permitted】解决_第3张图片
原因分析:
对于待测试模块的输出 “dout_7888”,在编写测试文件的时候,不能将与之交联的“dout_7888”定义为 reg 型,须改为 wire 型。

对于模块中的输出来说
即,不能以 TestBench中的 reg 型赋值给被测模块作为输出的 wire 型;
同,不能以 TestBench中的 reg 型赋值给被测模块作为输出的 reg 型;
只能以TestBench中的 wire 型赋值给被测模块作为输出的 wire 型,
对于输入来说用 reg 可行。

你可能感兴趣的:(Verilog,Tips,verilog,fpga)