3
integer test[7:0];
,但我不能這樣做:
test[0] = 0;
或
assign test[0] = 0;
或
intial
begin
test[0]=0;
end
或
integer test[7:0] = {0,0,0,0,0,0,0,0,0};
任何想法?以0爲例,我需要它是26,40,32,18,50,0,20,12
integer test[7:0];
,但我不能這樣做:
test[0] = 0;
或
assign test[0] = 0;
或
intial
begin
test[0]=0;
end
或
integer test[7:0] = {0,0,0,0,0,0,0,0,0};
任何想法?以0爲例,我需要它是26,40,32,18,50,0,20,12
你確定initial
不起作用(你可能有一個錯字... )?
initial begin
for(int i=0; i<8; i++) begin
test[i] = i;
end
$display(test[4]);
end
在systemverilog中,類似下面的內容將起作用。這些被稱爲「分配模式」:
integer test[7:0] = '{26, 40, 32, 18, 50, 0, 20, 12}; // note the '
我懷疑上述任一的是綜合的,除了靶向FPGA或許時。
是否需要申報? – Edmund 2013-07-06 07:31:33
'''在'for'語句中聲明,儘管它實際上應該是'integer i'。 – stanri 2014-02-17 10:36:17