Project

General

Profile

[logo] 
 
Home
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Module port list using AUTOARG cant pass an Interface

Added by Vinit Shah 10 months ago

Hi,

I am trying to pass interfaces across modules. Modules are using AUTOARG to populate inputs, outputs and inouts in the module port list. I tried doing the same for Interfaces. It didnt work. I tried using AUTOINOUTMODPORT. It didnt work.

Can you point me to an example on the site (if this is supported)?

Also how can I declare interfaces automatically for modules using AUTOINST and passing interfaces across them?

Thanks


Replies (3)

RE: Module port list using AUTOARG cant pass an Interface - Added by Wilson Snyder 10 months ago

There's an example on the Faq. Beyond that I'm not sure what you are trying to do so would need an example.

RE: Module port list using AUTOARG cant pass an Interface - Added by Vinit Shah 10 months ago

Adding Example

Issue 1


interface calc_if (
input clk, input rst
);

logic add_sub;
logic [3:0] num1;
logic [3:0] num2;
logic [4:0] num3;

modport master (
output add_sub,
output num1,
output num2,
input num3
);

modport slave (
input add_sub,
input num1,
input num2,
output num3
);

endinterface

// Above code is part of an include file (calc_if.sv)

`include "calc_if.sv" 
module top (/*AUTOARG*/);

calc_if.slave dut_calc_if;

dut DUT_INST (/*AUTOINST*/
              // Interfaces
              .dut_calc_if (dut_calc_if)
              // Inputs
              .dut_clk (dut_clk),
              .dut_rst (dut_rst)
             );

module dut (/*AUTOARG*/
            dut_clk,
            dut_rst
            );

Question : For both modules (top and dut) will the AUTOARG automatically populate the interface in the port list? Am I missing something or this is incorrect?

If you have a solution can you point to me the FAQ?

Issue 2


// Interface declaration
calc_if dut1_to_dut2_calc_if();

dut1 DUT (/*AUTOINST*/
          // Interfaces
          .dut1_to_dut2_calc_if (dut1_to_dut2_calc_if),
         --- Other ports ---
          );

dut2 DUT (/*AUTOINST*/
          // Interfaces
          .calc_if (dut1_to_dut2_calc_if),
         --- Other ports ---
          );

Does the above interface declaration need to be added explicitly? Is there any AUTO function that allows to do this?

Thanks

RE: Module port list using AUTOARG cant pass an Interface - Added by Wilson Snyder 10 months ago

For both modules (top and dut) will the AUTOARG automatically populate the interface in the port list? Am I missing something or this is incorrect?

No because it doesn't know if the interface is for connection or for a port. Use ANSI style ports instead with input/output/interfaces in the module (...) instead of using AUTOARG.

Does the above interface declaration need to be added explicitly? Is there any AUTO function that allows to do this?

Using ANSI as above should make this work.

    (1-3/3)