Subject: [sv-cc] Re: Modified "perspectives from a user" examples
From: Stickley, John (john_stickley@mentorg.com)
Date: Wed Apr 02 2003 - 11:43:08 PST
Oops - slight correction on Variation 2 example:
John Stickley wrote:
>
> void MyCModel::SendPacketHeader( const etherHeaderT *header, unsigned
> crc ){
>
> // Declare source compatible, implementation required space for each
> arg
> SV_BIT_PACKED_ARRAY( 48, destAddr );
> SV_BIT_PACKED_ARRAY( 48, srcAddr );
> unsigned compareCrc;
>
> // Pack args into allocated implementation required storage areas
> svPutPartSelectBit( destAddr, (svBitVec32)(header->destAddr), 0, 32);
> svPutPartSelectBit( destAddr, (svBitVec32)(header->destAddr>>32),
> 32, 16 );
> svPutPartSelectBit( srcAddr, (svBitVec32)(header->srcAddr), 0, 32);
> svPutPartSelectBit( srcAddr, (svBitVec32)(header->srcAddr>>32), 32,
> 16 );
>
> // Now call actual function.
> SendPacketHeader( type, length, destAddr, srcAddr, &compareCrc );
johnS:
Corrected call:
SendPacketHeader(
header->type, header->length, destAddr, srcAddr, &compareCrc );
>
> // Compare returned CRC to actual.
> if( compareCrc != crc ) error( "mismatched crcs" );
> }
>
> -- johnS
> __
> ______ | \
> ______________________/ \__ / \
> \ H Dome ___/ |
> John Stickley E | a __ ___/ / \____
> Principal Engineer l | l | \ /
> Verification Solutions Group | f | \/ ____
> Mentor Graphics Corp. - MED C \ -- / /
> 17 E. Cedar Place a \ __/ / /
> Ramsey, NJ 07446 p | / ___/
> | / /
> mailto:John_Stickley@mentor.com \ /
> Phone: (201)818-2585 \ /
> ---------
>
--This email may contain material that is confidential, privileged and/or attorney work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. __ ______ | \ ______________________/ \__ / \ \ H Dome ___/ | John Stickley E | a __ ___/ / \____ Principal Engineer l | l | \ / Verification Solutions Group | f | \/ ____ Mentor Graphics Corp. - MED C \ -- / / 17 E. Cedar Place a \ __/ / / Ramsey, NJ 07446 p | / ___/ | / / mailto:John_Stickley@mentor.com \ / Phone: (201)818-2585 \ / ---------
This archive was generated by hypermail 2b28 : Wed Apr 02 2003 - 11:44:43 PST