Add the buf functor type.

This commit is contained in:
steve 2001-04-01 21:31:46 +00:00
parent 9bce21ddb7
commit 311e1ce9ee
4 changed files with 52 additions and 4 deletions

View File

@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.12 2001/03/31 19:00:43 steve Exp $"
#ident "$Id: Makefile.in,v 1.13 2001/04/01 21:31:46 steve Exp $"
#
#
SHELL = /bin/sh
@ -81,6 +81,8 @@ lexor.o: lexor.cc parse.h
parse.o: parse.cc
tables.o: tables.cc
parse.h parse.cc: $(srcdir)/parse.y
bison --verbose -t -d $(srcdir)/parse.y -o parse.cc
mv parse.cc.h parse.h

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: compile.cc,v 1.26 2001/04/01 07:22:08 steve Exp $"
#ident "$Id: compile.cc,v 1.27 2001/04/01 21:31:46 steve Exp $"
#endif
# include "compile.h"
@ -255,6 +255,9 @@ void compile_functor(char*label, char*type, unsigned init,
} else if (strcmp(type, "AND") == 0) {
obj->table = ft_AND;
} else if (strcmp(type, "BUF") == 0) {
obj->table = ft_BUF;
} else if (strcmp(type, "NOR") == 0) {
obj->table = ft_NOR;
@ -708,6 +711,9 @@ void compile_dump(FILE*fd)
/*
* $Log: compile.cc,v $
* Revision 1.27 2001/04/01 21:31:46 steve
* Add the buf functor type.
*
* Revision 1.26 2001/04/01 07:22:08 steve
* Implement the less-then and %or instructions.
*

View File

@ -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.3 2001/03/25 20:45:09 steve Exp $"
#ident "$Id: draw_tt.c,v 1.4 2001/04/01 21:31:46 steve Exp $"
#endif
# include <stdio.h>
@ -56,6 +56,38 @@ static void draw_AND(void)
printf("};\n");
}
static void draw_BUF(void)
{
unsigned i0, i1, i2, i3;
printf("const unsigned char ft_BUF[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;
if (i0 == 1)
val = 1;
else if (i0 == 0)
val = 0;
else
val = 2;
byte |= val << (i0*2);
}
printf("0x%02x, ", byte);
}
}
printf("};\n");
}
static void draw_NOR(void)
{
unsigned i0, i1, i2, i3;
@ -257,6 +289,7 @@ main()
{
printf("# include \"functor.h\"\n");
draw_AND();
draw_BUF();
draw_NOR();
draw_NOT();
draw_OR();
@ -267,6 +300,9 @@ main()
/*
* $Log: draw_tt.c,v $
* Revision 1.4 2001/04/01 21:31:46 steve
* Add the buf functor type.
*
* Revision 1.3 2001/03/25 20:45:09 steve
* Add vpiOctStrVal access to signals.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: functor.h,v 1.7 2001/03/29 03:46:36 steve Exp $"
#ident "$Id: functor.h,v 1.8 2001/04/01 21:31:46 steve Exp $"
#endif
# include "pointers.h"
@ -137,6 +137,7 @@ extern void functor_dump(FILE*fd);
extern const unsigned char ft_AND[];
extern const unsigned char ft_BUF[];
extern const unsigned char ft_NOR[];
extern const unsigned char ft_NOT[];
extern const unsigned char ft_OR[];
@ -144,6 +145,9 @@ extern const unsigned char ft_var[];
/*
* $Log: functor.h,v $
* Revision 1.8 2001/04/01 21:31:46 steve
* Add the buf functor type.
*
* Revision 1.7 2001/03/29 03:46:36 steve
* Support named events as mode 2 functors.
*