RE: [sv-ec] Query on Interface

From: Saurabh Kumar Shrimal, Noida <saurabhsk_at_.....>
Date: Thu May 12 2005 - 22:42:03 PDT
Hi Dave,

 

   If I am calling the task using the normal hierarchy name 

 

intf1.initialize(32'h0,32'h0); 

intf1.control(32'h0000003F,32'h0);             

 

 

   So, if the interface code is now,

 

 interface intf(input bit clk);

 

logic [0 :31] addr;

logic [0 : 31] data_in;

logic ready;

logic [0 : 31] data_out;

 

modport channel( input data_out,ready , output data_in,addr,clk,

                 import task initialize(input [0 : 31] addr_in,input [0 :
31] data),

                 import task write(input [0 : 31] data),

                 import task read(),

                 import task control(input [0 : 31] addr_in,input [0 : 31]
data));

 

task initialize;

input [0 : 31] addr_in;

input [0 : 31] data;

begin

  @(posedge clk)

     begin

        addr = addr_in;

        data_in = data;

     end

end

endtask

 

task control;

input [0 : 31] addr_in;

input [0 : 31] data;

begin

     wait(ready);

      begin

        @(posedge clk)

          begin

              addr = addr_in;

             data_in = data;

         end

     end

end

endtask

 

endinterface

 

And from the top I m calling the interface task like:

 

intf1.initialize(32'h0,32'h0); 

intf1.control(32'h0000003F,32'h0);             

 

   Then as per the requirement 

    

      The port of the DUT - Block 1 

     Addr = 32'h0 

    Data_in = 32'h0

 

    Should be like this .and the ready pin which is under wait condition
should be 0 or 1 in interface instance.

 

 But what is happening that all remains 'x' .(addr_in/data)

 

  So, I have doubt abt it that there should some connection of modport also
to tell task call that wht is input and wht output...

 

Please help me out that what is going wrong.

 

 

Regards

-Saurabh

 

 

   _____  

From: Rich, Dave [mailto:Dave_Rich@mentor.com] 
Sent: Friday, May 13, 2005 4:23 AM
To: Saurabh Kumar Shrimal, Noida; sv-ec@eda.org
Subject: RE: [sv-ec] Query on Interface

 

Saurabh,

 

A modport does not create a scope and can only be used in the context of a
port connection.

 

From the top module, you just use the normal hierarchical names, as if the
interface instance was a module instance.

 

 

intf1.initialize(32'h0,32'h0); 

intf1.control(32'h0000003F,32'h0);             

 

Dave

 

 

 

   _____  

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Saurabh
Kumar Shrimal, Noida
Sent: Thursday, May 12, 2005 1:00 PM
To: sv-ec@eda.org
Subject: [sv-ec] Query on Interface

 

As the LRM tells that interfaces can be use for the purpose, Design as well
as verification ...

 

   So now in the example:

 

   The DUT is verified .The different values r given to the DUT through the
Interface's tasks from the top module.

 


	
		 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


According to the LRM(3.1a) 19.6.3 The interface for the above model should
like :

 

interface intf(input bit clk);

 

logic [0 :31] addr;

logic [0 : 31] data_in;

logic ready;

logic [0 : 31] data_out;

 

modport channel( input data_out,ready , output data_in,addr,clk,

                 import task initialize(input [0 : 31] addr_in,input [0 :
31] data),

                 import task write(input [0 : 31] data),

                 import task read(),

                 import task control(input [0 : 31] addr_in,input [0 : 31]
data));

 

task initialize;

input [0 : 31] addr_in;

input [0 : 31] data;

........

..........

..........

endtask

 

task control;

input [0 : 31] addr_in;

input [0 : 31] data;

........

..........

..........

endtask

 

 

task write;

input [0 : 31] data;

........

..........

..........

endtask

 

 

task read;

........

..........

..........

endtask

 

endinterface

 

 

So, as per the block diagram the top module from where, I want to use the
interface's tasks for forcing the value to the DUT, then :

 

 

Module top;

 

intf intf1(

           .clk(clk)

          );

 

//<<  How should I use the task...>>

 

/*

intf1.initialize(32'h0,32'h0); 

intf1.control(32'h0000003F,32'h0);               

               or

intf1.channel.control(32'h0000003F,32'h0);

intf1.channel.initialize(32'h0,32'h0);

*/

 

endmodule

 

 

 

   So, wht's the proper way to use the interface task in the top module for
forcing the value , with modport??

 

Regards

-Saurabh



Disclaimer: 


This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.





Disclaimer: 

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.


  


image002.gif
Received on Fri, 13 May 2005 11:12:03 +0530

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 22:43:25 PDT