User guide
24-130
SystemVerilog Testbench Constructs
For information on the creation and refinement of verification
testbenches, see the Reference Verification Methodology User
Guide.
Aspect-Oriented Extensions in SV
In SV, AOP is supported by a set of directives and constructs that
need to be processed before compilation. Therefore, an SV program
with these Aspect oriented directives and constructs would need to
be processed as per the definition of these directives and constructs
in SV to generate an equivalent SV program that is devoid of aspect
extensions, and consists of traditional SV. Conceptually, AOP is
implemented as pre-compilation expansion of code.
This chapter explains how AOE in SV are directives to SV compiler
as to how the pre-compilation expansion of code needs to be
performed.
In SV, an aspect extension for a class can be defined in any scope
where the class is visible, except for within another aspect extension.
That is, aspect extensions can not be nested.
An aspect oriented extension in SV is defined using a new top-level
extends directive. Terms aspect and “extends directive” have been
used interchangeably throughout the document. Normally, a class is
extended through derivation, but an extends directive defines
modifications to a pre-existing class by doing in-place extension of
the class. in-place extension modifies the definition of a class by
adding new member fields and member methods, and changing the
behavior of earlier defined class methods, without creating any new
subclasse(s). That is, SV’s Aspect-Oriented Extensions change the
original class definition without creating subclasses. These changes
affect all instances of the original class that was extended by AOEs.