Subject: Re: [sv-cc] sv-cc 2 sv-ec: extern/export requirements
From: Michael Rohleder (michael.rohleder@motorola.com)
Date: Tue Jan 28 2003 - 06:11:54 PST
Joao,
below you have stated that "'pure' function must not have inout or output arguments.".
This has not been stated until now (or my simple mind has overlooked this). I would
like to know and understand the rationale behind this limitation.
Also, if I remind properly the proposed extern syntax permits to rename the SV function/task
to another name on the C side of the interface. I did miss this in your requirements ...
-Michael
Joao Geada wrote:
> David,
>
> please find below the requirements from sv-cc for extern and export
> declarations. Note that these are just the requirements, without the
> proposed syntax, or LRM description.
> I'll send the sv-cc LRM extensions proposal for these items once we have
> reached a proposal in sv-cc that is fully consistent with the current LRM.
>
> Joao
>
> 1. export declarations:
>
> - means to declare that a SV function is to be made accessible to a foreign
> programming language (eg C);
> - specifying a function as exported does not change its semantics nor usage
> - must allow an optional identifier to be used in the foreign code;
> by default foreign name and SV name will be identical
> - must provide full hierarchical path identifying a unique instance (unless
> $root scope function)
> ## Note that tasks may not be exported; therefore there is no need for redundant
> keyword "function"; similarly there is no need for repeating function
> result types and argument specification. However such redundancy may be
> desirable for language consistency.
>
> 2. extern declarations:
>
> - means to declare that a SV visible function is to be provided by
> a foreign programming language (eg C) (ie function's body is foreign)
> - must provide function result type and directions and types of formal
> arguments; the syntax should be as close as possible to the syntax
> for SV function declarations;
> note that DirectC extends the syntax for specifying types of formal arguments
> by allowing unsized ranges, denoted by '[]'.
> - in SV syntax, invocation of the functions declared as extern must be
> identical to invocation of any other normally declared SV function
> - additionally provide further information about the function. Specifically,
> as SV compiler will not have visibility into the implementation of the
> function, it needs to know:
> i) whether the function is 'pure', meaning all invocations with same
> arguments result in the same output values and have no side effects
> whatsoever; 'pure' function must not have inout or output arguments.
> ii) whether the function needs to be aware of its context (such as current
> instance)
> iii) whether the function will make use of any other SV API such that it
> may access (read or write) signals other than those being passed
> through the function's argument list.
>
> Actually, we plan to bundle ii) and iii) together, they are also
> mutually exclusive with i); therefore there are 3 possible combinations:
> 1) default 2) 'pure' 3) 'context' denoting (ii)+(iii)
>
> ## - optional: identifier representing the foreign function name. Only for
> symmetry with export declaration, but this is not required by sv-cc.
>
> Joao
> ==============================================================================
> Joao Geada, PhD Principal Engineer Verif Tech Group
> Synopsys, Inc TEL: (508) 263-8083
> 344 Simarano Drive, Suite 300, FAX: (508) 263-8069
> Marlboro, MA 01752, USA
> ==============================================================================
--NOTE: The content of this message may contain personal views which are not neccessarily the views of Motorola, unless specifically stated.
___________________________________________________ | | _ | Michael Rohleder Tel: +49-89-92103-259 | _ / )| Software Technologist Fax: +49-89-92103-680 |( \ / / | Motorola, Semiconductor Products, System Design | \ \ _( (_ | _ Schatzbogen 7, D-81829 Munich, Germany _ | _) )_ (((\ \>|_/ > < \_|</ /))) (\\\\ \_/ / mailto:Michael.Rohleder@motorola.com \ \_/ ////) \ /_______________________________________________\ / \ _/ \_ / / / \ \
The information contained in this email has been classified as: Motorola General Business Information (x) Motorola Internal Use Only ( ) Motorola Confidential Proprietary ( )
*** This note may contain Motorola Confidential Proprietary or Motorola Internal Use Only Information and is intended to be reviewed by only the individual or organization named above. If you are not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any review, dissemination or copying of this email and its attachments, if any, or the information contained herein is prohibited. If you have received this email in error, please immediately notify the sender by return email and delete this email from your system. Thank you! ***
This archive was generated by hypermail 2b28 : Tue Jan 28 2003 - 07:53:14 PST