diff --git a/design_dump.cc b/design_dump.cc index 13dd7e082..cb57a3ea1 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: design_dump.cc,v 1.156 2005/02/08 00:12:36 steve Exp $" +#ident "$Id: design_dump.cc,v 1.157 2005/03/09 05:52:03 steve Exp $" #endif # include "config.h" @@ -249,7 +249,11 @@ void NetBUFZ::dump_node(ostream&o, unsigned ind) const void NetCaseCmp::dump_node(ostream&o, unsigned ind) const { - o << setw(ind) << "" << "case compare === : " << name() << endl; + if (eeq_) + o << setw(ind) << "" << "case compare === : " << name() << endl; + else + o << setw(ind) << "" << "case compare !== : " << name() << endl; + dump_node_pins(o, ind+4); } @@ -1139,6 +1143,9 @@ void Design::dump(ostream&o) const /* * $Log: design_dump.cc,v $ + * Revision 1.157 2005/03/09 05:52:03 steve + * Handle case inequality in netlists. + * * Revision 1.156 2005/02/08 00:12:36 steve * Add the NetRepeat node, and code generator support. * diff --git a/elab_net.cc b/elab_net.cc index 2ca7758fb..8f1621b20 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: elab_net.cc,v 1.152 2005/02/19 02:43:38 steve Exp $" +#ident "$Id: elab_net.cc,v 1.153 2005/03/09 05:52:03 steve Exp $" #endif # include "config.h" @@ -627,17 +627,17 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope, } case 'E': // Case equals (===) - gate = new NetCaseCmp(scope, scope->local_symbol(), dwidth); + gate = new NetCaseCmp(scope, scope->local_symbol(), dwidth, true); connect(gate->pin(0), osig->pin(0)); connect(gate->pin(1), lsig->pin(0)); connect(gate->pin(2), rsig->pin(0)); break; case 'N': // Case equals (!==) - cerr << get_line() << ": internal error: " - << "Forgot how to elaborate !==." << endl; - des->errors += 1; - gate = 0; + gate = new NetCaseCmp(scope, scope->local_symbol(), dwidth, false); + connect(gate->pin(0), osig->pin(0)); + connect(gate->pin(1), lsig->pin(0)); + connect(gate->pin(2), rsig->pin(0)); break; case 'e': // == @@ -2504,6 +2504,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope, /* * $Log: elab_net.cc,v $ + * Revision 1.153 2005/03/09 05:52:03 steve + * Handle case inequality in netlists. + * * Revision 1.152 2005/02/19 02:43:38 steve * Support shifts and divide. * diff --git a/netlist.cc b/netlist.cc index a7190a67b..aca0ff38d 100644 --- a/netlist.cc +++ b/netlist.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: netlist.cc,v 1.238 2005/02/19 02:43:38 steve Exp $" +#ident "$Id: netlist.cc,v 1.239 2005/03/09 05:52:04 steve Exp $" #endif # include "config.h" @@ -1503,8 +1503,8 @@ unsigned NetBUFZ::width() const return width_; } -NetCaseCmp::NetCaseCmp(NetScope*s, perm_string n, unsigned wid) -: NetNode(s, n, 3), width_(wid) +NetCaseCmp::NetCaseCmp(NetScope*s, perm_string n, unsigned wid, bool eeq) +: NetNode(s, n, 3), width_(wid), eeq_(eeq) { pin(0).set_dir(Link::OUTPUT); pin(0).set_name(perm_string::literal("O"),0); pin(1).set_dir(Link::INPUT); pin(1).set_name(perm_string::literal("I"),0); @@ -1520,6 +1520,11 @@ unsigned NetCaseCmp::width() const return width_; } +bool NetCaseCmp::eeq() const +{ + return eeq_; +} + NetCondit::NetCondit(NetExpr*ex, NetProc*i, NetProc*e) : expr_(ex), if_(i), else_(e) { @@ -2191,6 +2196,9 @@ const NetProc*NetTaskDef::proc() const /* * $Log: netlist.cc,v $ + * Revision 1.239 2005/03/09 05:52:04 steve + * Handle case inequality in netlists. + * * Revision 1.238 2005/02/19 02:43:38 steve * Support shifts and divide. * diff --git a/netlist.h b/netlist.h index b5add2dec..112e8084d 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: netlist.h,v 1.335 2005/02/19 02:43:38 steve Exp $" +#ident "$Id: netlist.h,v 1.336 2005/03/09 05:52:04 steve Exp $" #endif /* @@ -1254,16 +1254,19 @@ class NetBUFZ : public NetNode { class NetCaseCmp : public NetNode { public: - explicit NetCaseCmp(NetScope*s, perm_string n, unsigned wid); + explicit NetCaseCmp(NetScope*s, perm_string n, unsigned wid, bool eeq); ~NetCaseCmp(); unsigned width() const; + // true if this is ===, false if this is !== + bool eeq() const; virtual void dump_node(ostream&, unsigned ind) const; virtual bool emit_node(struct target_t*) const; private: unsigned width_; + bool eeq_; }; /* @@ -3414,6 +3417,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.336 2005/03/09 05:52:04 steve + * Handle case inequality in netlists. + * * Revision 1.335 2005/02/19 02:43:38 steve * Support shifts and divide. * diff --git a/t-dll-api.cc b/t-dll-api.cc index 6f6756192..f038baae1 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: t-dll-api.cc,v 1.119 2005/02/19 02:43:38 steve Exp $" +#ident "$Id: t-dll-api.cc,v 1.120 2005/03/09 05:52:04 steve Exp $" #endif # include "config.h" @@ -745,6 +745,7 @@ extern "C" ivl_nexus_t ivl_lpm_data(ivl_lpm_t net, unsigned idx) case IVL_LPM_CMP_GE: case IVL_LPM_CMP_GT: case IVL_LPM_CMP_NE: + case IVL_LPM_CMP_NEE: case IVL_LPM_DIVIDE: case IVL_LPM_MOD: case IVL_LPM_MULT: @@ -910,6 +911,7 @@ extern "C" ivl_nexus_t ivl_lpm_q(ivl_lpm_t net, unsigned idx) case IVL_LPM_CMP_EQ: case IVL_LPM_CMP_NE: case IVL_LPM_CMP_EEQ: + case IVL_LPM_CMP_NEE: assert(idx == 0); return net->u_.arith.q; @@ -1016,6 +1018,7 @@ extern "C" int ivl_lpm_signed(ivl_lpm_t net) case IVL_LPM_CMP_GE: case IVL_LPM_CMP_GT: case IVL_LPM_CMP_NE: + case IVL_LPM_CMP_NEE: case IVL_LPM_DIVIDE: case IVL_LPM_MOD: case IVL_LPM_MULT: @@ -1081,6 +1084,7 @@ extern "C" unsigned ivl_lpm_width(ivl_lpm_t net) case IVL_LPM_CMP_GE: case IVL_LPM_CMP_GT: case IVL_LPM_CMP_NE: + case IVL_LPM_CMP_NEE: case IVL_LPM_DIVIDE: case IVL_LPM_MOD: case IVL_LPM_MULT: @@ -1987,6 +1991,9 @@ extern "C" ivl_variable_type_t ivl_variable_type(ivl_variable_t net) /* * $Log: t-dll-api.cc,v $ + * Revision 1.120 2005/03/09 05:52:04 steve + * Handle case inequality in netlists. + * * Revision 1.119 2005/02/19 02:43:38 steve * Support shifts and divide. * diff --git a/t-dll.cc b/t-dll.cc index 7d0106b89..115ddb6eb 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: t-dll.cc,v 1.142 2005/02/19 02:43:38 steve Exp $" +#ident "$Id: t-dll.cc,v 1.143 2005/03/09 05:52:04 steve Exp $" #endif # include "config.h" @@ -959,7 +959,7 @@ bool dll_target::ureduce(const NetUReduce*net) void dll_target::net_case_cmp(const NetCaseCmp*net) { struct ivl_lpm_s*obj = new struct ivl_lpm_s; - obj->type = IVL_LPM_CMP_EEQ; + obj->type = net->eeq()? IVL_LPM_CMP_EEQ : IVL_LPM_CMP_NEE; obj->name = net->name(); obj->scope = find_scope(des_, net->scope()); assert(obj->scope); @@ -2168,6 +2168,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.143 2005/03/09 05:52:04 steve + * Handle case inequality in netlists. + * * Revision 1.142 2005/02/19 02:43:38 steve * Support shifts and divide. * diff --git a/tgt-stub/stub.c b/tgt-stub/stub.c index 2c99c9570..7da31320c 100644 --- a/tgt-stub/stub.c +++ b/tgt-stub/stub.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: stub.c,v 1.114 2005/03/09 04:53:40 steve Exp $" +#ident "$Id: stub.c,v 1.115 2005/03/09 05:52:04 steve Exp $" #endif # include "config.h" @@ -292,15 +292,16 @@ static void show_lpm_divide(ivl_lpm_t net) show_lpm_arithmetic_pins(net); } -/* IVL_LPM_CMP_EEQ +/* IVL_LPM_CMP_EEQ/NEE * This LPM node supports two-input compare. The output width is * actually always 1, the lpm_width is the expected width of the inputs. */ static void show_lpm_cmp_eeq(ivl_lpm_t net) { + const char*str = (ivl_lpm_type(net) == IVL_LPM_CMP_EEQ)? "EEQ" : "NEE"; unsigned width = ivl_lpm_width(net); - fprintf(out, " LPM_CMP_EEQ %s: \n", + fprintf(out, " LPM_CMP_%s %s: \n", str, ivl_lpm_basename(net), width); fprintf(out, " O: %s\n", ivl_nexus_name(ivl_lpm_q(net,0))); @@ -609,6 +610,7 @@ static void show_lpm(ivl_lpm_t net) break; case IVL_LPM_CMP_EEQ: + case IVL_LPM_CMP_NEE: show_lpm_cmp_eeq(net); break; @@ -1169,6 +1171,9 @@ int target_design(ivl_design_t des) /* * $Log: stub.c,v $ + * Revision 1.115 2005/03/09 05:52:04 steve + * Handle case inequality in netlists. + * * Revision 1.114 2005/03/09 04:53:40 steve * Generate code for new form of memory ports. * diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index 3861abbc7..da8988974 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vvp_scope.c,v 1.120 2005/03/09 04:53:40 steve Exp $" +#ident "$Id: vvp_scope.c,v 1.121 2005/03/09 05:52:04 steve Exp $" #endif # include "vvp_priv.h" @@ -1399,6 +1399,10 @@ static void draw_lpm_cmp(ivl_lpm_t net) type = "ne"; signed_string = ""; break; + case IVL_LPM_CMP_NEE: + type = "nee"; + signed_string = ""; + break; default: assert(0); } @@ -1855,6 +1859,7 @@ static void draw_lpm_in_scope(ivl_lpm_t net) case IVL_LPM_CMP_GE: case IVL_LPM_CMP_GT: case IVL_LPM_CMP_NE: + case IVL_LPM_CMP_NEE: draw_lpm_cmp(net); return; @@ -2017,6 +2022,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent) /* * $Log: vvp_scope.c,v $ + * Revision 1.121 2005/03/09 05:52:04 steve + * Handle case inequality in netlists. + * * Revision 1.120 2005/03/09 04:53:40 steve * Generate code for new form of memory ports. * diff --git a/vvp/README.txt b/vvp/README.txt index 3587c0124..bcf177614 100644 --- a/vvp/README.txt +++ b/vvp/README.txt @@ -1,7 +1,7 @@ /* * Copyright (c) 2001 Stephen Williams (steve@icarus.com) * - * $Id: README.txt,v 1.59 2005/03/09 04:52:40 steve Exp $ + * $Id: README.txt,v 1.60 2005/03/09 05:52:04 steve Exp $ */ VVP SIMULATION ENGINE @@ -579,6 +579,7 @@ are implemented a bit differently. The syntax, however, is very similar: