【发布时间】:2021-12-31 19:21:01
【问题描述】:
我收到了错误:
concurrent assignment to a non-net 'A' is not permitted
concurrent assignment to a non-net 'B' is not permitted
Static elaboration of top level Verilog design unit(s) in library work failed.
我做错了什么?
module ex1( input reg [1:0] a,
input reg [1:0]b,
output wire c,
);
assign c=(a>b)?(a=1'b1):(c=1'b0);
endmodule
module testbench(
);
reg[1:0]a=2'b11;
reg [1:0]b=2'b00;
wire c;
always#10
begin
a=a-2'b01;
b=b-2'b01;
end
initial
#150 $finish;
ex1 testbench2 (.a(a),
.b(b),.c(c));
endmodule
【问题讨论】:
-
从输入中删除“reg”。同样在您的分配语句中使用 RHS 中的“==”。我假设您希望在 RHS 中进行比较。