The input and output signals of a module are the main way to communicate with other blocks in the design. There can be hundreds of signals for complex designs that involve multiple bus protocols, memory interfaces and connections to various other peripherals. From a testbench perspective, such designs have to be instantiated and connected for each signal and it becomes time consuming to debug, prone to errors and difficult to maintain for design changes.

System Verilog interface is a named bundle of nets or variables created specifically to encapsulate communication between blocks, hence assuring a smoother migration between different projects. Moreover it brings an element of abstraction hiding away the details and another level of hierarchy that enables different blocks to be connected to the testbench more easily.

Traditional way of connecting design with testbench
  module mydesign ( input clk,
                      output gnt,
                             ... );
  module tb;
      reg clk;
      reg tb_reset;
    mydesign top  (   .clk (tb_clk),
                      .reset (tb_reset)
                      .gnt (tb_gnt),
                      ... );

Login to your free account to read more ...

Was this article helpful ?