Hi,
I want to hierarchically access the contents inside the SV class from the top level TB. Assume that I have a file called 'sv_class.sv" where i have defined the class called, 'sv_class'
class sv_class extends uvm_sequence();
...
int repeat_cnt;
...
endclass
I compile this in my top level TB as follows:
module top_tb;
`include "sv_class.sv"
endmodule
But when I try to access the int repeat_cnt from class 'sv_class' from the top_tb, I am getting the error:
module top_tb;
`include "sv_class.sv"
initial begin
if(top_tb.sv_class.repeat_cnt == 10) begin
...
end
end
endmodule
Here, i am getting, 'Illegal hierarchical reference detected [top_tb.sv_class.repeat_cnt](illegal hierarchical name containing a type name).
Any idea on how to solve this issue?