RE: [sv-ac] input, inout, output

From: Bassam Tabbara <Bassam.Tabbara_at_.....>
Date: Tue Oct 17 2006 - 08:55:45 PDT
Looks good John -- I agree with the concept/spirit i.e. local vars pass
by value which can accommodate compatible types (extension/truncation),
and has a direction.

Cosmetically some initial comments of what comes to mind:
- (default) Initialization: I think we would get it for free along with
the types/direction (tf_port_list)
- "local": Clashes with the "local" of classes ... It is similar in
spirit but we are passing lvar around/accessing, may be "protected"
would work :). This needs some thought.... We are thinking of adding
sequence/property/... Qualifier so adding a "local_var" or "lvar" might
be ok.   

Thx.
-Bassam.

-----Original Message-----
From: owner-sv-ac@eda.org [mailto:owner-sv-ac@eda.org] On Behalf Of John
Havlicek
Sent: Tuesday, October 17, 2006 8:37 AM
To: sv-ac@eda-stds.org
Subject: [sv-ac] input, inout, output

All:

Since the discussion is bringing these in, I think I had better pop my
ideas into the mix.  See the sketch copied below.

J.H.

Local Variable Formal Arguments (a.k.a. Pass by Local)
------------------------------------------------------

The keyword "local" followed by a direction "input", "output", or
"inout" is used to define a local variable formal argument for a
sequence or property declaration.  The direction can be omitted, in
which case it is understood to be "input".

The type of the local variable formal argument must also be specified,
either explicitly or inferred from a previous type specification in the
formal argument list.

A local variable formal argument defines a local variable in the
declared sequence or property.  Except as noted below, this local
variable can be manipulated within the declared sequence or property
just as an ordinary local variable.

If a local variable formal argument has direction "input" or "inout",
then the actual argument expression bound to the local variable formal
argument is used to initialize the local variable formal argument at the
beginning of each evalution attempt of the sequence or property
instance.  The actual argument expression must not reference any
unassigned local variable.

For example

    property p(local <type> v, ...)
       ...
    endproperty

    p(e,...)

behaves like

    property p(<type> v1, ...)
       <type> v = v1;  // local variable initializer is another
enhancement
       ...
    endproperty

    p(e,...)


The direction "output" or "inout" can be specified only for a local
variable formal argument of a sequence.  The actual argument expression
bound to an "output" or "inout" local variable formal argument must
itself be a local variable of a consistent (how
consistent?) type.  The directions "output" and "inout" specify that the
value of the local variable formal argument flow out of an instance of
the sequence and be assigned to the actual argument local variable when
the sequence instance matches.  The structure of the sequence must
ensure that the local variable formal argument flow out according to the
flow rules.
Received on Tue Oct 17 08:55:57 2006

This archive was generated by hypermail 2.1.8 : Tue Oct 17 2006 - 08:56:12 PDT