User guide
24-154
SystemVerilog Testbench Constructs
f = new();
f.myTask();
endprogram
class foo;
int i;
task myTask();
printf("Executing original code\n");
endtask
endclass
extends aoe1 (foo);
around task myTask();
proceed;
printf("around in aoe1\n");
endtask
endextends
extends aoe2 (foo) dominates (aoe1);
around task myTask();
proceed;
printf("around in aoe2\n");
endtask
endextends
// End file input.sv
On the other hand, when aoe2 dominates aoe1 as in this Example
24-16, the output is:
Executing original code
around in aoe1
around in aoe2
Symbol resolution details:
As introductions and advices defined within extends directives are
pre-processed as a pre-compilation expansion of the input program,
the pre-processing occurs earlier than final symbol resolution stage
within a compiler. Therefore, it possible for AOE code to reference
symbols that were added to the original class definition using AOEs.