RE: [sv-bc] MERGE REVIEW draft 2: Chapter 11

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Apr 12 2007 - 08:43:29 PDT
Hi,

> 11.1 "An operand can be one of the following: ... Any net type ... Any
> net type"  What is a net type?  (And why is it listed twice?) A net is
> a
> more likely operand than a type, although, of course, the type
> operator
> and some system tasks can be applied to data types.

[SB] I agree with Brad. This confusion arises from use of the term
"type" to mean different things. For example, 6.4 says, "The net data
types can represent physical connections between structural entities,
such as gates."

I strongly recommend we clear this up and be pedantic about the use of
the terms "type", "object", and "kind" (22.1.2.3 in D2). In many cases,
the term "object" can simply be omitted, e.g., "net" instead of "net
object".


> Table 11-2 Where else does the LRM say that ++ and -- can be applied
> to
> real operands?  Is this based on the precedent of C?

[SB] See 1800-2005, 8.6: "Operands of type shortreal have the same
operation restrictions as Verilog real operands. The unary operators ++
and -- can have operands of type real and shortreal (the increment or
decrement is by 1.0). The assignment operators +=, -=, *=, /= can also
have operands of type real and shortreal."

 
> 11.2.10  "All net types are unsigned by default.  The byte, shortint,
> int, integer and longint variable types are signed types by default.
> Other variable types are unsigned by default. See 6.5 for variable
> types."  The reason 'byte', 'shortint', etc. are disallowed on nets is
> not because they are "variable types", but because they are 2-state
> types.  (This limitation was the topic of ballot issue 228.)  There
> are
> kinds and there are types, and some types cannot be used with some
> kinds.  For example, a data object of net kind cannot have a 2-state
> data type.

[SB] I agree with Brad, but regarding the terminology, although there
was a proposal to talk about "net kinds", this was not done in
1800-2005.


> 11.2.18 "If cond_predicate is true, the operator returns the first
> expression; if false, it returns the second expression."  Actually, it
> evaluates an expression and returns its value.

[SB] Also, regarding the text, "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)," Stu asked, "Is the shorter operand always zero extended, or
can it be sign extended?" 

For the answer, see Mantis 1004. Brad's tool seemed to really do
zero-extension, but I ran the same example on two other tools and got on
both of them
11111111111111111111111111111110
11111111111111111111111111111110
which is sign-extension.
So it seems that the LRM is wrong here.

Shalom

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Apr 12 08:45:02 2007

This archive was generated by hypermail 2.1.8 : Thu Apr 12 2007 - 08:47:01 PDT