diff --git a/elab_net.cc b/elab_net.cc index 1d862e670..1dda277ac 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 */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: elab_net.cc,v 1.70 2001/07/01 23:37:48 steve Exp $" +#ident "$Id: elab_net.cc,v 1.71 2001/07/04 22:59:25 steve Exp $" #endif # include "PExpr.h" @@ -893,7 +893,7 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, const string&path, // Make the shift device itself, and the output // NetNet. Connect the Result output pins to the osig signal - NetCLShift*gate = new NetCLShift(des->local_symbol(path), + NetCLShift*gate = new NetCLShift(scope, des->local_symbol(path), lwidth, rsig->pin_count()); NetNet*osig = new NetNet(scope, des->local_symbol(path), @@ -1902,6 +1902,9 @@ NetNet* PEUnary::elaborate_net(Design*des, const string&path, /* * $Log: elab_net.cc,v $ + * Revision 1.71 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.70 2001/07/01 23:37:48 steve * Make sure tmp net gets connected to ramdq output * diff --git a/ivl_target.h b/ivl_target.h index 5f69916f4..bbd472cd6 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: ivl_target.h,v 1.70 2001/06/30 23:03:16 steve Exp $" +#ident "$Id: ivl_target.h,v 1.71 2001/07/04 22:59:25 steve Exp $" #endif #ifdef __cplusplus @@ -209,6 +209,8 @@ typedef enum ivl_lpm_type_e { IVL_LPM_FF, IVL_LPM_MULT, IVL_LPM_MUX, + IVL_LPM_SHIFTL, + IVL_LPM_SHIFTR, IVL_LPM_SUB, IVL_LPM_RAM } ivl_lpm_type_t; @@ -889,6 +891,9 @@ _END_DECL /* * $Log: ivl_target.h,v $ + * Revision 1.71 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.70 2001/06/30 23:03:16 steve * support fast programming by only writing the bits * that are listed in the input file. diff --git a/netlist.cc b/netlist.cc index 8c4bc9d49..102303997 100644 --- a/netlist.cc +++ b/netlist.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: netlist.cc,v 1.164 2001/07/01 00:27:34 steve Exp $" +#ident "$Id: netlist.cc,v 1.165 2001/07/04 22:59:25 steve Exp $" #endif # include @@ -727,8 +727,9 @@ const Link& NetAddSub::pin_Result(unsigned idx) const * 3+W -- Result(0) * 3+2W -- Distance(0) */ -NetCLShift::NetCLShift(const string&n, unsigned width, unsigned width_dist) -: NetNode(n, 3+2*width+width_dist), width_(width), width_dist_(width_dist) +NetCLShift::NetCLShift(NetScope*s, const string&n, + unsigned width, unsigned width_dist) +: NetNode(s, n, 3+2*width+width_dist), width_(width), width_dist_(width_dist) { pin(0).set_dir(Link::INPUT); pin(0).set_name("Direction", 0); pin(1).set_dir(Link::OUTPUT); pin(1).set_name("Underflow", 0); @@ -2341,6 +2342,9 @@ const NetProc*NetTaskDef::proc() const /* * $Log: netlist.cc,v $ + * Revision 1.165 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.164 2001/07/01 00:27:34 steve * Make NetFF constructor take const char* for the name. * diff --git a/netlist.h b/netlist.h index 09e689c69..8aaf932d4 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: netlist.h,v 1.210 2001/07/01 00:27:34 steve Exp $" +#ident "$Id: netlist.h,v 1.211 2001/07/04 22:59:25 steve Exp $" #endif /* @@ -430,7 +430,8 @@ class NetAddSub : public NetNode { class NetCLShift : public NetNode { public: - NetCLShift(const string&n, unsigned width, unsigned width_dist); + NetCLShift(NetScope*s, const string&n, unsigned width, + unsigned width_dist); ~NetCLShift(); unsigned width() const; @@ -2811,6 +2812,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.211 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.210 2001/07/01 00:27:34 steve * Make NetFF constructor take const char* for the name. * diff --git a/t-dll-api.cc b/t-dll-api.cc index cdd379a31..4e313f224 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 */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll-api.cc,v 1.52 2001/06/30 23:03:16 steve Exp $" +#ident "$Id: t-dll-api.cc,v 1.53 2001/07/04 22:59:25 steve Exp $" #endif # include "t-dll.h" @@ -475,6 +475,10 @@ extern "C" ivl_nexus_t ivl_lpm_data(ivl_lpm_t net, unsigned idx) assert(idx < net->u_.arith.width); return net->u_.arith.a[idx]; + case IVL_LPM_SHIFTL: + assert(idx < net->u_.shift.width); + return net->u_.shift.d[idx]; + case IVL_LPM_FF: case IVL_LPM_RAM: assert(idx < net->u_.ff.width); @@ -559,6 +563,10 @@ extern "C" ivl_nexus_t ivl_lpm_q(ivl_lpm_t net, unsigned idx) else return net->u_.mux.q.pins[idx]; + case IVL_LPM_SHIFTL: + assert(idx < net->u_.shift.width); + return net->u_.shift.q[idx]; + default: assert(0); return 0; @@ -582,6 +590,10 @@ extern "C" ivl_nexus_t ivl_lpm_select(ivl_lpm_t net, unsigned idx) else return net->u_.mux.s.pins[idx]; + case IVL_LPM_SHIFTL: + assert(idx < net->u_.shift.select); + return net->u_.shift.s[idx]; + default: assert(0); return 0; @@ -595,6 +607,8 @@ extern "C" unsigned ivl_lpm_selects(ivl_lpm_t net) return net->u_.ff.swid; case IVL_LPM_MUX: return net->u_.mux.swid; + case IVL_LPM_SHIFTL: + return net->u_.shift.select; default: assert(0); return 0; @@ -632,6 +646,8 @@ extern "C" unsigned ivl_lpm_width(ivl_lpm_t net) case IVL_LPM_MULT: case IVL_LPM_SUB: return net->u_.arith.width; + case IVL_LPM_SHIFTL: + return net->u_.shift.width; default: assert(0); return 0; @@ -1232,6 +1248,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) /* * $Log: t-dll-api.cc,v $ + * Revision 1.53 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.52 2001/06/30 23:03:16 steve * support fast programming by only writing the bits * that are listed in the input file. diff --git a/t-dll.cc b/t-dll.cc index 08e07ba46..302954042 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 */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll.cc,v 1.52 2001/06/30 23:03:16 steve Exp $" +#ident "$Id: t-dll.cc,v 1.53 2001/07/04 22:59:25 steve Exp $" #endif # include "compiler.h" @@ -703,6 +703,63 @@ void dll_target::lpm_add_sub(const NetAddSub*net) scope_add_lpm(obj->scope, obj); } +void dll_target::lpm_clshift(const NetCLShift*net) +{ + ivl_lpm_t obj = new struct ivl_lpm_s; + obj->type = IVL_LPM_SHIFTL; + obj->name = strdup(net->name()); + assert(net->scope()); + obj->scope = find_scope(des_.root_, net->scope()); + assert(obj->scope); + + assert(! net->pin_Direction().is_linked()); + + obj->u_.shift.width = net->width(); + obj->u_.shift.select = net->width_dist(); + unsigned nex_count = obj->u_.shift.width * 2 + obj->u_.shift.select; + obj->u_.shift.q = new ivl_nexus_t[nex_count]; + obj->u_.shift.d = obj->u_.shift.q + obj->u_.shift.width; + obj->u_.shift.s = obj->u_.shift.d + obj->u_.shift.width; + + for (unsigned idx = 0 ; idx < nex_count ; idx += 1) + obj->u_.shift.q[idx] = 0; + + for (unsigned idx = 0 ; idx < net->width() ; idx += 1) { + const Nexus*nex; + + nex = net->pin_Result(idx).nexus(); + assert(nex && nex->t_cookie()); + + obj->u_.shift.q[idx] = (ivl_nexus_t) nex->t_cookie(); + nexus_lpm_add(obj->u_.shift.q[idx], obj, 0, + IVL_DR_STRONG, IVL_DR_STRONG); + } + + for (unsigned idx = 0 ; idx < net->width() ; idx += 1) { + const Nexus*nex; + + nex = net->pin_Data(idx).nexus(); + assert(nex && nex->t_cookie()); + + obj->u_.shift.d[idx] = (ivl_nexus_t) nex->t_cookie(); + nexus_lpm_add(obj->u_.shift.q[idx], obj, 0, + IVL_DR_HiZ, IVL_DR_HiZ); + } + + for (unsigned idx = 0 ; idx < net->width_dist() ; idx += 1) { + const Nexus*nex; + + nex = net->pin_Distance(idx).nexus(); + assert(nex && nex->t_cookie()); + + obj->u_.shift.s[idx] = (ivl_nexus_t) nex->t_cookie(); + nexus_lpm_add(obj->u_.shift.s[idx], obj, 0, + IVL_DR_HiZ, IVL_DR_HiZ); + } + + scope_add_lpm(obj->scope, obj); +} + /* * Make out of the NetCompare object an ivl_lpm_s object. The * comparators in ivl_target do not support < or <=, but they can be @@ -1382,6 +1439,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.53 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.52 2001/06/30 23:03:16 steve * support fast programming by only writing the bits * that are listed in the input file. diff --git a/t-dll.h b/t-dll.h index c4e29a66b..a332c177c 100644 --- a/t-dll.h +++ b/t-dll.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll.h,v 1.52 2001/06/30 23:03:16 steve Exp $" +#ident "$Id: t-dll.h,v 1.53 2001/07/04 22:59:25 steve Exp $" #endif # include "target.h" @@ -65,6 +65,7 @@ struct dll_target : public target_t, public expr_scan_t { void net_case_cmp(const NetCaseCmp*); void udp(const NetUDP*); void lpm_add_sub(const NetAddSub*); + void lpm_clshift(const NetCLShift*); void lpm_compare(const NetCompare*); void lpm_ff(const NetFF*); void lpm_mult(const NetMult*); @@ -261,6 +262,14 @@ struct ivl_lpm_s { } s; } mux; + struct ivl_lpm_shift_s { + unsigned short width; + unsigned short select; + ivl_nexus_t*q; + ivl_nexus_t*d; + ivl_nexus_t*s; + } shift; + struct ivl_lpm_arith_s { unsigned short width; ivl_nexus_t*q, *a, *b; @@ -541,6 +550,9 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.53 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.52 2001/06/30 23:03:16 steve * support fast programming by only writing the bits * that are listed in the input file. diff --git a/tgt-stub/stub.c b/tgt-stub/stub.c index 2284e4789..c7c576ed7 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 */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: stub.c,v 1.46 2001/07/01 23:44:19 steve Exp $" +#ident "$Id: stub.c,v 1.47 2001/07/04 22:59:25 steve Exp $" #endif /* @@ -119,6 +119,21 @@ static void show_lpm(ivl_lpm_t net) break; } + case IVL_LPM_SHIFTL: { + fprintf(out, " LPM_SHIFTL %s: \n", + ivl_lpm_name(net), width, ivl_lpm_selects(net)); + for (idx = 0 ; idx < width ; idx += 1) + fprintf(out, " Q %u: %s\n", idx, + ivl_nexus_name(ivl_lpm_q(net, idx))); + for (idx = 0 ; idx < width ; idx += 1) + fprintf(out, " Data A %u: %s\n", idx, + ivl_nexus_name(ivl_lpm_data(net, idx))); + for (idx = 0 ; idx < ivl_lpm_selects(net) ; idx += 1) + fprintf(out, " Shift %u: %s\n", idx, + ivl_nexus_name(ivl_lpm_select(net, idx))); + break; + } + case IVL_LPM_SUB: { fprintf(out, " LPM_SUB %s: \n", ivl_lpm_name(net), width); @@ -587,6 +602,9 @@ DECLARE_CYGWIN_DLL(DllMain); /* * $Log: stub.c,v $ + * Revision 1.47 2001/07/04 22:59:25 steve + * handle left shifter in dll output. + * * Revision 1.46 2001/07/01 23:44:19 steve * Print memory l-values. *