Re: [sv-cc] Suggest LRM warning: lack of certain type equivalences

From: Swapnajit Mittra <mittra@juno.com>
Date: Thu Mar 18 2004 - 14:16:29 PST

Team,

Unless I hear any objection from anyone, this will
be considered accepted and sent to LRM editors by
the end of the day tomorrow.

--
Swapnajit Mittra
Project VeriPage ::: http://www.angelfire.com/ca/verilog
Please note: message attached

attached mail follows:


SV-CC team,

Please find below a suggested addition to the LRM. Our intent is to
prevent
users from making erroneous, though perhaps natural, assumptions about
certain type equivalences. Please let me know if you think this might
be helpful.

Thanks,
Ralph

---------------------------------

1. Request

Please add the following remarks to Annex E.6.4 as a stand-alone
paragraph,
following the remark about DPI unsigned types:

"Note that input mode arguments of type 'byte unsigned' and 'shortint
unsigned'
are not equivalent to bit[7:0] or bit[15:0], respectively, since the
former are
passed as C types 'unsigned char' and 'unsigned short' and the latter
are passed
as C 'unsigned int' (i.e., svBitVec32). A similar lack of equivalence
applies
to passing such parameters by reference for output and inout modes."

2. Rationale

This warns users who might otherwise assume that these bit vectors and
integral types
are equivalent.

3. Background

a. unsigned byte = C unsigned char and unsigned shortint = C unsigned
short (E.6.4).

b. input mode packed bit arrays <= 32 bits are passed as svBitVec32
(E.7.7).

c. svBitVec32 = C unsigned int (svdpi.h, F.1).

d. bit vectors default to unsigned (3.3.3).

---------------
Ralph Duncan
Staff Engineer
Mentor Graphics
San Jose, CA
408-487-7414

________________________________________________________________
The best thing to hit the Internet in years - Juno SpeedBand!
Surf the Web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
Received on Thu Mar 18 14:17:35 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 18 2004 - 14:17:37 PST