EDA.org Mantis
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Date Submitted Last Update
0001666 [SystemVerilog P1800] SV-BC major 2006-11-05 06:34 2008-05-10 19:46
Reporter shalom View Status public  
Assigned To shalom
Priority immediate Resolution fixed  
Status closed   Product Version
Summary 0001666: 3.8: error in structural literal example
Description Krishanu Debnath asserted in http://www.eda-stds.org/sv-bc/hm/3652.html [^] that there is a problem in structure literal example at end of 3.8.

I just saw, and no seems to have noticed then, that the first level of expansion is clearly wrong in that it expands the 3{a in two different ways, both of which are different from the source code.

Greg Jaxon wrote in http://www.eda-stds.org/sv-bc/hm/3667.html [^] :

The example on page 12 is wrong, and its expansion has been bungled.
Here is a corrected version:

struct {int X,Y,Z;} XYZ = '{3{1}};
typedef struct {int a,b[4];} ab_t;
int a,b,c;
ab_t v1[1:0] [2:0];
v1 = '{2{'{3{'{a,'{2{b,c}}}}}}};
/* expands to '{ '{3{ '{ a, '{2{ b, c }} } }},
                 '{3{ '{ a, '{2{ b, c }} } }}
                } */

/* expands to '{ '{ '{ a, '{2{ b, c }} },
                    '{ a, '{2{ b, c }} },
                    '{ a, '{2{ b, c }} }
                   },
                 '{ '{ a, '{2{ b, c }} },
                    '{ a, '{2{ b, c }} },
                    '{ a, '{2{ b, c }} }
                   }
                } */

/* expands to '{ '{ '{ a, '{ b, c, b, c } },
                    '{ a, '{ b, c, b, c } },
                    '{ a, '{ b, c, b, c } }
                   },
                  '{ '{ a, '{ b, c, b, c } },
                     '{ a, '{ b, c, b, c } },
                     '{ a, '{ b, c, b, c } }
                   }
                } */

Since there is enough room on the page, please use the vertical pattern to better illustrate the repetitive behavior.

He added in http://www.eda-stds.org/sv-bc/hm/3669.html [^] :

I understand that examples aren't normative, but please add:

/* Implementations are not required to replicate assignment patterns before evaluating them. */

I classified this as severity major because the apostrophe rules for aggregate literals are very confusing as it is.
Additional Information
Tags No tags attached.
Type Errata
Attached Files htm file icon 1666.htm [^] (58,200 bytes) 2006-12-28 01:36
htm file icon 1666_D3.htm [^] (56,130 bytes) 2007-06-01 03:25

- Relationships

-  Notes
User avatar (0003244)
shalom (manager)
2006-11-05 06:37

Dave Rich wrote in http://www.eda-stds.org/sv-bc/hm/3739.html [^] :

"It has come back to me. Some functionality has been garbled when '{} was added to {}.

Before we added the ', only one set of braces in a literal was represented by a replication. so {4{1}} could become the same as {1,1,1,1}, the inner set of braces is part of the replication, not part the assignment pattern.

so {2{1,1}} becomes {1,1,1,1}, it

Therefore I believe replication in assignment patters should only require one '

'{4{1,1}}
"

But I am not sure whether Dave intended to disagree with Greg.
User avatar (0003245)
Dave Rich (manager)
2006-11-06 17:41

I was replying to an earlier e-mail. I do agree with Greg's re-write of the example.
User avatar (0003262)
Brad Pierce (developer)
2006-11-16 09:38

See comments in http://www.eda-stds.org/sv-bc/hm/5372.html [^]
User avatar (0003331)
shalom (manager)
2006-12-28 01:37

I uploaded a new proposal which just fixes the example and does not mention the number of times a replication is evaluated. That is dealt with in 0001301.
User avatar (0003508)
mmaidment (manager)
2007-03-05 01:25

On January 8, 2007 the SV-BC unanimously approved the attached proposal.
User avatar (0003712)
mmaidment (manager)
2007-05-25 16:30

