RE: [sv-cc] Question about mantis 2636

From: Amit Kohli <akohli_at_.....>
Date: Tue Jun 02 2009 - 11:55:16 PDT
 

Hi,

I apologize for a delay in response from my side. I am presenting below
the discussion that
happened in SV-CC regarding this mantis item and the resolution adopted
for the same. 

The issue reported under Mantis item 2636 identified an apparent
contradiction in sections
35.2.1 and 35.9.

Subsequent discussions in SV-CC clarified that both the statements of
section 35.2.1 and 35.9 
are correct as they present two different views of DPI. One is a
SystemVerilog code view 
which explains the call syntax of import tasks as visible in the
SystemVerilog code. The other 
view is of participation of the import task/foreign application code in
the DPI disable protocol. 

The two are explained further below:

a. first is the user view of how import tasks are declared in the
SystemVerilog code. Towards this 
   DPI states that a call to a import task is indistinguishable from a
call to native 
   SystemVerilog tasks. This applies to section 35.2.1, which indicates
that imported tasks
   always return a void value and thus can only be used in a statement
context. Thus the usage
   of DPI import SystemVerilog tasks will be the same as the usage of
native SystemVerilog tasks.

b. second is the disable protocol view according to which DPI allows the
foreign language application 
   to participate in the SystemVerilog disable processing. The disable
protocol puts a requirement on 
   the SystemVerilog simulators as well as on the foreign application to
indicate the disable status of 
   export and import calls respectively. 

   The disable protocol requires the SystemVerilog simulators to return
a 1 when the call to an export 
   task is returning due to a disable, and it requires the simulators to
return a 0 when the call to an 
   export task is non-disable/normal end of task return. Please note,
there is no requirement on the 
   export task in SystemVerilog code to return the value. The simulator
should be taking care of that.
  
   Similarly, on the import side DPI puts a requirement on the foreign
application to return its disable 
   status. This applies to Section 35.5.4 which says that imported tasks
always return a value as 
   part of the DPI disable protocol. The return value will indicate
whether the called import task is
   returning due to a disable or a normal return at the end of the call.
This impacts the declaration 
   of the import task in the foreign code. It does not impact the
calling of the import task in the 
   SystemVerilog code, which is indistinguishable from calling of other
natively declared tasks in 
   SystemVerilog.


The resolution adopted for the mantis item was to further explain the
disable protocol and explicitly 
clarify the responsibility of the simulator, the foreign application and
the call semantics for the 
import tasks. This explanation should address the confusion caused by
the contradiction in the earlier
sections where on one hand it is stated that an import task always
returns a void value, and then that
an import task always returns a value.

Do let me know if you still see issues with the explanation.

Regards,

--Amit 

-----Original Message-----
From: owner-sv-cc@eda.org [mailto:owner-sv-cc@eda.org] On Behalf Of Neil
Korpusik
Sent: Wednesday, May 27, 2009 6:26 AM
To: SV-CC
Cc: sv-champions@eda.org
Subject: [sv-cc] Question about mantis 2636

Does anyone in the sv-cc have a reply?

Neil



-------- Original Message --------
Subject: RE: [sv-champions] Email vote ending May 27, 2009
Date: Tue, 26 May 2009 16:27:29 +0300
From: Bresticker, Shalom <shalom.bresticker@intel.com>
To: Neil.Korpusik@Sun.COM <Neil.Korpusik@Sun.COM>, sv-champions@eda.org
<sv-champions@eda.org>, 'Havlicek John' <john.havlicek@freescale.com>
References: <4A1608D5.4080203@Sun.COM>

Hi,

Regarding the following issue,

2.04 2636  SV-CC Ballot comment #145            contradiction for return
value of imported tasks

I don't see how the proposal fixes the problem.

35.2.1 says, "Imported tasks always return a void value and thus can
only be used in statement context."
35.5.4 says, "Imported tasks always return an int result as part of the
DPI disable protocol and, thus, are declared in foreign code as int
functions (see 35.8 and 35.9)."

At best, this is confusing.

Shalom
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution by
others is strictly prohibited. If you are not the intended recipient,
please contact the sender and delete all copies.


--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Jun 2 12:00:14 2009

This archive was generated by hypermail 2.1.8 : Tue Jun 02 2009 - 12:00:42 PDT