Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Module port list using AUTOARG cant pass an Interface #1646

Closed
veripoolbot opened this issue Jan 26, 2020 · 3 comments
Closed

Question: Module port list using AUTOARG cant pass an Interface #1646

veripoolbot opened this issue Jan 26, 2020 · 3 comments
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Vinit Shah
Original Redmine Message: 3209 from https://www.veripool.org


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

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2020-01-26T02:10:17Z


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

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Vinit Shah
Original Date: 2020-01-26T02:44:11Z


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

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2020-01-27T13:58:40Z


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant