Subject: Re: [sv-cc] Updated LRM - functions for bit type part-selects
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Wed Mar 19 2003 - 10:54:23 PST
> > /* canonical <-- actual */
> > svBitVec32 svGetBits(const svBitPackedArrRef s, int i, int w);
> > svBitVec32 svGet32Bits(const svBitPackedArrRef s, int i); // 32-bits
> > long long svGet64Bits(const svBitPackedArrRef s, int i); // 64-bits
>
> It looks good but I would prefer the following for the bit
> select functions:
>
> typedef long long svBitVec64;
> svBitVec64 svGet64Bits( ... );
John,
I'm afraid that defining the type svBitVec64 may lead to confusion
and misinterpretation, due to its similarity to svBitVec32.
Users may think that this is an alternative form of canonical representation
which siimply uses bigger chunks of data. (I remember that you were fond of
such idea.).
If you'd rather have a new type, than what about sv64Bits?
typedef long long sv64Bits;
sv64Bits svGet64Bits( ... );
Function svGet64Bits() is an exception, as generally only narrow (<=32 bit)
part-selects are supported.
> svBitVec32 svGet32Bits(
> const svBitPackedArrRef s, int i, int w); // Up to 32-bits
> svBitVec64 svGet64Bits(
> const swBitPacketArrRef s, int i, int w ); // Up to 64-bits
>
> I think it is important to include the 'w' parameter in both so
> that proper masking can be applied before the result is returned.
> Plus this is more consistent with what is already in there for
> svGetPartSelectBit() (and what you have listed for svGetBits()).
>
> -- johnS
Parameter 'w' is redundant for svGet32Bits() and svGet64Bits() because
those functions assume width=32 or width=64, respectively.
While svGet64Bits() is an exception in narrow-part-selects-only support,
svGet32Bits(...) is solely a shortcut for svGetBits(..., 32).
Regards,
Andrzej
This archive was generated by hypermail 2b28 : Wed Mar 19 2003 - 10:55:56 PST