I would like to know if possible from “uvm testcase” class to have a path back to the DUT submodules in order to switch off assertions. Because assertions are based on sub-module of DUT, the goal is to switch off assertion depends on the test.
//uvm testcase
class example_test extends uvm_test;
…
task run_phase(uvm_phase phase)
$assertoff(1, path to the DUT submodule) //something similar
endtask
endclass
Sorry, it doesn’t work for me. The problem is having $assertoff(0) in the testcase unable to switch off assertions. So I thought by giving direct path to the DUT sub-module might help, but what is the path from uvm testcase to DUT submodule?
There are two arguments, first is zero and secondly we are accessing the dut submodu
le from tb top file. inst_dut is instance fo dut submodule in the tb top file.
Don’t use $assertoff() statements. They are messy and require code changes/recompilation to change the testbench behavior.
Instead, you should be using your simulation tool’s method for disabling assertions. Each simulator has a unique way of doing this, so you will need to read your tool’s user manual.
Another option is to put the bind statements in a separate top-level module. You can disable all of the assertions associated with the bind statements by not simulating that module.
But the problem is the verification environment I’m working on is UVM testbench, how can I switch assertions off in testcase class or in testcase class access to testbench top?
There is no restriction, you can use the simulator features to switch off/on the assertions.
Doing this from your UVM testbench/test code is more restrictive.