From 7ba7b925ed216a17b7568eb7fa91cdd00a9dafe2 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 17 Jul 1999 03:39:11 +0000 Subject: [PATCH] simplified process scan for targets. --- emit.cc | 12 +++++------- t-vvm.cc | 18 +++++++++++++++--- t-xnf.cc | 7 +++++-- target.cc | 14 ++++++++------ target.h | 13 +++++++------ 5 files changed, 40 insertions(+), 24 deletions(-) diff --git a/emit.cc b/emit.cc index 899cc847c..4a5e744eb 100644 --- a/emit.cc +++ b/emit.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: emit.cc,v 1.16 1999/07/07 04:20:57 steve Exp $" +#ident "$Id: emit.cc,v 1.17 1999/07/17 03:39:11 steve Exp $" #endif /* @@ -72,12 +72,7 @@ void NetBUFZ::emit_node(ostream&o, struct target_t*tgt) const void NetProcTop::emit(ostream&o, struct target_t*tgt) const { - assert(statement_); - tgt->start_process(o, this); - - statement_->emit_proc(o, tgt); - - tgt->end_process(o, this); + tgt->process(o, this); } void NetProc::emit_proc(ostream&o, struct target_t*tgt) const @@ -308,6 +303,9 @@ void emit(ostream&o, const Design*des, const char*type) /* * $Log: emit.cc,v $ + * Revision 1.17 1999/07/17 03:39:11 steve + * simplified process scan for targets. + * * Revision 1.16 1999/07/07 04:20:57 steve * Emit vvm for user defined tasks. * diff --git a/t-vvm.cc b/t-vvm.cc index 69c8035a1..6502e8cd8 100644 --- a/t-vvm.cc +++ b/t-vvm.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: t-vvm.cc,v 1.30 1999/07/10 03:00:05 steve Exp $" +#ident "$Id: t-vvm.cc,v 1.31 1999/07/17 03:39:11 steve Exp $" #endif # include @@ -50,7 +50,7 @@ class target_vvm : public target_t { virtual void net_const(ostream&os, const NetConst*); virtual void net_esignal(ostream&os, const NetESignal*); virtual void net_event(ostream&os, const NetNEvent*); - virtual void start_process(ostream&os, const NetProcTop*); + virtual void process(ostream&os, const NetProcTop*); virtual void proc_assign(ostream&os, const NetAssign*); virtual void proc_assign_mem(ostream&os, const NetAssignMem*); virtual void proc_assign_nb(ostream&os, const NetAssignNB*); @@ -64,9 +64,11 @@ class target_vvm : public target_t { virtual void proc_while(ostream&os, const NetWhile*); virtual void proc_event(ostream&os, const NetPEvent*); virtual void proc_delay(ostream&os, const NetPDelay*); - virtual void end_process(ostream&os, const NetProcTop*); virtual void end_design(ostream&os, const Design*); + void start_process(ostream&os, const NetProcTop*); + void end_process(ostream&os, const NetProcTop*); + private: void emit_gate_outputfun_(const NetNode*); @@ -419,6 +421,13 @@ void target_vvm::end_design(ostream&os, const Design*mod) os << "}" << endl; } +void target_vvm::process(ostream&os, const NetProcTop*top) +{ + start_process(os, top); + top->statement()->emit_proc(os, this); + end_process(os, top); +} + void target_vvm::signal(ostream&os, const NetNet*sig) { @@ -1267,6 +1276,9 @@ extern const struct target tgt_vvm = { }; /* * $Log: t-vvm.cc,v $ + * Revision 1.31 1999/07/17 03:39:11 steve + * simplified process scan for targets. + * * Revision 1.30 1999/07/10 03:00:05 steve * Proper initialization of registers. * diff --git a/t-xnf.cc b/t-xnf.cc index 96e7d76ab..55ba581e8 100644 --- a/t-xnf.cc +++ b/t-xnf.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: t-xnf.cc,v 1.6 1998/12/09 02:43:19 steve Exp $" +#ident "$Id: t-xnf.cc,v 1.7 1999/07/17 03:39:11 steve Exp $" #endif /* XNF BACKEND @@ -175,7 +175,7 @@ void target_xnf::draw_sym_with_lcaname(ostream&os, string lca, void target_xnf::start_design(ostream&os, const Design*des) { os << "LCANET,6" << endl; - os << "PROG,verilog,0.0,\"Steve's Verilog\"" << endl; + os << "PROG,verilog,0.0,\"Icarus Verilog\"" << endl; os << "PART," << des->get_flag("part") << endl; } @@ -333,6 +333,9 @@ extern const struct target tgt_xnf = { "xnf", &target_xnf_obj }; /* * $Log: t-xnf.cc,v $ + * Revision 1.7 1999/07/17 03:39:11 steve + * simplified process scan for targets. + * * Revision 1.6 1998/12/09 02:43:19 steve * Fix 2pin logic gates. * diff --git a/target.cc b/target.cc index 68c8fc79b..4fc00f449 100644 --- a/target.cc +++ b/target.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: target.cc,v 1.13 1999/07/03 02:12:52 steve Exp $" +#ident "$Id: target.cc,v 1.14 1999/07/17 03:39:11 steve Exp $" #endif # include "target.h" @@ -91,12 +91,15 @@ void target_t::net_event(ostream&os, const NetNEvent*) "Unhandled EVENT net node." << endl; } -void target_t::start_process(ostream&os, const NetProcTop*) +void target_t::process(ostream&os, const NetProcTop*top) { + top->statement()->emit_proc(os, this); } void target_t::proc_assign(ostream&os, const NetAssign*) { + cerr << "target (" << typeid(*this).name() << "): " + "Unhandled procedural assignment." << endl; } void target_t::proc_assign_mem(ostream&os, const NetAssignMem*) @@ -174,10 +177,6 @@ void target_t::proc_while(ostream&os, const NetWhile*net) net->dump(cerr, 6); } -void target_t::end_process(ostream&os, const NetProcTop*) -{ -} - void target_t::end_design(ostream&os, const Design*) { } @@ -236,6 +235,9 @@ void expr_scan_t::expr_binary(const NetEBinary*ex) /* * $Log: target.cc,v $ + * Revision 1.14 1999/07/17 03:39:11 steve + * simplified process scan for targets. + * * Revision 1.13 1999/07/03 02:12:52 steve * Elaborate user defined tasks. * diff --git a/target.h b/target.h index 7c0ea0f48..9179dac3a 100644 --- a/target.h +++ b/target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: target.h,v 1.13 1999/07/03 02:12:52 steve Exp $" +#ident "$Id: target.h,v 1.14 1999/07/17 03:39:11 steve Exp $" #endif # include "netlist.h" @@ -74,8 +74,9 @@ struct target_t { virtual void net_esignal(ostream&os, const NetESignal*); virtual void net_event(ostream&os, const NetNEvent*); - /* Output a process (called for each process) */ - virtual void start_process(ostream&os, const NetProcTop*); + /* Output a process (called for each process). It is up to the + target to recurse if desired. */ + virtual void process(ostream&os, const NetProcTop*); /* Various kinds of process nodes are dispatched through these. */ virtual void proc_assign(ostream&os, const NetAssign*); @@ -93,9 +94,6 @@ struct target_t { virtual void proc_event(ostream&os, const NetPEvent*); virtual void proc_delay(ostream&os, const NetPDelay*); - /* (called for each process) */ - virtual void end_process(ostream&os, const NetProcTop*); - /* Done with the design. */ virtual void end_design(ostream&os, const Design*); }; @@ -131,6 +129,9 @@ extern const struct target *target_table[]; /* * $Log: target.h,v $ + * Revision 1.14 1999/07/17 03:39:11 steve + * simplified process scan for targets. + * * Revision 1.13 1999/07/03 02:12:52 steve * Elaborate user defined tasks. *