module my_mod ( input clk, input rst );
endmodule: my_mod
module dut ( input clk, input rst );
genvar i;
generate
for(i=0;i<2;i++) begin: gen_my_mod
my_mod u_my_mod ( .clk(clk), .rst(rst) );
end
endgenerate
endmodule
module bind_x ( input clk, input rst );
endmodule: bind_x
module tb;
bit clk;
bit rst;
dut u_dut ( .clk(clk), .rst(rst) );
bind u_dut.gen_my_mod[0].u_my_mod bind_x bind_inst (.clk(clk), .rst(rst));
bind u_dut.gen_my_mod[1].u_my_mod bind_x bind_inst (.clk(clk), .rst(rst));
endmodule: tb
Tuesday, September 17, 2024
How to bind multiple instances of module inside DUT
Subscribe to:
Post Comments (Atom)
Generating prime numbers between 1 to 100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 class test ; int prime_q[$]; function voi...
-
Following is the SV code for knight tour. On each randomisation, we get the next position of knight. The concept is simple, based on which w...
-
Array of size 100 You have elements from 100 to 199 randomly shuffled. One number is replaced with another number in the same range .. Fin...
No comments:
Post a Comment