Skip to content

Commit

Permalink
Support the BUFZ logic device.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Jan 12, 2002
1 parent c6a937e commit b274dad
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
32 changes: 31 additions & 1 deletion vvp/draw_tt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -599,6 +625,7 @@ main()
draw_BUF();
draw_BUFIF0();
draw_BUFIF1();
draw_BUFZ();
draw_PMOS();
draw_NMOS();
draw_MUXZ();
Expand All @@ -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)
*
Expand Down
8 changes: 7 additions & 1 deletion vvp/logic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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.
*
Expand Down
6 changes: 5 additions & 1 deletion vvp/logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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[];
Expand All @@ -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.
*
Expand Down

0 comments on commit b274dad

Please sign in to comment.