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

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Wed Mar 07 2007 - 10:07:35 PST
I have to add my displeasure about mixing prefix and postfix
indexing/part-select.

Mixing prefix and postfix operations in this manner leads to very
difficult code to write or read. If you need an example of how such
syntax quickly becomes unwieldy, consider what happens in C, which uses
'*' as prefix operator and [] as a postfix operator. Do you know what
the declaration below does?

 

      int **(*foo[][])(int**)

 

   Arturo

 

________________________________________

From: Adam Krolnik [mailto:adam.krolnik@verisilicon.com] 

Sent: Wednesday, March 07, 2007 9:02 AM

To: Rich, Dave

Cc: Michael (Mac) McNamara; Feldman, Yulik; Steven Sharp;
Arturo.Salz@synopsys.COM; Bresticker, Shalom; sv-bc@eda.org

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

 

 

Hello All;

 

Dave Rich wrote:

 

typedef logic [1:8] t[5:2];

 

t[3][8]'(expr)

 

That means cast the expression to t, then take word 3, bit 8 of that

type.

 

Ahhh, I see;  we are using the phrase 'part select'  for  both part
selection of a vector

and field/index selection from a type. 

 

It is strange to see the field selection inline with the cast compared
with a postfix as in C and

perl.  Postfix is definitely preferred.

 

Maybe this should be separated into two enhancements:

   1. Part selection of an expression (treated as a vector)

   2. Field/index selection of an expression cast to a named type.

 

It would be much clearer.

 

 

 

-- 

    Soli Deo Gloria

    Adam Krolnik

    Director of Design Verification

    VeriSilicon Inc.

    Plano TX. 75074

    Co-author "Assertion-Based Design"


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Mar 7 10:08:03 2007

This archive was generated by hypermail 2.1.8 : Wed Mar 07 2007 - 10:08:08 PST