Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] SystemVerilog interface & package connection to legacy Verilog module

Status
Not open for further replies.

dpaul

Advanced Member level 5
Advanced Member level 5
Joined
Jan 16, 2008
Messages
1,859
Helped
317
Reputation
635
Reaction score
352
Trophy points
1,373
Location
Germany
Visit site
Activity points
13,465
Hi,

I want to use the SysWip AXI4Lite Slave verification IP (in SystemVerilog) in my top-level test-bench with my traditional *Verilog* AXI4Lite master.

Being completely new to SystemVerilog, I have problems to port-map in the toplevel testbench.

What I have: From the SysWip I have downloaded axi4lite_s_if.sv which is an *interface* and the axi4lite_s.sv which is a *package* (http://syswip.com/axi4-lite-verification-ip).
From my legacy code I have a dut_top.v and dut_top_tb.sv (I have renamed it to .sv in order to support some SV constructs - import, creating the slave class object, etc). The Verilog AXI4Lite master module is instiantiated in the dut_top.v

Target: I want to connect the ports of the legacy Verilog AXI4Lite Master to that of the SysWip VIP slave. I am getting a Syntax error message where the ports are being mapped in the dut_top_tb.sv.
Of course I am doing it wrong, so please help me to rectify the mistake.

An excerpt from the dut_top_tb.sv is given below where the error is occuring. Note that I don't want to bring out the AXI4Lite master ports from the dut_top.v and so I am using the following way to connect the ports in the test-bench with the slave VIP BFM.

Code:
.
.  /////////////////////////////////////////////////////////////////////////////
   // AXI4Lite VIP instance
   /////////////////////////////////////////////////////////////////////////////
  `ifdef AXI4LITE_VIP_syswip
    axi4lite_s_if axi4lite_s_if_inst();    // create an instance for the SysWip interface

   // ---------------------------------------------------------------------------- 
   // AXI4-Lite Master signals connected to axi4lite_s_if
   // ----------------------------------------------------------------------------
   // READ address/cmd channel
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_AR_ADDR_o  (axi4lite_s_if_inst.araddr);  
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_AR_VALID_o (axi4lite_s_if_inst.arvalid); 
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_AR_READY_i (axi4lite_s_if_inst.arready);
   // READ data/response channel
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_DATA_i   (axi4lite_s_if_inst.rdata[32:0]);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_RESP_i   (axi4lite_s_if_inst.rresp);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_VALID_i  (axi4lite_s_if_inst.rvalid);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_READY_o  (axi4lite_s_if_inst.rready);
   // WRITE address/cmd channel
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_AW_ADDR_o  (axi4lite_s_if_inst.awaddr);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_AW_VALID_o (axi4lite_s_if_inst.awvalid);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_AW_READY_i (axi4lite_s_if_inst.awready);
   // WRITE data channel
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_DATA_o   (axi4lite_s_if_inst.wdata[32:0]);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_STRB_o   (axi4lite_s_if_inst.wstrb[3:0]);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_VALID_o  (axi4lite_s_if_inst.wvalid);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_READY_i  (axi4lite_s_if_inst.wready);
   // WRITE response channel
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_B_RESP_i   (axi4lite_s_if_inst.bresp);
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_B_VALID_i  (axi4lite_s_if_inst.bvalid); 
   te0630_top_inst.emi2axi4_lite_inst.m_AXI_B_READY_o  (axi4lite_s_if_inst.bready);  
      
   initial begin
   // Create AXI4Lite_s_env class object
   AXI4Lite_s_env_s_env axi4lite = new(axi4lite_s, axi4lite_s_if_inst, 4);

   // Start AXI4-Lite Slave Environment
   axi4lite.startEnv();

   end
   `endif
.
.
 
Last edited:

Part of the code I posted is crap. I modified it and the syntax error for port mapping is gone. I have the following right now, but don't know if it is correct.

Code:
/////////////////////////////////////////////////////////////////////////////
   // AXI4Lite VIP instance
   /////////////////////////////////////////////////////////////////////////////
   `ifdef AXI4LITE_VIP_syswip
    axi4lite_s_if axi4lite_s_if_inst(    
    .awaddr  (te0630_top_inst.emi2axi4_lite_inst.m_AXI_AW_ADDR_o),
    .awvalid (te0630_top_inst.emi2axi4_lite_inst.m_AXI_AW_VALID_o),
    .awready (te0630_top_inst.emi2axi4_lite_inst.m_AXI_AW_READY_i),
    // Slave write data channel
    .wdata  (te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_DATA_o),
    .wstrb  (te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_STRB_o),
    .wvalid (te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_VALID_o),
    .wready (te0630_top_inst.emi2axi4_lite_inst.m_AXI_W_READY_i),
    // Slave write response channel
    .bresp  (te0630_top_inst.emi2axi4_lite_inst.m_AXI_B_RESP_i),
    .bvalid (te0630_top_inst.emi2axi4_lite_inst.m_AXI_B_VALID_i),
    .bready (te0630_top_inst.emi2axi4_lite_inst.m_AXI_B_READY_o),
    // Slave read address channel
    .araddr  (te0630_top_inst.emi2axi4_lite_inst.m_AXI_AR_ADDR_o),
    .arvalid (te0630_top_inst.emi2axi4_lite_inst.m_AXI_AR_VALID_o),
    .arready (te0630_top_inst.emi2axi4_lite_inst.m_AXI_AR_READY_i),
    // Slave read data channel
    .rdata  (te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_DATA_i),
    .rresp  (te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_RESP_i),
    .rvalid (te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_VALID_i),
    .rready (te0630_top_inst.emi2axi4_lite_inst.m_AXI_R_READY_o)       
    );   
    
   
   initial begin
   // Create AXI4Lite_s_env class object
   AXI4Lite_s_env axi4lite = new(axi4lite_s, axi4lite_s_if_inst, 4);

   // Start AXI4-Lite Slave Environment
   axi4lite.startEnv();

   end
   `endif
 
Last edited:

Hi Dave,

no it is still not working, the connection cannot be done like that.
My question remains the same. Please refer to my original post for the details. Ignore the codes I have posted before.
How can I connect the ports of a Verilog module to that of a SystemVerilog Interface module?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top