[sv-ac] Re: P1800-2009 : Contradictions in legality of type "event" in formal argument

From: ben cohen <hdlcohen_at_.....>
Date: Sun May 10 2009 - 00:13:11 PDT
An errata to my last comment: It strikes me as odd, particularly, the way I
view it, a formal argument, by default of direction input, acts the same as
a local variable formal argument of direction input.  Yet, type argument of
type event is legal if formal argument is not declared as a local variable
formal argument.
I meant to say, It strikes me as odd, particularly, the way I view it, a
non-local formal argument, by default of direction input, acts  as a local
variable formal argument of direction input it is it not written into it
(i.e., can write into a local variable formal argument, but not into a
non-local formal argument).  Yet, type argument of type event is legal if
formal argument is not declared as a local variable formal argument.
Ben

On Sat, May 9, 2009 at 10:01 PM, ben cohen <hdlcohen@gmail.com> wrote:

> Reading draft 8, (same in draft 7), I found the following, which sounds
> like contradictions in that type event, declared as illegal in 16.6.1Operand types, is used as formal argument, but is
> illegal in local variable formal argument.  Specifically:
> 16.8.1 Typed formal arguments in sequence declarations
> If a formal argument of a named sequence is typed, then the type shall be
> sequence, event, or one of the
> types allowed in 16.6.1
> [Ben Cohen] Interestingly, 16.6.1 specifies "event" as illegal.  Thus,
> this is an exception.
> p321
> The following shows an example of a formal argument with event type:
> sequence event_arg_example (event ev);
> @(ev) x ##1 y;
> endsequence
>
> 16.8.2 Local variable formal arguments in sequence declarations
> p322
> sequence illegal_loc_var_formal (
> output logic a, // illegal: local must be specified with
> ...
> local event e, // illegal: event is a type disallowed in
> // 16.6.1
> ---
> 16.6.1 Operand types
> The following types are not allowed:
> Noninteger types (shortreal, real, and realtime)
>  string
>  event
>  chandle
>  class
>  Associative arrays
>  Dynamic arrays
> [Ben Cohen] So, If I understand this correctly, a typed formal argument
> that is declared with local is illegal, but if declared without the local is
> legal.
> Thus, updating the example on page 321, I can say the following:
> sequence event_arg_example_Ben (
>     local inout logic a,
>                       logic e, f,
>     local event evt,      // illegal: event is a type disallowed in 16.6.1
>              event ev);  // Legal: Exception to rules in 16.6.1, as
> per 16.8.1
> @(ev) a ##1 e;
> endsequence
> It strikes me as odd, particularly, the way I view it, a formal argument,
> by default of direction input, acts the same as a local variable formal
> argument of direction input.  Yet, type argument of type event is legal if
> formal argument is not declared as a local variable formal argument.
> Where am wet here?
> Ben
>
>
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun May 10 00:14:50 2009

This archive was generated by hypermail 2.1.8 : Sun May 10 2009 - 00:16:08 PDT