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

From: Feldman, Yulik <yulik.feldman_at_.....>
Date: Tue Feb 20 2007 - 10:09:03 PST
Yes, as I wrote in the original mail, I think most operators, including
concatenations, should have a packed array type with [N-1:0] range; just
as you suggested.

W.r.t. the parenthesis, they are a syntactic wrapper in Verilog, and
there is no reason to change that. So, both a[3:0] and (a)[3:0] in your
example should be illegal.

I see no ambiguities/difficulties here.

--Yulik.

-----Original Message-----
From: Jonathan Bromley [mailto:jonathan.bromley@doulos.com] 
Sent: Tuesday, February 20, 2007 5:34 PM
To: Feldman, Yulik; sv-bc@server.eda.org
Subject: RE: [sv-bc] part selects on arbitrary expressions

[Yulik]
> I would like to propose to make part selects operators and 
> to allow them to select parts of arbitrary expressions.

I think this leads to many difficulties.

Verilog vector subscripts can have ascending or descending 
ranges, and need not be based at 0.  To allow subscripting
of expressions we must make a decision about the subscript
bouunds of the expression.

For example, what happens here?

logic [1:15] a; logic [2:5] b;
$display( {a, b}[5:2] );

It's worth noting that VHDL got itself into quite serious
trouble over exactly this issue (subscript range of a
concatenation).

The only reasonable answer is to give the expression a
self-determined range such as [N-1:0].  But that would
cause further trouble.  Given the definition of 'a' above,
it's clear that

  a[3:0]

is illegal.  But what about 

  (a)[3:0]

?? Is (a) an expression, or merely a syntactic wrapper
for the variable a?  It would be very confusing for them
to be different.  

Given all of this, I think that the existing requirement
to use a temporary variable (or an alias) is entirely 
reasonable and is not a serious limitation.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24
1AW, UK
Tel: +44 (0)1425 471223                   Email:
jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573                           Web:
http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Feb 20 10:09:52 2007

This archive was generated by hypermail 2.1.8 : Tue Feb 20 2007 - 10:09:57 PST