In the base class (base_class.svh), I created below code.
class my_base_class;
function new(...);
super.new(name);
endfunction: new
bit st_ld_buf[$];
task store(logic [47:0] addr, logic [63:0] data);
...... // do something related with sequence and sequencer
my_buf.push_back(1);
endtask
endclass
And I created another class named my_func_class which is extending from my_base_class.
class my_func_class extends my_base_class;
function new(...);
super.new(name);
endfunction: new
endclass
And Then I created another class named my_important_class which is extending from my_func_class.
In this body(), the my_process() task is forever executed to wait the my_buf is not empty.
class my_important_class extends my_base_class;
function new(...);
super.new(name);
endfunction: new
task body();
fork
my_process();
other_proc();
join
......
endtask
task my_process();
bit is_op;
forever begin
wait(my_buf.size);
is_op = my_buf.pop_front();
......
end
endtask
endclass
Now I created a test, which is extended from my_func_class. and here is the snippet of code.
class my_test0 extends my_func_class;
function new(...);
super.new(name);
endfunction: new
task body();
logic [47:0] addr;
logic [63:0] data;
// do something to get addr and data
store(addr, data);
.....
endtask
endclass
But when the test starts, I just saw we hit the “push_back” operation but never reach to “pop_front”. May I know what’s wrong here ?