Subject: Re: [sv-bc] External Functions and Tasks proposal
From: Francoise Martinolle (fm@cadence.com)
Date: Mon Mar 17 2003 - 07:15:20 PST
Peter,
what is going to be the rule for matching prototype with declaration?
Is it a lexical match?
Do we allow different names for the arguments?
Are we allowing default types in the prototype?
Are we allowing default values in the prototype?
Francoise
'
At 03:27 PM 3/14/2003 +0000, Peter Flake wrote:
>ADD to draft 3 new section 10.6
>
>5.8 External tasks and functions
>
>Some tools require each module to be analyzed separately. If the module
>uses tasks or functions declared in $root, the names and argument types
>need to be visible to the analysis to allow checking. However it is
>important that each analysis does not create its own copy of the task or
>function.
>
>SystemVerilog allows the existence elsewhere of a task or function name
>and prototype to be declared using the extern keyword. For example
> extern function int func1(int I);
>
>If this external declaration is in $root, the same name can be declared
>with the same prototype more than once.
>
>A declarations of a task or function prototype requires a matching
>declaration (with the same arguments) somewhere else , otherwise there is
>an elaboration error. For example:
> function int func1(int I);
> return I;
> endfunction
>
>If the prototype is in the $root scope, the task or function must be
>declared in the $root scope.
>
>If the prototype is in an interface, the task or function must be declared
>in one of the modules connected to an instance of that interface.
>
>If the prototype is a class, the task or function must be declared as an
>out-of-body method (see section 11.20).
>
This archive was generated by hypermail 2b28 : Mon Mar 17 2003 - 07:16:02 PST