Missing PSpec.cc file.

This commit is contained in:
steve 2006-09-26 19:48:40 +00:00
parent d3ceae7ee0
commit b658a3b41f
4 changed files with 78 additions and 4 deletions

32
PSpec.cc Normal file
View File

@ -0,0 +1,32 @@
/*
* Copyright (c) 2006 Stephen Williams <steve@icarus.com>
*
* 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()
{
}

View File

@ -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<perm_string,long>::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.
*

View File

@ -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<NetEConst*> (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<perm_string,PExpr*>::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<NetEConst*> (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<PGenerate*>::const_iterator generate_it_t;
for (generate_it_t cur = generate_schemes.begin()
@ -3255,6 +3279,9 @@ Design* elaborate(list<perm_string>roots)
/*
* $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.
*

View File

@ -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 {
};
map<perm_string,param_expr_t>parameters;
map<perm_string,param_expr_t>localparams;
map<perm_string,long>specparams;
/* 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.
*