Guest
Hi,
I am trying create verilog module that can support parameterized instance name. I understand that the signal width and other such things can be parameterized. But can we also parameterize the module instance name?
In following code, I am curious if there is any way SomeDynamicInstanceName can be parameterized also? I can try to use system verilog if that can help here
My purpose is to be able to reuse the verilog gmon module (generic verilog module) for various types of signals. But for a reason, I need to change the SomeDynamicInstanceName. I have control of a verilog file where I instantiate gmon verilog module so I can pass the parameters.
Prompt response is greatly appreciated.
`timescale 1 ns/100 ps
module gmon
#(
parameter WIDTH = 32
)
(Clk, Rst, SignalName);
// PCIE MST_BIF
input Clk;
input Rst;
input [WIDTH-1:0] SignalName;
// input [31:0] SignalName_ret
reg [WIDTH-1:0] SignalName_d1;
//reg [31:0] SignalName_d2;
always @ (posedge Clk) begin
SignalName_d1 <= SignalName;
// SignalName_d2 <= SignalName_ret;
end
wire b = some combinatroial log;
test_module #(.FIFOBUF_WIDTH(WIDTH)) SomeDynamicInstanceName (
..reset(Rst), //CHECK THIS -- ACTIVE HIGH
..wclk(Clk),
..out_data_valid(b),
..out_data(SignalName[WIDTH-1:0]),
..out_eom(1'b0),
..out_flush_file(1'b0),
..out_flush_pipe(1'b0)
);
I am trying create verilog module that can support parameterized instance name. I understand that the signal width and other such things can be parameterized. But can we also parameterize the module instance name?
In following code, I am curious if there is any way SomeDynamicInstanceName can be parameterized also? I can try to use system verilog if that can help here
My purpose is to be able to reuse the verilog gmon module (generic verilog module) for various types of signals. But for a reason, I need to change the SomeDynamicInstanceName. I have control of a verilog file where I instantiate gmon verilog module so I can pass the parameters.
Prompt response is greatly appreciated.
`timescale 1 ns/100 ps
module gmon
#(
parameter WIDTH = 32
)
(Clk, Rst, SignalName);
// PCIE MST_BIF
input Clk;
input Rst;
input [WIDTH-1:0] SignalName;
// input [31:0] SignalName_ret
reg [WIDTH-1:0] SignalName_d1;
//reg [31:0] SignalName_d2;
always @ (posedge Clk) begin
SignalName_d1 <= SignalName;
// SignalName_d2 <= SignalName_ret;
end
wire b = some combinatroial log;
test_module #(.FIFOBUF_WIDTH(WIDTH)) SomeDynamicInstanceName (
..reset(Rst), //CHECK THIS -- ACTIVE HIGH
..wclk(Clk),
..out_data_valid(b),
..out_data(SignalName[WIDTH-1:0]),
..out_eom(1'b0),
..out_flush_file(1'b0),
..out_flush_pipe(1'b0)
);