你如何获得未知宽度的参数?
How do you get a parameter of unknown width?
我想要一个未知宽度的设计参数。
VHDL 中类似这种通用的东西。
Generic (xyz : std_logic_vector);
这是怎么做到的?
Verilog 参数采用分配给它们的值的宽度。
module foo();
parameter xyz = 1'b0;
initial $display("%m %b",xyz); // display foo 0 by itself
endmodule
module top;
foo #(3'b0) f1(); // will display top.f1 000
foo #(4'b0) f1(); // will display top.f2 0000
endmodule
我想要一个未知宽度的设计参数。
VHDL 中类似这种通用的东西。
Generic (xyz : std_logic_vector);
这是怎么做到的?
Verilog 参数采用分配给它们的值的宽度。
module foo();
parameter xyz = 1'b0;
initial $display("%m %b",xyz); // display foo 0 by itself
endmodule
module top;
foo #(3'b0) f1(); // will display top.f1 000
foo #(4'b0) f1(); // will display top.f2 0000
endmodule