Introduction covered the need for an interface, how to instantiate and connect the interface with a design. There are two ways in which the design can be written:

  • By using an existing interface name to specifically use only that interface
  • By using a generic interface handle to which any interface can be passed

Obviously, the generic method works best when interface definitions are updated to newer versions with a different name, and needs to support older designs that use it.

Example using a named bundle

In this case, the design references the actual interface name for access to its signals. The example below shows that both design modules myDesign and yourDesign declares a port in the port list called if0 of type myInterface to access signals.

  module myDesign  (  myInterface  if0, 
                      input logic  clk);
    always @ (posedge clk)
      if (if0.ack)
        if0.gnt <= 1;
  module yourDesign (  myInterface   if0,
             input logic   clk);
  module tb;
    logic clk = 0;
    myInterface   _if;
    myDesign   md0   (_if, clk);
    yourDesign  yd0   (_if, clk);
Example using a generic bundle

Login to your free account to read more ...

Was this article helpful ?