RE: [sv-bc] implicit casts

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Fri Apr 04 2008 - 00:30:56 PDT
Hi, 

> "The existence of casts may enable tools to perform stronger 
> type checking, by providing a mechanism for users to suppress 
> that type checking when desired."

This enables detection of inadvertent type conversion by letting the
user tag deliberate type conversion.

A similar idea is in size-extension. SV has implicit size-extension, but
it can hide errors. For example, if one wrote

a[15:0] = b[16:2]; // LHS = 16 bits, RHS = 15 bits

it is likely that this is an error, and the RHS was supposed to be
either b[16:1] or b[17:2]. By requiring explicit size-extension, such as
{1'b0, b[16:2]}, when one really wants it, this allows detection of
likely errors by implicit size-extension. Otherwise, the implicit
size-extension errors are swamped by the 99% of cases which are not
errors.

By the way, in a similar case I had years ago, the RHS which was really
desired was of the form {b[16:2], 1'b0}.

None of this answers my original question, though. I don't find implicit
casting really described in 6.24.

Shalom

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Apr 4 00:33:54 2008

This archive was generated by hypermail 2.1.8 : Fri Apr 04 2008 - 00:34:24 PDT