RE: [sv-ec] Re: [sv-bc] Musings on array assignment compatibility

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Wed Jun 03 2009 - 02:24:49 PDT
Greg,

As I understood the 2611 proposal, all unpacked structure needed to be conformable (same rank, same unpacked dimension lengths).
Only packed elements could be truncated or extended.

As much as I like the [=] [<=]  notation for elementwise assignment, it does not cover function actual or assignment pattern
activities, so it is no substitute for the 2611 proposal.   Likewise for foreach'().

[SB] 2611 does not seem to be relevant. Did you mean maybe 1447 or 1702?

The standard already encourages issuing a warning whenever an assignment silently causes a truncation or extension.
[SB]  Actually the 1364-2005 said nothing about warnings on truncations or extensions. This was an invention of 1800-2005 and has been removed in the 2009 version.

In 1800-2005, 8.7 said, "With Verilog, tools can issue a warning when the left- and right-hand sides of an assignment are different sizes."   Strictly speaking, that might be true,  because tools "can" issue a warning anytime they want, even in SystemVerilog, but 1364 never said anything about it.

8.12 said, "Software tools can generate a warning if the concatenation width on one side of an assignment is different from the expression on the other side," and the same comment applies.

10.3 said, "The size of the left-hand side of an assignment forms the context for the right-hand expression. If the lefthand side is smaller than the right-hand side, information can be lost, and a warning can be given."  Same comment.

19.11.1 said, "As long as the connecting variables are ordered correctly and are the same size as the instance ports to which they are connected, there shall be no warnings and the simulation shall work as expected." Here the 2005 LRM implied that if there was a size-mismatch, there might be a warning, but again, this was not in 1364.

19.11.2 said, "Named port connections do not have to be ordered the same as the ports of the instantiated module. The variables connected to the instance ports must be the same size, or a port-size mismatch warning shall be reported." Here 1800 invented a new requirement that was not in 1364, but the person who wrote this thought that 1364 worked that way, and it was a mistake.

All these statements have been removed in the 2009 draft.

In contrast, 8.13.1 on array assignment patterns said,

"In other words, the following examples do not give size warnings, unlike the similar assignments above:

bit unpackedbits [1:0] = '{1,1}; // no size warning as bit can be set to 1

int unpackedints [1:0] = '{1'b1, 1'b1}; // no size warning as int can be set to 1'b1"

Here 1800-2005 forbade that a warning be given. This was softened in the 2009 draft:

Now 10.9.1 says, "In other words, the following examples are not required to cause size warnings:

bit unpackedbits [1:0] = '{1,1}; // no size warning required as bit can be set to 1

int unpackedints [1:0] = '{1'b1, 1'b1}; // no size warning required as int can be set to 1'b1"



In short, the standard does not encourage such warnings, nor forbid them.



Regards,

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 Wed Jun 3 02:38:05 2009

This archive was generated by hypermail 2.1.8 : Wed Jun 03 2009 - 02:40:51 PDT