Re: [sv-bc] part selects on arbitrary expressions

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Tue Mar 06 2007 - 10:33:27 PST
Arturo Salz wrote:
> Shalom,
> 
>  
> 
> I have to agree with Yulik on this. Put aside expressions for a moment 
> and consider taking a slice of the return value of a function:
> 
>             function bit [16:1] F; … enfunction
>             reg [5:0] instr;
> 
>             always @(clk)
>                  instr = F()[8:2]; 
> 
> The function call is a self-determined context, so there are no 
> ambiguities as to what the semantics of the above ought to be 

That is only true if you assume/require that the select
binds to the self-determined type of the expression before
the context-determined type is applied.  But that argument
could be used for any expression as long as we syntactically
denote what is going on.  That is exactly what the
parenthesized expression syntax does -- (expr)[select] would
be treated as though the (expr) was self-determined (as in
your function call example) and the select would apply to
that before consideration of the context-determined type.

I won't reiterate the rest of the discussion, but I don't
think function calls are anything different, they
are just simpler to recognize as a special case.

Gord.

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Mar 6 10:33:46 2007

This archive was generated by hypermail 2.1.8 : Tue Mar 06 2007 - 10:33:55 PST