User guide

24-148
SystemVerilog Testbench Constructs
$display("Aspect_2: send advice after\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);
around task send(); // Advice 3
$display("Aspect_3: Begin send advice around\n");
proceed;
$display("Aspect_3: End send advice around\n");
endtask
before task send(); // Advice 4
$display("Aspect_3: send advice before\n");
endtask
endextends
// End of file Input.sv
This Example 24-12 shows what the input program looks like after
weaving advice 2 into the class method. Two new methods
send_Created_a and send_after_Created_b are created in the
process and the instances of method call to the target method
packet::send are modified, such that the code block from advice 2
executes after the code block of the target method packet::send.
Example 24-13
// Beginnning of file Input.vr
program top;
packet p;
p = new();
p.send_around_Created_c();
endprogram
class packet;
...
// Other member fields/methods