我写了一个类似下面的代码来连接,但它显示了一个错误:
module main ;
bit [4:0] a;
reg b,c,d;
initial
begin
b = 0;
c = 1;
d = 1;
a = {b,c,0,0,d};
{b,c,d} = 3'b111;
$display(" a %b b %b c %b d %b ",a,b,c,d);
end
endmodule 这里的错误显示的是该constants cannot be concatenated。
它不能在这里连接0和1。有人能帮我解决这个问题吗?
发布于 2013-07-30 16:10:50
当前代码正在连接32位(或整数)宽度0。您实际需要的是:
a = {b, c, 1'b0, 1'b0, d}; 注:通过cadence工具,我得到了:
file: main.sv
a = {b,c,0,0,d};
|
ncvlog: *E,NONOWD (main.sv,11|13): Illegal use of a constant without an explicit width specification [4.1.14(IEEE)].
a = {b,c,0,0,d};
|
ncvlog: *E,NONOWD (main.sv,11|15): Illegal use of a constant without an explicit width specification [4.1.14(IEEE)].https://stackoverflow.com/questions/17939750
复制相似问题