Add support for triand and trior.

This commit is contained in:
steve 2003-07-30 01:13:28 +00:00
parent d4b7c835de
commit d653a7e88d
6 changed files with 120 additions and 22 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_target.h,v 1.119 2003/06/23 01:25:44 steve Exp $" #ident "$Id: ivl_target.h,v 1.120 2003/07/30 01:13:28 steve Exp $"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
@ -276,9 +276,7 @@ typedef enum ivl_signal_type_e {
IVL_SIT_TRI0, IVL_SIT_TRI0,
IVL_SIT_TRI1, IVL_SIT_TRI1,
IVL_SIT_TRIAND, IVL_SIT_TRIAND,
IVL_SIT_TRIOR, IVL_SIT_TRIOR
IVL_SIT_WAND,
IVL_SIT_WOR
} ivl_signal_type_t; } ivl_signal_type_t;
/* This is the type code for ivl_statement_t objects. */ /* This is the type code for ivl_statement_t objects. */
@ -1222,6 +1220,9 @@ _END_DECL
/* /*
* $Log: ivl_target.h,v $ * $Log: ivl_target.h,v $
* Revision 1.120 2003/07/30 01:13:28 steve
* Add support for triand and trior.
*
* Revision 1.119 2003/06/23 01:25:44 steve * Revision 1.119 2003/06/23 01:25:44 steve
* Module attributes make it al the way to ivl_target. * Module attributes make it al the way to ivl_target.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.117 2003/07/26 04:06:58 steve Exp $" #ident "$Id: t-dll.cc,v 1.118 2003/07/30 01:13:28 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -2053,6 +2053,8 @@ void dll_target::signal(const NetNet*net)
break; break;
case NetNet::TRI: case NetNet::TRI:
case NetNet::WIRE:
case NetNet::IMPLICIT:
obj->type_ = IVL_SIT_TRI; obj->type_ = IVL_SIT_TRI;
break; break;
@ -2065,24 +2067,13 @@ void dll_target::signal(const NetNet*net)
break; break;
case NetNet::TRIAND: case NetNet::TRIAND:
case NetNet::WAND:
obj->type_ = IVL_SIT_TRIAND; obj->type_ = IVL_SIT_TRIAND;
break; break;
case NetNet::TRIOR: case NetNet::TRIOR:
obj->type_ = IVL_SIT_TRIOR;
break;
case NetNet::WAND:
obj->type_ = IVL_SIT_WAND;
break;
case NetNet::WIRE:
case NetNet::IMPLICIT:
obj->type_ = IVL_SIT_TRI;
break;
case NetNet::WOR: case NetNet::WOR:
obj->type_ = IVL_SIT_WOR; obj->type_ = IVL_SIT_TRIOR;
break; break;
default: default:
@ -2143,6 +2134,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/* /*
* $Log: t-dll.cc,v $ * $Log: t-dll.cc,v $
* Revision 1.118 2003/07/30 01:13:28 steve
* Add support for triand and trior.
*
* Revision 1.117 2003/07/26 04:06:58 steve * Revision 1.117 2003/07/26 04:06:58 steve
* Watch out for moving nexus_ptr while adding pins to nexus. * Watch out for moving nexus_ptr while adding pins to nexus.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_scope.c,v 1.94 2003/05/29 02:21:45 steve Exp $" #ident "$Id: vvp_scope.c,v 1.95 2003/07/30 01:13:28 steve Exp $"
#endif #endif
# include "vvp_priv.h" # include "vvp_priv.h"
@ -424,6 +424,12 @@ const char* draw_net_input(ivl_nexus_t nex)
break; break;
case IVL_SIT_TRI1: case IVL_SIT_TRI1:
resolv_type = "tri1"; resolv_type = "tri1";
break;
case IVL_SIT_TRIAND:
resolv_type = "triand";
break;
case IVL_SIT_TRIOR:
resolv_type = "trior";
break; break;
/* Catch the special cases that the nets are supply /* Catch the special cases that the nets are supply
@ -1648,6 +1654,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
/* /*
* $Log: vvp_scope.c,v $ * $Log: vvp_scope.c,v $
* Revision 1.95 2003/07/30 01:13:28 steve
* Add support for triand and trior.
*
* Revision 1.94 2003/05/29 02:21:45 steve * Revision 1.94 2003/05/29 02:21:45 steve
* Implement acc_fetch_defname and its infrastructure in vvp. * Implement acc_fetch_defname and its infrastructure in vvp.
* *

View File

@ -17,12 +17,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: compile.cc,v 1.168 2003/07/22 20:30:24 steve Exp $" #ident "$Id: compile.cc,v 1.169 2003/07/30 01:13:28 steve Exp $"
#endif #endif
# include "arith.h" # include "arith.h"
# include "compile.h" # include "compile.h"
# include "functor.h" # include "functor.h"
# include "logic.h"
# include "resolv.h" # include "resolv.h"
# include "udp.h" # include "udp.h"
# include "memory.h" # include "memory.h"
@ -1048,6 +1049,12 @@ void compile_resolver(char*label, char*type, unsigned argc, struct symb_s*argv)
} else if (strcmp(type,"tri1") == 0) { } else if (strcmp(type,"tri1") == 0) {
obj = new resolv_functor_s(Pu1); obj = new resolv_functor_s(Pu1);
} else if (strcmp(type,"triand") == 0) {
obj = new table_functor_s(ft_TRIAND, 6, 6);
} else if (strcmp(type,"trior") == 0) {
obj = new table_functor_s(ft_TRIOR, 6, 6);
} else { } else {
fprintf(stderr, "invalid resolver type: %s\n", type); fprintf(stderr, "invalid resolver type: %s\n", type);
compile_errors += 1; compile_errors += 1;
@ -1532,6 +1539,9 @@ void compile_param_string(char*label, char*name, char*str, char*value)
/* /*
* $Log: compile.cc,v $ * $Log: compile.cc,v $
* Revision 1.169 2003/07/30 01:13:28 steve
* Add support for triand and trior.
*
* Revision 1.168 2003/07/22 20:30:24 steve * Revision 1.168 2003/07/22 20:30:24 steve
* Forgot to read the /x parameter for %load/x * Forgot to read the /x parameter for %load/x
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: draw_tt.c,v 1.14 2002/08/29 03:04:01 steve Exp $" #ident "$Id: draw_tt.c,v 1.15 2003/07/30 01:13:29 steve Exp $"
#endif #endif
# include <stdio.h> # include <stdio.h>
@ -559,6 +559,80 @@ static void draw_XOR(void)
printf("};\n"); printf("};\n");
} }
static void draw_TRIAND(void)
{
unsigned i0, i1, i2, i3;
printf("const unsigned char ft_TRIAND[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 == 0) || (i1 == 0) ||
(i2 == 0) || (i3 == 0))
val = 0;
else if ((i0 == 2) || (i1 == 2) ||
(i2 == 2) || (i3 == 2))
val = 2;
else if ((i0 == 3) && (i1 == 3) &&
(i2 == 3) && (i3 == 3))
val = 3;
else
val = 1;
byte |= val << (i0*2);
}
printf("0x%02x, ", byte);
}
}
printf("};\n");
}
static void draw_TRIOR(void)
{
unsigned i0, i1, i2, i3;
printf("const unsigned char ft_TRIOR[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) || (i1 == 1) ||
(i2 == 1) || (i3 == 1))
val = 1;
else if ((i0 == 2) || (i1 == 2) ||
(i2 == 2) || (i3 == 2))
val = 2;
else if ((i0 == 3) && (i1 == 3) &&
(i2 == 3) && (i3 == 3))
val = 3;
else
val = 0;
byte |= val << (i0*2);
}
printf("0x%02x, ", byte);
}
}
printf("};\n");
}
/* /*
* The hex_digits table is not a functor truth table per say, but a * The hex_digits table is not a functor truth table per say, but a
* map of a 4-vbit value to a hex digit. The table handles the display * map of a 4-vbit value to a hex digit. The table handles the display
@ -673,6 +747,8 @@ main()
draw_NOR(); draw_NOR();
draw_NOT(); draw_NOT();
draw_OR(); draw_OR();
draw_TRIAND();
draw_TRIOR();
draw_XNOR(); draw_XNOR();
draw_XOR(); draw_XOR();
draw_hex_table(); draw_hex_table();
@ -682,6 +758,9 @@ main()
/* /*
* $Log: draw_tt.c,v $ * $Log: draw_tt.c,v $
* Revision 1.15 2003/07/30 01:13:29 steve
* Add support for triand and trior.
*
* Revision 1.14 2002/08/29 03:04:01 steve * Revision 1.14 2002/08/29 03:04:01 steve
* Generate x out for x select on wide muxes. * Generate x out for x select on wide muxes.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: logic.h,v 1.6 2002/08/29 03:04:01 steve Exp $" #ident "$Id: logic.h,v 1.7 2003/07/30 01:13:29 steve Exp $"
#endif #endif
# include "functor.h" # include "functor.h"
@ -58,12 +58,17 @@ extern const unsigned char ft_NAND[];
extern const unsigned char ft_NOR[]; extern const unsigned char ft_NOR[];
extern const unsigned char ft_NOT[]; extern const unsigned char ft_NOT[];
extern const unsigned char ft_OR[]; extern const unsigned char ft_OR[];
extern const unsigned char ft_TRIAND[];
extern const unsigned char ft_TRIOR[];
extern const unsigned char ft_XNOR[]; extern const unsigned char ft_XNOR[];
extern const unsigned char ft_XOR[]; extern const unsigned char ft_XOR[];
extern const unsigned char ft_var[]; extern const unsigned char ft_var[];
/* /*
* $Log: logic.h,v $ * $Log: logic.h,v $
* Revision 1.7 2003/07/30 01:13:29 steve
* Add support for triand and trior.
*
* Revision 1.6 2002/08/29 03:04:01 steve * Revision 1.6 2002/08/29 03:04:01 steve
* Generate x out for x select on wide muxes. * Generate x out for x select on wide muxes.
* *