User guide

24-149
SystemVerilog Testbench Constructs
...
task send();
$display("Sending data\n”);
endtask
task send_Created_a();
send();
send_after_Created_b();
endtask
task send_after_Created_b();
$display("Aspect_2: send advice after\n");
endtask
task send_around_Created_c();
$display("Aspect_3: Begin send advice around\n");
send_Created_a();
$display("Aspect_3: End send advice around\n");
endtask
endclass
extends aspect_1(packet) dominates (aspect_2, aspect_3);
after task send(); // Advice 1
$display("Aspect_1: send advice after\n");
endtask
endextends
extends aspect_3(packet);
before task send(); // Advice 4
$display("Aspect_3: send advice before\n");
endtask
endextends
// End of file Input.sv
This Example 24-13 shows what the input program looks like after
weaving advice 3 into the class method. A new method
send_around_Created_c is created in this step and the instances of
method call to the target method packet::send_Created_a are
modified, such that the code block from advice 3 executes around
the code block of method packet::send_Created_a. Also note that
the proceed statement from the advice code block is replaced by a