Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想根据genvar i在generate语句中声明许多reg。例如,如果 genvar i = 10 i,我想声明 reg_0, reg_1, reg_2 ... reg_9。
我怎样才能做到这一点?
我认为您必须将它们声明为数组。我的 Verilog 有点生锈,但我认为这样的事情应该可以工作:
reg [width-1:0] foo [0:i - 1];