RE: [sv-cc] David's update to our extern/export proposal


Subject: RE: [sv-cc] David's update to our extern/export proposal
From: Stickley, John (john_stickley@mentorg.com)
Date: Tue Mar 18 2003 - 11:52:39 PST


Joao,

This looks pretty good.

I have only one comment. Regarding this,

"Exported functions can only be invoked if the
current context refers to an instance from which the named function could be
called in SystemVerilog by an unqualified function call (i.e. a call to the function
with no hierarchical path qualifier). In general this implies that an exported
SystemVerilog function is visible from its declared scope to any scope lower
down in the hierarchy."

I don't think we want to say that modules in lower hierchical
scope have visiblity to functions above them in hierarchy.
You should only allow visibility to functions in higher
declarative scope not hierarchical scope.

-------------------------------
What is allowed:

function root_scope_func( ... )
    ...
endfunction

module foo
     function f( ... )
         ...
     endfunction

     module bar
         // Code inside bar ...
     endmodule
endmodule

In this case code inside bar *can* call function
root_scope_func() *and* f() because both are
defined in enclosing declarative scopes.

-------------------------------
What is not allowed:

function root_scope_func( ... )
    ...
endfunction

module foo
     function f( ... )
         ...
     endfunction

     bar u1( );
endmodule

module bar
     // Code inside bar ...
endmodule

Here, although code inside bar can still call
root_scope_func() (because root scope encloses
both bar and foo declarative scopes), code inside
bar cannot call f() unless it qualifies the name with
explicit hierarchical reference. Bar is lower in
hierarchy than foo but f() is not directly visible
because it is not in a lower nested declarative scope.

You may have meant to say this but the phrase "any scope
lower in the hierarchy" in the wording above implies visibility
in lower instantiated scopes rather than lower declarative
scopes. I think the word hierarchy should be taken out.
"hierarchy" implies a chain of instantiated scopes not
nested declarative scopes.

I believe this is what the LRM implies for normal SV function
and I think this is what we want to follow for import/export
functions.

-- johnS

> -----Original Message-----
> From: Joao Geada [mailto:Joao.Geada@synopsys.com]
> Sent: Tuesday, March 18, 2003 12:11 PM
> To: sv-cc
> Subject: [sv-cc] David's update to our extern/export proposal
>
>
> Attached...
>

-- 
                                                            __
                        ______                             |  \
______________________/      \__                         /    \
                                 \       H  Dome      ___/     |
John Stickley                 E |       a  __    ___/  /       \____
Principal Engineer            l |       l  | \  /
Verification Solutions Group    |       f  |  \/     ____
Mentor Graphics Corp. - MED   C \         --  /     /
17 E. Cedar Place             a  \     __/   /     /
Ramsey, NJ  07446             p  |    /        ___/
                                  |   /        /
mailto:John_Stickley@mentor.com  \           /
Phone: (201)818-2585              \         /
                                    ---------



This archive was generated by hypermail 2b28 : Tue Mar 18 2003 - 11:55:12 PST