Verilog中如何做到C语言中define定义常量的功能
C code:
定义一个常量可用define: 如 define CNT_MAX 200
Verilog module设计:
定义一个常量可用parameter: 如 parameter CNT_MAX = 200;
Verilog top如何列化:
counter
#(
.CNT_MAX(25'd24_999_999)
)
counter0(
.Clk(c0),
.Rst_n(Rst_n),
.led(LED[0])
);
Verilog testbench如何列化:
defparam PLL_LED.counter0.CNT_MAX = 24;
defparam 顶层模块名.子模块名.CNT_MAX = 24;