BTF: B11 Proposal "Automatic width extension beyond 32 bits"

From: Anders Nordstrom (andersn@nortel.ca)
Date: Thu Jul 23 1998 - 11:40:43 PDT


BAD MSG:
BTF Team,
ontent-Length: 2667
X-Lines: 112
X-Status: $$$$
X-UID: 0000000580
Status: RO

Please review the wording for this proposal. This one was discussed and
agreed to on our Feb 20 conference call.

<p>Regards,

        Anders

<p><p><p><HTML>
<HEAD>
<TITLE> B11 </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">

<BR>
<HR SIZE=5 NOSHADE>

<H2> B11 - Automatic width extension beyond 32 bits </H2>

<TABLE BORDER COLS=2 WIDTH="75%" >
<TR><TD>
Section: </TD><TD> 2.5.1 page 7
</TD></TR><TR><TD>
Date Submitted: </TD><TD> 970319
</TD></TR><TR><TD>
Requestor: </TD><TD> adamk@cyrix.com (Adam Krolnik)
</TD></TR><TR><TD>
Status: </TD><TD> proposal
</TD></TR><TR><TD>
Analyzed by: </TD><TD> BTF team and Anders Nordstrom
</TD></TR><TR><TD>
Synthesizable: </TD><TD> Yes
</TD></TR>
</TABLE>

<H3> Details </H3>

Width extension.
If you want to size a constant you need to specify a width to it. E.g. 7'h2 <BR>
If you don't specify a size ('h123) it has a machine word width (I.e. 32 <BR>
bits.) This causes the following statements to provide unexpected behavior:
<PRE>
reg[63:0] a;
initial a = 'h0;
reg[63:0] b;
initial b = 'bz;
</PRE>
Rather, the unsized constant should be extended (signed?, zero?, last-bit?)<BR>
to the width of the lhs. In the example, 'a' should have the value 64'h0, <BR>
not {32'bx, 32'b0}.

<p>>From cliffc@europa.com Fri May 2 11:41:32 1997

I could support this request.

I always find it amusing to run the following code through Synopsys, only to
<BR> find 32 tri-state drivers and 32 and gates with one input tied low.
<PRE>
module driver (y, a, en);
  output [63:0] y;
  input [63:0] a;
  input en;
  
  assign y = en ? a : 'bz;
endmodule
</PRE>
Note: This could potentially break exiting models if anyone has been <BR>
counting on zero-extension for busses greater that 32 bits wide, but it <BR>
seems like an extremely risky strategy to intentionally employ that coding
style.

Regards - Cliff Cummings

From: mac@silicon-sorcery.com

        Not unreasonable; the current behavior is not really serving <BR>
any useful purpose, except to confuse newbies.

        I would support this proposal. one would need to consider the <BR>
size of unsized constants in expression context:
<PRE>
        wire [24:0] a, b;

        assign a = (b + 'h23)>>2;
</PRE>

<H3> Proposal </H3>

Add the following sentence at the end of the first paragraph
on page 7: <BR>
"If the size constant is not specified, the number shall be sized to <BR>
the size of the left hand side expression where the number is used" <P>

Add to the "Automatic left padding" example on page 8: <BR>
<PRE>
reg [84:0] e, f, g;

        e = 'h5; // yields {82{1'b0},3'b101}
        f = 'hx; // yields {85{1'hx}}
        g = 'hz; // yields {85{1'hz}}
</PRE>

<HR SIZE=5 NOSHADE>
</BODY>
</HTML>



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:52:58 PDT and
sponsored by Boyd Technology, Inc.