diff --git a/PSpec.cc b/PSpec.cc new file mode 100644 index 000000000..4677c3060 --- /dev/null +++ b/PSpec.cc @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2006 Stephen Williams + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#ifdef HAVE_CVS_IDENT +#ident "$Id: PSpec.cc,v 1.1 2006/09/26 19:48:40 steve Exp $" +#endif + +# include "PSpec.h" + +PSpecPath::PSpecPath(unsigned src_cnt, unsigned dst_cnt) +: src(src_cnt), dst(dst_cnt) +{ +} + +PSpecPath::~PSpecPath() +{ +} diff --git a/design_dump.cc b/design_dump.cc index c8caf2c85..38de69c4a 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: design_dump.cc,v 1.168 2006/09/23 04:57:19 steve Exp $" +#ident "$Id: design_dump.cc,v 1.169 2006/09/26 19:48:40 steve Exp $" #endif # include "config.h" @@ -915,6 +915,14 @@ void NetScope::dump(ostream&o) const } while (cur != memories_->snext_); } + // Dump specparams + typedef map::const_iterator specparam_it_t; + for (specparam_it_t cur = specparams.begin() + ; cur != specparams.end() ; cur ++ ) { + o << " specparam " << (*cur).first + << " = " << (*cur).second << endl; + } + switch (type_) { case FUNC: if (func_def()) @@ -1208,6 +1216,9 @@ void Design::dump(ostream&o) const /* * $Log: design_dump.cc,v $ + * Revision 1.169 2006/09/26 19:48:40 steve + * Missing PSpec.cc file. + * * Revision 1.168 2006/09/23 04:57:19 steve * Basic support for specify timing. * diff --git a/elaborate.cc b/elaborate.cc index 94515dcb3..a57d230cf 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: elaborate.cc,v 1.343 2006/09/23 04:57:19 steve Exp $" +#ident "$Id: elaborate.cc,v 1.344 2006/09/26 19:48:40 steve Exp $" #endif # include "config.h" @@ -2890,7 +2890,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const if (NetEConst*cur_con = dynamic_cast (cur)) { delay_value[idx] = cur_con->value().as_ulong(); } else { - cerr << cur->get_line() << ": error: Path delay value " + cerr << get_line() << ": error: Path delay value " << "must be constant." << endl; delay_value[idx] = 0; des->errors += 1; @@ -2983,6 +2983,30 @@ bool Module::elaborate(Design*des, NetScope*scope) const { bool result_flag = true; + // Elaborate specparams + typedef map::const_iterator specparam_it_t; + for (specparam_it_t cur = specparams.begin() + ; cur != specparams.end() ; cur ++ ) { + + NetExpr*val = elab_and_eval(des, scope, (*cur).second, -1); + NetEConst*val_c = dynamic_cast (val); + if (! val_c ) { + cerr << (*cur).second->get_line() << ": error: " + << "specparam " << (*cur).first << " value" + << " is not constant: " << *val << endl; + des->errors += 1; + continue; + } + + scope->specparams[(*cur).first] = val_c->value().as_long(); + + if (debug_elaborate) + cerr << get_line() << ": debug: Elaborate " + << "specparam " << (*cur).first + << " value=" << val_c->value().as_long() << endl; + + } + // Elaborate within the generate blocks. typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() @@ -3255,6 +3279,9 @@ Design* elaborate(listroots) /* * $Log: elaborate.cc,v $ + * Revision 1.344 2006/09/26 19:48:40 steve + * Missing PSpec.cc file. + * * Revision 1.343 2006/09/23 04:57:19 steve * Basic support for specify timing. * diff --git a/netlist.h b/netlist.h index e8551d02a..5d1d94424 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: netlist.h,v 1.361 2006/09/23 04:57:19 steve Exp $" +#ident "$Id: netlist.h,v 1.362 2006/09/26 19:48:40 steve Exp $" #endif /* @@ -3369,6 +3369,7 @@ class NetScope : public Attrib { }; mapparameters; maplocalparams; + mapspecparams; /* Module instance arrays are collected here for access during the multiple elaboration passes. */ @@ -3558,6 +3559,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.362 2006/09/26 19:48:40 steve + * Missing PSpec.cc file. + * * Revision 1.361 2006/09/23 04:57:19 steve * Basic support for specify timing. *