[sv-bc] External Functions and Tasks proposal


Subject: [sv-bc] External Functions and Tasks proposal
From: Peter Flake (Peter.Flake@synopsys.com)
Date: Fri Mar 14 2003 - 07:27:23 PST


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 : Fri Mar 14 2003 - 07:38:30 PST