Hardware Reference
In-Depth Information
To instantiate the checker in a module it is necessary to import the package
contents first:
module m( logic clk, rst, send, ack, ...);
import check_lib:: * ;
...
request_granted ack_received(send, ack, 1, posedge clk, rst);
endmodule :m
The statement import check_lib:: * makes the entire contents of the package
visible in m . Instead of importing the entire contents, we could import only this
specific checker using import check_lib::request_granted .Itisalsopossible
to use the fully qualified name of the checker when instantiating it:
check_lib::request_granted ack_received(
send, ack, 1, posedge clk, rst);
without importing the package contents to avoid name collision.
t
Checkers in packages cannot refer to the data that do not belong to the scope
of the package. Thus, (the corrected version of) checker mycheck in Example 9.14
cannot be placed in a package, since it refers to data top.unit1.block2.a in a
module. This is forbidden in packages.
9.3
Checker Instantiation
A checker may be instantiated in any place where a concurrent assertion may appear,
except for fork ... join blocks. This means that checkers may be instantiated both
outside and inside procedural code. This is one of the important differences between
checkers and modules, as modules may be instantiated only outside procedural code.
Checker instantiation in procedural code is called a procedural checker instance,
while the checker instantiation outside procedural code is called a static checker
instance.
9.3.1
Connecting Checker Arguments
The association of checker actual arguments with its formal arguments has the same
syntax as module port association. The argument association may be positional or
named, and the name association may be explicit, implicit, and may use wildcards,
the same way as modules, properties, and other similar constructs in SystemVerilog.
Different argument association forms may be mixed. We recapitulate these rules
common for SystemVerilog design elements on the examples of checkers and
illustrate different ways of checker argument associations on the instantiation of
checker request_granted from Example 9.7 .
Search WWH ::




Custom Search