的Cadence艾朗給出誤差下面的代碼,其中fifo_depth_base2是參數如下:SystemVerilog的:在級聯使用的參數給出了艾朗錯誤
ncvlog:* E,NONOWD(buff_mgr.v,17 | 46):在沒有明確寬度規範的情況下非法使用常量[4.1.14(IEEE)]。
我可以理解這個錯誤,但我的問題是我將如何將它分配給參數化設計。
// rd pointer and read logic
always @(posedge clk or posedge rst) begin
if(rst) rd_ptr <= 0;
else begin
case({flush, rd})
2'b10, 2'b11: rd_ptr <= {fifo_depth_base2{'b0}}; // error here
...
endcase
end
end
我認爲SystemVerilog中,使用結構時,這樣的'fifo_depth_base2 {'B0}',fifo_depth_base2應一個常數。你可以使用for循環來使其參數化,或者只是'rd_ptr <='0'。 – Ari
看到這個:http://stackoverflow.com/questions/23239366/how-to-generate-a-set-of-continuous-one-in-verilog – Ari
@Ari,'fifo_depth_base2'是一個參數,所以它已經是一個常數。 – Greg