User guide

24-146
SystemVerilog Testbench Constructs
Weaving of advices
An input program may contain several aspect extensions for any or
each of the different class definitions in the program. Weaving of
advices needs to be carried out for each class method for which an
advice is specified.
Weaving of advices in the input program consists of weaving of
advices into each such class method. Weaving of advices into a
class method A is unrelated to weaving of advices into a different
class method B, and therefore weaving of advices to various class
methods can be done in any ordering of the class methods.
For weaving of advices into a class method, all the advices
pertaining to the class method are identified and ordered in the order
of increasing precedence in a list L. This is the order in which these
advices are woven into the class method thereby affecting the
run-time behavior of the method. The advices in list L are woven in
the class method as per the following steps. Target method is
initialized to the class method.
a. Advice A that has the lowest precedence in L is woven into the
target method as explained earlier. Note that the target method
may either be the class method or some other method newly
created during the weaving process.
b. Advice A is deleted from list L.
c. The next advice on list L is woven into the target method. This
continues until all the advices on the list have been woven into
list L.
It would become apparent from the example provided later in this
section how the order of precedence of advices for a class method
affects how advices are woven into their target method and thus the
relative order of execution of advice code blocks. Before and after
advices within an aspect to a target method are unrelated to each