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

systemVerilog - modelsim Altera starter - uses of interfaces #564

Closed
FAIG2014 opened this issue Aug 23, 2017 · 1 comment
Closed

systemVerilog - modelsim Altera starter - uses of interfaces #564

FAIG2014 opened this issue Aug 23, 2017 · 1 comment

Comments

@FAIG2014
Copy link

FAIG2014 commented Aug 23, 2017

interface avalon_st_if
  #(
    parameter DATAW        = 64,
    parameter NBYTES_LG2   = 3
    )
   ();
   
    logic                   valid;
    logic                   sop;
    logic                   eop;
    logic                    err;
    logic [NBYTES_LG2-1:0]  empty;   
    logic [DATAW-1:0]       data;
    logic                   ready;
    modport rx
    (
     input  valid,
     input  sop,
     input  eop,
     input  err,
     input  empty,
     input  data,
     output ready
     );
    
    modport tx 
    (
     output valid,
     output sop,
     output eop,
     output err,
     output empty,
     output data,
     input  ready
     );

endinterface // avalon_st_if


module icmp_reply (
    input                                  clk,
    input                                  reset_n,

    avalon_st_if.rx    st_in,
    avalon_st_if.tx    st_out
    
);

I would like to be able to simulate the module icmp_reply as defined previously.
I currently have weird errors:

# ** Fatal: (vsim-3695) /home/fgagnaire/workspace/cocotb/examples/ping_tun_tap/tests/../hdl/icmp_reply.sv(58): The interface port 'st_in' must be passed an actual interface.
@AlexanderSpirin
Copy link
Contributor

I think it's impossible to have interfaces at DUT top level in simulation. As same as you can't use interfaces at top level in your design in synthesis. You have to create wrapper around module. It's certainly inconvenient, but I doubt that another solution exist.

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

No branches or pull requests

2 participants