Subject: Re: [sv-bc] Re: The Action item for you from the SV-BC
From: Kevin Cameron x3251 (Kevin.Cameron@nsc.com)
Date: Mon Jan 20 2003 - 16:31:03 PST
> From: "Andrzej Litwiniuk" <Andrzej.Litwiniuk@synopsys.com>
> Subject: Re: [sv-bc] Re: The Action item for you from the SV-BC
>
> > Does anyone care about mapping bit-vectors to C bit fields?
> >
> > E.g.:
> >
> > SV:
> > struct { bit [4:0] x;
> > char y;} sv_strct;
> >
> > ==
> >
> > C:
> > struct { int x:5;
> > char y;} c_strct;
> >
> >
> > Kev.
> >
>
> Kevin,
>
> That was too easy. Try this:
>
> SV:
> struct { bit [500:0] x;
> char y;} sv_strct;
>
>
> Andrzej
I was really looking at the C to SV mapping since the code
for my USB testbench has this in it:
typedef struct {
unsigned int
#ifdef BIG_ENDIAN
dw0_pad:5,
dw0_MPS:11,
dw0_F:1,
dw0_K:1,
dw0_S:1,
dw0_D:2,
dw0_EN:4,
dw0_FA:7,
dw1_TailP:28,
dw1_X:4,
dw2_HeadP:28,
dw2_H:1,
dw2_C:1,
dw2_O:2,
dw3_NextED:28,
dw3_X:4;
#else
dw0_FA:7,
dw0_EN:4,
dw0_D:2,
dw0_S:1,
dw0_K:1,
dw0_F:1,
dw0_MPS:11,
dw0_pad:5,
dw1_X:4,
dw1_TailP:28,
dw2_H:1,
dw2_C:1,
dw2_O:2,
dw2_HeadP:28,
dw3_X:4,
dw3_NextED:28;
#endif
} UsbED;
However there's no reason not to do:
struct { bit [500:0] x;
char y;} sv_strct;
->
struct { int x0[15],
x1:21;
char y;} c_strct;
Kev.
-- National Semiconductor, Tel: (408) 721 3251 2900 Semiconductor Drive, Mail Stop D3-500, Santa Clara, CA 95052-8090> From Andrzej.Litwiniuk@synopsys.com Mon Jan 20 16:04:56 2003
This archive was generated by hypermail 2b28 : Mon Jan 20 2003 - 16:31:33 PST