Mantis 1197

Allow bit- and part-selects from concatenations

P1800-2008/D4

In Section 11.4.12

CHANGE

The concatenation is treated as a packed vector of bits. It can be used on the left-hand side of an assignment or in an expression.

 

logic log1, log2, log3;

{log1, log2, log3} = 3’b111;
{log1, log2, log3} = {1’b1, 1’b1, 1’b1}; // same effect as 3’b111

TO

The concatenation is treated as a packed vector of bits. It can be used on the left-hand side of an assignment or in an expression.

 

logic log1, log2, log3;

{log1, log2, log3} = 3’b111;
{log1, log2, log3} = {1’b1, 1’b1, 1’b1}; // same effect as 3’b111

 

One or more bits of a concatenation can be selected as if it were a packed array, assuming an [n-1:0] numbering, except on the left-hand side of an assignment:

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

In 11.5.1, CHANGE

11.5.1 Vector bit-select and part-select addressing

Bit-selects extract a particular bit from a vector net, vector variable, packed array, packed structure or parameter. The bit can be addressed using an expression. If the bit-select is out of the address bounds or the bit-select is x or z, then the value returned by the reference shall be x. A bit-select or part-select of a scalar, or of a real variable or real parameter, shall be illegal.

 

Several contiguous bits in a vector net, vector variable, packed array, packed structure or parameter can be addressed and are known as part-selects.

...

An indexed part-select of a vector net, vector variable, packed array, packed structure or parameter is given with the following syntax:

...

A part-select of any type that addresses a range of bits that are completely out of the address bounds of the vector net, vector variable, packed array, packed structure parameter, or a part-select that is x or z shall yield the value x when read and shall have no effect on the data stored when written.

 

TO

11.5.1 Vector bit-select and part-select addressing

Bit-selects extract a particular bit from a vector net, vector variable, packed array, packed structure or parameter , parameter, or concatenation. The bit can be addressed using an expression. If the bit-select is out of the address bounds or the bit-select is x or z, then the value returned by the reference shall be x. A bit-select or part-select of a scalar, or of a real variable or real parameter, shall be illegal.

 

Several contiguous bits in a vector net, vector variable, packed array, packed structure or parameter can be addressed and are known as part-selects.

...

An indexed part-select indexed part-select of a vector net, vector variable, packed array, packed structure or parameter is given with the following syntax:

...

A part-select of any type that addresses a range of bits that are completely out of the address bounds of the vector net, vector variable, packed array, packed structure, parameter or concatenation, or a part-select that is x or z shall yield the value x when read and shall have no effect on the data stored when written.

 

 

 

In A.8.4, CHANGE

constant_primary ::=

               ...

| constant_concatenation
| constant_multiple_concatenation

...

 

primary ::=

...

| concatenation

| multiple_concatenation

...

 

TO

constant_primary ::=

               ...

| constant_concatenation [ [ constant_range_expression ] ]
| constant_multiple_concatenation [ [ constant_range_expression ] ]

...

primary ::=

...

| concatenation

| multiple_concatenation

...

 

range_expression ::=

                 expression [ [ range_expression ] ]

               | part_select_range [ [ range_expression ] ]