sky_above
Member level 2
Can a module be instantiated with a generic variable for parameter value as done in the following codes for the instances
multiplier #(k) multiplier0, divider #(v) divider0, block_p #(k,v) block_p0?
Here multiplier0 is the instance of multiplier module whose rtl has a parameter named z inside it. The block_p0 is the instance of a module named block_p whose rt has two parameter named u and x inside it. The divider0 is also an instance of a module named divider whose rtl also has a paramer declared.
multiplier #(k) multiplier0, divider #(v) divider0, block_p #(k,v) block_p0?
Here multiplier0 is the instance of multiplier module whose rtl has a parameter named z inside it. The block_p0 is the instance of a module named block_p whose rt has two parameter named u and x inside it. The divider0 is also an instance of a module named divider whose rtl also has a paramer declared.
Code:
module toplevel (.....);
parameter k =6;
parameter v=9;
input .......
output ......
reg ..........
multiplier #(k) multiplier0
divider #(v) divider0
block_p #(k,v) block_p0
............
endmodule