diff --git a/emit.cc b/emit.cc index e3e3f82c8..0ab23a61d 100644 --- a/emit.cc +++ b/emit.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: emit.cc,v 1.87 2006/06/18 04:15:50 steve Exp $" +#ident "$Id: emit.cc,v 1.88 2006/11/10 05:44:44 steve Exp $" #endif # include "config.h" @@ -344,6 +344,17 @@ void NetScope::emit_scope(struct target_t*tgt) const tgt->signal(cur); cur = cur->sig_next_; } while (cur != signals_->sig_next_); + + /* Run the signals again, but this time to connect the + delay paths. This is done as a second pass because + the paths reference other signals that may be later + in the list. We can do it here becase delay paths are + always connected within the scope. */ + cur = signals_->sig_next_; + do { + tgt->signal_paths(cur); + cur = cur->sig_next_; + } while (cur != signals_->sig_next_); } if (memories_) { @@ -529,6 +540,9 @@ int emit(const Design*des, const char*type) /* * $Log: emit.cc,v $ + * Revision 1.88 2006/11/10 05:44:44 steve + * Process delay paths in second path over signals. + * * Revision 1.87 2006/06/18 04:15:50 steve * Add support for system functions in continuous assignments. * diff --git a/t-dll.cc b/t-dll.cc index adf80303e..4fcf2a30f 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.160 2006/10/15 03:25:58 steve Exp $" +#ident "$Id: t-dll.cc,v 1.161 2006/11/10 05:44:45 steve Exp $" #endif # include "config.h" @@ -2174,43 +2174,9 @@ void dll_target::signal(const NetNet*net) break; } - /* Collect the delay paths for this signal. */ + /* Initialize the path fields to be filled in later. */ obj->npath = 0; - if (net->delay_paths() > 0) { - /* Figure out how many paths there really are. */ - for (unsigned idx = 0 ; idx < net->delay_paths() ; idx += 1) { - const NetDelaySrc*src = net->delay_path(idx); - obj->npath += src->pin_count(); - } - - obj->path = new struct ivl_delaypath_s[obj->npath]; - - unsigned ptr = 0; - for (unsigned idx = 0 ; idx < net->delay_paths() ; idx += 1) { - const NetDelaySrc*src = net->delay_path(idx); - - for (unsigned pin = 0; pin < src->pin_count(); pin += 1) { - const Nexus*nex = src->pin(pin).nexus(); - if (! nex->t_cookie()) { - cerr << src->get_line() << ": internal error: " - << "No signal connected to pin " << pin - << " of delay path to " << net->name() - << "." << endl; - } - assert(nex->t_cookie()); - obj->path[ptr].src = (ivl_nexus_t) nex->t_cookie(); - - for (unsigned pe = 0 ; pe < 12 ; pe += 1) { - obj->path[ptr].delay[pe] = src->get_delay(pe); - } - - ptr += 1; - } - } - - } else { - obj->path = 0; - } + obj->path = 0; obj->data_type = net->data_type(); obj->nattr = net->attr_cnt(); @@ -2240,11 +2206,61 @@ void dll_target::signal(const NetNet*net) } +bool dll_target::signal_paths(const NetNet*net) +{ + /* Nothing to do if there are no paths for this signal. */ + if (net->delay_paths() == 0) + return true; + + ivl_signal_t obj = find_signal(des_, net); + assert(obj); + + /* We cannot have already set up the paths for this signal. */ + assert(obj->npath == 0); + assert(obj->path == 0); + + /* Figure out how many paths there really are. */ + for (unsigned idx = 0 ; idx < net->delay_paths() ; idx += 1) { + const NetDelaySrc*src = net->delay_path(idx); + obj->npath += src->pin_count(); + } + + obj->path = new struct ivl_delaypath_s[obj->npath]; + + unsigned ptr = 0; + for (unsigned idx = 0 ; idx < net->delay_paths() ; idx += 1) { + const NetDelaySrc*src = net->delay_path(idx); + + for (unsigned pin = 0; pin < src->pin_count(); pin += 1) { + const Nexus*nex = src->pin(pin).nexus(); + if (! nex->t_cookie()) { + cerr << src->get_line() << ": internal error: " + << "No signal connected to pin " << pin + << " of delay path to " << net->name() + << "." << endl; + } + assert(nex->t_cookie()); + obj->path[ptr].src = (ivl_nexus_t) nex->t_cookie(); + + for (unsigned pe = 0 ; pe < 12 ; pe += 1) { + obj->path[ptr].delay[pe] = src->get_delay(pe); + } + + ptr += 1; + } + } + + return true; +} + extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.161 2006/11/10 05:44:45 steve + * Process delay paths in second path over signals. + * * Revision 1.160 2006/10/15 03:25:58 steve * More detailed internal error message. * diff --git a/t-dll.h b/t-dll.h index 7ac53e387..2d53f6cb7 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 */ #ifdef HAVE_CVS_IDENT -#ident "$Id: t-dll.h,v 1.133 2006/09/23 04:57:19 steve Exp $" +#ident "$Id: t-dll.h,v 1.134 2006/11/10 05:44:45 steve Exp $" #endif # include "target.h" @@ -96,6 +96,7 @@ struct dll_target : public target_t, public expr_scan_t { bool process(const NetProcTop*); void scope(const NetScope*); void signal(const NetNet*); + bool signal_paths(const NetNet*); void memory(const NetMemory*); ivl_dll_t dll_; @@ -679,6 +680,9 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.134 2006/11/10 05:44:45 steve + * Process delay paths in second path over signals. + * * Revision 1.133 2006/09/23 04:57:19 steve * Basic support for specify timing. * diff --git a/target.cc b/target.cc index fe5c35ed5..1915fdcb8 100644 --- a/target.cc +++ b/target.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: target.cc,v 1.78 2006/06/18 04:15:50 steve Exp $" +#ident "$Id: target.cc,v 1.79 2006/11/10 05:44:45 steve Exp $" #endif # include "config.h" @@ -41,6 +41,11 @@ void target_t::event(const NetEvent*ev) << "): Unhandled event <" << ev->full_name() << ">." << endl; } +bool target_t::signal_paths(const NetNet*) +{ + return true; +} + void target_t::memory(const NetMemory*) { cerr << "target (" << typeid(*this).name() << "): " @@ -438,6 +443,9 @@ void expr_scan_t::expr_binary(const NetEBinary*ex) /* * $Log: target.cc,v $ + * Revision 1.79 2006/11/10 05:44:45 steve + * Process delay paths in second path over signals. + * * Revision 1.78 2006/06/18 04:15:50 steve * Add support for system functions in continuous assignments. * diff --git a/target.h b/target.h index 3ff97eb1d..08888a676 100644 --- a/target.h +++ b/target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: target.h,v 1.75 2006/06/18 04:15:50 steve Exp $" +#ident "$Id: target.h,v 1.76 2006/11/10 05:44:45 steve Exp $" #endif # include "netlist.h" @@ -64,6 +64,7 @@ struct target_t { /* Output a signal (called for each signal) */ virtual void signal(const NetNet*) =0; + virtual bool signal_paths(const NetNet*); /* Output a memory (called for each memory object) */ virtual void memory(const NetMemory*); @@ -171,6 +172,9 @@ extern const struct target *target_table[]; /* * $Log: target.h,v $ + * Revision 1.76 2006/11/10 05:44:45 steve + * Process delay paths in second path over signals. + * * Revision 1.75 2006/06/18 04:15:50 steve * Add support for system functions in continuous assignments. *