我在systemverilog中有這個代碼,我必須在for循環中使用十六進制數。我正在嘗試下面的語法和代碼。十六進制值在verilog循環中生成
genvar i,j;
localparam int i_d = 1;
localparam int j_d = 134;
generate
for (i = 8'h01; i <= MAX1; i = i + INCR)
begin
add_bit[i_d] = (creg_add == i);
i_d = i_d + 1;
end
for (j = 8'h86; j <= MAX2; j = j + INCR)
begin
add_bit[j_d] = (creg_add == j);
j_d = j_d + 1;
end
endgenerate
但是我正面臨着這個錯誤。有人可以幫我嗎?
Error-[SE] Syntax error
Following verilog source has syntax error :
"creg.vs",
715: token is '['
add_bit[i_d] = (creg_add == i);
^
什麼是'add_bit'?你可能需要'assign ad_bit [i_d] = ....'。我認爲這是一個重複的:https://stackoverflow.com/questions/45491164/getting-the-invalid-module-instantiation-in-my-fir-verilog-code – Serge
你有什麼定義'add_bit'爲? –
add_bit被定義爲邏輯 –