diff --git a/emit.cc b/emit.cc index 8d5e9aed4..f9eaf36c8 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) && !defined(macintosh) -#ident "$Id: emit.cc,v 1.63 2001/10/19 21:53:24 steve Exp $" +#ident "$Id: emit.cc,v 1.64 2002/01/19 19:02:08 steve Exp $" #endif # include "config.h" @@ -186,8 +186,7 @@ bool NetCAssign::emit_proc(struct target_t*tgt) const bool NetCondit::emit_proc(struct target_t*tgt) const { - tgt->proc_condit(this); - return true; + return tgt->proc_condit(this); } bool NetDeassign::emit_proc(struct target_t*tgt) const @@ -263,16 +262,20 @@ void NetBlock::emit_recurse(struct target_t*tgt) const } while (cur != last_); } -void NetCondit::emit_recurse_if(struct target_t*tgt) const +bool NetCondit::emit_recurse_if(struct target_t*tgt) const { if (if_) - if_->emit_proc(tgt); + return if_->emit_proc(tgt); + else + return true; } -void NetCondit::emit_recurse_else(struct target_t*tgt) const +bool NetCondit::emit_recurse_else(struct target_t*tgt) const { if (else_) - else_->emit_proc(tgt); + return else_->emit_proc(tgt); + else + return true; } bool NetEvProbe::emit_node(struct target_t*tgt) const @@ -474,6 +477,9 @@ bool emit(const Design*des, const char*type) /* * $Log: emit.cc,v $ + * Revision 1.64 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.63 2001/10/19 21:53:24 steve * Support multiple root modules (Philip Blundell) * diff --git a/net_force.cc b/net_force.cc index d80acce1f..3d30e2eb3 100644 --- a/net_force.cc +++ b/net_force.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: net_force.cc,v 1.6 2001/11/14 03:28:49 steve Exp $" +#ident "$Id: net_force.cc,v 1.7 2002/01/19 19:02:08 steve Exp $" #endif # include "config.h" @@ -89,6 +89,8 @@ const NetNet*NetDeassign::lval() const NetForce::NetForce(NetScope*s, const string&n, NetNet*l) : NetNode(s, n, l->pin_count()), lval_(l) { + lval_->incr_eref(); + for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) { pin(idx).set_dir(Link::INPUT); pin(idx).set_name("I", idx); @@ -97,6 +99,7 @@ NetForce::NetForce(NetScope*s, const string&n, NetNet*l) NetForce::~NetForce() { + lval_->decr_eref(); } const Link& NetForce::lval_pin(unsigned idx) const @@ -127,6 +130,9 @@ const NetNet*NetRelease::lval() const /* * $Log: net_force.cc,v $ + * Revision 1.7 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.6 2001/11/14 03:28:49 steve * DLL target support for force and release. * diff --git a/netlist.h b/netlist.h index bbd11719f..1addf73de 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.228 2001/12/31 00:08:14 steve Exp $" +#ident "$Id: netlist.h,v 1.229 2002/01/19 19:02:08 steve Exp $" #endif /* @@ -1455,8 +1455,8 @@ class NetCondit : public NetProc { // Replace the condition expression. void set_expr(NetExpr*ex); - void emit_recurse_if(struct target_t*) const; - void emit_recurse_else(struct target_t*) const; + bool emit_recurse_if(struct target_t*) const; + bool emit_recurse_else(struct target_t*) const; virtual bool emit_proc(struct target_t*) const; virtual int match_proc(struct proc_match_t*); @@ -2864,6 +2864,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.229 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.228 2001/12/31 00:08:14 steve * Support $signed cast of expressions. * diff --git a/t-dll-proc.cc b/t-dll-proc.cc index 97b44adaa..53d5bf37a 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll-proc.cc,v 1.40 2001/11/14 03:28:49 steve Exp $" +#ident "$Id: t-dll-proc.cc,v 1.41 2002/01/19 19:02:08 steve Exp $" #endif # include "config.h" @@ -421,7 +421,7 @@ bool dll_target::proc_cassign(const NetCAssign*net) return true; } -void dll_target::proc_condit(const NetCondit*net) +bool dll_target::proc_condit(const NetCondit*net) { assert(stmt_cur_); assert(stmt_cur_->type_ == IVL_ST_NONE); @@ -438,12 +438,13 @@ void dll_target::proc_condit(const NetCondit*net) ivl_statement_t save_cur_ = stmt_cur_; stmt_cur_ = save_cur_->u_.condit_.stmt_+0; - net->emit_recurse_if(this); + bool flag = net->emit_recurse_if(this); stmt_cur_ = save_cur_->u_.condit_.stmt_+1; - net->emit_recurse_else(this); + flag = flag && net->emit_recurse_else(this); stmt_cur_ = save_cur_; + return flag; } bool dll_target::proc_deassign(const NetDeassign*net) @@ -531,8 +532,16 @@ bool dll_target::proc_force(const NetForce*net) calloc(1, sizeof(struct ivl_lval_s)); const NetNet*lsig = net->lval(); + assert(lsig); ivl_signal_t sig = find_signal(des_, lsig); assert(sig); + if (sig->type_ != IVL_SIT_REG) { + cerr << net->get_line() << ": internal error: Sorry, " + << "force to nets not supported by this target." + << endl; + return false; + } + assert(sig->type_ == IVL_SIT_REG); stmt_cur_->u_.cassign_.lval[0].width_ = lsig->pin_count(); @@ -784,6 +793,9 @@ void dll_target::proc_while(const NetWhile*net) /* * $Log: t-dll-proc.cc,v $ + * Revision 1.41 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.40 2001/11/14 03:28:49 steve * DLL target support for force and release. * diff --git a/t-dll.cc b/t-dll.cc index 8649c7187..806c88a43 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.77 2002/01/12 04:03:09 steve Exp $" +#ident "$Id: t-dll.cc,v 1.78 2002/01/19 19:02:08 steve Exp $" #endif # include "config.h" @@ -163,10 +163,13 @@ static ivl_scope_t find_scope_from_root(ivl_scope_t root, const NetScope*cur) ivl_scope_t dll_target::find_scope(ivl_design_s &des, const NetScope*cur) { - unsigned i; - ivl_scope_t scope = NULL; - for (i = 0; i < des.nroots_ && scope == NULL; i++) + assert(cur); + + ivl_scope_t scope = 0; + for (unsigned i = 0; i < des.nroots_ && scope == 0; i += 1) { + assert(des.roots_[i]); scope = find_scope_from_root(des.roots_[i], cur); + } return scope; } @@ -1873,6 +1876,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.78 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.77 2002/01/12 04:03:09 steve * Make BUFZ device strengths available. * diff --git a/t-dll.h b/t-dll.h index c8c614eca..7db91785c 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.73 2002/01/03 04:19:01 steve Exp $" +#ident "$Id: t-dll.h,v 1.74 2002/01/19 19:02:08 steve Exp $" #endif # include "target.h" @@ -108,7 +108,7 @@ struct dll_target : public target_t, public expr_scan_t { bool proc_block(const NetBlock*); void proc_case(const NetCase*); bool proc_cassign(const NetCAssign*); - void proc_condit(const NetCondit*); + bool proc_condit(const NetCondit*); bool proc_deassign(const NetDeassign*); bool proc_delay(const NetPDelay*); bool proc_disable(const NetDisable*); @@ -590,6 +590,9 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.74 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.73 2002/01/03 04:19:01 steve * Add structural modulus support down to vvp. * diff --git a/t-vvm.cc b/t-vvm.cc index 9cd746bb8..7901210c5 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) && !defined(macintosh) -#ident "$Id: t-vvm.cc,v 1.213 2001/10/14 03:50:53 steve Exp $" +#ident "$Id: t-vvm.cc,v 1.214 2002/01/19 19:02:08 steve Exp $" #endif # include "config.h" @@ -190,7 +190,7 @@ class target_vvm : public target_t { virtual void proc_case(const NetCase*net); void proc_case_fun(ostream&os, const NetCase*net); virtual bool proc_cassign(const NetCAssign*); - virtual void proc_condit(const NetCondit*); + virtual bool proc_condit(const NetCondit*); void proc_condit_fun(ostream&os, const NetCondit*); virtual bool proc_deassign(const NetDeassign*); virtual bool proc_delay(const NetPDelay*); @@ -3195,11 +3195,11 @@ bool target_vvm::proc_cassign(const NetCAssign*dev) return true; } -void target_vvm::proc_condit(const NetCondit*net) +bool target_vvm::proc_condit(const NetCondit*net) { if (function_def_flag_) { proc_condit_fun(out, net); - return; + return true; } string expr = emit_proc_rval(this, net->expr()); @@ -3250,6 +3250,7 @@ void target_vvm::proc_condit(const NetCondit*net) defn << "static bool " << thread_class_ << "_step_" << out_step << "_(vvm_thread*thr) {" << endl; + return true; } void target_vvm::proc_condit_fun(ostream&os, const NetCondit*net) @@ -3658,6 +3659,9 @@ extern const struct target tgt_vvm = { }; /* * $Log: t-vvm.cc,v $ + * Revision 1.214 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.213 2001/10/14 03:50:53 steve * vvm support for pullup/down gates (PR#288) * diff --git a/target.cc b/target.cc index bada0b721..17379fd08 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) && !defined(macintosh) -#ident "$Id: target.cc,v 1.57 2001/08/25 23:50:03 steve Exp $" +#ident "$Id: target.cc,v 1.58 2002/01/19 19:02:08 steve Exp $" #endif # include "config.h" @@ -216,11 +216,12 @@ bool target_t::proc_cassign(const NetCAssign*dev) return false; } -void target_t::proc_condit(const NetCondit*condit) +bool target_t::proc_condit(const NetCondit*condit) { cerr << "target (" << typeid(*this).name() << "): " "Unhandled conditional:" << endl; condit->dump(cerr, 6); + return false; } bool target_t::proc_deassign(const NetDeassign*dev) @@ -383,6 +384,9 @@ void expr_scan_t::expr_binary(const NetEBinary*ex) /* * $Log: target.cc,v $ + * Revision 1.58 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.57 2001/08/25 23:50:03 steve * Change the NetAssign_ class to refer to the signal * instead of link into the netlist. This is faster diff --git a/target.h b/target.h index f1fe266bb..fbbfcc289 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) && !defined(macintosh) -#ident "$Id: target.h,v 1.54 2001/08/25 23:50:03 steve Exp $" +#ident "$Id: target.h,v 1.55 2002/01/19 19:02:08 steve Exp $" #endif # include "netlist.h" @@ -105,7 +105,7 @@ struct target_t { virtual bool proc_block(const NetBlock*); virtual void proc_case(const NetCase*); virtual bool proc_cassign(const NetCAssign*); - virtual void proc_condit(const NetCondit*); + virtual bool proc_condit(const NetCondit*); virtual bool proc_deassign(const NetDeassign*); virtual bool proc_delay(const NetPDelay*); virtual bool proc_disable(const NetDisable*); @@ -162,6 +162,9 @@ extern const struct target *target_table[]; /* * $Log: target.h,v $ + * Revision 1.55 2002/01/19 19:02:08 steve + * Pass back target errors processing conditionals. + * * Revision 1.54 2001/08/25 23:50:03 steve * Change the NetAssign_ class to refer to the signal * instead of link into the netlist. This is faster