Hi VA,
Trying to extend a task in my ext_test, which was defined before in the base_test.
Used the call of: super.main_phase(phase)
In the extended main_phase task, but still receive errors while compilation:
Error-[IND] Identifier not declared
/space/git/block_a/verif/tests/ext_test.sv, 61
Identifier ‘main_drain_time’ has not been declared yet. If this error is not
expected, please check if you have set `default_nettype to none.
Instance stack trace:
$unit /tools/snps/vcs/S-2021.09-SP1-1/etc/uvm-1.2/uvm_pkg.sv, 1
Error-[XMRE] Cross-module reference resolution error
/space/git/block_a/verif/tests/ext_test.sv, 63
Error found while trying to resolve cross-module reference.
token ‘obj’. Originating package ‘$unit’.
Source info: obj.set_drain_time(\this , main_drain_time);
Instance stack trace:
$unit /tools/snps/vcs/S-2021.09-SP1-1/etc/uvm-1.2/uvm_pkg.sv, 1
Code example:
class base_test extends uvm_test;
....
task main_phase(uvm_phase phase);
uvm_objection obj = phase.get_objection();
time main_drain_time;
super.main_phase(phase);
`uvm_info(get_name(), "main_phase()", UVM_LOW)
main_drain_time = 200ns;
obj.set_drain_time(this, main_drain_time);
`uvm_info(get_name(), $sformatf("[BASE_TEST] drain_time=%0t, was set for main_phase", main_drain_time), UVM_NONE)
endtask // main_phase
endclass
class ext_test extends base_test;
...
task main_phase(uvm_phase phase);
super.main_phase(phase);
`uvm_info(get_name(), "extended_test - main_phase()", UVM_LOW)
main_drain_time = 500ns;
obj.set_drain_time(this, main_drain_time);
`uvm_info(get_name(), $sformatf("[EXTENDED_TEST] override drain_time=%0t, was set for main_phase", main_drain_time), UVM_NONE)
endtask // main_phase
endclass
What am I missing?
Why the access to the defined members in the base class task are not accessible by the extended class task?
Will appreciate your help.
Thanks,
Michael