Connect SystemVerilog interface to Verilog module ?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
Hi,

I want to write SystemVerilog testbench for traditional Verilog module.
But I have no idea how to SystemVerilog interface to traditional Verilog module? Can I both use modport and instance the module? Or is there any walk around method? Thanks!

Code:
//----- Verilog Module-----
module dut(
    CLK,
    RESET,
    DATA,
    ... ...
);
input CLK, RESET;
output DATA;
...
//-----------------------------------
and
Code:
//----- SystemVerilog Interface-----
interface dut_tb_if;
bit clk,reset,data;

modport... ...
//---------------------------------------------
Best regards,
Davy
 

is this a way?
dut_tb_if dut_if;
wire clk = dut_if.clk;
connect clk to module.
 

Hi Yes u need to declare an interface and modports to indicate direction. I am uploading one ppt. Kindly go through that. I think that will be beneficial for you.
 

    davyzhu

    Points: 2
    Helpful Answer Positive Rating
is you use vcs, pls check the guide in it
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…