First, I want to instantiate a bunch of generic buffers using genvar in system verilog where each instantance basically contains what the value of the index is, to make them have different names so I can tie them to an 8 bit bus, one buffer per bit.
The code may not be syntactically correct, but this is what I want to do:
genvar i;
generate
for (i=0; i<7; i=i+1)
begin
IBUFDS IBUFDS_[actual_value_of_i_here]_clk
(
.I (input1_reg[fire_actual_value_of_i_here_starter]),
.IB (input1b_reg[actual_value_of_i_here_starter]),
.O (output_reg[actual_value_of_i_here_starter])
);
end
endgenerate
I want the end result to look something like this, from 0 to 7.
IBUFDS IBUFDS_[0]_clk
(
.I (input1_reg[fire_0_starter]),
.IB (input1b_reg[fire_0_starter),
.O (output_reg[fire_0_starter)
);
IBUFDS IBUFDS_[1]_clk
(
.I (input1_reg[fire_1_starter]),
.IB (input1b_reg[fire_1_starter]),
.O (output_reg[fire_1_starter])
);
I don't know how to pass in the index i such that it's used in the name of the instance as well as inserted in the signal that it's connected to.
Second: I also want to do something more advanced, where in the instance name I have some array with 8 values such as farm_array[chicken, rooster, cow... etc] and I pull out string values and enter them in the instance name so the end result looks like this for example:
IBUFDS IBUFDS_chicken_0_clk
(
.I (input1_reg[fire_0_starter]),
.IB (input1b_reg[fire_0_starter),
.O (output_reg[fire_0_starter)
);
IBUFDS IBUFDS_rooster_1_clk
(
.I (input1_reg[fire_1_starter]),
.IB (input1b_reg[fire_1_starter]),
.O (output_reg[fire_1_starter])
);
How do I pass in string values from that array into the genvar?