Proposal needs to be updated for incorporation in 1800-2008 Draft 3.
User avatar (0003749)
shalom (manager)
2007-06-01 03:24

Updated to Draft 3
User avatar (0003827)
mmaidment (manager)
2007-06-22 11:33

On June 11, 2007, via e-mail ballot, the SV-BC approved resolving this issue per Shalom's proposal.

Stu abstained from the vote as he did not have time to review the
examples.
User avatar (0004584)
Neil Korpusik (administrator)
2007-09-13 15:34

Unanimously approved by the Champions in the August 15, 2007 conference call.
User avatar (0004585)
Neil Korpusik (administrator)
2007-09-13 15:34

Unanimously approved by the P1800 Working Group in the August 30, 2007
conference call.
User avatar (0004833)
Stuart Sutherland (manager)
2007-10-03 21:55

Corrected in P1800-2008 draft 4.
User avatar (0005721)
shalom (manager)
2008-01-15 23:31

The indentation of the last comment is not right.

The first line of the last comment is OK, but the remaining lines are indented too much, and not aligned with the first line.
User avatar (0006555)
Stuart Sutherland (manager)
2008-04-17 09:59

Correction to indentation made in P1800-2008/D5, per bug note dated 2008-01-15.
User avatar (0006753)
shalom (manager)
2008-05-10 19:46

Change verified in Drsft 5.

- Issue History
Date Modified Username Field Change
2006-11-05 06:34 shalom New Issue
2006-11-05 06:34 shalom Type => Errata
2006-11-05 06:37 shalom Note Added: 0003244
2006-11-06 17:41 Dave Rich Note Added: 0003245
2006-11-08 00:36 shalom File Added: 1666.htm
2006-11-12 06:54 shalom Status new => assigned
2006-11-12 06:54 shalom Assigned To => shalom
2006-11-12 22:51 Brad Pierce Priority normal => immediate
2006-11-16 09:38 Brad Pierce Note Added: 0003262
2006-12-28 01:36 shalom File Added: 1666.htm
2006-12-28 01:36 shalom File Deleted: 1666.htm
2006-12-28 01:37 shalom Note Added: 0003331
2007-03-05 01:25 mmaidment Status assigned => resolved
2007-03-05 01:25 mmaidment Resolution open => fixed
2007-03-05 01:25 mmaidment Note Added: 0003508
2007-05-25 16:30 mmaidment Status resolved => feedback
2007-05-25 16:30 mmaidment Resolution fixed => reopened
2007-05-25 16:30 mmaidment Note Added: 0003712
2007-06-01 03:24 shalom Note Added: 0003749
2007-06-01 03:24 shalom Status feedback => assigned
2007-06-01 03:25 shalom File Added: 1666_D3.htm
2007-06-22 11:33 mmaidment Note Added: 0003827
2007-06-22 11:33 mmaidment Status assigned => resolved
2007-09-13 15:34 Neil Korpusik Note Added: 0004584
2007-09-13 15:34 Neil Korpusik Note Added: 0004585
2007-09-13 15:34 Neil Korpusik Status resolved => approved
2007-09-13 15:34 Neil Korpusik Resolution reopened => fixed
2007-10-03 21:55 Stuart Sutherland Status approved => completed
2007-10-03 21:55 Stuart Sutherland Fixed in Version => P1800-2008/D4
2007-10-03 21:55 Stuart Sutherland Note Added: 0004833
2008-01-15 23:31 shalom Note Added: 0005721
2008-01-15 23:31 shalom Status completed => editor
2008-01-16 02:19 shalom Issue Monitored: shalom
2008-04-17 09:59 Stuart Sutherland Status editor => completed
2008-04-17 09:59 Stuart Sutherland Note Added: 0006555
2008-05-10 19:46 shalom Status completed => closed
2008-05-10 19:46 shalom Note Added: 0006753
2008-05-10 19:46 shalom Fixed in Version P1800-2008/D4 => P1800-2008/D5


Mantis 1.1.7[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker