Hi,
I am using ‘genvar’ for the below code,please tell me if there is anything wrong.
The code in tb_top file:
genvar count;
generate
for (count=0;count<8;count++) begin:abc
abc_if handel_if(clk);
end
initial begin
uvm_config_db#(virtual abc_if)::set(null,"xgbe_static", $sformatf("abc_port_if_%0d",count), handel_if);
end
endgenerate
generate
for (count=0;count<8;count++) begin:def
if(count==0) begin
some code.....
end
else if(count==1)begin
some code.....
end
endgenerate
Doing get like below mentioned:
for (int i=0;;i++) begin
if( uvm_config_db#(virtual abc_if)::get(null, "xgbe_static", $sformatf("abc_port_if_%0d",i*2), abc_if0) == 0) begin
`uvm_error(get_type_name(), $sformatf("Can NOT find eth_port_if."))
end