RE: [vhdl-200x] RE: Vote Cancelled: VHDL + VHPI (P1076c-2006-D2.4a)]

From: Francoise Martinolle <fm_at_.....>
Date: Wed Jul 12 2006 - 07:09:01 PDT
 
Evan,

I think that the version of vhpi_user.h that you are looking at is an
old version.
We had replaced all the PLI_* with standards definitions from
inttypes.h/sdtint.h.

I am checking with Jim Lewis for the exact location of the standard LRM
that is going to be sent
to the IEEE.

Francoise
    '
-----Original Message-----
From: owner-vhdl-200x@eda-stds.org [mailto:owner-vhdl-200x@eda-stds.org]
On Behalf Of Evan Lavelle
Sent: Tuesday, July 11, 2006 6:34 AM
To: vhdl-200x@eda-stds.org
Subject: Re: [vhdl-200x] RE: Vote Cancelled: VHDL + VHPI
(P1076c-2006-D2.4a)]

I've just had a quick look through vhpi_user.h on eda.org (I wasn't
actually aware it was there). The char and sized-integer handling needs
cleaning up. For instance, we have

> typedef int             PLI_INT32;
> typedef unsigned int    PLI_UINT32;
> typedef short           PLI_INT16;
> typedef unsigned short  PLI_UINT16;
> typedef char            PLI_BYTE8;
> typedef unsigned char   PLI_UBYTE8;
...
> typedef char vhpiCharT;


1 - 'plain' char is a distinct type (it is neither a 'signed char' nor
an 'unsigned char' type), and the standards don't specify whether it is
treated as signed or unsigned; this is up to the compiler. For short,
int, and long, specifying 'signed' is optional, since objects of these
types are signed unless the 'unsigned' keyword is used. This isn't true
of char.

2 - In C and C++, a char is a byte, and sizeof(char) is 1. However, a
"byte" is not necessarily 8 bits; the standard only says that CHAR_BIT
is required to be at least 8. This is probably not relevant - I guess
nothing actually requires a char to be 8 bits?

3 - Most C/C++ coding standards prohibit the use of 'plain char', except
when it is required in the API for an existing library

4 - The macros in inttypes.h/stdint.h should be used for standardised
typedefs for integers of a known size; ie. uint8_t, uint32_t, etc.

5 - What's going on in:

> #define VHPI_GET_PRINTABLE_STRINGCODE( ch )  VHPICharCodes[PLI_UBYTE8 
> ch]

is '[PLI_UBYTE8 ch]' meant to be a typecast (it isn't)?

Evan
Received on Wed Jul 12 07:09:11 2006

This archive was generated by hypermail 2.1.8 : Wed Jul 12 2006 - 07:09:41 PDT