UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
1,092 Views
Registered: ‎12-02-2012

modport syntax

Jump to solution

I'm trying to use a modport in Vivado 2018.1 but the thing is refusing to accept the code and I cannot for the life of me figure out why. I've tried the example interface code from Xilinx and that works, but I can't see anything obvious in the syntax of my code and Xilinx's. The following is basically a dummy I was testing out, and it's not working. Can anyone see what I might be doing wrong? I expect it to be a really stupid mistake but I can't seem to see it.

 

 

interface dummy;

logic foo1;
logic foo2;

modport in(input foo1, output foo2);
modport out(output foo1, input foo2);

endinterface

module foo_mod(
  dummy.in foo_in,
  dummy.out foo_out);

  assign foo_out.foo1 = foo_in.foo1;
  assign foo_in.foo2 = foo_out.foo2;

endmodule

Vivado is specifically throwing the following errors:

 

ERROR: [VRFC 10-715] formal port foo_in expects a modport or interface instance actual

ERROR: [VRFC 10-715] formal port foo_out expects a modport or interface instance actual

 

On the following lines:

  dummy.in foo_in,
dummy.out foo_out);

So, any ideas, anyone?

0 Kudos
1 Solution

Accepted Solutions
Scholar markcurry
Scholar
1,079 Views
Registered: ‎09-16-2009

Re: modport syntax

Jump to solution

Your syntax looks correct.  But I think you've left out context.  

 

For interfaces on ports, they MUST be connected to an instantiated interface - you cannot leave them dangling.  So your calling function must connect up both "foo_in", and "foo_out" ports from an actual interface(s) instance(s).

 

If you're just trying this as a quick test (without another top-level), and the "foo_mod" is considered the top module, then there's no instantiated interfaces connected to the ports - hence the error.

 

Try creating a top-level wrapper that instantiates the interface(s), and connects them up to "foo_mod".

 

Regards,

 

Mark

View solution in original post

0 Kudos
3 Replies
Scholar markcurry
Scholar
1,080 Views
Registered: ‎09-16-2009

Re: modport syntax

Jump to solution

Your syntax looks correct.  But I think you've left out context.  

 

For interfaces on ports, they MUST be connected to an instantiated interface - you cannot leave them dangling.  So your calling function must connect up both "foo_in", and "foo_out" ports from an actual interface(s) instance(s).

 

If you're just trying this as a quick test (without another top-level), and the "foo_mod" is considered the top module, then there's no instantiated interfaces connected to the ports - hence the error.

 

Try creating a top-level wrapper that instantiates the interface(s), and connects them up to "foo_mod".

 

Regards,

 

Mark

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
1,059 Views
Registered: ‎12-02-2012

Re: modport syntax

Jump to solution

*takes a deep breath*

 

Parenthesis. The instantiation of the interfaces in the top level tb were missing parenthesis at the end. Oh my god that error message from Vivado was ever so unhelpful. Thanks Mark.

Visitor checkmate
Visitor
685 Views
Registered: ‎03-17-2019

Re: modport syntax

Jump to solution

I, too, dealt with this incredibly unhelpful error message. What's especially maddening is that the problem is nowhere near where the error report says it is. It's not even in the same file.

I was starting to think Vivado couldn't handle modports in module arguments, thus rendering SystemVerilog interfaces useless for me. Not so. All I had to do was change

    AXIStream axis;

To

    AXIStream axis ();

In one of my files, and everything magically worked.

0 Kudos