From b274dada859f84a26011085a2b2f90d80f137d23 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 12 Jan 2002 04:02:16 +0000 Subject: [PATCH] Support the BUFZ logic device. --- vvp/draw_tt.c | 32 +++++++++++++++++++++++++++++++- vvp/logic.cc | 8 +++++++- vvp/logic.h | 6 +++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/vvp/draw_tt.c b/vvp/draw_tt.c index ab1a154b1..7e9d4ce60 100644 --- a/vvp/draw_tt.c +++ b/vvp/draw_tt.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: draw_tt.c,v 1.11 2001/11/06 03:07:22 steve Exp $" +#ident "$Id: draw_tt.c,v 1.12 2002/01/12 04:02:16 steve Exp $" #endif # include @@ -122,6 +122,32 @@ static void draw_BUF(void) printf("};\n"); } +static void draw_BUFZ(void) +{ + unsigned i0, i1, i2, i3; + + printf("const unsigned char ft_BUFZ[64] = {"); + + for (i3 = 0 ; i3 < 4 ; i3 += 1) + for (i2 = 0 ; i2 < 4 ; i2 += 1) { + printf("\n "); + for (i1 = 0 ; i1 < 4 ; i1 += 1) { + unsigned idx = (i3 << 4) | (i2 << 2) | i1; + unsigned char byte = 0; + + for (i0 = 0 ; i0 < 4 ; i0 += 1) { + unsigned val = i0; + + byte |= val << (i0*2); + } + + printf("0x%02x, ", byte); + } + } + + printf("};\n"); +} + static void draw_BUFIF0(void) { unsigned i0, i1, i2, i3; @@ -599,6 +625,7 @@ main() draw_BUF(); draw_BUFIF0(); draw_BUFIF1(); + draw_BUFZ(); draw_PMOS(); draw_NMOS(); draw_MUXZ(); @@ -616,6 +643,9 @@ main() /* * $Log: draw_tt.c,v $ + * Revision 1.12 2002/01/12 04:02:16 steve + * Support the BUFZ logic device. + * * Revision 1.11 2001/11/06 03:07:22 steve * Code rearrange. (Stephan Boettcher) * diff --git a/vvp/logic.cc b/vvp/logic.cc index ceec4c82e..797b19644 100644 --- a/vvp/logic.cc +++ b/vvp/logic.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: logic.cc,v 1.6 2001/12/14 06:03:17 steve Exp $" +#ident "$Id: logic.cc,v 1.7 2002/01/12 04:02:16 steve Exp $" #endif # include "logic.h" @@ -88,6 +88,9 @@ void compile_functor(char*label, char*type, } else if (strcmp(type, "BUFIF1") == 0) { obj = new vvp_bufif_s(false,false); + } else if (strcmp(type, "BUFZ") == 0) { + obj = new table_functor_s(ft_BUFZ, ostr0, ostr1); + } else if (strcmp(type, "PMOS") == 0) { obj = new vvp_pmos_s; @@ -152,6 +155,9 @@ void compile_functor(char*label, char*type, /* * $Log: logic.cc,v $ + * Revision 1.7 2002/01/12 04:02:16 steve + * Support the BUFZ logic device. + * * Revision 1.6 2001/12/14 06:03:17 steve * Arrange bufif to support notif as well. * diff --git a/vvp/logic.h b/vvp/logic.h index a5f6d2416..e02eed705 100644 --- a/vvp/logic.h +++ b/vvp/logic.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: logic.h,v 1.2 2001/12/14 02:04:49 steve Exp $" +#ident "$Id: logic.h,v 1.3 2002/01/12 04:02:16 steve Exp $" #endif # include "functor.h" @@ -47,6 +47,7 @@ extern const unsigned char ft_AND[]; extern const unsigned char ft_BUF[]; extern const unsigned char ft_BUFIF0[]; extern const unsigned char ft_BUFIF1[]; +extern const unsigned char ft_BUFZ[]; extern const unsigned char ft_PMOS[]; extern const unsigned char ft_NMOS[]; extern const unsigned char ft_MUXZ[]; @@ -61,6 +62,9 @@ extern const unsigned char ft_var[]; /* * $Log: logic.h,v $ + * Revision 1.3 2002/01/12 04:02:16 steve + * Support the BUFZ logic device. + * * Revision 1.2 2001/12/14 02:04:49 steve * Support strength syntax on functors. *