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
0001345 [SystemVerilog P1800] SV-BC feature 2006-02-20 07:01 2008-06-22 11:06
Reporter shalom View Status public  
Assigned To shalom
Priority immediate Resolution fixed  
Status closed   Product Version
Summary 0001345: 10.4: "illegal" unique if/case issues
Description In 10.4, there are some unclearnesses about 'illegal' unique if and case statements.

This is a follow-up to the long email discussion which began in http://www.eda.org/sv-bc/hm/3691.html [^] .

10.4 says,

"A unique if shall be illegal if, for any such interleaving of evaluation and use of the conditions,
more than one condition is true. For an illegal unique if, an implementation shall be required to issue a
warning, unless it can demonstrate a legal interleaving so that no more than one condition is true."

and

"A unique case shall be illegal if, for any such interleaving of evaluations and comparisons, more
than one case item matches the case expression. For an illegal unique case, an implementation shall be
required to issue a warning message, unless it can demonstrate a legal interleaving of evaluations and comparisons
so that no more than one case item matches the case expression."


1. In each quote, the first sentence contains the phrase "for any such interleaving". This is ambiguous. It can be interpreted as "there exists some such interleaving" or as "for all such interleavings" (as in mathematical expressions, "for any x", which means "for all x"). In fact, the email discussion showed that the intent was closer to the first interpretation, but more precisely something like "the tools detects such an interleaving", which is subtly different from the first interpretation also.


2. The wording "For an illegal unique case, an implementation shall be
required to issue a warning message, unless it can demonstrate a legal interleaving" (same for if statements) sounds like it is saying "It shall issue a warning for an illegal case unless it is legal", which sounds self-contradictory.


3. "Shall be required to issue" is verbose. "shall issue" is enough. Again, in two places.


4. The text is not clear as to whether the tool is required to look for a legal ordering.


5. The term "illegal" is not appropriate. "illegal" designates a construct with bad syntax or a run-time condition which is not allowed. Here, the intent is simply an assertion which fails.

Contrast to "It shall be illegal to make nonblocking assignments to automatic variables." two paragraphs before 10.4, or "The unique and priority keywords apply to the entire series of if...else...if conditions. In the preceding examples, it would have been illegal to insert either keyword after any of the occurrences of else." in 10.4 itself.


6. Subject for possible discussion: why should a tool not issue a warning if it finds ANY ordering which violates uniqueness (even if it finds a different ordering which does not, which probably makes it a pathological case anyway)?
Additional Information
Tags No tags attached.
Type Errata
Attached Files htm file icon 1345_D4_unique.V2.htm [^] (56,370 bytes) 2007-11-27 10:31
htm file icon 1345_D4_unique.V3.htm [^] (56,442 bytes) 2007-12-04 01:51
htm file icon 1345_D4_unique.V4.htm [^] (56,438 bytes) 2007-12-04 19:31

- Relationships
related to 0001711closedshalom Rules for unique case evaluation 
related to 0002036closedshalom Unique case and overlapping expressions in a case item 
related to 0000218closedBrad Pierce Unique case/if evaluation order 
related to 0002131closedCliff Cummings Parallel_case equivalent needed for case and if statements 
related to 0002008closedThomas R Alsop Glitch problem in unique/priority if/case 

-  Notes
User avatar (0003325)
shalom (manager)
2006-12-18 10:22

The discussion included the subject of what do you do if there are side-effects.
User avatar (0005532)
mmaidment (manager)
2007-12-11 17:07

The SV-BC unanimously approved the attached proposal via e-mail vote
that closed December 10, 2007.
User avatar (0005623)
Neil Korpusik (administrator)
2007-12-23 18:01

The proposal was unanimously approved by the Champions in the
December 20th, 2007 conference call.
User avatar (0005892)
Neil Korpusik (administrator)
2008-02-04 18:29

The proposal was unanimously approved by the P1800 Working Group
in the January 31, 2008 conference call.
User avatar (0006148)
shalom (manager)
2008-03-05 21:42

Note that this proposal incorportates and supercedes 0002036.
User avatar (0006648)
shalom (manager)
2008-05-02 08:06

In 12.4.2, in the sentence, "Unique-if and unique0-if assert that there is no overlap in a series of if–else–if conditions, i.e., they are mutually exclusive and hence it is safe for the expressions to be evaluated in parallel," the word 'expressions' should be changed to 'conditions'.

In 12.5.3, in the sentence, "It is not a violation of uniqueness for a single case_item to contain more than one case_item_expressions that matches the case_expression. If a case_item_expressions matches the case_expression, the implementation is not required to evaluate additional case_item_expressions in the same case_item," the first two uses of the term "case_item_expressions" should be singular.
User avatar (0006949)
Stuart Sutherland (manager)
2008-06-03 00:33

The errors noted in bug note 6648 were corrected in Draft 6.

- Issue History
Date Modified Username Field Change
2006-02-20 07:01 shalom New Issue
2006-02-20 07:01 shalom Type => Errata
2006-12-12 04:00 shalom Description Updated
2006-12-12 04:26 shalom Status new => assigned
2006-12-12 04:26 shalom Assigned To => shalom
2006-12-18 10:22 shalom Note Added: 0003325
2007-06-11 03:34 shalom Relationship added related to 0001711
2007-09-16 00:21 shalom Relationship added related to 0002036
2007-11-05 13:03 shalom Relationship added related to 0000218
2007-11-27 10:31 shalom File Added: 1345_D4_unique.V2.htm
2007-11-27 10:32 shalom Priority normal => immediate
2007-12-04 01:51 shalom File Added: 1345_D4_unique.V3.htm
2007-12-04 19:31 shalom File Added: 1345_D4_unique.V4.htm
2007-12-11 17:07 mmaidment Note Added: 0005532
2007-12-11 17:07 mmaidment Status assigned => resolved
2007-12-11 17:07 mmaidment Resolution open => fixed
2007-12-12 11:36 shalom Issue Monitored: shalom
2007-12-16 22:31 Cliff Cummings Relationship added related to 0002131
2007-12-23 18:01 Neil Korpusik Note Added: 0005623
2008-02-04 18:29 Neil Korpusik Note Added: 0005892
2008-02-04 18:29 Neil Korpusik Status resolved => approved
2008-03-03 22:53 shalom Relationship added related to 0002008
2008-03-05 21:42 shalom Note Added: 0006148
2008-04-15 00:07 Stuart Sutherland Status approved => completed
2008-04-15 00:07 Stuart Sutherland Fixed in Version => P1800-2008/D5
2008-05-02 08:06 shalom Note Added: 0006648
2008-05-02 08:06 shalom Status completed => editor
2008-06-03 00:33 Stuart Sutherland Status editor => completed
2008-06-03 00:33 Stuart Sutherland Fixed in Version P1800-2008/D5 => P1800-2008/D6
2008-06-03 00:33 Stuart Sutherland Note Added: 0006949
2008-06-22 11:06 Brad Pierce Status completed => closed


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