Thursday, February 09, 2012     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: connecting interfaces to old fashion DUTs
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
marco.stanzani
Posts: 11
Online: User is Offline
4/23/2008 9:53 AM  
While it looks clean (or so) how to connect two module exposing interfaces, My basic question is how to connect a system verilog interface to a old fashion verilog DUT
I have an issue connecting an interface to a DUTwhich is an old fashion verilog module (Verilog 1996), i.e. with traditional port declaration
The interface looks like this

interface xram_if

  (output CLK, nRST);

timeunit 1ns;
timeprecision 1ps;

  logic Ε:0] AD;
  logic ALE;
  logic nWR;
  logic nRD;

  modport master (
    output nWR,
    output nRD,
    output ALE,
    inout AD,
    import write,
    import read
  );

  modport slave (
    input nWR,
    input nRD,

    input ALE,

    inout AD
  );
....

  task init ();
   begin
    ALE = 0;
    nRD = 1;
    nWR = 1;
    AD = `DATAW'bz;
    nrst    = 1'b1;
...

  endtask // init

  task write (
    input t_xram_addr addr,
    input t_xram_data data
  );
  begin
   ....

  end

  endtask // write

  task read (
    input t_xram_addr addr,
    output t_xram_data data
  );
  begin
...

  end
 endtask

I want to instantiate it in a test bench, e.g.

  xram_if xramif (
    .CLK(MCLK),
    .nRST(nRST)
  );

and I need a master interface to drive my DUT (so there are modports
above)
My DUT does not support interfaces (it is Verilog 2001)
How do I specifiy
- which interface flavor (master or slave)
How doi I connect my interface to the DUT?

The following does not work ...

I think I am missing sopme big points here ...

  vdt_top i_vdt_top(
...
    .access_if_ale_i               (xramif.master.ALE),
    .access_if_nwr_i               (xramif.master.nWR),
    .access_if_nrd_i               (xramif.master.nRD),
...

    .access_if_ad_0                (xramif.master.ADΎ]),
    .access_if_ad_1                (xramif.master.ADΏ]),
    .access_if_ad_2                (xramif.master.ADΐ]),
    .access_if_ad_3                (xramif.master.ADΑ]),
    .access_if_ad_4                (xramif.master.ADΒ]),
    .access_if_ad_5                (xramif.master.ADΓ]),
    .access_if_ad_6                (xramif.master.ADΔ]),
    .access_if_ad_7                (xramif.master.ADΕ]),

...

);


I feel I am missing some big points here ...

thanks to whoever will help on this



Marco Stanzani Accent S.p.A.
Sr. Consultant Engineer via Torri Bianche 3
Tel. +39-039-6290020 20059 - Vimercate (MI), Italy
tpylant
Posts: 87
Online: User is Offline
4/23/2008 12:55 PM  
My first question is "do you really need modports?" If you are not sure, then you might be able to get by without them and your problem is solved. If you absolutely must have them, then I see the only solution is to create a wrapper for your dut that can take an interface with modport.

module dut_wrapper(interface mif, sif);
  vdt_! top i_vdt_top( 
    ... 
    .access_if_ale_i (mif.ALE), 
    .access_if_nwr_i (mif.nWR), 
    .access_if_nrd_i (mif.nRD), 
    ...
  ); 
endmodule
module top;
  xram_if xramif_m (.CLK(MCLK), .nRST(nRST)); 
  xram_if xramif_s (.CLK(MCLK), .nRST(nRST)); 
  dut_wrapper dut (xramif_m.master, xramif_s.slave);
endmodule
Tim
marco.stanzani
Posts: 11
Online: User is Offline
4/24/2008 12:51 AM  
Hello tplyant
thanks for looking into my issue, first.
Then, assuming modport is not there any longer, i.e

interface xram_if

  (
    output CLK,
    output nRST
 
  );

timeunit 1ns;
timeprecision 1ps;

 
  logic [`DATAW-1:0] AD;
  logic ALE;
  logic nWR;
  logic nRD;

  task write (
    input t_xram_addr addr,
    input t_xram_data data
  );
  begin
   nWR=1;
   nRD=1;
   AD = `DATAW'bz;

   ALE=1;
   #(tLHLL-tAVLL);
   AD = addr[`DATAW-1:0]
   #(tAVLL);  // Addrss valid to ALE low
   ALE=0;
   #(tLLAX);
   AD =`DATAW'bz;
   #(tLLWL-tLLAX-tQVWX);
  .....
 etc

I tried to connect interface signals, which I did not declared as ports, just 'logic' in the inetrface

....
    .access_if_ale_i               (xramif.ALE),                   
    .access_if_nwr_i               (xramif.nWR),                   
    .access_if_nrd_i               (xramif.nRD),                   
....

    .access_if_ad_0                (xramif.ADΎ]),            <<-- inout         
    .access_if_ad_1                (xramif.ADΏ]),                     

ALE, nWR,nRD seems OK, but I havve an issu with bidirs

    .access_if_ad_0                (xramif.ADΎ]),
                                            |
ncelab: *E,CUVMIO (../hdl/tb.v,213|44): port connections to inout ports must be collapsible, that is, they must be nets.
Defininmg AD ad tri instead of logic does not help ...

regards

 



Marco Stanzani Accent S.p.A.
Sr. Consultant Engineer via Torri Bianche 3
Tel. +39-039-6290020 20059 - Vimercate (MI), Italy
tpylant
Posts: 87
Online: User is Offline
4/24/2008 8:12 AM  
First let me make a correction to my code. There should only be one instance of the interface.

module top;
  xram_if xramif (.CLK(MCLK), .nRST(nRST)); 
  dut_wrapper dut (xramif.master, xramif.slave);
endmodule
Now to address your last issue. Since you are not using modports to separate AD to input or output, I assume you are having to connnect to an inout. This means that you will have to use standard coding methods to connect to inout.

interface xram_if(...);
  ...
  wire  [`DATAW-1:0] AD
  logic [`DATAW-1:0] data_out;
  assign AD = !nWR ? data_out : 'z;
  ...
  task write(...);
    ...
    data_out = addr[`DATAW-1:0]
    ...
  endtask
  ...
endinterface
I attached a testcase that demonstrates this. Tim

Attachment: test_if.tar.gz

Posting to forums is available to community members only.
Login or Register

Forums > Functional Verification > SystemVerilog > connecting interfaces to old fashion DUTs


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.