Permalink
Browse files

More UDP consolidation from Stephan Boettcher.

  • Loading branch information...
1 parent 57b0d96 commit 66cf3ec8fabdd469da16ac650bd6e4dac3d07748 steve committed Apr 22, 2001
Showing with 350 additions and 577 deletions.
  1. +5 −3 PGate.h
  2. +5 −2 PUdp.h
  3. +5 −67 design_dump.cc
  4. +9 −75 elaborate.cc
  5. +4 −7 emit.cc
  6. +21 −2 ivl_target.h
  7. +35 −2 mangle.cc
  8. +51 −153 net_udp.cc
  9. +4 −148 netlist.cc
  10. +17 −84 netlist.h
  11. +47 −1 t-dll-api.cc
  12. +64 −1 t-dll.cc
  13. +18 −1 t-dll.h
  14. +14 −16 t-vvm.cc
  15. +4 −7 target.cc
  16. +8 −2 target.h
  17. +5 −1 vvm/vvm_gates.h
  18. +34 −5 vvm/vvm_udp.cc
View
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: PGate.h,v 1.18 2000/05/06 15:41:56 steve Exp $"
+#ident "$Id: PGate.h,v 1.19 2001/04/22 23:09:45 steve Exp $"
#endif
# include "svector.h"
@@ -211,14 +211,16 @@ class PGModule : public PGate {
PExpr*lsb_;
void elaborate_mod_(Design*, Module*mod, const string&path) const;
- void elaborate_sudp_(Design*, PUdp *udp, const string&path) const;
- void elaborate_cudp_(Design*, PUdp *udp, const string&path) const;
+ void elaborate_udp_(Design*, PUdp *udp, const string&path) const;
void elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const;
bool elaborate_sig_mod_(Design*des, NetScope*scope, Module*mod) const;
};
/*
* $Log: PGate.h,v $
+ * Revision 1.19 2001/04/22 23:09:45 steve
+ * More UDP consolidation from Stephan Boettcher.
+ *
* Revision 1.18 2000/05/06 15:41:56 steve
* Carry assignment strength to pform.
*
View
7 PUdp.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: PUdp.h,v 1.4 2000/02/23 02:56:53 steve Exp $"
+#ident "$Id: PUdp.h,v 1.5 2001/04/22 23:09:45 steve Exp $"
#endif
# include <map>
@@ -72,8 +72,8 @@ class PUdp {
void dump(ostream&out) const;
- private:
const string name_;
+ private:
private: // Not implemented
PUdp(const PUdp&);
@@ -82,6 +82,9 @@ class PUdp {
/*
* $Log: PUdp.h,v $
+ * Revision 1.5 2001/04/22 23:09:45 steve
+ * More UDP consolidation from Stephan Boettcher.
+ *
* Revision 1.4 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
*
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: design_dump.cc,v 1.111 2001/02/17 05:13:36 steve Exp $"
+#ident "$Id: design_dump.cc,v 1.112 2001/04/22 23:09:46 steve Exp $"
#endif
/*
@@ -367,77 +367,12 @@ void NetTaskDef::dump(ostream&o, unsigned ind) const
o << setw(ind) << "" << "endtask" << endl;
}
-void NetUDP::dump_sequ_(ostream&o, unsigned ind) const
-{
- string tmp = "";
- for (unsigned idx = 0 ; idx < ind ; idx += 1)
- tmp += " ";
-
- o << tmp << "Sequential UDP" << " #(" << rise_time() <<
- "," << fall_time() << "," << decay_time() << ") " << name() <<
- endl;
-
- for (FSM_::const_iterator ent = fsm_.begin()
- ; ent != fsm_.end() ; ent++) {
- o << setw(ind+6) << "" << (*ent).first << " -->";
-
- state_t_*st = (*ent).second;
- assert((*ent).first[0] == st->out);
- for (unsigned idx = 1 ; idx < pin_count() ; idx += 1) {
- string tmp = (*ent).first;
- if (st->pins[idx].zer) {
- tmp[0] = st->pins[idx].zer->out;
- tmp[idx] = '0';
- o << " " << tmp;
- }
-
- if (st->pins[idx].one) {
- tmp[0] = st->pins[idx].one->out;
- tmp[idx] = '1';
- o << " " << tmp;
- }
-
- if (st->pins[idx].xxx) {
- tmp[0] = st->pins[idx].xxx->out;
- tmp[idx] = 'x';
- o << " " << tmp;
- }
- }
-
- o << endl;
- }
-
- o << setw(ind+6) << "" << "initial value == " << init_ << endl;
-
- dump_node_pins(o, ind+4);
- dump_obj_attr(o, ind+4);
-}
-
-void NetUDP::dump_comb_(ostream&o, unsigned ind) const
-{
- assert(0);
-}
-
void NetUDP::dump_node(ostream&o, unsigned ind) const
{
- if (is_sequential())
- dump_sequ_(o, ind);
- else
- dump_comb_(o, ind);
-}
-
-void NetUDP_COMB::dump_node(ostream&o, unsigned ind) const
-{
- o << setw(ind) << "" << "Combinational primitive: ";
+ o << setw(ind) << "" << "UDP (" << udp_name() << "): ";
o << " #(" << rise_time() << "," << fall_time() << "," << decay_time() <<
") " << name() << endl;
- for (map<string,char>::const_iterator ent = cm_.begin()
- ; ent != cm_.end() ; ent++) {
- o << setw(ind+6) << "" << (*ent).first << " --> " <<
- (*ent).second << endl;
- }
-
dump_node_pins(o, ind+4);
dump_obj_attr(o, ind+4);
}
@@ -1001,6 +936,9 @@ void Design::dump(ostream&o) const
/*
* $Log: design_dump.cc,v $
+ * Revision 1.112 2001/04/22 23:09:46 steve
+ * More UDP consolidation from Stephan Boettcher.
+ *
* Revision 1.111 2001/02/17 05:13:36 steve
* Check that the port really exists here.
*
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: elaborate.cc,v 1.209 2001/04/02 02:28:12 steve Exp $"
+#ident "$Id: elaborate.cc,v 1.210 2001/04/22 23:09:46 steve Exp $"
#endif
/*
@@ -604,60 +604,16 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, const string&path) const
}
}
-void PGModule::elaborate_cudp_(Design*des, PUdp*udp, const string&path) const
-{
- const string my_name = path+"."+get_name();
- NetUDP_COMB*net = new NetUDP_COMB(my_name, udp->ports.count());
- net->set_attributes(udp->attributes);
-
- /* Run through the pins, making netlists for the pin
- expressions and connecting them to the pin in question. All
- of this is independent of the nature of the UDP. */
- for (unsigned idx = 0 ; idx < net->pin_count() ; idx += 1) {
- if (pin(idx) == 0)
- continue;
-
- NetNet*sig = pin(idx)->elaborate_net(des, path, 1, 0, 0, 0);
- if (sig == 0) {
- cerr << "internal error: Expression too complicated "
- "for elaboration:" << *pin(idx) << endl;
- continue;
- }
-
- connect(sig->pin(0), net->pin(idx));
-
- // Delete excess holding signal.
- if (NetTmp*tmp = dynamic_cast<NetTmp*>(sig))
- delete tmp;
- }
-
- /* Build up the truth table for the netlist from the input
- strings. */
- for (unsigned idx = 0 ; idx < udp->tinput.count() ; idx += 1) {
- string input = udp->tinput[idx];
-
- bool flag = net->set_table(input, udp->toutput[idx]);
- if (flag == false) {
- cerr << get_line()<<": error: invalid table format." << endl;
- des->errors += 1;
- }
- }
-
- net->cleanup_table();
-
- // All done. Add the object to the design.
- des->add_node(net);
-}
-
/*
* From a UDP definition in the source, make a NetUDP
* object. Elaborate the pin expressions as netlists, then connect
* those networks to the pins.
*/
-void PGModule::elaborate_sudp_(Design*des, PUdp*udp, const string&path) const
+
+void PGModule::elaborate_udp_(Design*des, PUdp*udp, const string&path) const
{
const string my_name = path+"."+get_name();
- NetUDP*net = new NetUDP(my_name, udp->ports.count(), udp->sequential);
+ NetUDP*net = new NetUDP(my_name, udp->ports.count(), udp);
net->set_attributes(udp->attributes);
/* Run through the pins, making netlists for the pin
@@ -680,29 +636,7 @@ void PGModule::elaborate_sudp_(Design*des, PUdp*udp, const string&path) const
if (NetTmp*tmp = dynamic_cast<NetTmp*>(sig))
delete tmp;
}
-
- /* Build up the truth table for the netlist from the input
- strings. */
- for (unsigned idx = 0 ; idx < udp->tinput.count() ; idx += 1) {
- string input = string("") + udp->tcurrent[idx] + udp->tinput[idx];
- net->set_table(input, udp->toutput[idx]);
- }
-
- net->cleanup_table();
-
- switch (udp->initial) {
- case verinum::V0:
- net->set_initial('0');
- break;
- case verinum::V1:
- net->set_initial('1');
- break;
- case verinum::Vx:
- case verinum::Vz:
- net->set_initial('x');
- break;
- }
-
+
// All done. Add the object to the design.
des->add_node(net);
}
@@ -731,10 +665,7 @@ void PGModule::elaborate(Design*des, const string&path) const
// Try a primitive type
map<string,PUdp*>::const_iterator udp = udplist->find(type_);
if (udp != udplist->end()) {
- if ((*udp).second->sequential)
- elaborate_sudp_(des, (*udp).second, path);
- else
- elaborate_cudp_(des, (*udp).second, path);
+ elaborate_udp_(des, (*udp).second, path);
return;
}
@@ -2369,6 +2300,9 @@ Design* elaborate(const map<string,Module*>&modules,
/*
* $Log: elaborate.cc,v $
+ * Revision 1.210 2001/04/22 23:09:46 steve
+ * More UDP consolidation from Stephan Boettcher.
+ *
* Revision 1.209 2001/04/02 02:28:12 steve
* Generate code for task calls.
*
View
11 emit.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: emit.cc,v 1.58 2001/04/06 02:28:02 steve Exp $"
+#ident "$Id: emit.cc,v 1.59 2001/04/22 23:09:46 steve Exp $"
#endif
/*
@@ -41,12 +41,6 @@ bool NetLogic::emit_node(struct target_t*tgt) const
return true;
}
-bool NetUDP_COMB::emit_node(struct target_t*tgt) const
-{
- tgt->udp_comb(this);
- return true;
-}
-
bool NetUDP::emit_node(struct target_t*tgt) const
{
tgt->udp(this);
@@ -478,6 +472,9 @@ bool emit(const Design*des, const char*type)
/*
* $Log: emit.cc,v $
+ * Revision 1.59 2001/04/22 23:09:46 steve
+ * More UDP consolidation from Stephan Boettcher.
+ *
* Revision 1.58 2001/04/06 02:28:02 steve
* Generate vvp code for functions with ports.
*
View
@@ -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.53 2001/04/21 00:55:46 steve Exp $"
+#ident "$Id: ivl_target.h,v 1.54 2001/04/22 23:09:46 steve Exp $"
#endif
#ifdef __cplusplus
@@ -135,6 +135,7 @@ typedef struct ivl_lpm_ff_s *ivl_lpm_ff_t;
typedef struct ivl_lval_s *ivl_lval_t;
typedef struct ivl_net_const_s*ivl_net_const_t;
typedef struct ivl_net_logic_s*ivl_net_logic_t;
+typedef struct ivl_udp_s *ivl_udp_t;
typedef struct ivl_net_probe_s*ivl_net_probe_t;
typedef struct ivl_nexus_s *ivl_nexus_t;
typedef struct ivl_nexus_ptr_s*ivl_nexus_ptr_t;
@@ -184,7 +185,9 @@ typedef enum ivl_logic_e {
IVL_LO_RPMOS,
IVL_LO_PMOS,
IVL_LO_XNOR,
- IVL_LO_XOR
+ IVL_LO_XOR,
+
+ IVL_LO_UDP
} ivl_logic_t;
/* This is the type of an LPM object. */
@@ -421,6 +424,19 @@ extern const char* ivl_logic_basename(ivl_net_logic_t net);
extern ivl_logic_t ivl_logic_type(ivl_net_logic_t net);
extern ivl_nexus_t ivl_logic_pin(ivl_net_logic_t net, unsigned pin);
extern unsigned ivl_logic_pins(ivl_net_logic_t net);
+extern ivl_udp_t ivl_logic_udp(ivl_net_logic_t net);
+
+/* UDP
+ *
+ */
+
+extern unsigned ivl_udp_sequ(ivl_udp_t net);
+extern unsigned ivl_udp_nin(ivl_udp_t net);
+extern unsigned ivl_udp_init(ivl_udp_t net);
+extern const char* ivl_udp_row(ivl_udp_t net, unsigned idx);
+extern unsigned ivl_udp_rows(ivl_udp_t net);
+extern const char* ivl_udp_name(ivl_udp_t net);
+
/* LPM
* These functions support access to the properties of LPM devices.
@@ -765,6 +781,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
+ * Revision 1.54 2001/04/22 23:09:46 steve
+ * More UDP consolidation from Stephan Boettcher.
+ *
* Revision 1.53 2001/04/21 00:55:46 steve
* Generate code for disable.
*
Oops, something went wrong.

0 comments on commit 66cf3ec

Please sign in to comment.