User guide

24-158
SystemVerilog Testbench Constructs
Example 24-19
class pbase;
virtual task print();
$display("I’m pbase\n");
endtask
endclass
class packet extends pbase;
task foo();
$display(); //Call the print task
endtask
endclass
extends myaspect(packet);
hide(virtuals); // Allows permissions to
// hide pbase::print task
virtual task print();
$display("I’m packet\n”);
endtask
endextends
As explained earlier, there are two types of hide permissions:
a. Permission to hide virtual methods defined in a super class
(option virtuals) is referred to as virtuals-permission. An aspect
item is either an introduction, an advice, or a hide list within an
aspect. If at an aspect item within an aspect, such permission
is granted, then the virtuals-permission is said to be on or the
status of virtuals-permission is said to be on at that aspect item
and at all the aspect items following that, until a hide list that
forfeits the permission is encountered. If virtuals-permission is
not on or the status of virtuals-permission is not on at an aspect
item, then the virtuals-permission at that item is said to be off
or the status of virtuals-permission at that item is said to be off