RE: [sv-bc] RE: [sv-ac] Mantis 1974: Definitions of true and false conditions

From: Alsop, Thomas R <thomas.r.alsop_at_.....>
Date: Wed Aug 15 2007 - 10:36:30 PDT
Brad, It isn't clear if you are agreeing with Shalom on this or not.  

 

I don't think 12.4 and 16.3 fall into the same category as the ternary
"?:" operator. With the ternary operator we have a clear assignment into
the first argument and the result is coming from one of two expressions
which will evaluate to a scalar/singular type.  Table 11-22 is very
clear on how we remove some of the x propagation pessimism when we do
the bit by bit comparison.  

 

In 12.4 the "If then Else" semantics do not necessarily result in the
assignment of a single scalar type, but can be multiple assignments to
different objects.  In 16.3, the assertion "selector expression" is
typically going to print a message and is not going to do any type of
bit by bit concatenation operation.  Hence, I don't believe there is any
need to change their current wording or semantics.

 

I also want to comment on a question I am seeing near Table 11-22

 

QUESTION:

Is the shorter

operand always

zero extended, or

can it be sign

extended? 

 

It's referring to this sentence "If the lengths of the first and second
expression are different, the shorter operand shall be

lengthened to match the longer and zero-filled from the left (the
high-order end)."

 

I think this should be sign extended.  It will most closely match real
implementation.  Also it matches our sign extension rules

 

From 10.7:

When the right-hand side evaluates to fewer bits than the left-hand
side, the right-hand side value is

padded to the size of the left-hand side. If the right-hand side is
unsigned, it is padded according to

the rules specified in 11.6.1. If the right-hand side is signed, it is
sign-extended.

 

 

Thanks,

-Tom

 

________________________________

From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On
Behalf Of Brad Pierce
Sent: Tuesday, August 14, 2007 11:17 PM
To: sv-bc
Cc: sv-ac@server.eda-stds.org
Subject: [sv-bc] RE: [sv-ac] Mantis 1974: Definitions of true and false
conditions

 

Shalom,

 

The fix for 1364 issue 403 became the following in 11.4.12 of Draft 3a
--

 

      "If cond_predicate is true, the operator returns the value of the
first expression; if false, it returns the value of  the second
expression. If cond_predicate evaluates to an ambiguous value (x or z),
then both the first expression and the second expression shall be
evaluated, and their results shall be combined bit by bit using Table
11-22 to calculate the final result".

 

The cond_predicate has a scalar type, and cannot usefully be considered
bitwise.  Instead, this paragraph is saying that, if the cond_predicate
is ambiguous, then where the first and second expression agree about
particular bits of the result, a non-x-pessimistic value is calculated
for those bits.

 

This is related to enhancement request

 

     http://www.eda-stds.org/svdb/view.php?id=1190
<http://www.eda-stds.org/svdb/view.php?id=1190> 

 

which was http://www.boyd.com/1364_btf/report/full_pr/401.html
<http://www.boyd.com/1364_btf/report/full_pr/401.html>  .

 

-- Brad

 

________________________________

From: owner-sv-ac@eda.org [mailto:owner-sv-ac@eda.org] On Behalf Of
Bresticker, Shalom
Sent: Tuesday, August 14, 2007 9:54 PM
To: sv-bc
Cc: sv-ac@eda-stds.org
Subject: [sv-ac] Mantis 1974: Definitions of true and false conditions

Section 12.4 has the following definitions of 'true' and 'false'
conditions: 

"If the cond_predicate expression evaluates to true (that is, has a
nonzero known value), the first statement shall be executed. If it
evaluates to false (that is, has a zero value or the value is x or z),
the first statement shall not execute."

These descriptions are incorrect. We corrected them for the conditional
operator (?:) in 1364-2005, but missed this place. See old 1364 issue
403 (http://boyd.com/1364_btf/report/full_pr/403.html
<http://boyd.com/1364_btf/report/full_pr/403.html> ).

Section 16.3 (Immediate Assertions) has the same mistake: 

"The expression is nontemporal and is interpreted the same way as an
expression in the condition 
of a procedural if statement. In other words, if the expression
evaluates to X, Z, or 0, then it is interpreted as being false, and the
assertion is said to fail. Otherwise, the expression is interpreted as
being true, and the assertion is said to pass."

The difference is where some of the bits are X/Z and some are 0/1. The
value is known but also not completely unknown. The value is not quite
X/Z, but not completely 0s and 1s. What is known is that if any of the
bits is 1, then the value is definitely non-zero. In this case, the
condition is true, even though the value is not quite known. On the
other hand, if the known bits are all 0, then the condition is false,
even though its value is not quite 0, X, or Z.

This is Mantis 1974. 

Shalom 

Shalom Bresticker 
Intel Jerusalem LAD DA 
+972 2 589-6852 
+972 54 721-1033 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Aug 15 10:37:06 2007

This archive was generated by hypermail 2.1.8 : Wed Aug 15 2007 - 10:37:50 PDT