S SystemVerilog interface is a static construct and not a class. For this reason you cannot put it into a package. It has to be compiled and can be used after it is available in your compiled library.
But it should be part of your agent’s database.
A good approach is to compile this interface together with your package.
This is how it looks like in my Environment:
In reply to snognogt:
S SystemVerilog interface is a static construct and not a class. For this reason you cannot put it into a package. It has to be compiled and can be used after it is available in your compiled library.
But it should be part of your agent’s database.
A good approach is to compile this interface together with your package.
This is how it looks like in my Environment:
where apb.svh is a file which includes all class-based constructs and apb_if.sv contains the SV interface.
Hi
Thanks for the answer.
However, if i want to instance the interface in my driver (that is in the agent, in the pkg) for example - how can i do that ? the agent and driver are in the pkg and the interface is not…
Modules, interfaces, and packages are known as design units exist in a global namespace. That means once you compile them, they become visible to all. Module and interfaces do not need to be compiled in any specific order — they get bound by instantiation in a later elaboration step.