RE: [sv-bc] constant_range_expression in constant_primary

From: Bresticker, Shalom <shalom.bresticker@intel.com>
Date: Wed Jan 26 2011 - 03:38:09 PST

You can't write 4'b1100[2:1], but rather {4'b1100}[2:1].

See 11.4.12:

"One or more bits of a concatenation can be selected as if the concatenation were a packed array with the range [n-1:0]. Such a select shall not be legal as a net_lvalue, variable_lvalue or in any equivalent use, such as on the left-hand side of an assignment. Example:

byte a, b ;
bit [1:0] c ;
c = {a + b}[1:0]; // 2 lsb's of sum of a and b"

Shalom

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Bisht, Laurence S
Sent: Wednesday, January 26, 2011 1:22 PM
To: sv-bc@eda.org
Cc: av-ac@eda.org
Subject: [sv-bc] constant_range_expression in constant_primary

Hello,

I am trying to understand why in constant_primary there exists [constant_range_expression] after constant_concatenation ? or after specparam_identifier?

constant_primary ::=
primary_literal
| ps_parameter_identifier constant_select
| specparam_identifier [ [ constant_range_expression ] ]
| genvar_identifier35
| [ package_scope | class_scope ] enum_identifier
| constant_concatenation [ [ constant_range_expression ] ]
| constant_multiple_concatenation [ [ constant_range_expression ] ]
| constant_function_call
| constant_let_expression
| ( constant_mintypmax_expression )
| constant_cast
| constant_assignment_pattern_expression
| type_reference36

My immediate guess is to be able to write 4'b1100[2:1].

However, I am sure that there exists a better explanation, can you please help?

Thanks,
Laurence
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

image002.gif
Received on Wed Jan 26 03:38:55 2011

This archive was generated by hypermail 2.1.8 : Wed Jan 26 2011 - 03:39:05 PST