User guide
24-147
SystemVerilog Testbench Constructs
other in the sense that their relative precedence to each other does
not affect their relative order of execution when a method call to the
target method is executed. The before advice’s code block executes
before the target method code block, and the after advice code block
executes after the target method code block. When an around
advice is used with a before or after advice in the same aspect, code
weaving depends upon their precedence with respect to each other.
Depending upon the precedence of the around advice with respect
to other advices in the aspect for the same target method, the around
advice either may be woven before all or some of the other advices,
or may be woven after all of the other advices.
As an example, weaving of advices 1, 2, 3, 4 specified in aspect
extensions in Example 24-11 leads to the expansion of code in the
following manner. Advices are woven in the order of increasing
precedence {2, 3, 4, 1} as explained earlier.
Example 24-12
// Beginnning of file Input.vr
program top ;
packet p;
p = new();
p.send_Created_a();
endprogram
class packet;
...
// Other member fields/methods
...
task send();
p$display("Sending data\n”);
endtask
task send_Created_a();
send();
send_after_Created_b();
endtask
task send_after_Created_b();