LineInfo uses perm_string for path.
Rework the handling of file names to use a perm_string heap to hold the file names, instead of the custom file name heap in the lexor. Also rename the get_line to get_fileline to reflect its real duties. This latter chage touched a lot of files.
This commit is contained in:
parent
dff59f8ad8
commit
7975e14b5c
29
LineInfo.cc
29
LineInfo.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: LineInfo.cc,v 1.4 2003/01/17 05:49:03 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -26,7 +23,7 @@
|
|||
# include <sstream>
|
||||
|
||||
LineInfo::LineInfo()
|
||||
: file_(0), lineno_(0)
|
||||
: lineno_(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -34,10 +31,10 @@ LineInfo::~LineInfo()
|
|||
{
|
||||
}
|
||||
|
||||
string LineInfo::get_line() const
|
||||
string LineInfo::get_fileline() const
|
||||
{
|
||||
ostringstream buf;
|
||||
buf << (file_? file_ : "") << ":" << lineno_;
|
||||
buf << (file_.str()? file_.str() : "") << ":" << lineno_;
|
||||
|
||||
string res = buf.str();
|
||||
return res;
|
||||
|
|
@ -49,7 +46,7 @@ void LineInfo::set_line(const LineInfo&that)
|
|||
lineno_ = that.lineno_;
|
||||
}
|
||||
|
||||
void LineInfo::set_file(const char*f)
|
||||
void LineInfo::set_file(perm_string f)
|
||||
{
|
||||
file_ = f;
|
||||
}
|
||||
|
|
@ -58,21 +55,3 @@ void LineInfo::set_lineno(unsigned n)
|
|||
{
|
||||
lineno_ = n;
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: LineInfo.cc,v $
|
||||
* Revision 1.4 2003/01/17 05:49:03 steve
|
||||
* Use stringstream in place of sprintf.
|
||||
*
|
||||
* Revision 1.3 2002/08/12 01:34:58 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.2 2001/07/25 03:10:48 steve
|
||||
* Create a config.h.in file to hold all the config
|
||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.1 2000/11/30 17:31:42 steve
|
||||
* Change LineInfo to store const C strings.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
34
LineInfo.h
34
LineInfo.h
|
|
@ -18,10 +18,8 @@
|
|||
* 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: LineInfo.h,v 1.8 2005/06/14 19:13:43 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "StringHeap.h"
|
||||
# include <string>
|
||||
|
||||
using namespace std;
|
||||
|
|
@ -40,36 +38,18 @@ class LineInfo {
|
|||
LineInfo();
|
||||
~LineInfo();
|
||||
|
||||
string get_line() const;
|
||||
|
||||
// Get a fully formatted file/lineno
|
||||
string get_fileline() const;
|
||||
// Set the file/line fro another LineInfo object.
|
||||
void set_line(const LineInfo&that);
|
||||
|
||||
void set_file(const char*f);
|
||||
// Access parts of LineInfo data
|
||||
void set_file(perm_string f);
|
||||
void set_lineno(unsigned n);
|
||||
|
||||
private:
|
||||
const char* file_;
|
||||
perm_string file_;
|
||||
unsigned lineno_;
|
||||
};
|
||||
|
||||
/*
|
||||
* $Log: LineInfo.h,v $
|
||||
* Revision 1.8 2005/06/14 19:13:43 steve
|
||||
* gcc3/4 compile errors.
|
||||
*
|
||||
* Revision 1.7 2003/01/17 05:49:03 steve
|
||||
* Use stringstream in place of sprintf.
|
||||
*
|
||||
* Revision 1.6 2002/08/12 01:34:58 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.5 2000/11/30 17:31:42 steve
|
||||
* Change LineInfo to store const C strings.
|
||||
*
|
||||
* Revision 1.4 2000/02/23 02:56:53 steve
|
||||
* Macintosh compilers do not support ident.
|
||||
*
|
||||
* Revision 1.3 1999/02/15 02:06:15 steve
|
||||
* Elaborate gate ranges.
|
||||
*/
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: PDelays.cc,v 1.15 2006/07/08 21:48:46 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -116,7 +113,7 @@ static NetExpr* make_delay_nets(Design*des, NetExpr*expr)
|
|||
|
||||
NetNet*sig = expr->synthesize(des);
|
||||
if (sig == 0) {
|
||||
cerr << expr->get_line() << ": error: Expression " << *expr
|
||||
cerr << expr->get_fileline() << ": error: Expression " << *expr
|
||||
<< " is not suitable for delay expression." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
161
PExpr.cc
161
PExpr.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998-1999 Stephen Williams <steve@icarus.com>
|
||||
* Copyright (c) 1998-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: PExpr.cc,v 1.39 2007/05/24 04:07:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -48,14 +45,14 @@ bool PExpr::is_constant(Module*) const
|
|||
|
||||
NetNet* PExpr::elaborate_lnet(Design*des, NetScope*, bool) const
|
||||
{
|
||||
cerr << get_line() << ": error: expression not valid in assign l-value: "
|
||||
cerr << get_fileline() << ": error: expression not valid in assign l-value: "
|
||||
<< *this << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetNet* PExpr::elaborate_bi_net(Design*des, NetScope*) const
|
||||
{
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "expression not valid as argument to inout port: "
|
||||
<< *this << endl;
|
||||
return 0;
|
||||
|
|
@ -298,155 +295,3 @@ bool PEUnary::is_constant(Module*m) const
|
|||
return expr_->is_constant(m);
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: PExpr.cc,v $
|
||||
* Revision 1.39 2007/05/24 04:07:11 steve
|
||||
* Rework the heirarchical identifier parse syntax and pform
|
||||
* to handle more general combinations of heirarch and bit selects.
|
||||
*
|
||||
* Revision 1.38 2006/10/30 05:44:49 steve
|
||||
* Expression widths with unsized literals are pseudo-infinite width.
|
||||
*
|
||||
* Revision 1.37 2005/10/04 04:09:25 steve
|
||||
* Add support for indexed select attached to parameters.
|
||||
*
|
||||
* Revision 1.36 2005/08/06 17:58:16 steve
|
||||
* Implement bi-directional part selects.
|
||||
*
|
||||
* Revision 1.35 2004/10/04 01:10:51 steve
|
||||
* Clean up spurious trailing white space.
|
||||
*
|
||||
* Revision 1.34 2004/02/20 06:22:56 steve
|
||||
* parameter keys are per_strings.
|
||||
*
|
||||
* Revision 1.33 2003/01/27 05:09:17 steve
|
||||
* Spelling fixes.
|
||||
*
|
||||
* Revision 1.32 2002/11/09 19:20:48 steve
|
||||
* Port expressions for output ports are lnets, not nets.
|
||||
*
|
||||
* Revision 1.31 2002/08/19 02:39:16 steve
|
||||
* Support parameters with defined ranges.
|
||||
*
|
||||
* Revision 1.30 2002/08/12 01:34:58 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.29 2001/12/30 21:32:03 steve
|
||||
* Support elaborate_net for PEString objects.
|
||||
*
|
||||
* Revision 1.28 2001/12/03 04:47:14 steve
|
||||
* Parser and pform use hierarchical names as hname_t
|
||||
* objects instead of encoded strings.
|
||||
*
|
||||
* Revision 1.27 2001/11/08 05:15:50 steve
|
||||
* Remove string paths from PExpr elaboration.
|
||||
*
|
||||
* Revision 1.26 2001/11/07 04:26:46 steve
|
||||
* elaborate_lnet uses scope instead of string path.
|
||||
*
|
||||
* Revision 1.25 2001/11/06 06:11:55 steve
|
||||
* Support more real arithmetic in delay constants.
|
||||
*
|
||||
* Revision 1.24 2001/07/25 03:10:48 steve
|
||||
* Create a config.h.in file to hold all the config
|
||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.23 2001/01/14 23:04:55 steve
|
||||
* Generalize the evaluation of floating point delays, and
|
||||
* get it working with delay assignment statements.
|
||||
*
|
||||
* Allow parameters to be referenced by hierarchical name.
|
||||
*
|
||||
* Revision 1.22 2001/01/12 04:31:27 steve
|
||||
* Handle error idents in constants not in any scope (PR#97)
|
||||
*
|
||||
* Revision 1.21 2000/12/16 19:03:30 steve
|
||||
* Evaluate <= and ?: in parameter expressions (PR#81)
|
||||
*
|
||||
* Revision 1.20 2000/12/10 22:01:35 steve
|
||||
* Support decimal constants in behavioral delays.
|
||||
*
|
||||
* Revision 1.19 2000/06/30 15:50:20 steve
|
||||
* Allow unary operators in constant expressions.
|
||||
*
|
||||
* Revision 1.18 2000/05/07 04:37:55 steve
|
||||
* Carry strength values from Verilog source to the
|
||||
* pform and netlist for gates.
|
||||
*
|
||||
* Change vvm constants to use the driver_t to drive
|
||||
* a constant value. This works better if there are
|
||||
* multiple drivers on a signal.
|
||||
*
|
||||
* Revision 1.17 2000/05/04 03:37:58 steve
|
||||
* Add infrastructure for system functions, move
|
||||
* $time to that structure and add $random.
|
||||
*
|
||||
* Revision 1.16 2000/04/12 04:23:57 steve
|
||||
* Named events really should be expressed with PEIdent
|
||||
* objects in the pform,
|
||||
*
|
||||
* Handle named events within the mix of net events
|
||||
* and edges. As a unified lot they get caught together.
|
||||
* wait statements are broken into more complex statements
|
||||
* that include a conditional.
|
||||
*
|
||||
* Do not generate NetPEvent or NetNEvent objects in
|
||||
* elaboration. NetEvent, NetEvWait and NetEvProbe
|
||||
* take over those functions in the netlist.
|
||||
*
|
||||
* Revision 1.15 2000/04/01 19:31:57 steve
|
||||
* Named events as far as the pform.
|
||||
*
|
||||
* Revision 1.14 2000/03/12 18:22:11 steve
|
||||
* Binary and unary operators in parameter expressions.
|
||||
*
|
||||
* Revision 1.13 2000/02/23 02:56:53 steve
|
||||
* Macintosh compilers do not support ident.
|
||||
*
|
||||
* Revision 1.12 1999/12/31 17:38:37 steve
|
||||
* Standardize some of the error messages.
|
||||
*
|
||||
* Revision 1.11 1999/10/31 04:11:27 steve
|
||||
* Add to netlist links pin name and instance number,
|
||||
* and arrange in vvm for pin connections by name
|
||||
* and instance number.
|
||||
*
|
||||
* Revision 1.10 1999/09/25 02:57:29 steve
|
||||
* Parse system function calls.
|
||||
*
|
||||
* Revision 1.9 1999/09/16 04:18:15 steve
|
||||
* elaborate concatenation repeats.
|
||||
*
|
||||
* Revision 1.8 1999/09/15 04:17:52 steve
|
||||
* separate assign lval elaboration for error checking.
|
||||
*
|
||||
* Revision 1.7 1999/07/22 02:05:20 steve
|
||||
* is_constant method for PEConcat.
|
||||
*
|
||||
* Revision 1.6 1999/07/17 19:50:59 steve
|
||||
* netlist support for ternary operator.
|
||||
*
|
||||
* Revision 1.5 1999/06/16 03:13:29 steve
|
||||
* More syntax parse with sorry stubs.
|
||||
*
|
||||
* Revision 1.4 1999/06/10 04:03:52 steve
|
||||
* Add support for the Ternary operator,
|
||||
* Add support for repeat concatenation,
|
||||
* Correct some seg faults cause by elaboration
|
||||
* errors,
|
||||
* Parse the casex anc casez statements.
|
||||
*
|
||||
* Revision 1.3 1999/05/16 05:08:42 steve
|
||||
* Redo constant expression detection to happen
|
||||
* after parsing.
|
||||
*
|
||||
* Parse more operators and expressions.
|
||||
*
|
||||
* Revision 1.2 1998/11/11 00:01:51 steve
|
||||
* Check net ranges in declarations.
|
||||
*
|
||||
* Revision 1.1 1998/11/03 23:28:53 steve
|
||||
* Introduce verilog to CVS.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
82
PGate.cc
82
PGate.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999-2004 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: PGate.cc,v 1.18 2006/01/03 05:22:14 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -120,9 +117,9 @@ void PGate::eval_delays(Design*des, NetScope*scope,
|
|||
rise_time = tmp->value().as_ulong();
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Delay expressions must be "
|
||||
cerr << get_fileline() << ": error: Delay expressions must be "
|
||||
<< "constant here." << endl;
|
||||
cerr << get_line() << ": : Cannot calculate "
|
||||
cerr << get_fileline() << ": : Cannot calculate "
|
||||
<< *rise_expr << endl;
|
||||
des->errors += 1;
|
||||
rise_time = 0;
|
||||
|
|
@ -133,9 +130,9 @@ void PGate::eval_delays(Design*des, NetScope*scope,
|
|||
|
||||
} else {
|
||||
if (fall_expr != rise_expr) {
|
||||
cerr << get_line() << ": error: Delay expressions must be "
|
||||
cerr << get_fileline() << ": error: Delay expressions must be "
|
||||
<< "constant here." << endl;
|
||||
cerr << get_line() << ": : Cannot calculate "
|
||||
cerr << get_fileline() << ": : Cannot calculate "
|
||||
<< *rise_expr << endl;
|
||||
}
|
||||
des->errors += 1;
|
||||
|
|
@ -146,9 +143,9 @@ void PGate::eval_delays(Design*des, NetScope*scope,
|
|||
decay_time = tmp->value().as_ulong();
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Delay expressions must be "
|
||||
cerr << get_fileline() << ": error: Delay expressions must be "
|
||||
<< "constant here." << endl;
|
||||
cerr << get_line() << ": : Cannot calculate "
|
||||
cerr << get_fileline() << ": : Cannot calculate "
|
||||
<< *rise_expr << endl;
|
||||
des->errors += 1;
|
||||
decay_time = 0;
|
||||
|
|
@ -246,68 +243,3 @@ perm_string PGModule::get_type()
|
|||
return type_;
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: PGate.cc,v $
|
||||
* Revision 1.18 2006/01/03 05:22:14 steve
|
||||
* Handle complex net node delays.
|
||||
*
|
||||
* Revision 1.17 2006/01/02 05:33:19 steve
|
||||
* Node delays can be more general expressions in structural contexts.
|
||||
*
|
||||
* Revision 1.16 2004/02/18 17:11:54 steve
|
||||
* Use perm_strings for named langiage items.
|
||||
*
|
||||
* Revision 1.15 2003/03/06 04:37:12 steve
|
||||
* lex_strings.add module names earlier.
|
||||
*
|
||||
* Revision 1.14 2002/08/12 01:34:58 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.13 2001/11/22 06:20:59 steve
|
||||
* Use NetScope instead of string for scope path.
|
||||
*
|
||||
* Revision 1.12 2001/10/21 00:42:47 steve
|
||||
* Module types in pform are char* instead of string.
|
||||
*
|
||||
* Revision 1.11 2001/10/19 01:55:32 steve
|
||||
* Method to get the type_ member
|
||||
*
|
||||
* Revision 1.10 2001/07/25 03:10:48 steve
|
||||
* Create a config.h.in file to hold all the config
|
||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.9 2000/05/06 15:41:56 steve
|
||||
* Carry assignment strength to pform.
|
||||
*
|
||||
* Revision 1.8 2000/03/08 04:36:53 steve
|
||||
* Redesign the implementation of scopes and parameters.
|
||||
* I now generate the scopes and notice the parameters
|
||||
* in a separate pass over the pform. Once the scopes
|
||||
* are generated, I can process overrides and evalutate
|
||||
* paremeters before elaboration begins.
|
||||
*
|
||||
* Revision 1.7 2000/02/23 02:56:53 steve
|
||||
* Macintosh compilers do not support ident.
|
||||
*
|
||||
* Revision 1.6 2000/02/18 05:15:02 steve
|
||||
* Catch module instantiation arrays.
|
||||
*
|
||||
* Revision 1.5 1999/09/14 01:50:35 steve
|
||||
* Handle gates without delays.
|
||||
*
|
||||
* Revision 1.4 1999/09/04 19:11:46 steve
|
||||
* Add support for delayed non-blocking assignments.
|
||||
*
|
||||
* Revision 1.3 1999/08/01 21:18:55 steve
|
||||
* elaborate rise/fall/decay for continuous assign.
|
||||
*
|
||||
* Revision 1.2 1999/08/01 16:34:50 steve
|
||||
* Parse and elaborate rise/fall/decay times
|
||||
* for gates, and handle the rules for partial
|
||||
* lists of times.
|
||||
*
|
||||
* Revision 1.1 1999/02/15 02:06:15 steve
|
||||
* Elaborate gate ranges.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
13
PWire.cc
13
PWire.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: PWire.cc,v 1.14 2007/05/24 04:07:11 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
# include "PWire.h"
|
||||
|
|
@ -149,7 +146,7 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type)
|
|||
switch (type) {
|
||||
case SR_PORT:
|
||||
if (port_set_) {
|
||||
cerr << get_line() << ": error: Port ``" << hname_
|
||||
cerr << get_fileline() << ": error: Port ``" << hname_
|
||||
<< "'' has already been declared a port." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
|
|
@ -161,7 +158,7 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type)
|
|||
|
||||
case SR_NET:
|
||||
if (net_set_) {
|
||||
cerr << get_line() << ": error: Net ``" << hname_
|
||||
cerr << get_fileline() << ": error: Net ``" << hname_
|
||||
<< "'' has already been declared." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
|
|
@ -174,12 +171,12 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type)
|
|||
case SR_BOTH:
|
||||
if (port_set_ || net_set_) {
|
||||
if (port_set_) {
|
||||
cerr << get_line() << ": error: Port ``" << hname_
|
||||
cerr << get_fileline() << ": error: Port ``" << hname_
|
||||
<< "'' has already been declared a port." << endl;
|
||||
error_cnt_ += 1;
|
||||
}
|
||||
if (net_set_) {
|
||||
cerr << get_line() << ": error: Net ``" << hname_
|
||||
cerr << get_fileline() << ": error: Net ``" << hname_
|
||||
<< "'' has already been declared." << endl;
|
||||
error_cnt_ += 1;
|
||||
}
|
||||
|
|
@ -198,7 +195,7 @@ void PWire::set_range(PExpr*m, PExpr*l, PWSRType type)
|
|||
void PWire::set_memory_idx(PExpr*ldx, PExpr*rdx)
|
||||
{
|
||||
if (lidx_ != 0 || ridx_ != 0) {
|
||||
cerr << get_line() << ": error: Array ``" << hname_
|
||||
cerr << get_fileline() << ": error: Array ``" << hname_
|
||||
<< "'' has already been declared." << endl;
|
||||
error_cnt_ += 1;
|
||||
} else {
|
||||
|
|
|
|||
12
compiler.h
12
compiler.h
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __compiler_H
|
||||
#define __compiler_H
|
||||
/*
|
||||
* Copyright (c) 1999-2004 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2007 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
|
||||
|
|
@ -127,7 +127,7 @@ extern map<perm_string,unsigned> missing_modules;
|
|||
matches an entry in this table, it will turn on the
|
||||
library_active_flag so that modules know that they are in a
|
||||
library. */
|
||||
extern map<string,bool> library_file_map;
|
||||
extern map<perm_string,bool> library_file_map;
|
||||
|
||||
/*
|
||||
* the lex_strings are perm_strings made up of tokens from the source
|
||||
|
|
@ -137,6 +137,14 @@ extern map<string,bool> library_file_map;
|
|||
extern StringHeapLex lex_strings;
|
||||
extern StringHeap misc_strings;
|
||||
|
||||
/*
|
||||
* The filename_strings are perm_strings for file names. They are put
|
||||
* into their own StringHeapLex because these paths are used a *lot*
|
||||
* and this makes them more sure to hash together.
|
||||
*/
|
||||
extern StringHeapLex filename_strings;
|
||||
|
||||
|
||||
/*
|
||||
* system task/function listings.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -568,11 +568,11 @@ void NetProcTop::dump(ostream&o, unsigned ind) const
|
|||
{
|
||||
switch (type_) {
|
||||
case NetProcTop::KINITIAL:
|
||||
o << "initial /* " << get_line() << " in "
|
||||
o << "initial /* " << get_fileline() << " in "
|
||||
<< scope_path(scope_) << " */" << endl;
|
||||
break;
|
||||
case NetProcTop::KALWAYS:
|
||||
o << "always /* " << get_line() << " in "
|
||||
o << "always /* " << get_fileline() << " in "
|
||||
<< scope_path(scope_) << " */" << endl;
|
||||
break;
|
||||
}
|
||||
|
|
@ -705,7 +705,7 @@ void NetCAssign::dump(ostream&o, unsigned ind) const
|
|||
{
|
||||
o << setw(ind) << "" << "cassign ";
|
||||
dump_lval(o);
|
||||
o << " = " << *rval() << "; /* " << get_line() << " */" << endl;
|
||||
o << " = " << *rval() << "; /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void NetCondit::dump(ostream&o, unsigned ind) const
|
||||
|
|
@ -727,13 +727,13 @@ void NetDeassign::dump(ostream&o, unsigned ind) const
|
|||
{
|
||||
o << setw(ind) << "" << "deassign ";
|
||||
dump_lval(o);
|
||||
o << "; /* " << get_line() << " */" << endl;
|
||||
o << "; /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void NetDisable::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "disable " << scope_path(target_) << "; "
|
||||
<< "/* " << get_line() << " */" << endl;
|
||||
<< "/* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void NetEvProbe::dump_node(ostream&o, unsigned ind) const
|
||||
|
|
@ -759,7 +759,7 @@ void NetEvProbe::dump_node(ostream&o, unsigned ind) const
|
|||
void NetEvTrig::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "" << "-> " << event_->name() << "; "
|
||||
<< "// " << get_line() << endl;
|
||||
<< "// " << get_fileline() << endl;
|
||||
}
|
||||
|
||||
void NetEvWait::dump(ostream&o, unsigned ind) const
|
||||
|
|
@ -772,7 +772,7 @@ void NetEvWait::dump(ostream&o, unsigned ind) const
|
|||
for (unsigned idx = 1 ; idx < nevents() ; idx += 1)
|
||||
o << " or " << event(idx)->name();
|
||||
|
||||
o << ") // " << get_line() << endl;
|
||||
o << ") // " << get_fileline() << endl;
|
||||
|
||||
if (statement_)
|
||||
statement_->dump(o, ind+2);
|
||||
|
|
@ -784,7 +784,7 @@ void NetForce::dump(ostream&o, unsigned ind) const
|
|||
{
|
||||
o << setw(ind) << "" << "force ";
|
||||
dump_lval(o);
|
||||
o << " = " << *rval() << "; /* " << get_line() << " */" << endl;
|
||||
o << " = " << *rval() << "; /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void NetForever::dump(ostream&o, unsigned ind) const
|
||||
|
|
@ -826,7 +826,7 @@ void NetRelease::dump(ostream&o, unsigned ind) const
|
|||
{
|
||||
o << setw(ind) << "" << "release ";
|
||||
dump_lval(o);
|
||||
o << "; /* " << get_line() << " */" << endl;
|
||||
o << "; /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void NetRepeat::dump(ostream&o, unsigned ind) const
|
||||
|
|
@ -908,7 +908,7 @@ void NetScope::dump(ostream&o) const
|
|||
for (NetEvent*cur = events_ ; cur ; cur = cur->snext_) {
|
||||
o << " event " << cur->name() << "; nprobe="
|
||||
<< cur->nprobe() << " scope=" << scope_path(cur->scope())
|
||||
<< " // " << cur->get_line() << endl;
|
||||
<< " // " << cur->get_fileline() << endl;
|
||||
}
|
||||
|
||||
// Dump the signals,
|
||||
|
|
|
|||
114
elab_expr.cc
114
elab_expr.cc
|
|
@ -34,7 +34,7 @@ unsigned PExpr::test_width(Design*des, NetScope*scope,
|
|||
unsigned min, unsigned lval, bool&) const
|
||||
{
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: test_width defaults to "
|
||||
cerr << get_fileline() << ": debug: test_width defaults to "
|
||||
<< min << ", ignoring unsized_flag. typeid="
|
||||
<< typeid(*this).name() << endl;
|
||||
}
|
||||
|
|
@ -43,9 +43,9 @@ unsigned PExpr::test_width(Design*des, NetScope*scope,
|
|||
|
||||
NetExpr* PExpr::elaborate_expr(Design*des, NetScope*, int, bool) const
|
||||
{
|
||||
cerr << get_line() << ": internal error: I do not know how to elaborate"
|
||||
cerr << get_fileline() << ": internal error: I do not know how to elaborate"
|
||||
<< " expression. " << endl;
|
||||
cerr << get_line() << ": : Expression is: " << *this
|
||||
cerr << get_fileline() << ": : Expression is: " << *this
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -161,7 +161,7 @@ NetEBinary* PEBinary::elaborate_expr_base_(Design*des,
|
|||
bool flag;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: elaborate expression "
|
||||
cerr << get_fileline() << ": debug: elaborate expression "
|
||||
<< *this << " expr_wid=" << expr_wid << endl;
|
||||
}
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ NetEBinary* PEBinary::elaborate_expr_base_(Design*des,
|
|||
form of verilog. */
|
||||
if (generation_flag < GN_VER2001X) {
|
||||
if (lp->expr_type()==IVL_VT_REAL || rp->expr_type()==IVL_VT_REAL) {
|
||||
cerr << get_line() << ": error: Modulus operator may not "
|
||||
cerr << get_fileline() << ": error: Modulus operator may not "
|
||||
"have REAL operands." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -236,7 +236,7 @@ NetEBinary* PEBinary::elaborate_expr_base_(Design*des,
|
|||
case 'N': /* !== */
|
||||
if (lp->expr_type() == IVL_VT_REAL
|
||||
|| rp->expr_type() == IVL_VT_REAL) {
|
||||
cerr << get_line() << ": error: Case equality may not "
|
||||
cerr << get_fileline() << ": error: Case equality may not "
|
||||
<< "have real operands." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -260,7 +260,7 @@ NetEBinary* PEBinary::elaborate_expr_base_(Design*des,
|
|||
tmp->set_line(*this);
|
||||
flag = tmp->set_width(1);
|
||||
if (flag == false) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
"expression bit width of comparison != 1." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -295,7 +295,7 @@ NetEBinary* PEBComp::elaborate_expr(Design*des, NetScope*scope,
|
|||
use_wid = right_width;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Comparison expression operands are "
|
||||
<< left_width << " bits and "
|
||||
<< right_width << " bits. Resorting to "
|
||||
|
|
@ -338,14 +338,14 @@ unsigned PECallFunction::test_width_sfunc_(Design*des, NetScope*scope,
|
|||
return 0;
|
||||
unsigned wid = expr->test_width(des, scope, min, lval, unsized_flag);
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: test_width"
|
||||
cerr << get_fileline() << ": debug: test_width"
|
||||
<< " of $signed/$unsigned returns test_width"
|
||||
<< " of subexpression." << endl;
|
||||
return wid;
|
||||
}
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: test_width "
|
||||
cerr << get_fileline() << ": debug: test_width "
|
||||
<< "of system function " << name
|
||||
<< " returns 32 always?" << endl;
|
||||
return 32;
|
||||
|
|
@ -361,7 +361,7 @@ unsigned PECallFunction::test_width(Design*des, NetScope*scope,
|
|||
NetFuncDef*def = des->find_function(scope, path_);
|
||||
if (def == 0) {
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: test_width "
|
||||
cerr << get_fileline() << ": debug: test_width "
|
||||
<< "cannot find definition of " << path_
|
||||
<< " in " << scope_path(scope) << "." << endl;
|
||||
return 0;
|
||||
|
|
@ -372,7 +372,7 @@ unsigned PECallFunction::test_width(Design*des, NetScope*scope,
|
|||
|
||||
if (NetNet*res = dscope->find_signal(dscope->basename())) {
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: test_width "
|
||||
cerr << get_fileline() << ": debug: test_width "
|
||||
<< "of function returns width " << res->vector_width()
|
||||
<< "." << endl;
|
||||
return res->vector_width();
|
||||
|
|
@ -398,7 +398,7 @@ NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope, int expr_w
|
|||
it just changes the interpretation. */
|
||||
if (strcmp(peek_tail_name(path_), "$signed") == 0) {
|
||||
if ((parms_.count() != 1) || (parms_[0] == 0)) {
|
||||
cerr << get_line() << ": error: The $signed() function "
|
||||
cerr << get_fileline() << ": error: The $signed() function "
|
||||
<< "takes exactly one(1) argument." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -412,7 +412,7 @@ NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope, int expr_w
|
|||
/* add $unsigned to match $signed */
|
||||
if (strcmp(peek_tail_name(path_), "$unsigned") == 0) {
|
||||
if ((parms_.count() != 1) || (parms_[0] == 0)) {
|
||||
cerr << get_line() << ": error: The $unsigned() function "
|
||||
cerr << get_fileline() << ": error: The $unsigned() function "
|
||||
<< "takes exactly one(1) argument." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -435,14 +435,14 @@ NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope, int expr_w
|
|||
if ((strcmp(peek_tail_name(path_), "$sizeof") == 0)
|
||||
|| (strcmp(peek_tail_name(path_), "$bits") == 0)) {
|
||||
if ((parms_.count() != 1) || (parms_[0] == 0)) {
|
||||
cerr << get_line() << ": error: The $bits() function "
|
||||
cerr << get_fileline() << ": error: The $bits() function "
|
||||
<< "takes exactly one(1) argument." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(peek_tail_name(path_), "$sizeof") == 0)
|
||||
cerr << get_line() << ": warning: $sizeof is deprecated."
|
||||
cerr << get_fileline() << ": warning: $sizeof is deprecated."
|
||||
<< " Use $bits() instead." << endl;
|
||||
|
||||
PExpr*expr = parms_[0];
|
||||
|
|
@ -471,7 +471,7 @@ NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope, int expr_w
|
|||
evaluated. */
|
||||
if (strcmp(peek_tail_name(path_), "$is_signed") == 0) {
|
||||
if ((parms_.count() != 1) || (parms_[0] == 0)) {
|
||||
cerr << get_line() << ": error: The $is_signed() function "
|
||||
cerr << get_fileline() << ": error: The $is_signed() function "
|
||||
<< "takes exactly one(1) argument." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -541,10 +541,10 @@ NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope, int expr_w
|
|||
}
|
||||
|
||||
if (missing_parms > 0) {
|
||||
cerr << get_line() << ": error: The function "
|
||||
cerr << get_fileline() << ": error: The function "
|
||||
<< peek_tail_name(path_)
|
||||
<< " has been called with empty parameters." << endl;
|
||||
cerr << get_line() << ": : Verilog doesn't allow "
|
||||
cerr << get_fileline() << ": : Verilog doesn't allow "
|
||||
<< "passing empty parameters to functions." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -560,7 +560,7 @@ NetExpr* PECallFunction::elaborate_expr(Design*des, NetScope*scope,
|
|||
|
||||
NetFuncDef*def = des->find_function(scope, path_);
|
||||
if (def == 0) {
|
||||
cerr << get_line() << ": error: No function " << path_ <<
|
||||
cerr << get_fileline() << ": error: No function " << path_ <<
|
||||
" in this context (" << scope_path(scope) << ")." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -593,7 +593,7 @@ NetExpr* PECallFunction::elaborate_expr(Design*des, NetScope*scope,
|
|||
int argwid = def->port(idx)->vector_width();
|
||||
parms[idx] = elab_and_eval(des, scope, tmp, argwid);
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug:"
|
||||
cerr << get_fileline() << ": debug:"
|
||||
<< " function " << path_
|
||||
<< " arg " << (idx+1)
|
||||
<< " argwid=" << argwid
|
||||
|
|
@ -606,9 +606,9 @@ NetExpr* PECallFunction::elaborate_expr(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (missing_parms > 0) {
|
||||
cerr << get_line() << ": error: The function " << path_
|
||||
cerr << get_fileline() << ": error: The function " << path_
|
||||
<< " has been called with empty parameters." << endl;
|
||||
cerr << get_line() << ": : Verilog doesn't allow "
|
||||
cerr << get_fileline() << ": : Verilog doesn't allow "
|
||||
<< "passing empty parameters to functions." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -630,7 +630,7 @@ NetExpr* PECallFunction::elaborate_expr(Design*des, NetScope*scope,
|
|||
return func;
|
||||
}
|
||||
|
||||
cerr << get_line() << ": internal error: Unable to locate "
|
||||
cerr << get_fileline() << ": internal error: Unable to locate "
|
||||
"function return value for " << path_
|
||||
<< " in " << dscope->basename() << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -644,7 +644,7 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope,
|
|||
NetExpr* repeat = 0;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate expr=" << *this
|
||||
cerr << get_fileline() << ": debug: Elaborate expr=" << *this
|
||||
<< ", expr_wid=" << expr_wid << endl;
|
||||
}
|
||||
|
||||
|
|
@ -656,10 +656,10 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope,
|
|||
NetEConst*rep = dynamic_cast<NetEConst*>(tmp);
|
||||
|
||||
if (rep == 0) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
"concatenation repeat expression cannot be evaluated."
|
||||
<< endl;
|
||||
cerr << get_line() << ": : The expression is: "
|
||||
cerr << get_fileline() << ": : The expression is: "
|
||||
<< *tmp << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -676,7 +676,7 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope,
|
|||
/* Elaborate all the parameters and attach them to the concat node. */
|
||||
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
|
||||
if (parms_[idx] == 0) {
|
||||
cerr << get_line() << ": error: Missing expression "
|
||||
cerr << get_fileline() << ": error: Missing expression "
|
||||
<< (idx+1) << " of concatenation list." << endl;
|
||||
des->errors += 1;
|
||||
continue;
|
||||
|
|
@ -689,7 +689,7 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope,
|
|||
ex->set_line(*parms_[idx]);
|
||||
|
||||
if (! ex->has_width()) {
|
||||
cerr << ex->get_line() << ": error: operand of "
|
||||
cerr << ex->get_fileline() << ": error: operand of "
|
||||
<< "concatenation has indefinite width: "
|
||||
<< *ex << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -734,10 +734,10 @@ bool PEIdent::calculate_parts_(Design*des, NetScope*scope,
|
|||
NetExpr*lsb_ex = elab_and_eval(des, scope, index_tail.lsb, -1);
|
||||
NetEConst*lsb_c = dynamic_cast<NetEConst*>(lsb_ex);
|
||||
if (lsb_c == 0) {
|
||||
cerr << index_tail.lsb->get_line() << ": error: "
|
||||
cerr << index_tail.lsb->get_fileline() << ": error: "
|
||||
"Part select expressions must be constant."
|
||||
<< endl;
|
||||
cerr << index_tail.lsb->get_line() << ": : "
|
||||
cerr << index_tail.lsb->get_fileline() << ": : "
|
||||
"This lsb expression violates the rule: "
|
||||
<< *index_tail.lsb << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -747,10 +747,10 @@ bool PEIdent::calculate_parts_(Design*des, NetScope*scope,
|
|||
NetExpr*msb_ex = elab_and_eval(des, scope, index_tail.msb, -1);
|
||||
NetEConst*msb_c = dynamic_cast<NetEConst*>(msb_ex);
|
||||
if (msb_c == 0) {
|
||||
cerr << index_tail.msb->get_line() << ": error: "
|
||||
cerr << index_tail.msb->get_fileline() << ": error: "
|
||||
"Part select expressions must be constant."
|
||||
<< endl;
|
||||
cerr << index_tail.msb->get_line() << ": : This msb expression "
|
||||
cerr << index_tail.msb->get_fileline() << ": : This msb expression "
|
||||
"violates the rule: " << *index_tail.msb << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
|
|
@ -782,9 +782,9 @@ bool PEIdent::calculate_up_do_width_(Design*des, NetScope*scope,
|
|||
NetEConst*wid_c = dynamic_cast<NetEConst*>(wid_ex);
|
||||
|
||||
if (wid_c == 0) {
|
||||
cerr << get_line() << ": error: Indexed part width must be "
|
||||
cerr << get_fileline() << ": error: Indexed part width must be "
|
||||
<< "constant. Expression in question is..." << endl;
|
||||
cerr << get_line() << ": : " << *wid_ex << endl;
|
||||
cerr << get_fileline() << ": : " << *wid_ex << endl;
|
||||
des->errors += 1;
|
||||
flag = false;
|
||||
}
|
||||
|
|
@ -894,7 +894,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
|
|||
&& scope->genvar_tmp.str()
|
||||
&& strcmp(peek_tail_name(path_), scope->genvar_tmp) == 0) {
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: " << path_
|
||||
cerr << get_fileline() << ": debug: " << path_
|
||||
<< " is genvar with value " << scope->genvar_tmp_val
|
||||
<< "." << endl;
|
||||
verinum val (scope->genvar_tmp_val);
|
||||
|
|
@ -929,7 +929,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
|
|||
tmp->set_line(*this);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: " << path_
|
||||
cerr << get_fileline() << ": debug: " << path_
|
||||
<< " is a specparam" << endl;
|
||||
return tmp;
|
||||
}
|
||||
|
|
@ -941,7 +941,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
|
|||
|
||||
if (! sys_task_arg) {
|
||||
// I cannot interpret this identifier. Error message.
|
||||
cerr << get_line() << ": error: Unable to bind wire/reg/memory "
|
||||
cerr << get_fileline() << ": error: Unable to bind wire/reg/memory "
|
||||
"`" << path_ << "' in `" << scope_path(scope) << "'" << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -957,7 +957,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
|
|||
tmp->set_line(*this);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Found scope "
|
||||
cerr << get_fileline() << ": debug: Found scope "
|
||||
<< use_name << " in scope " << scope->basename()
|
||||
<< endl;
|
||||
|
||||
|
|
@ -975,12 +975,12 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
|
|||
tmp->set_line(*this);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Found scope "
|
||||
cerr << get_fileline() << ": debug: Found scope "
|
||||
<< nsc->basename()
|
||||
<< " path=" << path_ << endl;
|
||||
|
||||
if (! sys_task_arg) {
|
||||
cerr << get_line() << ": error: Scope name "
|
||||
cerr << get_fileline() << ": error: Scope name "
|
||||
<< nsc->basename() << " not allowed here." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -994,14 +994,14 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
|
|||
tmp->set_line(*this);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Found scope "
|
||||
cerr << get_fileline() << ": debug: Found scope "
|
||||
<< nsc->basename() << " in " << scope_path(scope) << endl;
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
// I cannot interpret this identifier. Error message.
|
||||
cerr << get_line() << ": error: Unable to bind wire/reg/memory "
|
||||
cerr << get_fileline() << ": error: Unable to bind wire/reg/memory "
|
||||
"`" << path_ << "' in `" << scope_path(scope) << "'" << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1041,7 +1041,7 @@ NetExpr* PEIdent::elaborate_expr_param(Design*des,
|
|||
verinum*lsn = index_tail.lsb->eval_const(des, scope);
|
||||
verinum*msn = index_tail.msb->eval_const(des, scope);
|
||||
if ((lsn == 0) || (msn == 0)) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
"Part select expressions must be "
|
||||
"constant expressions." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1051,7 +1051,7 @@ NetExpr* PEIdent::elaborate_expr_param(Design*des,
|
|||
long lsb = lsn->as_long();
|
||||
long msb = msn->as_long();
|
||||
if ((lsb < 0) || (msb < lsb)) {
|
||||
cerr << get_line() << ": error: invalid part "
|
||||
cerr << get_fileline() << ": error: invalid part "
|
||||
<< "select: " << path_
|
||||
<< "["<<msb<<":"<<lsb<<"]" << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1108,7 +1108,7 @@ NetExpr* PEIdent::elaborate_expr_param(Design*des,
|
|||
NetExpr*wid_ex = elab_and_eval(des, scope, index_tail.lsb, -1);
|
||||
NetEConst*wid_ec = dynamic_cast<NetEConst*> (wid_ex);
|
||||
if (wid_ec == 0) {
|
||||
cerr << index_tail.lsb->get_line() << ": error: "
|
||||
cerr << index_tail.lsb->get_fileline() << ": error: "
|
||||
<< "Second expression of indexed part select "
|
||||
<< "most be constant." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1239,7 +1239,7 @@ NetExpr* PEIdent::elaborate_expr_net_word_(Design*des, NetScope*scope,
|
|||
const name_component_t&name_tail = path_.back();
|
||||
|
||||
if (name_tail.index.empty() && !sys_task_arg) {
|
||||
cerr << get_line() << ": error: Array " << path()
|
||||
cerr << get_fileline() << ": error: Array " << path()
|
||||
<< " Needs an array index here." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1250,7 +1250,7 @@ NetExpr* PEIdent::elaborate_expr_net_word_(Design*des, NetScope*scope,
|
|||
index_front = name_tail.index.front();
|
||||
ivl_assert(*this, index_front.sel != index_component_t::SEL_NONE);
|
||||
if (index_front.sel != index_component_t::SEL_BIT) {
|
||||
cerr << get_line() << ": error: Array " << path_
|
||||
cerr << get_fileline() << ": error: Array " << path_
|
||||
<< " cannot be indexed by a range." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1342,7 +1342,7 @@ NetExpr* PEIdent::elaborate_expr_net_part_(Design*des, NetScope*scope,
|
|||
i.e., [1:0], [-4:6], etc. */
|
||||
unsigned long wid = 1 + ((msv>lsv)? (msv-lsv) : (lsv-msv));
|
||||
if (wid > net->vector_width()) {
|
||||
cerr << get_line() << ": error: part select ["
|
||||
cerr << get_fileline() << ": error: part select ["
|
||||
<< msv << ":" << lsv << "] out of range." << endl;
|
||||
des->errors += 1;
|
||||
//delete lsn;
|
||||
|
|
@ -1352,7 +1352,7 @@ NetExpr* PEIdent::elaborate_expr_net_part_(Design*des, NetScope*scope,
|
|||
ivl_assert(*this, wid <= net->vector_width());
|
||||
|
||||
if (net->sig()->sb_to_idx(msv) < net->sig()->sb_to_idx(lsv)) {
|
||||
cerr << get_line() << ": error: part select ["
|
||||
cerr << get_fileline() << ": error: part select ["
|
||||
<< msv << ":" << lsv << "] out of order." << endl;
|
||||
des->errors += 1;
|
||||
//delete lsn;
|
||||
|
|
@ -1362,7 +1362,7 @@ NetExpr* PEIdent::elaborate_expr_net_part_(Design*des, NetScope*scope,
|
|||
|
||||
|
||||
if (net->sig()->sb_to_idx(msv) >= net->vector_width()) {
|
||||
cerr << get_line() << ": error: part select ["
|
||||
cerr << get_fileline() << ": error: part select ["
|
||||
<< msv << ":" << lsv << "] out of range." << endl;
|
||||
des->errors += 1;
|
||||
//delete lsn;
|
||||
|
|
@ -1436,7 +1436,7 @@ NetExpr* PEIdent::elaborate_expr_net_idx_up_(Design*des, NetScope*scope,
|
|||
ss->set_line(*this);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate part "
|
||||
cerr << get_fileline() << ": debug: Elaborate part "
|
||||
<< "select base="<< *base << ", wid="<< wid << endl;
|
||||
}
|
||||
|
||||
|
|
@ -1490,7 +1490,7 @@ NetExpr* PEIdent::elaborate_expr_net_idx_do_(Design*des, NetScope*scope,
|
|||
ss->set_line(*this);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate part "
|
||||
cerr << get_fileline() << ": debug: Elaborate part "
|
||||
<< "select base="<< *base_adjusted << ", wid="<< wid << endl;
|
||||
}
|
||||
|
||||
|
|
@ -1524,11 +1524,11 @@ NetExpr* PEIdent::elaborate_expr_net_bit_(Design*des, NetScope*scope,
|
|||
NetEConst*tmp = new NetEConst(x);
|
||||
tmp->set_line(*this);
|
||||
|
||||
cerr << get_line() << ": warning: Bit select ["
|
||||
cerr << get_fileline() << ": warning: Bit select ["
|
||||
<< msv << "] out of range of vector "
|
||||
<< net->name() << "[" << net->sig()->msb()
|
||||
<< ":" << net->sig()->lsb() << "]." << endl;
|
||||
cerr << get_line() << ": : Replacing "
|
||||
cerr << get_fileline() << ": : Replacing "
|
||||
<< "expression with a constant 1'bx." << endl;
|
||||
delete ex;
|
||||
return tmp;
|
||||
|
|
@ -1696,7 +1696,7 @@ NetETernary*PETernary::elaborate_expr(Design*des, NetScope*scope,
|
|||
unsigned fal_wid = fal_->test_width(des, scope, 0, 0, flag);
|
||||
expr_wid = max(tru_wid, fal_wid);
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Self-sized ternary chooses wid="<< expr_wid
|
||||
<< " from " <<tru_wid
|
||||
<< " and " << fal_wid << endl;
|
||||
|
|
@ -1720,7 +1720,7 @@ NetETernary*PETernary::elaborate_expr(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (! test_ternary_operand_compat(tru->expr_type(), fal->expr_type())) {
|
||||
cerr << get_line() << ": error: Data types "
|
||||
cerr << get_fileline() << ": error: Data types "
|
||||
<< tru->expr_type() << " and "
|
||||
<< fal->expr_type() << " of ternary"
|
||||
<< " do not match." << endl;
|
||||
|
|
|
|||
41
elab_lval.cc
41
elab_lval.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000-2006 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: elab_lval.cc,v 1.44 2007/06/02 03:42:12 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -73,7 +70,7 @@ NetAssign_* PExpr::elaborate_lval(Design*des,
|
|||
{
|
||||
NetNet*ll = 0;
|
||||
if (ll == 0) {
|
||||
cerr << get_line() << ": Assignment l-value too complex."
|
||||
cerr << get_fileline() << ": Assignment l-value too complex."
|
||||
<< endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -100,7 +97,7 @@ NetAssign_* PEConcat::elaborate_lval(Design*des,
|
|||
bool is_force) const
|
||||
{
|
||||
if (repeat_) {
|
||||
cerr << get_line() << ": error: Repeat concatenations make "
|
||||
cerr << get_fileline() << ": error: Repeat concatenations make "
|
||||
"no sense in l-value expressions. I refuse." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -111,7 +108,7 @@ NetAssign_* PEConcat::elaborate_lval(Design*des,
|
|||
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
|
||||
|
||||
if (parms_[idx] == 0) {
|
||||
cerr << get_line() << ": error: Empty expressions "
|
||||
cerr << get_fileline() << ": error: Empty expressions "
|
||||
<< "not allowed in concatenations." << endl;
|
||||
des->errors += 1;
|
||||
continue;
|
||||
|
|
@ -155,7 +152,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
|
|||
|
||||
symbol_search(des, scope, path_, reg, par, eve);
|
||||
if (reg == 0) {
|
||||
cerr << get_line() << ": error: Could not find variable ``"
|
||||
cerr << get_fileline() << ": error: Could not find variable ``"
|
||||
<< path_ << "'' in ``" << scope_path(scope) <<
|
||||
"''" << endl;
|
||||
|
||||
|
|
@ -174,7 +171,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
|
|||
// This is the special case that the l-value is an entire
|
||||
// memory. This is, in fact, an error.
|
||||
if (reg->array_dimensions() > 0 && name_tail.index.empty()) {
|
||||
cerr << get_line() << ": error: Cannot assign to array "
|
||||
cerr << get_fileline() << ": error: Cannot assign to array "
|
||||
<< path_ << ". Did you forget a word index?" << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -200,10 +197,10 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
|
|||
it is a register. Wires are not allows in this context,
|
||||
unless this is the l-value of a force. */
|
||||
if ((reg->type() != NetNet::REG) && !is_force) {
|
||||
cerr << get_line() << ": error: " << path_ <<
|
||||
cerr << get_fileline() << ": error: " << path_ <<
|
||||
" is not a valid l-value in " << scope_path(scope) <<
|
||||
"." << endl;
|
||||
cerr << reg->get_line() << ": : " << path_ <<
|
||||
cerr << reg->get_fileline() << ": : " << path_ <<
|
||||
" is declared here as " << reg->type() << "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -280,7 +277,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
|
|||
unsigned wid = moff - loff + 1;
|
||||
|
||||
if (moff < loff) {
|
||||
cerr << get_line() << ": error: part select "
|
||||
cerr << get_fileline() << ": error: part select "
|
||||
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
|
||||
<< " is reversed." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -293,7 +290,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
|
|||
variable pins. */
|
||||
|
||||
if ((wid + loff) > reg->vector_width()) {
|
||||
cerr << get_line() << ": error: bit/part select "
|
||||
cerr << get_fileline() << ": error: bit/part select "
|
||||
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
|
||||
<< " is out of range." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -317,7 +314,7 @@ NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des,
|
|||
|
||||
const index_component_t&index_head = name_tail.index.front();
|
||||
if (index_head.sel == index_component_t::SEL_PART) {
|
||||
cerr << get_line() << ": error: cannot perform a part "
|
||||
cerr << get_fileline() << ": error: cannot perform a part "
|
||||
<< "select on array " << reg->name() << "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -343,7 +340,7 @@ NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des,
|
|||
lv->set_word(word);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Set array word=" << *word << endl;
|
||||
cerr << get_fileline() << ": debug: Set array word=" << *word << endl;
|
||||
|
||||
// Test for the case that the index is a constant, and is out
|
||||
// of bounds. The "word" expression is the word index already
|
||||
|
|
@ -353,7 +350,7 @@ NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des,
|
|||
verinum word_val = word_const->value();
|
||||
long index = word_val.as_long();
|
||||
if (index < 0 || index >= reg->array_count()) {
|
||||
cerr << get_line() << ": warning: Constant array index "
|
||||
cerr << get_fileline() << ": warning: Constant array index "
|
||||
<< (index + reg->array_first())
|
||||
<< " is out of range for array "
|
||||
<< reg->name() << "." << endl;
|
||||
|
|
@ -403,7 +400,7 @@ bool PEIdent::elaborate_lval_net_part_(Design*des,
|
|||
unsigned wid = moff - loff + 1;
|
||||
|
||||
if (moff < loff) {
|
||||
cerr << get_line() << ": error: part select "
|
||||
cerr << get_fileline() << ": error: part select "
|
||||
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
|
||||
<< " is reversed." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -416,7 +413,7 @@ bool PEIdent::elaborate_lval_net_part_(Design*des,
|
|||
variable pins. */
|
||||
|
||||
if ((wid + loff) > reg->vector_width()) {
|
||||
cerr << get_line() << ": error: bit/part select "
|
||||
cerr << get_fileline() << ": error: bit/part select "
|
||||
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
|
||||
<< " is out of range." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -445,10 +442,10 @@ bool PEIdent::elaborate_lval_net_idx_(Design*des,
|
|||
assert(reg);
|
||||
|
||||
if (reg->type() != NetNet::REG) {
|
||||
cerr << get_line() << ": error: " << path_ <<
|
||||
cerr << get_fileline() << ": error: " << path_ <<
|
||||
" is not a reg/integer/time in " << scope_path(scope) <<
|
||||
"." << endl;
|
||||
cerr << reg->get_line() << ": : " << path_ <<
|
||||
cerr << reg->get_fileline() << ": : " << path_ <<
|
||||
" is declared here as " << reg->type() << "." << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
|
|
@ -470,7 +467,7 @@ bool PEIdent::elaborate_lval_net_idx_(Design*des,
|
|||
}
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Set part select width="
|
||||
cerr << get_fileline() << ": debug: Set part select width="
|
||||
<< wid << ", base=" << *base << endl;
|
||||
|
||||
lv->set_part(base, wid);
|
||||
|
|
@ -480,7 +477,7 @@ bool PEIdent::elaborate_lval_net_idx_(Design*des,
|
|||
|
||||
NetAssign_* PENumber::elaborate_lval(Design*des, NetScope*, bool) const
|
||||
{
|
||||
cerr << get_line() << ": error: Constant values not allowed "
|
||||
cerr << get_fileline() << ": error: Constant values not allowed "
|
||||
<< "in l-value expressions." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
|
|||
206
elab_net.cc
206
elab_net.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: elab_net.cc,v 1.207 2007/06/12 04:05:45 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -46,7 +43,7 @@ NetNet* PExpr::elaborate_net(Design*des, NetScope*scope, unsigned,
|
|||
Link::strength_t,
|
||||
Link::strength_t) const
|
||||
{
|
||||
cerr << get_line() << ": error: Unable to elaborate `"
|
||||
cerr << get_fileline() << ": error: Unable to elaborate `"
|
||||
<< *this << "' as gates." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -102,13 +99,13 @@ NetNet* PEBinary::elaborate_net(Design*des, NetScope*scope,
|
|||
NetNet*lsig = left_->elaborate_net(des, scope, width, 0, 0, 0),
|
||||
*rsig = right_->elaborate_net(des, scope, width, 0, 0, 0);
|
||||
if (lsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
left_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
}
|
||||
if (rsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
right_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
|
|
@ -144,7 +141,7 @@ NetNet* PEBinary::elaborate_net(Design*des, NetScope*scope,
|
|||
assert(0);
|
||||
break;
|
||||
default:
|
||||
cerr << get_line() << ": internal error: unsupported"
|
||||
cerr << get_fileline() << ": internal error: unsupported"
|
||||
" combinational operator (" << op_ << ")." << endl;
|
||||
des->errors += 1;
|
||||
osig = 0;
|
||||
|
|
@ -169,13 +166,13 @@ NetNet* PEBinary::elaborate_net_add_(Design*des, NetScope*scope,
|
|||
NetNet*lsig = left_->elaborate_net(des, scope, lwidth, 0, 0, 0),
|
||||
*rsig = right_->elaborate_net(des, scope, lwidth, 0, 0, 0);
|
||||
if (lsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
left_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
}
|
||||
if (rsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
right_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
|
|
@ -228,9 +225,9 @@ NetNet* PEBinary::elaborate_net_add_(Design*des, NetScope*scope,
|
|||
|
||||
// Check that the argument types match.
|
||||
if (lsig->data_type() != rsig->data_type()) {
|
||||
cerr << get_line() << ": error: Arguments of add/sub "
|
||||
cerr << get_fileline() << ": error: Arguments of add/sub "
|
||||
<< "have different data types." << endl;
|
||||
cerr << get_line() << ": : Left argument is "
|
||||
cerr << get_fileline() << ": : Left argument is "
|
||||
<< lsig->data_type() << ", right argument is "
|
||||
<< rsig->data_type() << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -243,7 +240,7 @@ NetNet* PEBinary::elaborate_net_add_(Design*des, NetScope*scope,
|
|||
osig->set_signed(expr_signed);
|
||||
osig->local_flag(true);
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate NetAddSub "
|
||||
cerr << get_fileline() << ": debug: Elaborate NetAddSub "
|
||||
<< "width=" << width << " lwidth=" << lwidth
|
||||
<< endl;
|
||||
}
|
||||
|
|
@ -284,13 +281,13 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
|
|||
NetNet*lsig = left_->elaborate_net(des, scope, width, 0, 0, 0),
|
||||
*rsig = right_->elaborate_net(des, scope, width, 0, 0, 0);
|
||||
if (lsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
left_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
}
|
||||
if (rsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
right_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
|
|
@ -302,7 +299,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
|
|||
rsig = pad_to_width(des, rsig, lsig->vector_width());
|
||||
|
||||
if (lsig->data_type() != rsig->data_type()) {
|
||||
cerr << get_line() << ": error: Types of "
|
||||
cerr << get_fileline() << ": error: Types of "
|
||||
<< "operands of " << op_ << " do not match: "
|
||||
<< lsig->data_type() << " vs. " << rsig->data_type()
|
||||
<< endl;
|
||||
|
|
@ -311,7 +308,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (lsig->vector_width() != rsig->vector_width()) {
|
||||
cerr << get_line() << ": internal error: lsig width ("
|
||||
cerr << get_fileline() << ": internal error: lsig width ("
|
||||
<< lsig->vector_width() << ") != rsig pin width ("
|
||||
<< rsig->vector_width() << ")." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -396,7 +393,7 @@ static NetNet* compare_eq_constant(Design*des, NetScope*scope,
|
|||
delete ogate;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << lsig->get_line() << ": debug: "
|
||||
cerr << lsig->get_fileline() << ": debug: "
|
||||
<< "Equality replaced with "
|
||||
<< oval << " due to high pad mismatch"
|
||||
<< endl;
|
||||
|
|
@ -427,7 +424,7 @@ static NetNet* compare_eq_constant(Design*des, NetScope*scope,
|
|||
type = op_code == 'e'? NetUReduce::NOR : NetUReduce::OR;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << lsig->get_line() << ": debug: "
|
||||
cerr << lsig->get_fileline() << ": debug: "
|
||||
<< "Replace net==" << val << " equality with "
|
||||
<< zeros << "-input reduction [N]OR gate." << endl;
|
||||
|
||||
|
|
@ -435,7 +432,7 @@ static NetNet* compare_eq_constant(Design*des, NetScope*scope,
|
|||
type = op_code == 'e'? NetUReduce::AND : NetUReduce::NAND;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << lsig->get_line() << ": debug: "
|
||||
cerr << lsig->get_fileline() << ": debug: "
|
||||
<< "Replace net==" << val << " equality with "
|
||||
<< ones << "-input reduction AND gate." << endl;
|
||||
}
|
||||
|
|
@ -457,7 +454,7 @@ static NetNet* compare_eq_constant(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << lsig->get_line() << ": debug: "
|
||||
cerr << lsig->get_fileline() << ": debug: "
|
||||
<< "Give up trying to replace net==" << val
|
||||
<< " equality with "
|
||||
<< ones << "-input AND and "
|
||||
|
|
@ -485,7 +482,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
|
|||
into synthesized nets. */
|
||||
NetExpr*lexp = elab_and_eval(des, scope, left_, lwidth);
|
||||
if (lexp == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
left_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
|
|
@ -493,7 +490,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
|
|||
|
||||
NetExpr*rexp = elab_and_eval(des, scope, right_, lwidth);
|
||||
if (rexp == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
right_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
|
|
@ -521,7 +518,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
|
|||
|
||||
lsig = lexp->synthesize(des);
|
||||
if (lsig == 0) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
"Cannot elaborate net for " << *lexp << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -645,7 +642,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate net == gate."
|
||||
cerr << get_fileline() << ": debug: Elaborate net == gate."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
|
@ -734,9 +731,9 @@ NetNet* PEBinary::elaborate_net_div_(Design*des, NetScope*scope,
|
|||
|
||||
/* The arguments of a divide must have the same type. */
|
||||
if (lsig->data_type() != rsig->data_type()) {
|
||||
cerr << get_line() << ": error: Arguments of divide "
|
||||
cerr << get_fileline() << ": error: Arguments of divide "
|
||||
<< "have different data types." << endl;
|
||||
cerr << get_line() << ": : Left argument is "
|
||||
cerr << get_fileline() << ": : Left argument is "
|
||||
<< lsig->data_type() << ", right argument is "
|
||||
<< rsig->data_type() << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -792,9 +789,9 @@ NetNet* PEBinary::elaborate_net_mod_(Design*des, NetScope*scope,
|
|||
|
||||
/* The arguments of a modulus must have the same type. */
|
||||
if (lsig->data_type() != rsig->data_type()) {
|
||||
cerr << get_line() << ": error: Arguments of modulus "
|
||||
cerr << get_fileline() << ": error: Arguments of modulus "
|
||||
<< "have different data types." << endl;
|
||||
cerr << get_line() << ": : Left argument is "
|
||||
cerr << get_fileline() << ": : Left argument is "
|
||||
<< lsig->data_type() << ", right argument is "
|
||||
<< rsig->data_type() << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -841,13 +838,13 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope,
|
|||
NetNet*lsig = left_->elaborate_net(des, scope, 0, 0, 0, 0);
|
||||
NetNet*rsig = right_->elaborate_net(des, scope, 0, 0, 0, 0);
|
||||
if (lsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
left_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
}
|
||||
if (rsig == 0) {
|
||||
cerr << get_line() << ": error: Cannot elaborate ";
|
||||
cerr << get_fileline() << ": error: Cannot elaborate ";
|
||||
right_->dump(cerr);
|
||||
cerr << endl;
|
||||
return 0;
|
||||
|
|
@ -972,9 +969,9 @@ NetNet* PEBinary::elaborate_net_mul_(Design*des, NetScope*scope,
|
|||
|
||||
/* The arguments of a divide must have the same type. */
|
||||
if (lsig->data_type() != rsig->data_type()) {
|
||||
cerr << get_line() << ": error: Arguments of multiply "
|
||||
cerr << get_fileline() << ": error: Arguments of multiply "
|
||||
<< "have different data types." << endl;
|
||||
cerr << get_line() << ": : Left argument is "
|
||||
cerr << get_fileline() << ": : Left argument is "
|
||||
<< lsig->data_type() << ", right argument is "
|
||||
<< rsig->data_type() << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1148,7 +1145,7 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, NetScope*scope,
|
|||
des->add_node(part);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate shift "
|
||||
cerr << get_fileline() << ": debug: Elaborate shift "
|
||||
<< "(" << op_ << ") as concatenation of "
|
||||
<< pad_width << " zeros with " << part_width
|
||||
<< " bits of expression." << endl;
|
||||
|
|
@ -1204,7 +1201,7 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, NetScope*scope,
|
|||
connect(rsig->pin(0), gate->pin_Distance());
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Elaborate LPM_SHIFT: width="<<gate->width()
|
||||
<< ", swidth="<< gate->width_dist() << endl;
|
||||
}
|
||||
|
|
@ -1239,7 +1236,7 @@ NetNet* PECallFunction::elaborate_net(Design*des, NetScope*scope,
|
|||
/* Look up the function definition. */
|
||||
NetFuncDef*def = des->find_function(scope, path_);
|
||||
if (def == 0) {
|
||||
cerr << get_line() << ": error: No function " << path_ <<
|
||||
cerr << get_fileline() << ": error: No function " << path_ <<
|
||||
" in this context (" << scope_path(scope) << ")." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1269,7 +1266,7 @@ NetNet* PECallFunction::elaborate_net(Design*des, NetScope*scope,
|
|||
Link::STRONG,
|
||||
Link::STRONG);
|
||||
if (tmp == 0) {
|
||||
cerr << get_line() << ": error: Unable to elaborate "
|
||||
cerr << get_fileline() << ": error: Unable to elaborate "
|
||||
<< "port " << idx << " of call to " << path_ <<
|
||||
"." << endl;
|
||||
errors += 1;
|
||||
|
|
@ -1328,7 +1325,7 @@ NetNet* PECallFunction::elaborate_net_sfunc_(Design*des, NetScope*scope,
|
|||
$signed did not exist. */
|
||||
if (strcmp(name, "$signed") == 0) {
|
||||
if ((parms_.count() != 1) || (parms_[0] == 0)) {
|
||||
cerr << get_line() << ": error: The $signed() function "
|
||||
cerr << get_fileline() << ": error: The $signed() function "
|
||||
<< "takes exactly one(1) argument." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1344,7 +1341,7 @@ NetNet* PECallFunction::elaborate_net_sfunc_(Design*des, NetScope*scope,
|
|||
/* handle $unsigned like $signed */
|
||||
if (strcmp(name, "$unsigned") == 0) {
|
||||
if ((parms_.count() != 1) || (parms_[0] == 0)) {
|
||||
cerr << get_line() << ": error: The $unsigned() function "
|
||||
cerr << get_fileline() << ": error: The $unsigned() function "
|
||||
<< "takes exactly one(1) argument." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1360,7 +1357,7 @@ NetNet* PECallFunction::elaborate_net_sfunc_(Design*des, NetScope*scope,
|
|||
const struct sfunc_return_type*def = lookup_sys_func(name);
|
||||
|
||||
if (def == 0) {
|
||||
cerr << get_line() << ": error: System function "
|
||||
cerr << get_fileline() << ": error: System function "
|
||||
<< peek_tail_name(path_) << " not defined." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1384,7 +1381,7 @@ NetNet* PECallFunction::elaborate_net_sfunc_(Design*des, NetScope*scope,
|
|||
0, 0, 0,
|
||||
Link::STRONG, Link::STRONG);
|
||||
if (tmp == 0) {
|
||||
cerr << get_line() << ": error: Unable to elaborate "
|
||||
cerr << get_fileline() << ": error: Unable to elaborate "
|
||||
<< "port " << idx << " of call to " << path_ <<
|
||||
"." << endl;
|
||||
continue;
|
||||
|
|
@ -1422,7 +1419,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
NetEConst*erep = dynamic_cast<NetEConst*>(etmp);
|
||||
|
||||
if (erep == 0) {
|
||||
cerr << get_line() << ": error: Unable to "
|
||||
cerr << get_fileline() << ": error: Unable to "
|
||||
<< "evaluate constant repeat expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1432,7 +1429,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
delete etmp;
|
||||
|
||||
if (repeat == 0) {
|
||||
cerr << get_line() << ": error: Concatenation epeat "
|
||||
cerr << get_fileline() << ": error: Concatenation epeat "
|
||||
"may not be 0."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1441,7 +1438,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() <<": debug: PEConcat concat repeat="
|
||||
cerr << get_fileline() <<": debug: PEConcat concat repeat="
|
||||
<< repeat << "." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -1455,7 +1452,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) {
|
||||
|
||||
if (parms_[idx] == 0) {
|
||||
cerr << get_line() << ": error: Empty expressions "
|
||||
cerr << get_fileline() << ": error: Empty expressions "
|
||||
<< "not allowed in concatenations." << endl;
|
||||
errors += 1;
|
||||
continue;
|
||||
|
|
@ -1468,7 +1465,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
|
||||
if (PENumber*tmp = dynamic_cast<PENumber*>(parms_[idx])) {
|
||||
if (tmp->value().has_len() == false) {
|
||||
cerr << get_line() << ": error: Number "
|
||||
cerr << get_fileline() << ": error: Number "
|
||||
<< tmp->value() << " with indefinite size"
|
||||
<< " in concatenation." << endl;
|
||||
errors += 1;
|
||||
|
|
@ -1496,7 +1493,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() <<": debug: PEConcat concat collected "
|
||||
cerr << get_fileline() <<": debug: PEConcat concat collected "
|
||||
<< "width=" << vector_width << ", repeat=" << repeat
|
||||
<< " of " << nets.count() << " expressions." << endl;
|
||||
}
|
||||
|
|
@ -1583,7 +1580,7 @@ NetNet* PEIdent::elaborate_net_bitmux_(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Create NetPartSelect "
|
||||
cerr << get_fileline() << ": debug: Create NetPartSelect "
|
||||
<< "using signal " << sel->name() << " as selector"
|
||||
<< endl;
|
||||
}
|
||||
|
|
@ -1655,7 +1652,7 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
|
|||
is hierarchical. We can't just create a name in another
|
||||
scope, it's just not allowed. */
|
||||
if (sig == 0 && path_.size() != 1) {
|
||||
cerr << get_line() << ": error: The hierarchical name "
|
||||
cerr << get_fileline() << ": error: The hierarchical name "
|
||||
<< path_ << " is undefined in "
|
||||
<< scope_path(scope) << "." << endl;
|
||||
|
||||
|
|
@ -1665,7 +1662,7 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
|
|||
list<hname_t> stmp_path = eval_scope_path(des, scope, tmp_path);
|
||||
NetScope*tmp_scope = des->find_scope(scope, stmp_path);
|
||||
if (tmp_scope == 0) {
|
||||
cerr << get_line() << ": : I can't even find "
|
||||
cerr << get_fileline() << ": : I can't even find "
|
||||
<< "the scope " << tmp_path << "." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -1681,13 +1678,13 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
|
|||
sig->data_type(IVL_VT_LOGIC);
|
||||
|
||||
if (error_implicit || (nettype == NetNet::NONE)) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< scope_path(scope) << "." << name_tail.name
|
||||
<< " not defined in this scope." << endl;
|
||||
des->errors += 1;
|
||||
|
||||
} else if (warn_implicit) {
|
||||
cerr << get_line() << ": warning: implicit "
|
||||
cerr << get_fileline() << ": warning: implicit "
|
||||
"definition of wire " << scope_path(scope)
|
||||
<< "." << name_tail.name << "." << endl;
|
||||
}
|
||||
|
|
@ -1698,7 +1695,7 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
|
|||
/* Handle the case that this is an array elsewhere. */
|
||||
if (sig->array_dimensions() > 0) {
|
||||
if (name_tail.index.size() == 0) {
|
||||
cerr << get_line() << ": error: Array " << sig->name()
|
||||
cerr << get_fileline() << ": error: Array " << sig->name()
|
||||
<< " cannot be used here without an index." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1734,7 +1731,7 @@ NetNet* PEIdent::process_select_(Design*des, NetScope*scope,
|
|||
return sig;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate part select"
|
||||
cerr << get_fileline() << ": debug: Elaborate part select"
|
||||
<< " of word from " << sig->name() << "[base="<<lidx
|
||||
<< " wid=" << part_count << "]" << endl;
|
||||
}
|
||||
|
|
@ -1799,7 +1796,7 @@ NetNet* PEIdent::elaborate_net_net_(Design*des, NetScope*scope,
|
|||
|
||||
if (part_count != sig->vector_width()) {
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate part select "
|
||||
cerr << get_fileline() << ": debug: Elaborate part select "
|
||||
<< sig->name() << "[base="<<lidx
|
||||
<< " wid=" << part_count << "]" << endl;
|
||||
}
|
||||
|
|
@ -1919,7 +1916,7 @@ NetNet* PEIdent::elaborate_net_array_(Design*des, NetScope*scope,
|
|||
ivl_assert(*this, index_head.lsb == 0);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: elaborate array "
|
||||
cerr << get_fileline() << ": debug: elaborate array "
|
||||
<< name_tail.name << " with index " << index_head << endl;
|
||||
|
||||
NetExpr*index_ex = elab_and_eval(des, scope, index_head.msb, -1);
|
||||
|
|
@ -1951,7 +1948,7 @@ NetNet* PEIdent::elaborate_net_array_(Design*des, NetScope*scope,
|
|||
index = sig->array_index_to_address(index);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate word "
|
||||
cerr << get_fileline() << ": debug: Elaborate word "
|
||||
<< index << " of " << sig->name() << endl;
|
||||
}
|
||||
|
||||
|
|
@ -2008,7 +2005,7 @@ NetNet* PEIdent::elaborate_net_array_(Design*des, NetScope*scope,
|
|||
break;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate part select"
|
||||
cerr << get_fileline() << ": debug: Elaborate part select"
|
||||
<< " of word from " << sig->name() << "[base="<<lidx
|
||||
<< " wid=" << part_count << "]" << endl;
|
||||
}
|
||||
|
|
@ -2052,7 +2049,7 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
unsigned errors = 0;
|
||||
|
||||
if (repeat_) {
|
||||
cerr << get_line() << ": sorry: I do not know how to"
|
||||
cerr << get_fileline() << ": sorry: I do not know how to"
|
||||
" elaborate repeat concatenation nets." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2061,13 +2058,13 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) {
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate subexpression "
|
||||
cerr << get_fileline() << ": debug: Elaborate subexpression "
|
||||
<< idx << " of " << nets.count() << " l-values: "
|
||||
<< *parms_[idx] << endl;
|
||||
}
|
||||
|
||||
if (parms_[idx] == 0) {
|
||||
cerr << get_line() << ": error: Empty expressions "
|
||||
cerr << get_fileline() << ": error: Empty expressions "
|
||||
<< "not allowed in concatenations." << endl;
|
||||
errors += 1;
|
||||
continue;
|
||||
|
|
@ -2110,7 +2107,7 @@ NetNet* PEConcat::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
osig->set_line(*this);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Generating part selects "
|
||||
cerr << get_fileline() << ": debug: Generating part selects "
|
||||
<< "to connect input l-value to subexpressions."
|
||||
<< endl;
|
||||
}
|
||||
|
|
@ -2161,7 +2158,7 @@ NetNet* PEFNumber::elaborate_net(Design*des, NetScope*scope,
|
|||
Link::strength_t drive1) const
|
||||
{
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate real literal node, "
|
||||
cerr << get_fileline() << ": debug: Elaborate real literal node, "
|
||||
<< "value=" << value() << "." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -2192,13 +2189,13 @@ NetNet* PEIdent::make_implicit_net_(Design*des, NetScope*scope) const
|
|||
sig->data_type(IVL_VT_LOGIC);
|
||||
|
||||
if (warn_implicit) {
|
||||
cerr << get_line() << ": warning: implicit "
|
||||
cerr << get_fileline() << ": warning: implicit "
|
||||
"definition of wire logic " << scope_path(scope)
|
||||
<< "." << peek_tail_name(path_) << "." << endl;
|
||||
}
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Net " << path_
|
||||
cerr << get_fileline() << ": error: Net " << path_
|
||||
<< " is not defined in this context." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2233,7 +2230,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
|||
|
||||
switch (index_tail.sel) {
|
||||
default:
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Unexpected sel_ value = " << index_tail.sel << endl;
|
||||
ivl_assert(*this, 0);
|
||||
break;
|
||||
|
|
@ -2243,7 +2240,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
|||
NetExpr*tmp_ex = elab_and_eval(des, scope, index_tail.msb, -1);
|
||||
NetEConst*tmp = dynamic_cast<NetEConst*>(tmp_ex);
|
||||
if (!tmp) {
|
||||
cerr << get_line() << ": error: indexed part select of "
|
||||
cerr << get_fileline() << ": error: indexed part select of "
|
||||
<< sig->name()
|
||||
<< " must be a constant in this context." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -2278,36 +2275,15 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
|||
|
||||
long msb, lsb;
|
||||
bool flag = calculate_parts_(des, scope, msb, lsb);
|
||||
#if 0
|
||||
NetExpr*tmp_ex = elab_and_eval(des, scope, index_tail.msb, -1);
|
||||
NetEConst*tmp = dynamic_cast<NetEConst*>(tmp_ex);
|
||||
assert(tmp);
|
||||
|
||||
long midx_val = tmp->value().as_long();
|
||||
midx = sig->sb_to_idx(midx_val);
|
||||
delete tmp_ex;
|
||||
|
||||
tmp_ex = elab_and_eval(des, scope, index_tail.lsb, -1);
|
||||
tmp = dynamic_cast<NetEConst*>(tmp_ex);
|
||||
if (tmp == 0) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
<< "lsb expression is not constant?: "
|
||||
<< *tmp_ex << ", " << *index_tail.lsb << endl;
|
||||
}
|
||||
assert(tmp);
|
||||
|
||||
long lidx_val = tmp->value().as_long();
|
||||
lidx = sig->sb_to_idx(lidx_val);
|
||||
delete tmp_ex;
|
||||
#endif
|
||||
lidx = sig->sb_to_idx(lsb);
|
||||
midx = sig->sb_to_idx(msb);
|
||||
/* Detect reversed indices of a part select. */
|
||||
if (lidx > midx) {
|
||||
cerr << get_line() << ": error: Part select "
|
||||
cerr << get_fileline() << ": error: Part select "
|
||||
<< sig->name() << "[" << msb << ":"
|
||||
<< lsb << "] indices reversed." << endl;
|
||||
cerr << get_line() << ": : Did you mean "
|
||||
cerr << get_fileline() << ": : Did you mean "
|
||||
<< sig->name() << "[" << lsb << ":"
|
||||
<< msb << "]?" << endl;
|
||||
unsigned tmp = midx;
|
||||
|
|
@ -2318,7 +2294,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
|||
|
||||
/* Detect a part select out of range. */
|
||||
if (midx >= sig->vector_width()) {
|
||||
cerr << get_line() << ": error: Part select "
|
||||
cerr << get_fileline() << ": error: Part select "
|
||||
<< sig->name() << "[" << msb << ":"
|
||||
<< lsb << "] out of range." << endl;
|
||||
midx = sig->vector_width() - 1;
|
||||
|
|
@ -2332,12 +2308,12 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
|||
if (name_tail.index.size() > sig->array_dimensions()) {
|
||||
verinum*mval = index_tail.msb->eval_const(des, scope);
|
||||
if (mval == 0) {
|
||||
cerr << get_line() << ": error: Index of " << path_ <<
|
||||
cerr << get_fileline() << ": error: Index of " << path_ <<
|
||||
" needs to be constant in this context." <<
|
||||
endl;
|
||||
cerr << get_line() << ": : Index expression is: "
|
||||
cerr << get_fileline() << ": : Index expression is: "
|
||||
<< *index_tail.msb << endl;
|
||||
cerr << get_line() << ": : Context scope is: "
|
||||
cerr << get_fileline() << ": : Context scope is: "
|
||||
<< scope_path(scope) << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
|
|
@ -2346,7 +2322,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
|||
|
||||
midx = sig->sb_to_idx(mval->as_long());
|
||||
if (midx >= sig->vector_width()) {
|
||||
cerr << get_line() << ": error: Index " << sig->name()
|
||||
cerr << get_fileline() << ": error: Index " << sig->name()
|
||||
<< "[" << mval->as_long() << "] out of range."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -2355,7 +2331,7 @@ bool PEIdent::eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
|
|||
lidx = midx;
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Bit select " << path_ << endl;
|
||||
ivl_assert(*this, 0);
|
||||
midx = sig->vector_width() - 1;
|
||||
|
|
@ -2385,7 +2361,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
symbol_search(des, scope, path_, sig, par, eve);
|
||||
|
||||
if (eve != 0) {
|
||||
cerr << get_line() << ": error: named events (" << path_
|
||||
cerr << get_fileline() << ": error: named events (" << path_
|
||||
<< ") cannot be l-values in continuous "
|
||||
<< "assignments." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -2401,7 +2377,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
return 0;
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Net " << path_
|
||||
cerr << get_fileline() << ": error: Net " << path_
|
||||
<< " is not defined in this context." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2412,7 +2388,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
|
||||
/* Don't allow registers as assign l-values. */
|
||||
if (sig->type() == NetNet::REG) {
|
||||
cerr << get_line() << ": error: reg " << sig->name()
|
||||
cerr << get_fileline() << ": error: reg " << sig->name()
|
||||
<< "; cannot be driven by primitives"
|
||||
<< " or continuous assignment." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -2420,9 +2396,9 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (sig->port_type() == NetNet::PINPUT) {
|
||||
cerr << get_line() << ": warning: L-value ``"
|
||||
cerr << get_fileline() << ": warning: L-value ``"
|
||||
<< sig->name() << "'' is also an input port." << endl;
|
||||
cerr << sig->get_line() << ": warning: input "
|
||||
cerr << sig->get_fileline() << ": warning: input "
|
||||
<< sig->name() << "; is coerced to inout." << endl;
|
||||
sig->port_type(NetNet::PINOUT);
|
||||
}
|
||||
|
|
@ -2437,7 +2413,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
if (sig->array_dimensions() > 0) {
|
||||
|
||||
if (name_tail.index.empty()) {
|
||||
cerr << get_line() << ": error: array " << sig->name()
|
||||
cerr << get_fileline() << ": error: array " << sig->name()
|
||||
<< " must be used with an index." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2445,7 +2421,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
|
||||
const index_component_t&index_head = name_tail.index.front();
|
||||
if (index_head.sel == index_component_t::SEL_PART) {
|
||||
cerr << get_line() << ": error: cannot perform a part "
|
||||
cerr << get_fileline() << ": error: cannot perform a part "
|
||||
<< "select on array " << sig->name() << "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2455,7 +2431,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
NetExpr*tmp_ex = elab_and_eval(des, scope, index_head.msb, -1);
|
||||
NetEConst*tmp = dynamic_cast<NetEConst*>(tmp_ex);
|
||||
if (!tmp) {
|
||||
cerr << get_line() << ": error: array " << sig->name()
|
||||
cerr << get_fileline() << ": error: array " << sig->name()
|
||||
<< " index must be a constant in this context." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2466,7 +2442,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
delete tmp_ex;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Use [" << widx << "]"
|
||||
cerr << get_fileline() << ": debug: Use [" << widx << "]"
|
||||
<< " to index l-value array." << endl;
|
||||
|
||||
/* The array has a part/bit select at the end. */
|
||||
|
|
@ -2509,7 +2485,7 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope,
|
|||
part_dir = NetPartSelect::PV;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Elaborate lnet part select "
|
||||
<< sig->name()
|
||||
<< "[base=" << lidx
|
||||
|
|
@ -2561,7 +2537,7 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
|||
{
|
||||
NetNet*sig = des->find_signal(scope, path_);
|
||||
if (sig == 0) {
|
||||
cerr << get_line() << ": error: no wire/reg " << path_
|
||||
cerr << get_fileline() << ": error: no wire/reg " << path_
|
||||
<< " in module " << scope_path(scope) << "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2580,9 +2556,9 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
|||
matching input/output/inout declaration. */
|
||||
|
||||
case NetNet::NOT_A_PORT:
|
||||
cerr << get_line() << ": error: signal " << path_ << " in"
|
||||
cerr << get_fileline() << ": error: signal " << path_ << " in"
|
||||
<< " module " << scope_path(scope) << " is not a port." << endl;
|
||||
cerr << get_line() << ": : Are you missing an input/"
|
||||
cerr << get_fileline() << ": : Are you missing an input/"
|
||||
<< "output/inout declaration?" << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2592,7 +2568,7 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
|||
function should turn it into an output.... I think. */
|
||||
|
||||
case NetNet::PIMPLICIT:
|
||||
cerr << get_line() << ": internal error: signal " << path_
|
||||
cerr << get_fileline() << ": internal error: signal " << path_
|
||||
<< " in module " << scope_path(scope) << " is left as "
|
||||
<< "port type PIMPLICIT." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -2613,7 +2589,7 @@ NetNet* PEIdent::elaborate_port(Design*des, NetScope*scope) const
|
|||
unsigned swid = midx - lidx + 1;
|
||||
|
||||
if (swid < sig->vector_width()) {
|
||||
cerr << get_line() << ": XXXX: Forgot to implement part select"
|
||||
cerr << get_fileline() << ": XXXX: Forgot to implement part select"
|
||||
<< " of signal port." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -2683,7 +2659,7 @@ NetNet* PENumber::elaborate_net(Design*des, NetScope*scope,
|
|||
numbers. */
|
||||
|
||||
if (must_be_self_determined_flag) {
|
||||
cerr << get_line() << ": error: No idea how wide to make "
|
||||
cerr << get_fileline() << ": error: No idea how wide to make "
|
||||
<< "the unsized constant " << *value_ << "." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -2806,9 +2782,9 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
|
|||
ivl_variable_type_t expr_type = tru_sig->data_type();
|
||||
|
||||
if (tru_sig->data_type() != fal_sig->data_type()) {
|
||||
cerr << get_line() << ": error: True and False clauses of"
|
||||
cerr << get_fileline() << ": error: True and False clauses of"
|
||||
<< " ternary expression have differnt types." << endl;
|
||||
cerr << get_line() << ": : True clause is "
|
||||
cerr << get_fileline() << ": : True clause is "
|
||||
<< tru_sig->data_type() << ", false clause is "
|
||||
<< fal_sig->data_type() << "." << endl;
|
||||
|
||||
|
|
@ -2816,7 +2792,7 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
|
|||
expr_type = IVL_VT_NO_TYPE;
|
||||
|
||||
} else if (expr_type == IVL_VT_NO_TYPE) {
|
||||
cerr << get_line() << ": internal error: True and false "
|
||||
cerr << get_fileline() << ": internal error: True and false "
|
||||
<< "clauses of ternary both have NO TYPE." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -2998,7 +2974,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
|
|||
connect(sig->pin(0), con->pin(0));
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Replace expression "
|
||||
cerr << get_fileline() << ": debug: Replace expression "
|
||||
<< *this << " with constant " << tmp << "."<<endl;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: elab_pexpr.cc,v 1.28 2007/06/02 03:42:12 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -32,7 +29,7 @@
|
|||
|
||||
NetExpr*PExpr::elaborate_pexpr(Design*des, NetScope*sc) const
|
||||
{
|
||||
cerr << get_line() << ": error: invalid parameter expression: "
|
||||
cerr << get_fileline() << ": error: invalid parameter expression: "
|
||||
<< *this << endl;
|
||||
des->errors += 1;
|
||||
|
||||
|
|
@ -76,7 +73,7 @@ NetEConcat* PEConcat::elaborate_pexpr(Design*des, NetScope*scope) const
|
|||
if (repeat_) {
|
||||
repeat = repeat_->elaborate_pexpr(des, scope);
|
||||
if (repeat == 0) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
"concatenation repeat expression cannot be evaluated."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -106,7 +103,7 @@ NetEConcat* PEConcat::elaborate_pexpr(Design*des, NetScope*scope) const
|
|||
the width check for later. */
|
||||
|
||||
} else if (! ex->has_width()) {
|
||||
cerr << ex->get_line() << ": error: operand of "
|
||||
cerr << ex->get_fileline() << ": error: operand of "
|
||||
<< "concatenation has indefinite width: "
|
||||
<< *ex << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -158,7 +155,7 @@ NetExpr*PEIdent::elaborate_pexpr(Design*des, NetScope*scope) const
|
|||
ivl_assert(*this, pscope);
|
||||
}
|
||||
if (ex == 0) {
|
||||
cerr << get_line() << ": error: identifier ``" << name_tail.name <<
|
||||
cerr << get_fileline() << ": error: identifier ``" << name_tail.name <<
|
||||
"'' is not a parameter in "<< scope_path(scope)<< "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -177,7 +174,7 @@ NetExpr*PEIdent::elaborate_pexpr(Design*des, NetScope*scope) const
|
|||
break;
|
||||
default:
|
||||
case index_component_t::SEL_PART:
|
||||
cerr << get_line() << ": sorry: Cannot part select "
|
||||
cerr << get_fileline() << ": sorry: Cannot part select "
|
||||
"bits of parameters." << endl;
|
||||
des->errors += 1;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000-2003 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: elab_scope.cc,v 1.46 2007/06/02 03:42:12 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
# include "compiler.h"
|
||||
|
|
@ -50,7 +47,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
|||
const replace_t&replacements) const
|
||||
{
|
||||
if (debug_scopes) {
|
||||
cerr << get_line() << ": debug: Elaborate scope "
|
||||
cerr << get_fileline() << ": debug: Elaborate scope "
|
||||
<< scope_path(scope) << "." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -147,20 +144,20 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
|||
|
||||
NetExpr*val = (*cur).second;
|
||||
if (val == 0) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Missing expression in parameter replacement for "
|
||||
<< (*cur).first;
|
||||
}
|
||||
assert(val);
|
||||
if (debug_scopes) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Replace " << (*cur).first
|
||||
<< " with expression " << *val
|
||||
<< " from " << val->get_line() << "." << endl;
|
||||
<< " from " << val->get_fileline() << "." << endl;
|
||||
}
|
||||
bool flag = scope->replace_parameter((*cur).first, val);
|
||||
if (! flag) {
|
||||
cerr << val->get_line() << ": warning: parameter "
|
||||
cerr << val->get_fileline() << ": warning: parameter "
|
||||
<< (*cur).first << " not found in "
|
||||
<< scope_path(scope) << "." << endl;
|
||||
}
|
||||
|
|
@ -251,7 +248,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
|||
|
||||
hname_t use_name( (*cur).first );
|
||||
if (scope->child(use_name)) {
|
||||
cerr << get_line() << ": error: task/scope name "
|
||||
cerr << get_fileline() << ": error: task/scope name "
|
||||
<< use_name << " already used in this context."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -274,7 +271,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
|||
|
||||
hname_t use_name( (*cur).first );
|
||||
if (scope->child(use_name)) {
|
||||
cerr << get_line() << ": error: function/scope name "
|
||||
cerr << get_fileline() << ": error: function/scope name "
|
||||
<< use_name << " already used in this context."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -336,7 +333,7 @@ bool PGenerate::generate_scope(Design*des, NetScope*container)
|
|||
return generate_scope_condit_(des, container, true);
|
||||
|
||||
default:
|
||||
cerr << get_line() << ": sorry: Generate of this sort"
|
||||
cerr << get_fileline() << ": sorry: Generate of this sort"
|
||||
<< " is not supported yet!" << endl;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -356,7 +353,7 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
|
|||
NetExpr*init_ex = elab_and_eval(des, container, loop_init, -1);
|
||||
NetEConst*init = dynamic_cast<NetEConst*> (init_ex);
|
||||
if (init == 0) {
|
||||
cerr << get_line() << ": error: Cannot evaluate genvar"
|
||||
cerr << get_fileline() << ": error: Cannot evaluate genvar"
|
||||
<< " init expression: " << *loop_init << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
|
|
@ -366,7 +363,7 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
|
|||
delete init_ex;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: genvar init = " << genvar << endl;
|
||||
cerr << get_fileline() << ": debug: genvar init = " << genvar << endl;
|
||||
|
||||
container->genvar_tmp = loop_index;
|
||||
container->genvar_tmp_val = genvar;
|
||||
|
|
@ -381,14 +378,14 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
|
|||
// Verilog standard.
|
||||
hname_t use_name (scope_name, genvar);
|
||||
if (container->child(use_name)) {
|
||||
cerr << get_line() << ": error: block/scope name "
|
||||
cerr << get_fileline() << ": error: block/scope name "
|
||||
<< use_name << " already used in this context."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
}
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Create generated scope " << use_name << endl;
|
||||
|
||||
NetScope*scope = new NetScope(container, use_name,
|
||||
|
|
@ -407,7 +404,7 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
|
|||
scope->set_localparam(loop_index, gp);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Create implicit localparam "
|
||||
<< loop_index << " = " << genvar_verinum << endl;
|
||||
}
|
||||
|
|
@ -419,7 +416,7 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
|
|||
NetEConst*step = dynamic_cast<NetEConst*>(step_ex);
|
||||
assert(step);
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: genvar step from "
|
||||
cerr << get_fileline() << ": debug: genvar step from "
|
||||
<< genvar << " to " << step->value().as_long() << endl;
|
||||
|
||||
genvar = step->value().as_long();
|
||||
|
|
@ -449,7 +446,7 @@ bool PGenerate::generate_scope_condit_(Design*des, NetScope*container, bool else
|
|||
if (test->value().as_long() == 0 && !else_flag
|
||||
|| test->value().as_long() != 0 && else_flag) {
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Generate condition "
|
||||
cerr << get_fileline() << ": debug: Generate condition "
|
||||
<< (else_flag? "(else)" : "(if)")
|
||||
<< " value=" << test->value() << ": skip generation"
|
||||
<< endl;
|
||||
|
|
@ -459,14 +456,14 @@ bool PGenerate::generate_scope_condit_(Design*des, NetScope*container, bool else
|
|||
|
||||
hname_t use_name (scope_name);
|
||||
if (container->child(use_name)) {
|
||||
cerr << get_line() << ": error: block/scope name "
|
||||
cerr << get_fileline() << ": error: block/scope name "
|
||||
<< scope_name << " already used in this context."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
}
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Generate condition "
|
||||
cerr << get_fileline() << ": debug: Generate condition "
|
||||
<< (else_flag? "(else)" : "(if)")
|
||||
<< " value=" << test->value() << ": Generate scope="
|
||||
<< use_name << endl;
|
||||
|
|
@ -506,7 +503,7 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope)
|
|||
void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
||||
{
|
||||
if (get_name() == "") {
|
||||
cerr << get_line() << ": error: Instantiation of module "
|
||||
cerr << get_fileline() << ": error: Instantiation of module "
|
||||
<< mod->mod_name() << " requires an instance name." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -520,7 +517,7 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
|||
// it.
|
||||
|
||||
if (sc->child(hname_t(get_name()))) {
|
||||
cerr << get_line() << ": error: Instance/Scope name " <<
|
||||
cerr << get_fileline() << ": error: Instance/Scope name " <<
|
||||
get_name() << " already used in this context." <<
|
||||
endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -538,10 +535,10 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
|||
if (strcmp(mod->mod_name(), scn->module_name()) != 0)
|
||||
continue;
|
||||
|
||||
cerr << get_line() << ": error: You cannot instantiate "
|
||||
cerr << get_fileline() << ": error: You cannot instantiate "
|
||||
<< "module " << mod->mod_name() << " within itself." << endl;
|
||||
|
||||
cerr << get_line() << ": : The offending instance is "
|
||||
cerr << get_fileline() << ": : The offending instance is "
|
||||
<< scope_path(sc) << "." << get_name() << " within "
|
||||
<< scope_path(scn) << "." << endl;
|
||||
|
||||
|
|
@ -576,7 +573,7 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
|||
|
||||
NetScope::scope_vec_t instances (instance_count);
|
||||
if (debug_scopes) {
|
||||
cerr << get_line() << ": debug: Create " << instance_count
|
||||
cerr << get_fileline() << ": debug: Create " << instance_count
|
||||
<< " instances of " << get_name()
|
||||
<< "." << endl;
|
||||
}
|
||||
|
|
@ -599,7 +596,7 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
|||
}
|
||||
|
||||
if (debug_scopes) {
|
||||
cerr << get_line() << ": debug: Module instance " << use_name
|
||||
cerr << get_fileline() << ": debug: Module instance " << use_name
|
||||
<< " becomes child of " << scope_path(sc)
|
||||
<< "." << endl;
|
||||
}
|
||||
|
|
@ -743,7 +740,7 @@ void PBlock::elaborate_scope(Design*des, NetScope*scope) const
|
|||
if (name_ != 0) {
|
||||
hname_t use_name(name_);
|
||||
if (scope->child(use_name)) {
|
||||
cerr << get_line() << ": error: block/scope name "
|
||||
cerr << get_fileline() << ": error: block/scope name "
|
||||
<< use_name << " already used in this context."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
|
|||
91
elab_sig.cc
91
elab_sig.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000-2004 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: elab_sig.cc,v 1.52 2007/06/02 03:42:12 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -72,24 +69,6 @@ static bool signal_is_in_port(const svector<Module::port_t*>&ports,
|
|||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static NetNet*find_signal_in_scope(NetScope*scope, const hname_t&path)
|
||||
{
|
||||
NetScope*cur = scope;
|
||||
unsigned idx = 0;
|
||||
|
||||
while (path.peek_name(idx+1)) {
|
||||
cur = cur->child(path.peek_name(idx));
|
||||
if (cur == 0)
|
||||
return 0;
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return cur->find_signal(path.peek_name(idx));
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
||||
{
|
||||
bool flag = true;
|
||||
|
|
@ -107,7 +86,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
|||
wt = wires_.find(port_path);
|
||||
|
||||
if (wt == wires_.end()) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "Port " << pp->expr[cc]->path() << " ("
|
||||
<< (idx+1) << ") of module " << name_
|
||||
<< " is not declared within module." << endl;
|
||||
|
|
@ -116,7 +95,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
|||
}
|
||||
|
||||
if ((*wt).second->get_port_type() == NetNet::NOT_A_PORT) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "Port " << pp->expr[cc]->path() << " ("
|
||||
<< (idx+1) << ") of module " << name_
|
||||
<< " has no direction declaration."
|
||||
|
|
@ -144,7 +123,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
|||
|
||||
if (! signal_is_in_port(ports, sig)) {
|
||||
|
||||
cerr << cur->get_line() << ": error: Signal "
|
||||
cerr << cur->get_fileline() << ": error: Signal "
|
||||
<< sig->name() << " has a declared direction "
|
||||
<< "but is not a port." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -159,7 +138,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
|||
&& (sig->port_type() == NetNet::PINPUT)
|
||||
&& (sig->type() == NetNet::REG)) {
|
||||
|
||||
cerr << cur->get_line() << ": error: "
|
||||
cerr << cur->get_fileline() << ": error: "
|
||||
<< cur->path() << " in module "
|
||||
<< scope->module_name()
|
||||
<< " declared as input and as a reg type." << endl;
|
||||
|
|
@ -170,7 +149,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
|||
&& (sig->port_type() == NetNet::PINOUT)
|
||||
&& (sig->type() == NetNet::REG)) {
|
||||
|
||||
cerr << cur->get_line() << ": error: "
|
||||
cerr << cur->get_fileline() << ": error: "
|
||||
<< cur->path() << " in module "
|
||||
<< scope->module_name()
|
||||
<< " declared as inout and as a reg type." << endl;
|
||||
|
|
@ -212,7 +191,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
|||
hname_t use_name ( (*cur).first );
|
||||
NetScope*fscope = scope->child(use_name);
|
||||
if (scope == 0) {
|
||||
cerr << (*cur).second->get_line() << ": internal error: "
|
||||
cerr << (*cur).second->get_fileline() << ": internal error: "
|
||||
<< "Child scope for function " << (*cur).first
|
||||
<< " missing in " << scope_path(scope) << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -253,7 +232,7 @@ bool PGModule::elaborate_sig_mod_(Design*des, NetScope*scope,
|
|||
assert(my_scope);
|
||||
|
||||
if (my_scope->parent() != scope) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Instance " << scope_path(my_scope)
|
||||
<< " is in parent " << scope_path(my_scope->parent())
|
||||
<< " instead of " << scope_path(scope)
|
||||
|
|
@ -283,7 +262,7 @@ bool PGenerate::elaborate_sig(Design*des, NetScope*container) const
|
|||
continue;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Elaborate nets in "
|
||||
cerr << get_fileline() << ": debug: Elaborate nets in "
|
||||
<< "scope " << scope_path(*cur)
|
||||
<< " in generate " << id_number << endl;
|
||||
flag = elaborate_sig_(des, *cur) & flag;
|
||||
|
|
@ -303,7 +282,7 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const
|
|||
PWire*cur = (*wt).second;
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Elaborate PWire "
|
||||
cerr << get_fileline() << ": debug: Elaborate PWire "
|
||||
<< cur->path() << " in scope " << scope_path(scope) << endl;
|
||||
|
||||
cur->elaborate_sig(des, scope);
|
||||
|
|
@ -340,9 +319,9 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
|||
fails this test, print an error message. Keep going so we
|
||||
can find more errors. */
|
||||
if (ports_ == 0) {
|
||||
cerr << get_line() << ": error: Function " << fname
|
||||
cerr << get_fileline() << ": error: Function " << fname
|
||||
<< " has no ports." << endl;
|
||||
cerr << get_line() << ": : Functions must have"
|
||||
cerr << get_fileline() << ": : Functions must have"
|
||||
<< " at least one input port." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -367,7 +346,7 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
|||
if (NetEConst*tmp = dynamic_cast<NetEConst*>(me)) {
|
||||
mnum = tmp->value().as_long();
|
||||
} else {
|
||||
cerr << me->get_line() << ": error: "
|
||||
cerr << me->get_fileline() << ": error: "
|
||||
"Unable to evaluate constant expression "
|
||||
<< *me << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -376,7 +355,7 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
|||
if (NetEConst*tmp = dynamic_cast<NetEConst*>(le)) {
|
||||
lnum = tmp->value().as_long();
|
||||
} else {
|
||||
cerr << le->get_line() << ": error: "
|
||||
cerr << le->get_fileline() << ": error: "
|
||||
"Unable to evaluate constant expression "
|
||||
<< *le << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -422,7 +401,7 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
|||
break;
|
||||
|
||||
default:
|
||||
cerr << get_line() << ": internal error: I don't know how "
|
||||
cerr << get_fileline() << ": internal error: I don't know how "
|
||||
<< "to deal with return type of function "
|
||||
<< scope->basename() << "." << endl;
|
||||
}
|
||||
|
|
@ -443,7 +422,7 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
|||
perm_string ppath = peek_head_name(path);
|
||||
|
||||
if (ppath != scope->basename()) {
|
||||
cerr << get_line() << ": internal error: function "
|
||||
cerr << get_fileline() << ": internal error: function "
|
||||
<< "port " << (*ports_)[idx]->path()
|
||||
<< " has wrong name for function "
|
||||
<< scope_path(scope) << "." << endl;
|
||||
|
|
@ -452,11 +431,11 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
|||
|
||||
NetNet*tmp = scope->find_signal(pname);
|
||||
if (tmp == 0) {
|
||||
cerr << get_line() << ": internal error: function "
|
||||
cerr << get_fileline() << ": internal error: function "
|
||||
<< scope_path(scope) << " is missing port "
|
||||
<< pname << "." << endl;
|
||||
scope->dump(cerr);
|
||||
cerr << get_line() << ": Continuing..." << endl;
|
||||
cerr << get_fileline() << ": Continuing..." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
||||
|
|
@ -509,7 +488,7 @@ void PTask::elaborate_sig(Design*des, NetScope*scope) const
|
|||
NetNet*tmp = scope->find_signal(port_name);
|
||||
|
||||
if (tmp == 0) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Could not find port " << port_name
|
||||
<< " in scope " << scope_path(scope) << endl;
|
||||
scope->dump(cerr);
|
||||
|
|
@ -549,7 +528,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
scope = scope->child( hname_t(cur.name) );
|
||||
|
||||
if (scope == 0) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Bad scope component for name "
|
||||
<< hname_ << endl;
|
||||
assert(scope);
|
||||
|
|
@ -575,7 +554,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
NetExpr*texpr = elab_and_eval(des, scope, port_msb_, -1);
|
||||
|
||||
if (! eval_as_long(pmsb, texpr)) {
|
||||
cerr << port_msb_->get_line() << ": error: "
|
||||
cerr << port_msb_->get_fileline() << ": error: "
|
||||
"Unable to evaluate MSB constant expression ``"
|
||||
<< *port_msb_ << "''." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -587,7 +566,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
texpr = elab_and_eval(des, scope, port_lsb_, -1);
|
||||
|
||||
if (! eval_as_long(plsb, texpr)) {
|
||||
cerr << port_lsb_->get_line() << ": error: "
|
||||
cerr << port_lsb_->get_fileline() << ": error: "
|
||||
"Unable to evaluate LSB constant expression ``"
|
||||
<< *port_lsb_ << "''." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -607,7 +586,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
NetExpr*texpr = elab_and_eval(des, scope, net_msb_, -1);
|
||||
|
||||
if (! eval_as_long(nmsb, texpr)) {
|
||||
cerr << net_msb_->get_line() << ": error: "
|
||||
cerr << net_msb_->get_fileline() << ": error: "
|
||||
"Unable to evaluate MSB constant expression ``"
|
||||
<< *net_msb_ << "''." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -619,7 +598,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
texpr = elab_and_eval(des, scope, net_lsb_, -1);
|
||||
|
||||
if (! eval_as_long(nlsb, texpr)) {
|
||||
cerr << net_lsb_->get_line() << ": error: "
|
||||
cerr << net_lsb_->get_fileline() << ": error: "
|
||||
"Unable to evaluate LSB constant expression ``"
|
||||
<< *net_lsb_ << "''." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -638,12 +617,12 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
/* Scalar port with a vector net/etc. definition */
|
||||
if (port_msb_ == 0) {
|
||||
if (!gn_io_range_error_flag) {
|
||||
cerr << get_line()
|
||||
cerr << get_fileline()
|
||||
<< ": warning: Scalar port ``" << hname_
|
||||
<< "'' has a vectored net declaration ["
|
||||
<< nmsb << ":" << nlsb << "]." << endl;
|
||||
} else {
|
||||
cerr << get_line()
|
||||
cerr << get_fileline()
|
||||
<< ": error: Scalar port ``" << hname_
|
||||
<< "'' has a vectored net declaration ["
|
||||
<< nmsb << ":" << nlsb << "]." << endl;
|
||||
|
|
@ -654,22 +633,22 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
|
||||
/* Vectored port with a scalar net/etc. definition */
|
||||
if (net_msb_ == 0) {
|
||||
cerr << port_msb_->get_line()
|
||||
cerr << port_msb_->get_fileline()
|
||||
<< ": error: Vectored port ``"
|
||||
<< hname_ << "'' [" << pmsb << ":" << plsb
|
||||
<< "] has a scalar net declaration at "
|
||||
<< get_line() << "." << endl;
|
||||
<< get_fileline() << "." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Both vectored, but they have different ranges. */
|
||||
if (port_msb_ != 0 && net_msb_ != 0) {
|
||||
cerr << port_msb_->get_line()
|
||||
cerr << port_msb_->get_fileline()
|
||||
<< ": error: Vectored port ``"
|
||||
<< hname_ << "'' [" << pmsb << ":" << plsb
|
||||
<< "] has a net declaration [" << nmsb << ":"
|
||||
<< nlsb << "] at " << net_msb_->get_line()
|
||||
<< nlsb << "] at " << net_msb_->get_fileline()
|
||||
<< " that does not match." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -705,7 +684,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
NetExpr*rexp = elab_and_eval(des, scope, ridx_, -1);
|
||||
|
||||
if ((lexp == 0) || (rexp == 0)) {
|
||||
cerr << get_line() << ": internal error: There is "
|
||||
cerr << get_fileline() << ": internal error: There is "
|
||||
<< "a problem evaluating indices for ``"
|
||||
<< hname_ << "''." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -716,7 +695,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
NetEConst*rcon = dynamic_cast<NetEConst*> (rexp);
|
||||
|
||||
if ((lcon == 0) || (rcon == 0)) {
|
||||
cerr << get_line() << ": internal error: The indices "
|
||||
cerr << get_fileline() << ": internal error: The indices "
|
||||
<< "are not constant for array ``"
|
||||
<< hname_ << "''." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -762,7 +741,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
wtype = NetNet::WIRE;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Generate a SUPPLY pulldown for the "
|
||||
<< "supply0 net." << endl;
|
||||
}
|
||||
|
|
@ -770,7 +749,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
|
||||
perm_string name = peek_tail_name(hname_);
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Create signal "
|
||||
cerr << get_fileline() << ": debug: Create signal "
|
||||
<< wtype << " ["<<msb<<":"<<lsb<<"] " << name
|
||||
<< " in scope " << scope_path(scope) << endl;
|
||||
}
|
||||
|
|
@ -784,7 +763,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
|
|||
if (use_data_type == IVL_VT_NO_TYPE) {
|
||||
use_data_type = IVL_VT_LOGIC;
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Signal " << name
|
||||
<< " in scope " << scope_path(scope)
|
||||
<< " defaults to data type " << use_data_type << endl;
|
||||
|
|
|
|||
256
elaborate.cc
256
elaborate.cc
|
|
@ -104,7 +104,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
assert(lval->pin_count() == 1);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: PGassign: elaborated l-value"
|
||||
cerr << get_fileline() << ": debug: PGassign: elaborated l-value"
|
||||
<< " width=" << lval->vector_width()
|
||||
<< ", type=" << lval->data_type() << endl;
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
ivl_assert(*this, rid);
|
||||
if (rid->pin_count() != 1) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Invalid elaborate_net results here:" << endl;
|
||||
rid->dump_net(cerr, 4);
|
||||
des->errors += 1;
|
||||
|
|
@ -179,7 +179,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
unsigned use_width = lval->vector_width();
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: PGassign "
|
||||
cerr << get_fileline() << ": debug: PGassign "
|
||||
<< "Generate sign-extend node." << endl;
|
||||
|
||||
rid = pad_to_width_signed(des, rid, use_width);
|
||||
|
|
@ -187,7 +187,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
} else {
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: PGAssign "
|
||||
cerr << get_fileline() << ": debug: PGAssign "
|
||||
<< "Unsigned pad r-value from "
|
||||
<< cnt << " bits to "
|
||||
<< lval->vector_width() << " bits." << endl;
|
||||
|
|
@ -200,7 +200,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
} else if (cnt < rid->vector_width()) {
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: PGAssign "
|
||||
cerr << get_fileline() << ": debug: PGAssign "
|
||||
<< "Truncate r-value from "
|
||||
<< cnt << " bits to "
|
||||
<< lval->vector_width() << " bits." << endl;
|
||||
|
|
@ -218,7 +218,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
extend it, whichever makes sense. */
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: PGAssign: "
|
||||
cerr << get_fileline() << ": debug: PGAssign: "
|
||||
<< "Connect lval directly to "
|
||||
<< id->path() << endl;
|
||||
}
|
||||
|
|
@ -230,7 +230,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
strength and delays. */
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: PGAssign: "
|
||||
cerr << get_fileline() << ": debug: PGAssign: "
|
||||
<< "Connect lval to " << id->path()
|
||||
<< " through bufz. delay=(";
|
||||
if (rise_time)
|
||||
|
|
@ -272,14 +272,14 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
rise_time, fall_time, decay_time,
|
||||
drive0, drive1);
|
||||
if (rval == 0) {
|
||||
cerr << get_line() << ": error: Unable to elaborate r-value: "
|
||||
cerr << get_fileline() << ": error: Unable to elaborate r-value: "
|
||||
<< *pin(1) << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: PGAssign: elaborated r-value"
|
||||
cerr << get_fileline() << ": debug: PGAssign: elaborated r-value"
|
||||
<< " width="<<rval->vector_width()
|
||||
<< ", type="<< rval->data_type() << endl;
|
||||
}
|
||||
|
|
@ -342,14 +342,14 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
NetEConst*lsb_con = dynamic_cast<NetEConst*>(lsb_exp);
|
||||
|
||||
if (msb_con == 0) {
|
||||
cerr << get_line() << ": error: Unable to evaluate "
|
||||
cerr << get_fileline() << ": error: Unable to evaluate "
|
||||
"expression " << *msb_ << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (lsb_con == 0) {
|
||||
cerr << get_line() << ": error: Unable to evaluate "
|
||||
cerr << get_fileline() << ": error: Unable to evaluate "
|
||||
"expression " << *lsb_ << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -370,7 +370,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
high = msb.as_long();
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: PGBuiltin: Make arrray "
|
||||
cerr << get_fileline() << ": debug: PGBuiltin: Make arrray "
|
||||
<< "[" << high << ":" << low << "]"
|
||||
<< " of " << count << " gates for " << name << endl;
|
||||
}
|
||||
|
|
@ -381,7 +381,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
wide gate instead of an array of gates. */
|
||||
|
||||
if (pin(0) == 0) {
|
||||
cerr << get_line() << ": error: Logic gate port "
|
||||
cerr << get_fileline() << ": error: Logic gate port "
|
||||
"expressions are not optional." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -397,7 +397,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
count = 1;
|
||||
|
||||
if (debug_elaborate && instance_width != 1)
|
||||
cerr << get_line() << ": debug: PGBuiltin: "
|
||||
cerr << get_fileline() << ": debug: PGBuiltin: "
|
||||
"Collapsed gate array into single wide "
|
||||
"(" << instance_width << ") instance." << endl;
|
||||
}
|
||||
|
|
@ -444,7 +444,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
switch (type()) {
|
||||
case AND:
|
||||
if (pin_count() < 2) {
|
||||
cerr << get_line() << ": error: the AND "
|
||||
cerr << get_fileline() << ": error: the AND "
|
||||
"primitive must have an input." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -454,7 +454,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case BUF:
|
||||
if (pin_count() > 2) {
|
||||
cerr << get_line() << ": sorry: multiple output BUF "
|
||||
cerr << get_fileline() << ": sorry: multiple output BUF "
|
||||
"primitives are not supported." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -464,7 +464,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case BUFIF0:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the BUFIF0 "
|
||||
cerr << get_fileline() << ": error: the BUFIF0 "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -474,7 +474,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case BUFIF1:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the BUFIF1 "
|
||||
cerr << get_fileline() << ": error: the BUFIF1 "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -484,7 +484,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case CMOS:
|
||||
if (pin_count() != 4) {
|
||||
cerr << get_line() << ": error: the CMOS "
|
||||
cerr << get_fileline() << ": error: the CMOS "
|
||||
"primitive must have four arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -494,7 +494,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case NAND:
|
||||
if (pin_count() < 2) {
|
||||
cerr << get_line() << ": error: the NAND "
|
||||
cerr << get_fileline() << ": error: the NAND "
|
||||
"primitive must have an input." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -504,7 +504,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case NMOS:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the NMOS "
|
||||
cerr << get_fileline() << ": error: the NMOS "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -514,7 +514,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case NOR:
|
||||
if (pin_count() < 2) {
|
||||
cerr << get_line() << ": error: the NOR "
|
||||
cerr << get_fileline() << ": error: the NOR "
|
||||
"primitive must have an input." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -524,7 +524,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case NOT:
|
||||
if (pin_count() > 2) {
|
||||
cerr << get_line() << ": sorry: multiple output NOT "
|
||||
cerr << get_fileline() << ": sorry: multiple output NOT "
|
||||
"primitives are not supported." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -534,7 +534,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case NOTIF0:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the NOTIF0 "
|
||||
cerr << get_fileline() << ": error: the NOTIF0 "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -544,7 +544,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case NOTIF1:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the NOTIF1 "
|
||||
cerr << get_fileline() << ": error: the NOTIF1 "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -554,7 +554,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case OR:
|
||||
if (pin_count() < 2) {
|
||||
cerr << get_line() << ": error: the OR "
|
||||
cerr << get_fileline() << ": error: the OR "
|
||||
"primitive must have an input." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -564,7 +564,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case RCMOS:
|
||||
if (pin_count() != 4) {
|
||||
cerr << get_line() << ": error: the RCMOS "
|
||||
cerr << get_fileline() << ": error: the RCMOS "
|
||||
"primitive must have four arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -574,7 +574,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case RNMOS:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the RNMOS "
|
||||
cerr << get_fileline() << ": error: the RNMOS "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -584,7 +584,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case RPMOS:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the RPMOS "
|
||||
cerr << get_fileline() << ": error: the RPMOS "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -594,7 +594,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case PMOS:
|
||||
if (pin_count() != 3) {
|
||||
cerr << get_line() << ": error: the PMOS "
|
||||
cerr << get_fileline() << ": error: the PMOS "
|
||||
"primitive must have three arguments." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -604,7 +604,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case PULLDOWN:
|
||||
if (pin_count() > 1) {
|
||||
cerr << get_line() << ": sorry: multiple output PULLDOWN "
|
||||
cerr << get_fileline() << ": sorry: multiple output PULLDOWN "
|
||||
"primitives are not supported." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -615,7 +615,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case PULLUP:
|
||||
if (pin_count() > 1) {
|
||||
cerr << get_line() << ": sorry: multiple output PULLUP "
|
||||
cerr << get_fileline() << ": sorry: multiple output PULLUP "
|
||||
"primitives are not supported." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -625,7 +625,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case XNOR:
|
||||
if (pin_count() < 2) {
|
||||
cerr << get_line() << ": error: the XNOR "
|
||||
cerr << get_fileline() << ": error: the XNOR "
|
||||
"primitive must have an input." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -635,7 +635,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
break;
|
||||
case XOR:
|
||||
if (pin_count() < 2) {
|
||||
cerr << get_line() << ": error: the XOR "
|
||||
cerr << get_fileline() << ": error: the XOR "
|
||||
"primitive must have an input." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -644,7 +644,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
NetLogic::XOR, instance_width);
|
||||
break;
|
||||
default:
|
||||
cerr << get_line() << ": internal error: unhandled "
|
||||
cerr << get_fileline() << ": internal error: unhandled "
|
||||
"gate type." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -673,7 +673,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
|
||||
const PExpr*ex = pin(idx);
|
||||
if (ex == 0) {
|
||||
cerr << get_line() << ": error: Logic gate port "
|
||||
cerr << get_fileline() << ": error: Logic gate port "
|
||||
"expressions are not optional." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -713,7 +713,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
if (instance_width != sig->vector_width()) {
|
||||
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "Expression width " << sig->vector_width()
|
||||
<< " does not match width " << instance_width
|
||||
<< " of logic gate array port " << idx
|
||||
|
|
@ -774,7 +774,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
|
|||
}
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Gate count of " <<
|
||||
cerr << get_fileline() << ": error: Gate count of " <<
|
||||
count << " does not match net width of " <<
|
||||
sig->vector_width() << " at pin " << idx << "."
|
||||
<< endl;
|
||||
|
|
@ -855,7 +855,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
assert(scope);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Instantiate module "
|
||||
cerr << get_fileline() << ": debug: Instantiate module "
|
||||
<< rmod->mod_name() << " with instance name "
|
||||
<< get_name() << " in scope " << scope_path(scope) << endl;
|
||||
}
|
||||
|
|
@ -883,7 +883,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
// method will return the port count. Detect that
|
||||
// as an error.
|
||||
if (pidx == nexp) {
|
||||
cerr << get_line() << ": error: port ``" <<
|
||||
cerr << get_fileline() << ": error: port ``" <<
|
||||
pins_[idx].name << "'' is not a port of "
|
||||
<< get_name() << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -894,7 +894,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
// the pins array will already have a pointer
|
||||
// value where I want to place this expression.
|
||||
if (pins[pidx]) {
|
||||
cerr << get_line() << ": error: port ``" <<
|
||||
cerr << get_fileline() << ": error: port ``" <<
|
||||
pins_[idx].name << "'' already bound." <<
|
||||
endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -924,7 +924,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
right. Check that is is, the get the pin list. */
|
||||
|
||||
if (pin_count() != rmod->port_count()) {
|
||||
cerr << get_line() << ": error: Wrong number "
|
||||
cerr << get_fileline() << ": error: Wrong number "
|
||||
"of ports. Expecting " << rmod->port_count() <<
|
||||
", got " << pin_count() << "."
|
||||
<< endl;
|
||||
|
|
@ -982,7 +982,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
assert(tmp);
|
||||
|
||||
if (tmp->port_type() == NetNet::PINPUT) {
|
||||
cerr << get_line() << ": warning: "
|
||||
cerr << get_fileline() << ": warning: "
|
||||
<< "Instantiating module "
|
||||
<< rmod->mod_name()
|
||||
<< " with dangling input port "
|
||||
|
|
@ -1002,7 +1002,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
svector<NetNet*>prts (mport.count() * instance.count());
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: " << get_name()
|
||||
cerr << get_fileline() << ": debug: " << get_name()
|
||||
<< ": Port " << idx << " has " << prts.count()
|
||||
<< " sub-ports." << endl;
|
||||
}
|
||||
|
|
@ -1066,7 +1066,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
desired_vector_width,
|
||||
0, 0, 0);
|
||||
if (sig == 0) {
|
||||
cerr << pins[idx]->get_line()
|
||||
cerr << pins[idx]->get_fileline()
|
||||
<< ": internal error: Port expression "
|
||||
<< "too complicated for elaboration." << endl;
|
||||
continue;
|
||||
|
|
@ -1092,10 +1092,10 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
|
||||
sig = pins[idx]->elaborate_bi_net(des, scope);
|
||||
if (sig == 0) {
|
||||
cerr << pins[idx]->get_line() << ": error: "
|
||||
cerr << pins[idx]->get_fileline() << ": error: "
|
||||
<< "Inout port expression must support "
|
||||
<< "continuous assignment." << endl;
|
||||
cerr << pins[idx]->get_line() << ": : "
|
||||
cerr << pins[idx]->get_fileline() << ": : "
|
||||
<< "Port of " << rmod->mod_name()
|
||||
<< " is " << rmod->ports[idx]->name << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1114,10 +1114,10 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
|
||||
sig = pins[idx]->elaborate_lnet(des, scope, true);
|
||||
if (sig == 0) {
|
||||
cerr << pins[idx]->get_line() << ": error: "
|
||||
cerr << pins[idx]->get_fileline() << ": error: "
|
||||
<< "Output port expression must support "
|
||||
<< "continuous assignment." << endl;
|
||||
cerr << pins[idx]->get_line() << ": : "
|
||||
cerr << pins[idx]->get_fileline() << ": : "
|
||||
<< "Port of " << rmod->mod_name()
|
||||
<< " is " << rmod->ports[idx]->name << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1140,7 +1140,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
if ((instance.count() != 1)
|
||||
&& (sig->vector_width() != prts_vector_width)
|
||||
&& (sig->vector_width() != prts_vector_width/instance.count())) {
|
||||
cerr << pins[idx]->get_line() << ": error: "
|
||||
cerr << pins[idx]->get_fileline() << ": error: "
|
||||
<< "Port expression width " << sig->vector_width()
|
||||
<< " does not match expected width "<< prts_vector_width
|
||||
<< " or " << (prts_vector_width/instance.count())
|
||||
|
|
@ -1150,7 +1150,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
}
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: " << get_name()
|
||||
cerr << get_fileline() << ": debug: " << get_name()
|
||||
<< ": Port " << (idx+1) << " has vector width of "
|
||||
<< prts_vector_width << "." << endl;
|
||||
}
|
||||
|
|
@ -1162,20 +1162,20 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
&& (prts_vector_width != sig->vector_width())) {
|
||||
const char *tmp3 = rmod->ports[idx]->name.str();
|
||||
if (tmp3 == 0) tmp3 = "???";
|
||||
cerr << get_line() << ": warning: Port " << (idx+1)
|
||||
cerr << get_fileline() << ": warning: Port " << (idx+1)
|
||||
<< " (" << tmp3 << ") of "
|
||||
<< type_ << " expects " << prts_vector_width <<
|
||||
" bits, got " << sig->vector_width() << "." << endl;
|
||||
|
||||
if (prts_vector_width > sig->vector_width()) {
|
||||
cerr << get_line() << ": : Leaving "
|
||||
cerr << get_fileline() << ": : Leaving "
|
||||
<< (prts_vector_width-sig->vector_width())
|
||||
<< " high bits of the port unconnected."
|
||||
<< endl;
|
||||
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": : Leaving "
|
||||
cerr << get_fileline() << ": : Leaving "
|
||||
<< (sig->vector_width()-prts_vector_width)
|
||||
<< " high bits of the expression dangling."
|
||||
<< endl;
|
||||
|
|
@ -1229,7 +1229,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
&& prts.count()/instance.count() == 1) {
|
||||
|
||||
if (debug_elaborate){
|
||||
cerr << get_line() << ": debug: " << get_name()
|
||||
cerr << get_fileline() << ": debug: " << get_name()
|
||||
<< ": Replicating " << prts_vector_width
|
||||
<< " bits across all "
|
||||
<< prts_vector_width/instance.count()
|
||||
|
|
@ -1257,7 +1257,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
|
||||
case NetNet::PINPUT:
|
||||
if (debug_elaborate){
|
||||
cerr << get_line() << ": debug: " << get_name()
|
||||
cerr << get_fileline() << ": debug: " << get_name()
|
||||
<< ": Dividing " << prts_vector_width
|
||||
<< " bits across all "
|
||||
<< prts_vector_width/instance.count()
|
||||
|
|
@ -1276,17 +1276,17 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
}
|
||||
break;
|
||||
case NetNet::PINOUT:
|
||||
cerr << get_line() << ": XXXX: "
|
||||
cerr << get_fileline() << ": XXXX: "
|
||||
<< "Forgot how to bind inout ports!" << endl;
|
||||
des->errors += 1;
|
||||
break;
|
||||
case NetNet::PIMPLICIT:
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Unexpected IMPLICIT port" << endl;
|
||||
des->errors += 1;
|
||||
break;
|
||||
case NetNet::NOT_A_PORT:
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Unexpected NOT_A_PORT port." << endl;
|
||||
des->errors += 1;
|
||||
break;
|
||||
|
|
@ -1321,9 +1321,9 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
|
|||
if (dynamic_cast<NetEConst*> (rise_expr)) {
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Delay expressions must be "
|
||||
cerr << get_fileline() << ": error: Delay expressions must be "
|
||||
<< "constant for primitives." << endl;
|
||||
cerr << get_line() << ": : Cannot calculate "
|
||||
cerr << get_fileline() << ": : Cannot calculate "
|
||||
<< *rise_expr << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -1331,9 +1331,9 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
|
|||
if (dynamic_cast<NetEConst*> (fall_expr)) {
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Delay expressions must be "
|
||||
cerr << get_fileline() << ": error: Delay expressions must be "
|
||||
<< "constant for primitives." << endl;
|
||||
cerr << get_line() << ": : Cannot calculate "
|
||||
cerr << get_fileline() << ": : Cannot calculate "
|
||||
<< *rise_expr << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -1341,9 +1341,9 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
|
|||
if (dynamic_cast<NetEConst*> (decay_expr)) {
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Delay expressions must be "
|
||||
cerr << get_fileline() << ": error: Delay expressions must be "
|
||||
<< "constant for primitives." << endl;
|
||||
cerr << get_line() << ": : Cannot calculate "
|
||||
cerr << get_fileline() << ": : Cannot calculate "
|
||||
<< *rise_expr << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -1394,7 +1394,7 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
|
|||
// method will return the port count. Detect that
|
||||
// as an error.
|
||||
if (pidx == nexp) {
|
||||
cerr << get_line() << ": error: port ``" <<
|
||||
cerr << get_fileline() << ": error: port ``" <<
|
||||
pins_[idx].name << "'' is not a port of "
|
||||
<< get_name() << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1405,7 +1405,7 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
|
|||
// the (*exp) array will already have a pointer
|
||||
// value where I want to place this expression.
|
||||
if (pins[pidx]) {
|
||||
cerr << get_line() << ": error: port ``" <<
|
||||
cerr << get_fileline() << ": error: port ``" <<
|
||||
pins_[idx].name << "'' already bound." <<
|
||||
endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1424,7 +1424,7 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
|
|||
right. Check that is is, the get the pin list. */
|
||||
|
||||
if (pin_count() != udp->ports.count()) {
|
||||
cerr << get_line() << ": error: Wrong number "
|
||||
cerr << get_fileline() << ": error: Wrong number "
|
||||
"of ports. Expecting " << udp->ports.count() <<
|
||||
", got " << pin_count() << "."
|
||||
<< endl;
|
||||
|
|
@ -1443,15 +1443,15 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
|
|||
output port (the only output port) so must be passed an
|
||||
l-value net. */
|
||||
if (pins[0] == 0) {
|
||||
cerr << get_line() << ": warning: output port unconnected."
|
||||
cerr << get_fileline() << ": warning: output port unconnected."
|
||||
<< endl;
|
||||
|
||||
} else {
|
||||
NetNet*sig = pins[0]->elaborate_lnet(des, scope, true);
|
||||
if (sig == 0) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "Output port expression is not valid." << endl;
|
||||
cerr << get_line() << ": : Output "
|
||||
cerr << get_fileline() << ": : Output "
|
||||
<< "port of " << udp->name_
|
||||
<< " is " << udp->ports[0] << "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1510,7 +1510,7 @@ void PGModule::elaborate(Design*des, NetScope*scope) const
|
|||
return;
|
||||
}
|
||||
|
||||
cerr << get_line() << ": internal error: Unknown module type: " <<
|
||||
cerr << get_fileline() << ": internal error: Unknown module type: " <<
|
||||
type_ << endl;
|
||||
}
|
||||
|
||||
|
|
@ -1549,7 +1549,7 @@ void PGModule::elaborate_scope(Design*des, NetScope*sc) const
|
|||
|
||||
// Not a module or primitive that I know about or can find by
|
||||
// any means, so give up.
|
||||
cerr << get_line() << ": error: Unknown module type: " << type_ << endl;
|
||||
cerr << get_fileline() << ": error: Unknown module type: " << type_ << endl;
|
||||
missing_modules[type_] += 1;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -1557,7 +1557,7 @@ void PGModule::elaborate_scope(Design*des, NetScope*sc) const
|
|||
|
||||
NetProc* Statement::elaborate(Design*des, NetScope*) const
|
||||
{
|
||||
cerr << get_line() << ": internal error: elaborate: "
|
||||
cerr << get_fileline() << ": internal error: elaborate: "
|
||||
"What kind of statement? " << typeid(*this).name() << endl;
|
||||
NetProc*cur = new NetProc;
|
||||
des->errors += 1;
|
||||
|
|
@ -1693,7 +1693,7 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
|
|||
rv = pad_to_width(rv, wid);
|
||||
|
||||
if (wid > rv->expr_width()) {
|
||||
cerr << get_line() << ": error: Unable to match "
|
||||
cerr << get_fileline() << ": error: Unable to match "
|
||||
"expression width of " << rv->expr_width() <<
|
||||
" to l-value width of " << wid << "." << endl;
|
||||
//XXXX delete rv;
|
||||
|
|
@ -1725,7 +1725,7 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
|
|||
if (event_) {
|
||||
st = event_->elaborate_st(des, scope, a2);
|
||||
if (st == 0) {
|
||||
cerr << event_->get_line() << ": error: "
|
||||
cerr << event_->get_fileline() << ": error: "
|
||||
"unable to elaborate event expression."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1778,7 +1778,7 @@ NetProc* PAssignNB::elaborate(Design*des, NetScope*scope) const
|
|||
assert(scope);
|
||||
|
||||
if (scope->in_func()) {
|
||||
cerr << get_line() << ": error: functions cannot have non "
|
||||
cerr << get_fileline() << ": error: functions cannot have non "
|
||||
"blocking assignment statements." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1839,7 +1839,7 @@ NetProc* PBlock::elaborate(Design*des, NetScope*scope) const
|
|||
if (name_.str() != 0) {
|
||||
nscope = scope->child(hname_t(name_));
|
||||
if (nscope == 0) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
"unable to find block scope " << scope_path(scope)
|
||||
<< "<" << name_ << ">" << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -1899,7 +1899,7 @@ NetProc* PCase::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
NetExpr*expr = elab_and_eval(des, scope, expr_, -1);
|
||||
if (expr == 0) {
|
||||
cerr << get_line() << ": error: Unable to elaborate this case"
|
||||
cerr << get_fileline() << ": error: Unable to elaborate this case"
|
||||
" expression." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1967,13 +1967,13 @@ NetProc* PCondit::elaborate(Design*des, NetScope*scope) const
|
|||
assert(scope);
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Elaborate condition statement"
|
||||
cerr << get_fileline() << ": debug: Elaborate condition statement"
|
||||
<< " with conditional: " << *expr_ << endl;
|
||||
|
||||
// Elaborate and try to evaluate the conditional expression.
|
||||
NetExpr*expr = elab_and_eval(des, scope, expr_, -1);
|
||||
if (expr == 0) {
|
||||
cerr << get_line() << ": error: Unable to elaborate"
|
||||
cerr << get_fileline() << ": error: Unable to elaborate"
|
||||
" condition expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -1986,7 +1986,7 @@ NetProc* PCondit::elaborate(Design*des, NetScope*scope) const
|
|||
if (NetEConst*ce = dynamic_cast<NetEConst*>(expr)) {
|
||||
verinum val = ce->value();
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Condition expression "
|
||||
cerr << get_fileline() << ": debug: Condition expression "
|
||||
<< "is a constant " << val << "." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -2014,7 +2014,7 @@ NetProc* PCondit::elaborate(Design*des, NetScope*scope) const
|
|||
// one bit. Turn <e> into <e> != 0;
|
||||
|
||||
if (expr->expr_width() < 1) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
"incomprehensible expression width (0)." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2138,7 +2138,7 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const
|
|||
assert(scope);
|
||||
|
||||
if (scope->in_func()) {
|
||||
cerr << get_line() << ": error: functions cannot enable/call "
|
||||
cerr << get_fileline() << ": error: functions cannot enable/call "
|
||||
"tasks." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2146,7 +2146,7 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const
|
|||
|
||||
NetScope*task = des->find_task(scope, path_);
|
||||
if (task == 0) {
|
||||
cerr << get_line() << ": error: Enable of unknown task "
|
||||
cerr << get_fileline() << ": error: Enable of unknown task "
|
||||
<< "``" << path_ << "''." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2156,7 +2156,7 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const
|
|||
assert(task->type() == NetScope::TASK);
|
||||
NetTaskDef*def = task->task_def();
|
||||
if (def == 0) {
|
||||
cerr << get_line() << ": internal error: task " << path_
|
||||
cerr << get_fileline() << ": internal error: task " << path_
|
||||
<< " doesn't have a definition in " << scope_path(scope)
|
||||
<< "." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -2165,7 +2165,7 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const
|
|||
assert(def);
|
||||
|
||||
if (nparms() != def->port_count()) {
|
||||
cerr << get_line() << ": error: Port count mismatch in call to ``"
|
||||
cerr << get_fileline() << ": error: Port count mismatch in call to ``"
|
||||
<< path_ << "''. Got " << nparms()
|
||||
<< " ports, expecting " << def->port_count() << " ports." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -2253,7 +2253,7 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const
|
|||
if (parms_[idx]) {
|
||||
lv = parms_[idx]->elaborate_lval(des, scope, false);
|
||||
if (lv == 0) {
|
||||
cerr << parms_[idx]->get_line() << ": error: "
|
||||
cerr << parms_[idx]->get_fileline() << ": error: "
|
||||
<< "I give up on task port " << (idx+1)
|
||||
<< " expression: " << *parms_[idx] << endl;
|
||||
}
|
||||
|
|
@ -2303,7 +2303,7 @@ NetCAssign* PCAssign::elaborate(Design*des, NetScope*scope) const
|
|||
dev = new NetCAssign(lval, rexp);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Elaborate cassign,"
|
||||
cerr << get_fileline() << ": debug: Elaborate cassign,"
|
||||
<< " lval width=" << lwid
|
||||
<< " rval width=" << rexp->expr_width()
|
||||
<< " rval=" << *rexp
|
||||
|
|
@ -2339,7 +2339,7 @@ NetProc* PDelayStatement::elaborate(Design*des, NetScope*scope) const
|
|||
assert(scope);
|
||||
|
||||
if (scope->in_func()) {
|
||||
cerr << get_line() << ": error: functions cannot have "
|
||||
cerr << get_fileline() << ": error: functions cannot have "
|
||||
"delay statements." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2379,7 +2379,7 @@ NetProc* PDisable::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
NetScope*target = des->find_scope(scope, spath);
|
||||
if (target == 0) {
|
||||
cerr << get_line() << ": error: Cannot find scope "
|
||||
cerr << get_fileline() << ": error: Cannot find scope "
|
||||
<< scope_ << " in " << scope_path(scope) << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2387,12 +2387,12 @@ NetProc* PDisable::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
switch (target->type()) {
|
||||
case NetScope::FUNC:
|
||||
cerr << get_line() << ": error: Cannot disable functions." << endl;
|
||||
cerr << get_fileline() << ": error: Cannot disable functions." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
||||
case NetScope::MODULE:
|
||||
cerr << get_line() << ": error: Cannot disable modules." << endl;
|
||||
cerr << get_fileline() << ": error: Cannot disable modules." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
||||
|
|
@ -2491,7 +2491,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
|
|||
assert(scope);
|
||||
|
||||
if (scope->in_func()) {
|
||||
cerr << get_line() << ": error: functions cannot have "
|
||||
cerr << get_fileline() << ": error: functions cannot have "
|
||||
"event statements." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2523,7 +2523,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
|
|||
}
|
||||
NexusSet*nset = enet->nex_input(rem_out);
|
||||
if (nset == 0) {
|
||||
cerr << get_line() << ": internal error: No NexusSet"
|
||||
cerr << get_fileline() << ": internal error: No NexusSet"
|
||||
<< " from statement." << endl;
|
||||
enet->dump(cerr, 6);
|
||||
des->errors += 1;
|
||||
|
|
@ -2531,7 +2531,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
|
|||
}
|
||||
|
||||
if (nset->count() == 0) {
|
||||
cerr << get_line() << ": error: No inputs to statement."
|
||||
cerr << get_fileline() << ": error: No inputs to statement."
|
||||
<< " The @* cannot execute." << endl;
|
||||
des->errors += 1;
|
||||
return enet;
|
||||
|
|
@ -2659,7 +2659,7 @@ NetProc* PEventStatement::elaborate_wait(Design*des, NetScope*scope,
|
|||
assert(expr_.count() == 1);
|
||||
|
||||
if (scope->in_func()) {
|
||||
cerr << get_line() << ": error: functions cannot have "
|
||||
cerr << get_fileline() << ": error: functions cannot have "
|
||||
"wait statements." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2671,7 +2671,7 @@ NetProc* PEventStatement::elaborate_wait(Design*des, NetScope*scope,
|
|||
shortly, after we apply a reduction or. */
|
||||
NetExpr*expr = pe->elaborate_expr(des, scope, -1, false);
|
||||
if (expr == 0) {
|
||||
cerr << get_line() << ": error: Unable to elaborate"
|
||||
cerr << get_fileline() << ": error: Unable to elaborate"
|
||||
" wait condition expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2682,7 +2682,7 @@ NetProc* PEventStatement::elaborate_wait(Design*des, NetScope*scope,
|
|||
// one bit. In other words, Turn <e> into |<e>;
|
||||
|
||||
if (expr->expr_width() < 1) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
"incomprehensible wait expression width (0)." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2716,9 +2716,9 @@ NetProc* PEventStatement::elaborate_wait(Design*des, NetScope*scope,
|
|||
|
||||
/* Otherwise, false. wait(0) blocks permanently. */
|
||||
|
||||
cerr << get_line() << ": warning: wait expression is "
|
||||
cerr << get_fileline() << ": warning: wait expression is "
|
||||
<< "constant false." << endl;
|
||||
cerr << get_line() << ": : The statement will "
|
||||
cerr << get_fileline() << ": : The statement will "
|
||||
<< "block permanently." << endl;
|
||||
|
||||
/* Create an event wait and an otherwise unreferenced
|
||||
|
|
@ -2755,14 +2755,14 @@ NetProc* PEventStatement::elaborate_wait(Design*des, NetScope*scope,
|
|||
|
||||
NexusSet*wait_set = expr->nex_input();
|
||||
if (wait_set == 0) {
|
||||
cerr << get_line() << ": internal error: No NexusSet"
|
||||
cerr << get_fileline() << ": internal error: No NexusSet"
|
||||
<< " from wait expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (wait_set->count() == 0) {
|
||||
cerr << get_line() << ": internal error: Empty NexusSet"
|
||||
cerr << get_fileline() << ": internal error: Empty NexusSet"
|
||||
<< " from wait expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2861,7 +2861,7 @@ NetForce* PForce::elaborate(Design*des, NetScope*scope) const
|
|||
dev = new NetForce(lval, rexp);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: ELaborate force,"
|
||||
cerr << get_fileline() << ": debug: ELaborate force,"
|
||||
<< " lval width=" << lval->lwidth()
|
||||
<< " rval width=" << rexp->expr_width()
|
||||
<< " rval=" << *rexp
|
||||
|
|
@ -2902,7 +2902,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
|
|||
very specifically an assignment. */
|
||||
NetNet*sig = des->find_signal(scope, id1->path());
|
||||
if (sig == 0) {
|
||||
cerr << id1->get_line() << ": register ``" << id1->path()
|
||||
cerr << id1->get_fileline() << ": register ``" << id1->path()
|
||||
<< "'' unknown in this context." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -2923,7 +2923,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
|
|||
etmp = pad_to_width(etmp, use_width);
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: FOR initial assign: "
|
||||
cerr << get_fileline() << ": debug: FOR initial assign: "
|
||||
<< sig->name() << " = " << *etmp << endl;
|
||||
assert(etmp->expr_width() >= lv->lwidth());
|
||||
}
|
||||
|
|
@ -2950,7 +2950,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
|
|||
statement. Put this into the "body" block. */
|
||||
sig = des->find_signal(scope, id2->path());
|
||||
if (sig == 0) {
|
||||
cerr << get_line() << ": error: Unable to find variable "
|
||||
cerr << get_fileline() << ": error: Unable to find variable "
|
||||
<< id2->path() << " in for-loop increment expressin." << endl;
|
||||
des->errors += 1;
|
||||
return body;
|
||||
|
|
@ -2978,7 +2978,7 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
|
|||
}
|
||||
|
||||
if (dynamic_cast<NetEConst*>(ce)) {
|
||||
cerr << get_line() << ": warning: condition expression "
|
||||
cerr << get_fileline() << ": warning: condition expression "
|
||||
"of for-loop is constant." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -3016,7 +3016,7 @@ void PFunction::elaborate(Design*des, NetScope*scope) const
|
|||
{
|
||||
NetFuncDef*def = scope->func_def();
|
||||
if (def == 0) {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "No function definition for function "
|
||||
<< scope_path(scope) << endl;
|
||||
return;
|
||||
|
|
@ -3026,7 +3026,7 @@ void PFunction::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
NetProc*st = statement_->elaborate(des, scope);
|
||||
if (st == 0) {
|
||||
cerr << statement_->get_line() << ": error: Unable to elaborate "
|
||||
cerr << statement_->get_fileline() << ": error: Unable to elaborate "
|
||||
"statement in function " << scope->basename() << "." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -3054,7 +3054,7 @@ NetProc* PRepeat::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
NetExpr*expr = elab_and_eval(des, scope, expr_, -1);
|
||||
if (expr == 0) {
|
||||
cerr << get_line() << ": Unable to elaborate"
|
||||
cerr << get_fileline() << ": Unable to elaborate"
|
||||
" repeat expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -3127,9 +3127,9 @@ void PTask::elaborate(Design*des, NetScope*task) const
|
|||
|
||||
st = statement_->elaborate(des, task);
|
||||
if (st == 0) {
|
||||
cerr << statement_->get_line() << ": Unable to elaborate "
|
||||
cerr << statement_->get_fileline() << ": Unable to elaborate "
|
||||
"statement in task " << scope_path(task)
|
||||
<< " at " << get_line() << "." << endl;
|
||||
<< " at " << get_fileline() << "." << endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -3149,14 +3149,14 @@ NetProc* PTrigger::elaborate(Design*des, NetScope*scope) const
|
|||
sig, par, eve);
|
||||
|
||||
if (found_in == 0) {
|
||||
cerr << get_line() << ": error: event <" << event_ << ">"
|
||||
cerr << get_fileline() << ": error: event <" << event_ << ">"
|
||||
<< " not found." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (eve == 0) {
|
||||
cerr << get_line() << ": error: <" << event_ << ">"
|
||||
cerr << get_fileline() << ": error: <" << event_ << ">"
|
||||
<< " is not a named event." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -3262,9 +3262,9 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
/* Check for various path types that are not supported. */
|
||||
if (conditional && !condition) {
|
||||
cerr << get_line() << ": sorry: ifnone specify paths"
|
||||
cerr << get_fileline() << ": sorry: ifnone specify paths"
|
||||
<< " are not supported." << endl;
|
||||
cerr << get_line() << ": : Use -g no-specify to ignore"
|
||||
cerr << get_fileline() << ": : Use -g no-specify to ignore"
|
||||
<< " specify blocks." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -3293,7 +3293,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
|||
delay_value[idx] = cur_rcon->value().as_long(shift);
|
||||
|
||||
} else {
|
||||
cerr << get_line() << ": error: Path delay value "
|
||||
cerr << get_fileline() << ": error: Path delay value "
|
||||
<< "must be constant." << endl;
|
||||
delay_value[idx] = 0;
|
||||
des->errors += 1;
|
||||
|
|
@ -3309,7 +3309,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
|||
case 12:
|
||||
break;
|
||||
default:
|
||||
cerr << get_line() << ": error: Incorrect delay configuration."
|
||||
cerr << get_fileline() << ": error: Incorrect delay configuration."
|
||||
<< endl;
|
||||
ndelays = 1;
|
||||
des->errors += 1;
|
||||
|
|
@ -3336,7 +3336,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
|||
; cur != dst.end() ; cur ++) {
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: Path to " << (*cur);
|
||||
cerr << get_fileline() << ": debug: Path to " << (*cur);
|
||||
if (condit_sig)
|
||||
cerr << " if " << condit_sig->name();
|
||||
cerr << endl;
|
||||
|
|
@ -3344,7 +3344,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
NetNet*dst_sig = scope->find_signal(*cur);
|
||||
if (dst_sig == 0) {
|
||||
cerr << get_line() << ": error: No such wire "
|
||||
cerr << get_fileline() << ": error: No such wire "
|
||||
<< *cur << " in this module." << endl;
|
||||
des->errors += 1;
|
||||
continue;
|
||||
|
|
@ -3353,7 +3353,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
|||
if (dst_sig->port_type() != NetNet::POUTPUT
|
||||
&& dst_sig->port_type() != NetNet::PINOUT) {
|
||||
|
||||
cerr << get_line() << ": error: Path destination "
|
||||
cerr << get_fileline() << ": error: Path destination "
|
||||
<< *cur << " must be an output or inout port." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -3405,7 +3405,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
|||
if (src_sig->port_type() != NetNet::PINPUT
|
||||
& src_sig->port_type() != NetNet::PINOUT) {
|
||||
|
||||
cerr << get_line() << ": error: Path source "
|
||||
cerr << get_fileline() << ": error: Path source "
|
||||
<< *cur_src << " must be an input or inout port."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -3446,7 +3446,7 @@ bool Module::elaborate(Design*des, NetScope*scope) const
|
|||
value.real_val = val_c->value().as_double();
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Elaborate "
|
||||
cerr << get_fileline() << ": debug: Elaborate "
|
||||
<< "specparam " << (*cur).first
|
||||
<< " value=" << value.real_val << endl;
|
||||
|
||||
|
|
@ -3456,13 +3456,13 @@ bool Module::elaborate(Design*des, NetScope*scope) const
|
|||
value.integer = val_c->value().as_long();
|
||||
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Elaborate "
|
||||
cerr << get_fileline() << ": debug: Elaborate "
|
||||
<< "specparam " << (*cur).first
|
||||
<< " value=" << value.integer << endl;
|
||||
|
||||
} else {
|
||||
value.type = IVL_VT_NO_TYPE;
|
||||
cerr << (*cur).second->get_line() << ": error: "
|
||||
cerr << (*cur).second->get_fileline() << ": error: "
|
||||
<< "specparam " << (*cur).first << " value"
|
||||
<< " is not constant: " << *val << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -3559,13 +3559,13 @@ bool PGenerate::elaborate(Design*des, NetScope*container) const
|
|||
const char*name = scope_name.str();
|
||||
if (name[0] == '$') {
|
||||
if (!scope->auto_name("genblk", '0', name + 4)) {
|
||||
cerr << get_line() << ": warning: Couldn't build"
|
||||
cerr << get_fileline() << ": warning: Couldn't build"
|
||||
<< " unique name for unnamed generate block"
|
||||
<< " - using internal name " << name << endl;
|
||||
}
|
||||
}
|
||||
if (debug_elaborate)
|
||||
cerr << get_line() << ": debug: Elaborate in "
|
||||
cerr << get_fileline() << ": debug: Elaborate in "
|
||||
<< "scope " << scope_path(scope) << endl;
|
||||
|
||||
flag = elaborate_(des, scope) & flag;
|
||||
|
|
|
|||
84
emit.cc
84
emit.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: emit.cc,v 1.89 2007/01/16 05:44:15 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -466,7 +463,7 @@ void NetECRealParam::expr_scan(struct expr_scan_t*tgt) const
|
|||
|
||||
void NetEParam::expr_scan(struct expr_scan_t*tgt) const
|
||||
{
|
||||
cerr << get_line() << ":internal error: unexpected NetEParam."
|
||||
cerr << get_fileline() << ":internal error: unexpected NetEParam."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
|
@ -523,82 +520,3 @@ int emit(const Design*des, const char*type)
|
|||
<< " not found." << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log: emit.cc,v $
|
||||
* Revision 1.89 2007/01/16 05:44:15 steve
|
||||
* Major rework of array handling. Memories are replaced with the
|
||||
* more general concept of arrays. The NetMemory and NetEMemory
|
||||
* classes are removed from the ivl core program, and the IVL_LPM_RAM
|
||||
* lpm type is removed from the ivl_target API.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Revision 1.86 2005/07/11 16:56:50 steve
|
||||
* Remove NetVariable and ivl_variable_t structures.
|
||||
*
|
||||
* Revision 1.85 2005/07/07 16:22:49 steve
|
||||
* Generalize signals to carry types.
|
||||
*
|
||||
* Revision 1.84 2005/05/24 01:44:27 steve
|
||||
* Do sign extension of structuran nets.
|
||||
*
|
||||
* Revision 1.83 2005/02/08 00:12:36 steve
|
||||
* Add the NetRepeat node, and code generator support.
|
||||
*
|
||||
* Revision 1.82 2005/02/03 04:56:20 steve
|
||||
* laborate reduction gates into LPM_RED_ nodes.
|
||||
*
|
||||
* Revision 1.81 2005/01/24 05:28:30 steve
|
||||
* Remove the NetEBitSel and combine all bit/part select
|
||||
* behavior into the NetESelect node and IVL_EX_SELECT
|
||||
* ivl_target expression type.
|
||||
*
|
||||
* Revision 1.80 2005/01/22 01:06:55 steve
|
||||
* Change case compare from logic to an LPM node.
|
||||
*
|
||||
* Revision 1.79 2004/12/29 23:55:43 steve
|
||||
* Unify elaboration of l-values for all proceedural assignments,
|
||||
* including assing, cassign and force.
|
||||
*
|
||||
* Generate NetConcat devices for gate outputs that feed into a
|
||||
* vector results. Use this to hande gate arrays. Also let gate
|
||||
* arrays handle vectors of gates when the outputs allow for it.
|
||||
*
|
||||
* Revision 1.78 2004/12/11 02:31:26 steve
|
||||
* Rework of internals to carry vectors through nexus instead
|
||||
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
|
||||
* down this path.
|
||||
*
|
||||
* Revision 1.77 2004/10/04 01:10:53 steve
|
||||
* Clean up spurious trailing white space.
|
||||
*
|
||||
* Revision 1.76 2004/05/31 23:34:37 steve
|
||||
* Rewire/generalize parsing an elaboration of
|
||||
* function return values to allow for better
|
||||
* speed and more type support.
|
||||
*
|
||||
* Revision 1.75 2003/09/13 01:30:07 steve
|
||||
* Missing case warnings.
|
||||
*
|
||||
* Revision 1.74 2003/05/30 02:55:32 steve
|
||||
* Support parameters in real expressions and
|
||||
* as real expressions, and fix multiply and
|
||||
* divide with real results.
|
||||
*
|
||||
* Revision 1.73 2003/04/22 04:48:29 steve
|
||||
* Support event names as expressions elements.
|
||||
*
|
||||
* Revision 1.72 2003/03/10 23:40:53 steve
|
||||
* Keep parameter constants for the ivl_target API.
|
||||
*
|
||||
* Revision 1.71 2003/01/26 21:15:58 steve
|
||||
* Rework expression parsing and elaboration to
|
||||
* accommodate real/realtime values and expressions.
|
||||
*/
|
||||
|
||||
|
|
|
|||
125
eval.cc
125
eval.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: eval.cc,v 1.47 2007/06/04 19:14:06 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -194,7 +191,7 @@ verinum* PEIdent::eval_const(Design*des, NetScope*scope) const
|
|||
|
||||
const NetEConst*eval = dynamic_cast<const NetEConst*>(expr);
|
||||
if (eval == 0) {
|
||||
cerr << get_line() << ": internal error: Unable to evaluate "
|
||||
cerr << get_fileline() << ": internal error: Unable to evaluate "
|
||||
<< "constant expression (parameter=" << path_
|
||||
<< "): " << *expr << endl;
|
||||
return 0;
|
||||
|
|
@ -272,123 +269,3 @@ verinum* PEUnary::eval_const(Design*des, NetScope*scope) const
|
|||
delete val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log: eval.cc,v $
|
||||
* Revision 1.47 2007/06/04 19:14:06 steve
|
||||
* Build errors in picky GCC compilers.
|
||||
*
|
||||
* Revision 1.46 2007/05/24 04:07:12 steve
|
||||
* Rework the heirarchical identifier parse syntax and pform
|
||||
* to handle more general combinations of heirarch and bit selects.
|
||||
*
|
||||
* Revision 1.45 2007/03/07 00:38:15 steve
|
||||
* Lint fixes.
|
||||
*
|
||||
* Revision 1.44 2007/01/16 05:44:15 steve
|
||||
* Major rework of array handling. Memories are replaced with the
|
||||
* more general concept of arrays. The NetMemory and NetEMemory
|
||||
* classes are removed from the ivl core program, and the IVL_LPM_RAM
|
||||
* lpm type is removed from the ivl_target API.
|
||||
*
|
||||
* Revision 1.43 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.42 2006/05/19 04:07:24 steve
|
||||
* eval_const is not strict.
|
||||
*
|
||||
* Revision 1.41 2006/05/17 16:49:30 steve
|
||||
* Error message if concat expression cannot evaluate.
|
||||
*
|
||||
* Revision 1.40 2006/04/10 00:37:42 steve
|
||||
* Add support for generate loops w/ wires and gates.
|
||||
*
|
||||
* Revision 1.39 2005/12/07 04:04:23 steve
|
||||
* Allow constant concat expressions.
|
||||
*
|
||||
* Revision 1.38 2005/11/27 17:01:57 steve
|
||||
* Fix for stubborn compiler.
|
||||
*
|
||||
* Revision 1.37 2005/11/27 05:56:20 steve
|
||||
* Handle bit select of parameter with ranges.
|
||||
*
|
||||
* Revision 1.36 2003/06/21 01:21:43 steve
|
||||
* Harmless fixup of warnings.
|
||||
*
|
||||
* Revision 1.35 2003/04/14 03:40:21 steve
|
||||
* Make some effort to preserve bits while
|
||||
* operating on constant values.
|
||||
*
|
||||
* Revision 1.34 2003/03/26 06:16:18 steve
|
||||
* Evaluate > and < in constant expressions.
|
||||
*
|
||||
* Revision 1.33 2003/03/10 23:40:53 steve
|
||||
* Keep parameter constants for the ivl_target API.
|
||||
*
|
||||
* Revision 1.32 2002/10/19 22:59:49 steve
|
||||
* Redo the parameter vector support to allow
|
||||
* parameter names in range expressions.
|
||||
*
|
||||
* Revision 1.31 2002/10/13 05:01:07 steve
|
||||
* More verbose eval_const assert message.
|
||||
*
|
||||
* Revision 1.30 2002/08/12 01:34:59 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.29 2002/06/07 02:57:54 steve
|
||||
* Simply give up on constants with indices.
|
||||
*
|
||||
* Revision 1.28 2002/06/06 18:57:04 steve
|
||||
* Better error for identifier index eval.
|
||||
*
|
||||
* Revision 1.27 2002/05/23 03:08:51 steve
|
||||
* Add language support for Verilog-2001 attribute
|
||||
* syntax. Hook this support into existing $attribute
|
||||
* handling, and add number and void value types.
|
||||
*
|
||||
* Add to the ivl_target API new functions for access
|
||||
* of complex attributes attached to gates.
|
||||
*
|
||||
* Revision 1.26 2001/12/29 22:10:10 steve
|
||||
* constant eval of arithmetic with x and z.
|
||||
*
|
||||
* Revision 1.25 2001/12/29 00:43:55 steve
|
||||
* Evaluate constant right shifts.
|
||||
*
|
||||
* Revision 1.24 2001/12/03 04:47:15 steve
|
||||
* Parser and pform use hierarchical names as hname_t
|
||||
* objects instead of encoded strings.
|
||||
*
|
||||
* Revision 1.23 2001/11/07 04:01:59 steve
|
||||
* eval_const uses scope instead of a string path.
|
||||
*
|
||||
* Revision 1.22 2001/11/06 06:11:55 steve
|
||||
* Support more real arithmetic in delay constants.
|
||||
*
|
||||
* Revision 1.21 2001/07/25 03:10:49 steve
|
||||
* Create a config.h.in file to hold all the config
|
||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.20 2001/02/09 02:49:59 steve
|
||||
* Be more clear about scope of failure.
|
||||
*
|
||||
* Revision 1.19 2001/01/27 05:41:48 steve
|
||||
* Fix sign extension of evaluated constants. (PR#91)
|
||||
*
|
||||
* Revision 1.18 2001/01/14 23:04:56 steve
|
||||
* Generalize the evaluation of floating point delays, and
|
||||
* get it working with delay assignment statements.
|
||||
*
|
||||
* Allow parameters to be referenced by hierarchical name.
|
||||
*
|
||||
* Revision 1.17 2001/01/04 04:47:51 steve
|
||||
* Add support for << is signal indices.
|
||||
*
|
||||
* Revision 1.16 2000/12/10 22:01:36 steve
|
||||
* Support decimal constants in behavioral delays.
|
||||
*
|
||||
* Revision 1.15 2000/09/07 22:38:13 steve
|
||||
* Support unary + and - in constants.
|
||||
*/
|
||||
|
||||
|
|
|
|||
36
eval_tree.cc
36
eval_tree.cc
|
|
@ -128,7 +128,7 @@ NetExpr* NetEBAdd::eval_tree(int prune_to_width)
|
|||
/* Result might have known width. */
|
||||
if (has_width()) {
|
||||
if (debug_eval_tree) {
|
||||
cerr << get_line() << ": debug: Evaluate expr=" << *this
|
||||
cerr << get_fileline() << ": debug: Evaluate expr=" << *this
|
||||
<< " --- prune=" << prune_to_width << endl;
|
||||
}
|
||||
unsigned lwid = lc->expr_width();
|
||||
|
|
@ -441,9 +441,9 @@ NetEConst* NetEBComp::eval_leeq_()
|
|||
}
|
||||
|
||||
if (left_->expr_width() == 0) {
|
||||
cerr << get_line() << ": internal error: Something wrong "
|
||||
cerr << get_fileline() << ": internal error: Something wrong "
|
||||
<< "with the left side width of <= ?" << endl;
|
||||
cerr << get_line() << ": : " << *this << endl;
|
||||
cerr << get_fileline() << ": : " << *this << endl;
|
||||
}
|
||||
|
||||
/* Detect the case where the right side is greater that or
|
||||
|
|
@ -1062,7 +1062,7 @@ NetEConst* NetEBShift::eval_tree(int prune_to_width)
|
|||
unsigned shift = rv.as_ulong();
|
||||
|
||||
if (debug_eval_tree) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Evaluate " << lv << "<<" << op() << ">> "
|
||||
<< rv << ", wid=" << wid << ", shift=" << shift
|
||||
<< ", lv.has_len()=" << lv.has_len() << endl;
|
||||
|
|
@ -1132,7 +1132,7 @@ NetEConst* NetEConcat::eval_tree(int prune_to_width)
|
|||
unsigned local_errors = 0;
|
||||
|
||||
if (debug_eval_tree) {
|
||||
cerr << get_line() << ": debug: Evaluate expr=" << *this
|
||||
cerr << get_fileline() << ": debug: Evaluate expr=" << *this
|
||||
<< ", prune_to_width=" << prune_to_width << endl;
|
||||
}
|
||||
|
||||
|
|
@ -1162,12 +1162,12 @@ NetEConst* NetEConcat::eval_tree(int prune_to_width)
|
|||
parms_[idx] = expr;
|
||||
|
||||
if (! expr->has_width()) {
|
||||
cerr << get_line() << ": error: concatenation "
|
||||
cerr << get_fileline() << ": error: concatenation "
|
||||
<< "operand has indefinite width: "
|
||||
<< *parms_[idx] << endl;
|
||||
local_errors += 1;
|
||||
} else if (expr->expr_width() == 0) {
|
||||
cerr << expr->get_line() << ": internal error: "
|
||||
cerr << expr->get_fileline() << ": internal error: "
|
||||
<< "Operand of concatenation has no width: "
|
||||
<< *expr << endl;
|
||||
local_errors += 1;
|
||||
|
|
@ -1233,7 +1233,7 @@ NetExpr* NetEParam::eval_tree(int prune_to_width)
|
|||
}
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << get_line() << ": debug: evaluating expression: "
|
||||
cerr << get_fileline() << ": debug: evaluating expression: "
|
||||
<< *this << endl;
|
||||
}
|
||||
|
||||
|
|
@ -1242,7 +1242,7 @@ NetExpr* NetEParam::eval_tree(int prune_to_width)
|
|||
const NetExpr*expr_lsb;
|
||||
const NetExpr*expr = scope_->get_parameter(name_, expr_msb, expr_lsb);
|
||||
if (expr == 0) {
|
||||
cerr << get_line() << ": internal error: Unable to match "
|
||||
cerr << get_fileline() << ": internal error: Unable to match "
|
||||
<< "parameter " << name_ << " in scope "
|
||||
<< scope_path(scope_) << endl;
|
||||
return 0;
|
||||
|
|
@ -1275,7 +1275,7 @@ NetExpr* NetEParam::eval_tree(int prune_to_width)
|
|||
// expression is not a constant expression and I fail here.
|
||||
NetExpr*res = nexpr->eval_tree();
|
||||
if (res == 0) {
|
||||
cerr << get_line() << ": internal error: Unable to evaluate "
|
||||
cerr << get_fileline() << ": internal error: Unable to evaluate "
|
||||
<< "parameter " << name_ << " expression: "
|
||||
<< *nexpr << endl;
|
||||
delete nexpr;
|
||||
|
|
@ -1295,7 +1295,7 @@ NetExpr* NetEParam::eval_tree(int prune_to_width)
|
|||
case IVL_VT_LOGIC:
|
||||
{ NetEConst*tmp = dynamic_cast<NetEConst*>(res);
|
||||
if (tmp == 0) {
|
||||
cerr << get_line() << ": internal error: parameter "
|
||||
cerr << get_fileline() << ": internal error: parameter "
|
||||
<< name_ << " evaluates to incomprehensible "
|
||||
<< *res << "." << endl;
|
||||
return 0;
|
||||
|
|
@ -1312,7 +1312,7 @@ NetExpr* NetEParam::eval_tree(int prune_to_width)
|
|||
case IVL_VT_REAL:
|
||||
{ NetECReal*tmp = dynamic_cast<NetECReal*>(res);
|
||||
if (tmp == 0) {
|
||||
cerr << get_line() << ": internal error: parameter "
|
||||
cerr << get_fileline() << ": internal error: parameter "
|
||||
<< name_ << " evaluates to incomprehensible "
|
||||
<< *res << "." << endl;
|
||||
return 0;
|
||||
|
|
@ -1468,9 +1468,9 @@ NetExpr* NetETernary::eval_tree(int prune_to_width)
|
|||
|
||||
if (true_flag) {
|
||||
if (debug_eval_tree) {
|
||||
cerr << get_line() << ": debug: Evaluate ternary with "
|
||||
cerr << get_fileline() << ": debug: Evaluate ternary with "
|
||||
<< "constant condition value: " << c->value() << endl;
|
||||
cerr << get_line() << ": : Selecting true case: "
|
||||
cerr << get_fileline() << ": : Selecting true case: "
|
||||
<< *true_val_ << endl;
|
||||
}
|
||||
return true_val_->dup_expr();
|
||||
|
|
@ -1478,9 +1478,9 @@ NetExpr* NetETernary::eval_tree(int prune_to_width)
|
|||
|
||||
if (! x_flag) {
|
||||
if (debug_eval_tree) {
|
||||
cerr << get_line() << ": debug: Evaluate ternary with "
|
||||
cerr << get_fileline() << ": debug: Evaluate ternary with "
|
||||
<< "constant condition value: " << c->value() << endl;
|
||||
cerr << get_line() << ": : Selecting false case: "
|
||||
cerr << get_fileline() << ": : Selecting false case: "
|
||||
<< *true_val_ << endl;
|
||||
}
|
||||
return false_val_->dup_expr();
|
||||
|
|
@ -1517,9 +1517,9 @@ NetExpr* NetETernary::eval_tree(int prune_to_width)
|
|||
}
|
||||
|
||||
if (debug_eval_tree) {
|
||||
cerr << get_line() << ": debug: Evaluate ternary with "
|
||||
cerr << get_fileline() << ": debug: Evaluate ternary with "
|
||||
<< "constant condition value: " << c->value() << endl;
|
||||
cerr << get_line() << ": : Blending cases to get "
|
||||
cerr << get_fileline() << ": : Blending cases to get "
|
||||
<< val << endl;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999-2005 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: expr_synth.cc,v 1.87 2007/06/02 03:42:12 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -30,7 +27,7 @@
|
|||
|
||||
NetNet* NetExpr::synthesize(Design*des)
|
||||
{
|
||||
cerr << get_line() << ": internal error: cannot synthesize expression: "
|
||||
cerr << get_fileline() << ": internal error: cannot synthesize expression: "
|
||||
<< *this << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -94,12 +91,12 @@ NetNet* NetEBBits::synthesize(Design*des)
|
|||
assert(scope);
|
||||
|
||||
if (lsig->vector_width() != rsig->vector_width()) {
|
||||
cerr << get_line() << ": internal error: bitwise (" << op_
|
||||
cerr << get_fileline() << ": internal error: bitwise (" << op_
|
||||
<< ") widths do not match: " << lsig->vector_width()
|
||||
<< " != " << rsig->vector_width() << endl;
|
||||
cerr << get_line() << ": : width="
|
||||
cerr << get_fileline() << ": : width="
|
||||
<< lsig->vector_width() << ": " << *left_ << endl;
|
||||
cerr << get_line() << ": : width="
|
||||
cerr << get_fileline() << ": : width="
|
||||
<< rsig->vector_width() << ": " << *right_ << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -225,7 +222,7 @@ NetNet* NetEBComp::synthesize(Design*des)
|
|||
break;
|
||||
|
||||
default:
|
||||
cerr << get_line() << ": internal error: cannot synthesize "
|
||||
cerr << get_fileline() << ": internal error: cannot synthesize "
|
||||
"comparison: " << *this << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -236,7 +233,7 @@ NetNet* NetEBComp::synthesize(Design*des)
|
|||
|
||||
NetNet* NetEBPow::synthesize(Design*des)
|
||||
{
|
||||
cerr << get_line() << ": internal error: Do not yet know how to handle"
|
||||
cerr << get_fileline() << ": internal error: Do not yet know how to handle"
|
||||
<< " power operator in this context." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
|
|
@ -324,7 +321,7 @@ NetNet* NetEBDiv::synthesize(Design*des)
|
|||
}
|
||||
|
||||
default: {
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "NetEBDiv has unexpeced op() code: "
|
||||
<< op() << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -693,7 +690,7 @@ NetNet* NetEUReduce::synthesize(Design*des)
|
|||
rtype = NetUReduce::XNOR;
|
||||
break;
|
||||
default:
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "Unable to synthesize " << *this << "." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#define __ivl_assert(expression, tok, file, line) \
|
||||
do { \
|
||||
cerr << (tok).get_line() << ": assert: " \
|
||||
cerr << (tok).get_fileline() << ": assert: " \
|
||||
<< file << ":" << line \
|
||||
<< ": failed assertion " << (expression) << endl; \
|
||||
abort(); \
|
||||
|
|
|
|||
42
lexor.lex
42
lexor.lex
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
%{
|
||||
/*
|
||||
* Copyright (c) 1998-2000 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1998-2007 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
|
||||
|
|
@ -20,9 +20,6 @@
|
|||
* 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: lexor.lex,v 1.96 2007/06/14 03:50:00 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -50,37 +47,17 @@
|
|||
*/
|
||||
extern YYLTYPE yylloc;
|
||||
|
||||
struct file_name_cell {
|
||||
const char*text;
|
||||
struct file_name_cell*next;
|
||||
bool library_flag;
|
||||
};
|
||||
|
||||
static struct file_name_cell*file_names = 0;
|
||||
|
||||
static const char* set_file_name(char*text)
|
||||
{
|
||||
struct file_name_cell*cur = file_names;
|
||||
while (cur) {
|
||||
if (strcmp(cur->text, text) == 0) {
|
||||
delete[]text;
|
||||
return cur->text;
|
||||
}
|
||||
|
||||
cur = cur->next;
|
||||
}
|
||||
|
||||
cur = new struct file_name_cell;
|
||||
cur->text = text;
|
||||
cur->next = file_names;
|
||||
perm_string path = filename_strings.make(text);
|
||||
delete[]text;
|
||||
|
||||
/* Check this file name with the list of library file
|
||||
names. If there is a match, then turn on the
|
||||
pform_library_flag. This is how the parser knows that
|
||||
modules declared in this file are library modules. */
|
||||
cur->library_flag = library_file_map[cur->text];
|
||||
pform_library_flag = cur->library_flag;
|
||||
return text;
|
||||
pform_library_flag = library_file_map[path];
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -998,11 +975,6 @@ void reset_lexor()
|
|||
yyrestart(vl_input);
|
||||
yylloc.first_line = 1;
|
||||
|
||||
/* Start the file_names list. From here on, as I get a file
|
||||
name, I will add it to this list. Only add the name if it
|
||||
is not already in the list. */
|
||||
file_names = new struct file_name_cell;
|
||||
file_names->text = strdup(vl_file.c_str());
|
||||
file_names->next = 0;
|
||||
yylloc.text = file_names->text;
|
||||
/* Announce the first file name. */
|
||||
yylloc.text = set_file_name(strdup(vl_file.c_str()));
|
||||
}
|
||||
|
|
|
|||
6
main.cc
6
main.cc
|
|
@ -95,7 +95,7 @@ map<string,const char*> flags;
|
|||
char*vpi_module_list = 0;
|
||||
|
||||
map<perm_string,unsigned> missing_modules;
|
||||
map<string,bool> library_file_map;
|
||||
map<perm_string,bool> library_file_map;
|
||||
|
||||
list<const char*> library_suff;
|
||||
|
||||
|
|
@ -135,6 +135,8 @@ unsigned integer_width = 32;
|
|||
*/
|
||||
StringHeapLex lex_strings;
|
||||
|
||||
StringHeapLex filename_strings;
|
||||
|
||||
/*
|
||||
* In library searches, Windows file names are never case sensitive.
|
||||
*/
|
||||
|
|
@ -398,7 +400,7 @@ static void read_iconfig_file(const char*ipath)
|
|||
integer_width = strtoul(cp,0,10);
|
||||
|
||||
} else if (strcmp(buf, "library_file") == 0) {
|
||||
const char* path = strdup(cp);
|
||||
perm_string path = filename_strings.make(cp);
|
||||
library_file_map[path] = true;
|
||||
|
||||
} else if (strcmp(buf,"module") == 0) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000-2003 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: net_design.cc,v 1.54 2007/06/05 04:18:09 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -223,14 +220,14 @@ void NetScope::run_defparams(Design*des)
|
|||
is the current scope. */
|
||||
NetScope*targ_scope = des->find_scope(this, eval_path);
|
||||
if (targ_scope == 0) {
|
||||
cerr << val->get_line() << ": warning: scope of " <<
|
||||
cerr << val->get_fileline() << ": warning: scope of " <<
|
||||
path << "." << perm_name << " not found." << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
bool flag = targ_scope->replace_parameter(perm_name, val);
|
||||
if (! flag) {
|
||||
cerr << val->get_line() << ": warning: parameter "
|
||||
cerr << val->get_fileline() << ": warning: parameter "
|
||||
<< perm_name << " not found in "
|
||||
<< scope_path(targ_scope) << "." << endl;
|
||||
}
|
||||
|
|
@ -280,7 +277,7 @@ void NetScope::evaluate_parameters(Design*des)
|
|||
|
||||
NetExpr*nexpr = expr->eval_tree();
|
||||
if (nexpr == 0) {
|
||||
cerr << (*cur).second.expr->get_line()
|
||||
cerr << (*cur).second.expr->get_fileline()
|
||||
<< ": internal error: "
|
||||
<< "unable to evaluate msb expression "
|
||||
<< "for parameter " << (*cur).first << ": "
|
||||
|
|
@ -311,7 +308,7 @@ void NetScope::evaluate_parameters(Design*des)
|
|||
|
||||
NetExpr*nexpr = expr->eval_tree();
|
||||
if (nexpr == 0) {
|
||||
cerr << (*cur).second.expr->get_line()
|
||||
cerr << (*cur).second.expr->get_fileline()
|
||||
<< ": internal error: "
|
||||
<< "unable to evaluate lsb expression "
|
||||
<< "for parameter " << (*cur).first << ": "
|
||||
|
|
@ -344,7 +341,7 @@ void NetScope::evaluate_parameters(Design*des)
|
|||
|
||||
NetExpr*nexpr = expr->eval_tree();
|
||||
if (nexpr == 0) {
|
||||
cerr << (*cur).second.expr->get_line()
|
||||
cerr << (*cur).second.expr->get_fileline()
|
||||
<< ": internal error: "
|
||||
<< "unable to evaluate real parameter value: "
|
||||
<< *expr << endl;
|
||||
|
|
@ -365,7 +362,7 @@ void NetScope::evaluate_parameters(Design*des)
|
|||
// Try to evaluate the expression.
|
||||
NetExpr*nexpr = expr->eval_tree();
|
||||
if (nexpr == 0) {
|
||||
cerr << (*cur).second.expr->get_line()
|
||||
cerr << (*cur).second.expr->get_fileline()
|
||||
<< ": internal error: "
|
||||
<< "unable to evaluate parameter "
|
||||
<< (*cur).first
|
||||
|
|
@ -388,7 +385,7 @@ void NetScope::evaluate_parameters(Design*des)
|
|||
break;
|
||||
|
||||
default:
|
||||
cerr << (*cur).second.expr->get_line()
|
||||
cerr << (*cur).second.expr->get_fileline()
|
||||
<< ": internal error: "
|
||||
<< "unhandled expression type?" << endl;
|
||||
des->errors += 1;
|
||||
|
|
|
|||
|
|
@ -380,9 +380,9 @@ unsigned NetEConcat::repeat()
|
|||
/* This should not be possible, as it was checked earlier to
|
||||
assure that this is a constant expression. */
|
||||
if (repeat_const == 0) {
|
||||
cerr << get_line() << ": internal error: repeat expression "
|
||||
cerr << get_fileline() << ": internal error: repeat expression "
|
||||
<< "is not a compile time constant." << endl;
|
||||
cerr << get_line() << ": : Expression is: "
|
||||
cerr << get_fileline() << ": : Expression is: "
|
||||
<< *repeat_ << endl;
|
||||
repeat_calculated_ = true;
|
||||
repeat_value_ = 1;
|
||||
|
|
|
|||
44
net_func.cc
44
net_func.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: net_func.cc,v 1.10 2007/06/02 03:42:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
# include "netlist.h"
|
||||
|
|
@ -94,14 +91,14 @@ bool PECallFunction::check_call_matches_definition_(Design*des, NetScope*dscope)
|
|||
parms_count = 0;
|
||||
|
||||
if (dscope->type() != NetScope::FUNC) {
|
||||
cerr << get_line() << ": error: Attempt to call scope "
|
||||
cerr << get_fileline() << ": error: Attempt to call scope "
|
||||
<< scope_path(dscope) << " as a function." << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parms_count != dscope->func_def()->port_count()) {
|
||||
cerr << get_line() << ": error: Function " << scope_path(dscope)
|
||||
cerr << get_fileline() << ": error: Function " << scope_path(dscope)
|
||||
<< " expects " << (dscope->func_def()->port_count())
|
||||
<< " arguments, you passed " << parms_count << "."
|
||||
<< endl;
|
||||
|
|
@ -146,40 +143,3 @@ unsigned NetSysFunc::vector_width() const
|
|||
return def_->wid;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log: net_func.cc,v $
|
||||
* Revision 1.10 2007/06/02 03:42:13 steve
|
||||
* Properly evaluate scope path expressions.
|
||||
*
|
||||
* Revision 1.9 2007/04/17 04:17:47 steve
|
||||
* Fix argument count in function error message.
|
||||
*
|
||||
* Revision 1.8 2006/06/18 04:15:50 steve
|
||||
* Add support for system functions in continuous assignments.
|
||||
*
|
||||
* Revision 1.7 2005/03/18 02:56:03 steve
|
||||
* Add support for LPM_UFUNC user defined functions.
|
||||
*
|
||||
* Revision 1.6 2004/05/31 23:34:37 steve
|
||||
* Rewire/generalize parsing an elaboration of
|
||||
* function return values to allow for better
|
||||
* speed and more type support.
|
||||
*
|
||||
* Revision 1.5 2004/02/18 17:11:56 steve
|
||||
* Use perm_strings for named langiage items.
|
||||
*
|
||||
* Revision 1.4 2003/03/06 00:28:41 steve
|
||||
* All NetObj objects have lex_string base names.
|
||||
*
|
||||
* Revision 1.3 2002/08/12 01:34:59 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.2 2002/03/31 04:07:40 steve
|
||||
* Update for gcc 3.0
|
||||
*
|
||||
* Revision 1.1 2002/03/09 02:10:22 steve
|
||||
* Add the NetUserFunc netlist node.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2002-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: net_nex_input.cc,v 1.16 2007/01/16 05:44:15 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -31,7 +28,7 @@
|
|||
|
||||
NexusSet* NetExpr::nex_input(bool rem_out)
|
||||
{
|
||||
cerr << get_line()
|
||||
cerr << get_fileline()
|
||||
<< ": internal error: nex_input not implemented: "
|
||||
<< *this << endl;
|
||||
return 0;
|
||||
|
|
@ -39,7 +36,7 @@ NexusSet* NetExpr::nex_input(bool rem_out)
|
|||
|
||||
NexusSet* NetProc::nex_input(bool rem_out)
|
||||
{
|
||||
cerr << get_line()
|
||||
cerr << get_fileline()
|
||||
<< ": internal error: NetProc::nex_input not implemented"
|
||||
<< endl;
|
||||
return 0;
|
||||
|
|
@ -218,7 +215,7 @@ NexusSet* NetBlock::nex_input(bool rem_out)
|
|||
return new NexusSet;
|
||||
|
||||
if (type_ == PARA) {
|
||||
cerr << get_line() << ": internal error: Sorry, "
|
||||
cerr << get_fileline() << ": internal error: Sorry, "
|
||||
<< "I don't know how to synthesize fork/join blocks."
|
||||
<< endl;
|
||||
return 0;
|
||||
|
|
@ -291,7 +288,7 @@ NexusSet* NetCase::nex_input(bool rem_out)
|
|||
|
||||
NexusSet* NetCAssign::nex_input(bool rem_out)
|
||||
{
|
||||
cerr << get_line() << ": internal warning: NetCAssign::nex_input()"
|
||||
cerr << get_fileline() << ": internal warning: NetCAssign::nex_input()"
|
||||
<< " not implemented." << endl;
|
||||
return new NexusSet;
|
||||
}
|
||||
|
|
@ -316,7 +313,7 @@ NexusSet* NetCondit::nex_input(bool rem_out)
|
|||
|
||||
NexusSet* NetForce::nex_input(bool rem_out)
|
||||
{
|
||||
cerr << get_line() << ": internal warning: NetForce::nex_input()"
|
||||
cerr << get_fileline() << ": internal warning: NetForce::nex_input()"
|
||||
<< " not implemented." << endl;
|
||||
return new NexusSet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2002-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: net_nex_output.cc,v 1.14 2007/04/17 04:34:23 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -31,10 +28,10 @@
|
|||
|
||||
void NetProc::nex_output(NexusSet&out)
|
||||
{
|
||||
cerr << get_line()
|
||||
cerr << get_fileline()
|
||||
<< ": internal error: NetProc::nex_output not implemented"
|
||||
<< endl;
|
||||
cerr << get_line()
|
||||
cerr << get_fileline()
|
||||
<< ": : on object type " << typeid(*this).name()
|
||||
<< endl;
|
||||
}
|
||||
|
|
@ -53,7 +50,7 @@ void NetAssignBase::nex_output(NexusSet&out)
|
|||
* "This is not a node because memory objects can only be
|
||||
* accessed by behavioral code."
|
||||
*/
|
||||
cerr << get_line() << ": internal error: "
|
||||
cerr << get_fileline() << ": internal error: "
|
||||
<< "NetAssignBase::nex_output on unsupported lval ";
|
||||
dump_lval(cerr);
|
||||
cerr << endl;
|
||||
|
|
@ -129,52 +126,3 @@ void NetWhile::nex_output(NexusSet&out)
|
|||
if (proc_ != 0)
|
||||
proc_->nex_output(out);
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: net_nex_output.cc,v $
|
||||
* Revision 1.14 2007/04/17 04:34:23 steve
|
||||
* Fix handling calls to tasks in combinational always block
|
||||
*
|
||||
* Revision 1.13 2007/04/05 01:53:52 steve
|
||||
* Probe of case statement inputs can skip nul statements.
|
||||
*
|
||||
* Revision 1.12 2005/02/14 04:58:50 steve
|
||||
* l-value input may be a vector.
|
||||
*
|
||||
* Revision 1.11 2004/09/16 03:17:33 steve
|
||||
* net_output handles l-value concatenations.
|
||||
*
|
||||
* Revision 1.10 2004/08/28 16:23:05 steve
|
||||
* Fix use of system tasks in AT_STAR statements.
|
||||
*
|
||||
* Revision 1.9 2004/06/30 15:32:18 steve
|
||||
* nex_output for NetPDelay statements.
|
||||
*
|
||||
* Revision 1.8 2003/12/20 00:59:31 steve
|
||||
* Synthesis debug messages.
|
||||
*
|
||||
* Revision 1.7 2003/10/26 04:51:39 steve
|
||||
* Output of While is output of while substatement.
|
||||
*
|
||||
* Revision 1.6 2002/09/17 04:39:20 steve
|
||||
* Account for part select in l-value.
|
||||
*
|
||||
* Revision 1.5 2002/08/12 01:34:59 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.4 2002/07/29 00:00:28 steve
|
||||
* Asynchronous synthesis of sequential blocks.
|
||||
*
|
||||
* Revision 1.3 2002/07/07 22:32:15 steve
|
||||
* Asynchronous synthesis of case statements.
|
||||
*
|
||||
* Revision 1.2 2002/07/01 00:54:21 steve
|
||||
* synth_asych of if/else requires redirecting the target
|
||||
* if sub-statements. Use NetNet objects to manage the
|
||||
* situation.
|
||||
*
|
||||
* Revision 1.1 2002/06/30 02:21:32 steve
|
||||
* Add structure for asynchronous logic synthesis.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
13
netlist.cc
13
netlist.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: netlist.cc,v 1.258 2007/06/02 03:42:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -201,9 +198,9 @@ const NetScope* NetObj::scope() const
|
|||
Link& NetObj::pin(unsigned idx)
|
||||
{
|
||||
if (idx >= npins_) {
|
||||
cerr << get_line() << ": internal error: pin("<<idx<<")"
|
||||
cerr << get_fileline() << ": internal error: pin("<<idx<<")"
|
||||
<< " out of bounds("<<npins_<<")" << endl;
|
||||
cerr << get_line() << ": : typeid="
|
||||
cerr << get_fileline() << ": : typeid="
|
||||
<< typeid(*this).name() << endl;
|
||||
}
|
||||
|
||||
|
|
@ -525,14 +522,14 @@ NetNet::NetNet(NetScope*s, perm_string n, Type t,
|
|||
NetNet::~NetNet()
|
||||
{
|
||||
if (eref_count_ > 0) {
|
||||
cerr << get_line() << ": internal error: attempt to delete "
|
||||
cerr << get_fileline() << ": internal error: attempt to delete "
|
||||
<< "signal ``" << name() << "'' which has "
|
||||
<< "expression references." << endl;
|
||||
dump_net(cerr, 4);
|
||||
}
|
||||
assert(eref_count_ == 0);
|
||||
if (lref_count_ > 0) {
|
||||
cerr << get_line() << ": internal error: attempt to delete "
|
||||
cerr << get_fileline() << ": internal error: attempt to delete "
|
||||
<< "signal ``" << name() << "'' which has "
|
||||
<< "assign references." << endl;
|
||||
dump_net(cerr, 4);
|
||||
|
|
@ -2189,7 +2186,7 @@ ivl_variable_type_t NetETernary::expr_type() const
|
|||
return IVL_VT_LOGIC;
|
||||
|
||||
if (tru != fal) {
|
||||
cerr << get_line() << ": internal error:"
|
||||
cerr << get_fileline() << ": internal error:"
|
||||
<< " Unexpected ?: type clash:"
|
||||
<< " tru=" << tru << ", fal=" << fal << endl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: netmisc.cc,v 1.14 2007/06/02 03:42:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -73,7 +70,7 @@ NetNet* add_to_net(Design*des, NetNet*sig, long val)
|
|||
|
||||
return res;
|
||||
#else
|
||||
cerr << sig->get_line() << ": XXXX: Forgot how to implement add_to_net" << endl;
|
||||
cerr << sig->get_fileline() << ": XXXX: Forgot how to implement add_to_net" << endl;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -181,7 +178,7 @@ std::list<hname_t> eval_scope_path(Design*des, NetScope*scope,
|
|||
delete ctmp;
|
||||
continue;
|
||||
} else {
|
||||
cerr << index.msb->get_line() << ": error: "
|
||||
cerr << index.msb->get_fileline() << ": error: "
|
||||
<< "Scope index expression is not constant: "
|
||||
<< *index.msb << endl;
|
||||
des->errors += 1;
|
||||
|
|
|
|||
325
parse.y
325
parse.y
|
|
@ -18,9 +18,6 @@
|
|||
* 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: parse.y,v 1.239 2007/06/14 03:50:00 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -87,6 +84,12 @@ static list<perm_string>* list_from_identifier(list<perm_string>*tmp, char*id)
|
|||
return tmp;
|
||||
}
|
||||
|
||||
static inline void FILE_NAME(LineInfo*tmp, const struct vlltype&where)
|
||||
{
|
||||
tmp->set_lineno(where.first_line);
|
||||
tmp->set_file(filename_strings.make(where.text));
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%union {
|
||||
|
|
@ -581,8 +584,7 @@ delay_value_simple
|
|||
$$ = 0;
|
||||
} else {
|
||||
$$ = new PENumber(tmp);
|
||||
$$->set_file(@1.text);
|
||||
$$->set_lineno(@1.first_line);
|
||||
FILE_NAME($$, @1);
|
||||
}
|
||||
}
|
||||
| REALTIME
|
||||
|
|
@ -592,14 +594,12 @@ delay_value_simple
|
|||
$$ = 0;
|
||||
} else {
|
||||
$$ = new PEFNumber(tmp);
|
||||
$$->set_file(@1.text);
|
||||
$$->set_lineno(@1.first_line);
|
||||
FILE_NAME($$, @1);
|
||||
}
|
||||
}
|
||||
| IDENTIFIER
|
||||
{ PEIdent*tmp = new PEIdent(lex_strings.make($1));
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
delete $1;
|
||||
}
|
||||
|
|
@ -667,15 +667,13 @@ event_control
|
|||
{ PEIdent*tmpi = new PEIdent(*$2);
|
||||
PEEvent*tmpe = new PEEvent(PEEvent::ANYEDGE, tmpi);
|
||||
PEventStatement*tmps = new PEventStatement(tmpe);
|
||||
tmps->set_file(@1.text);
|
||||
tmps->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmps, @1);
|
||||
$$ = tmps;
|
||||
delete $2;
|
||||
}
|
||||
| '@' '(' event_expression_list ')'
|
||||
{ PEventStatement*tmp = new PEventStatement(*$3);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $3;
|
||||
$$ = tmp;
|
||||
}
|
||||
|
|
@ -705,24 +703,21 @@ event_expression_list
|
|||
event_expression
|
||||
: K_posedge expression
|
||||
{ PEEvent*tmp = new PEEvent(PEEvent::POSEDGE, $2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
svector<PEEvent*>*tl = new svector<PEEvent*>(1);
|
||||
(*tl)[0] = tmp;
|
||||
$$ = tl;
|
||||
}
|
||||
| K_negedge expression
|
||||
{ PEEvent*tmp = new PEEvent(PEEvent::NEGEDGE, $2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
svector<PEEvent*>*tl = new svector<PEEvent*>(1);
|
||||
(*tl)[0] = tmp;
|
||||
$$ = tl;
|
||||
}
|
||||
| expression
|
||||
{ PEEvent*tmp = new PEEvent(PEEvent::ANYEDGE, $1);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
svector<PEEvent*>*tl = new svector<PEEvent*>(1);
|
||||
(*tl)[0] = tmp;
|
||||
$$ = tl;
|
||||
|
|
@ -736,56 +731,47 @@ expression
|
|||
{ $$ = $2; }
|
||||
| '-' expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('-', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| '~' expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('~', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| '&' expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('&', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| '!' expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('!', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| '|' expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('|', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| '^' expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('^', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_NAND expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('A', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_NOR expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('N', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_NXOR expr_primary %prec UNARY_PREC
|
||||
{ PEUnary*tmp = new PEUnary('X', $2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| '!' error %prec UNARY_PREC
|
||||
|
|
@ -800,158 +786,132 @@ expression
|
|||
}
|
||||
| expression '^' expression
|
||||
{ PEBinary*tmp = new PEBinary('^', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_POW expression
|
||||
{ PEBinary*tmp = new PEBinary('p', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '*' expression
|
||||
{ PEBinary*tmp = new PEBinary('*', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '/' expression
|
||||
{ PEBinary*tmp = new PEBinary('/', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '%' expression
|
||||
{ PEBinary*tmp = new PEBinary('%', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '+' expression
|
||||
{ PEBinary*tmp = new PEBinary('+', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '-' expression
|
||||
{ PEBinary*tmp = new PEBinary('-', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '&' expression
|
||||
{ PEBinary*tmp = new PEBinary('&', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '|' expression
|
||||
{ PEBinary*tmp = new PEBinary('|', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_NAND expression
|
||||
{ PEBinary*tmp = new PEBinary('A', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_NOR expression
|
||||
{ PEBinary*tmp = new PEBinary('O', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_NXOR expression
|
||||
{ PEBinary*tmp = new PEBinary('X', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '<' expression
|
||||
{ PEBinary*tmp = new PEBComp('<', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '>' expression
|
||||
{ PEBinary*tmp = new PEBComp('>', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_LS expression
|
||||
{ PEBinary*tmp = new PEBShift('l', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_RS expression
|
||||
{ PEBinary*tmp = new PEBShift('r', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_RSS expression
|
||||
{ PEBinary*tmp = new PEBShift('R', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_EQ expression
|
||||
{ PEBinary*tmp = new PEBComp('e', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_CEQ expression
|
||||
{ PEBinary*tmp = new PEBComp('E', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_LE expression
|
||||
{ PEBinary*tmp = new PEBComp('L', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_GE expression
|
||||
{ PEBinary*tmp = new PEBComp('G', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_NE expression
|
||||
{ PEBinary*tmp = new PEBComp('n', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_CNE expression
|
||||
{ PEBinary*tmp = new PEBComp('N', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_LOR expression
|
||||
{ PEBinary*tmp = new PEBinary('o', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression K_LAND expression
|
||||
{ PEBinary*tmp = new PEBinary('a', $1, $3);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
| expression '?' expression ':' expression
|
||||
{ PETernary*tmp = new PETernary($1, $3, $5);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
$$ = tmp;
|
||||
}
|
||||
;
|
||||
|
|
@ -978,7 +938,7 @@ expr_mintypmax
|
|||
break;
|
||||
}
|
||||
if (min_typ_max_warn > 0) {
|
||||
cerr << $$->get_line() << ": warning: choosing ";
|
||||
cerr << $$->get_fileline() << ": warning: choosing ";
|
||||
switch (min_typ_max_flag) {
|
||||
case MIN:
|
||||
cerr << "min";
|
||||
|
|
@ -1046,27 +1006,23 @@ expr_primary
|
|||
: number
|
||||
{ assert($1);
|
||||
PENumber*tmp = new PENumber($1);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| REALTIME
|
||||
{ PEFNumber*tmp = new PEFNumber($1);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| STRING
|
||||
{ PEString*tmp = new PEString($1);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| SYSTEM_IDENTIFIER
|
||||
{ perm_string tn = lex_strings.make($1);
|
||||
PECallFunction*tmp = new PECallFunction(tn);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
delete $1;
|
||||
}
|
||||
|
|
@ -1076,8 +1032,7 @@ expr_primary
|
|||
|
||||
| heirarchy_identifier
|
||||
{ PEIdent*tmp = new PEIdent(*$1);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
delete $1;
|
||||
}
|
||||
|
|
@ -1088,16 +1043,14 @@ expr_primary
|
|||
|
||||
| heirarchy_identifier '(' expression_list_proper ')'
|
||||
{ PECallFunction*tmp = new PECallFunction(*$1, *$3);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $1;
|
||||
$$ = tmp;
|
||||
}
|
||||
| SYSTEM_IDENTIFIER '(' expression_list_proper ')'
|
||||
{ perm_string tn = lex_strings.make($1);
|
||||
PECallFunction*tmp = new PECallFunction(tn, *$3);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
|
||||
|
|
@ -1110,24 +1063,21 @@ expr_primary
|
|||
|
||||
| '{' expression_list_proper '}'
|
||||
{ PEConcat*tmp = new PEConcat(*$2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $2;
|
||||
$$ = tmp;
|
||||
}
|
||||
| '{' expression '{' expression_list_proper '}' '}'
|
||||
{ PExpr*rep = $2;
|
||||
PEConcat*tmp = new PEConcat(*$4, rep);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $4;
|
||||
$$ = tmp;
|
||||
}
|
||||
| '{' expression '{' expression_list_proper '}' error '}'
|
||||
{ PExpr*rep = $2;
|
||||
PEConcat*tmp = new PEConcat(*$4, rep);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $4;
|
||||
$$ = tmp;
|
||||
yyerror(@5, "error: Syntax error between internal '}' "
|
||||
|
|
@ -1598,15 +1548,13 @@ signed_opt : K_signed { $$ = true; } | {$$ = false; } ;
|
|||
lpvalue
|
||||
: heirarchy_identifier
|
||||
{ PEIdent*tmp = new PEIdent(*$1);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
delete $1;
|
||||
}
|
||||
| '{' expression_list_proper '}'
|
||||
{ PEConcat*tmp = new PEConcat(*$2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $2;
|
||||
$$ = tmp;
|
||||
}
|
||||
|
|
@ -1867,14 +1815,12 @@ module_item
|
|||
| attribute_list_opt K_always statement
|
||||
{ PProcess*tmp = pform_make_behavior(PProcess::PR_ALWAYS,
|
||||
$3, $1);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
}
|
||||
| attribute_list_opt K_initial statement
|
||||
{ PProcess*tmp = pform_make_behavior(PProcess::PR_INITIAL,
|
||||
$3, $1);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @2);
|
||||
}
|
||||
|
||||
/* The task declaration rule matches the task declaration
|
||||
|
|
@ -1892,8 +1838,7 @@ module_item
|
|||
K_endtask
|
||||
{ PTask*tmp = new PTask;
|
||||
perm_string tmp2 = lex_strings.make($2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
tmp->set_ports($5);
|
||||
tmp->set_statement($6);
|
||||
pform_set_task(tmp2, tmp);
|
||||
|
|
@ -1909,8 +1854,7 @@ module_item
|
|||
K_endtask
|
||||
{ PTask*tmp = new PTask;
|
||||
perm_string tmp2 = lex_strings.make($2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
tmp->set_ports($5);
|
||||
tmp->set_statement($9);
|
||||
pform_set_task(tmp2, tmp);
|
||||
|
|
@ -1929,8 +1873,7 @@ module_item
|
|||
K_endfunction
|
||||
{ perm_string name = lex_strings.make($3);
|
||||
PFunction *tmp = new PFunction(name);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
tmp->set_ports($6);
|
||||
tmp->set_statement($7);
|
||||
tmp->set_return($2);
|
||||
|
|
@ -2228,8 +2171,7 @@ parameter_value_opt
|
|||
| '#' DEC_NUMBER
|
||||
{ assert($2);
|
||||
PENumber*tmp = new PENumber($2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
|
||||
struct parmvalue_t*lst = new struct parmvalue_t;
|
||||
lst->by_order = new svector<PExpr*>(1);
|
||||
|
|
@ -2374,8 +2316,7 @@ port_reference
|
|||
pname.push_back(ntmp);
|
||||
|
||||
PEIdent*wtmp = new PEIdent(pname);
|
||||
wtmp->set_file(@1.text);
|
||||
wtmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(wtmp, @1);
|
||||
|
||||
Module::port_t*ptmp = new Module::port_t;
|
||||
ptmp->name = perm_string();
|
||||
|
|
@ -2403,8 +2344,7 @@ port_reference
|
|||
pname.push_back(ntmp);
|
||||
|
||||
PEIdent*tmp = new PEIdent(pname);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
|
||||
Module::port_t*ptmp = new Module::port_t;
|
||||
ptmp->name = perm_string();
|
||||
|
|
@ -2418,8 +2358,7 @@ port_reference
|
|||
{ yyerror(@1, "error: invalid port bit select");
|
||||
Module::port_t*ptmp = new Module::port_t;
|
||||
PEIdent*wtmp = new PEIdent(lex_strings.make($1));
|
||||
wtmp->set_file(@1.text);
|
||||
wtmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(wtmp, @1);
|
||||
ptmp->name = lex_strings.make($1);
|
||||
ptmp->expr = svector<PEIdent*>(1);
|
||||
ptmp->expr[0] = wtmp;
|
||||
|
|
@ -2857,7 +2796,7 @@ specparam
|
|||
break;
|
||||
}
|
||||
if (min_typ_max_warn > 0) {
|
||||
cerr << tmp->get_line() << ": warning: choosing ";
|
||||
cerr << tmp->get_fileline() << ": warning: choosing ";
|
||||
switch (min_typ_max_flag) {
|
||||
case MIN:
|
||||
cerr << "min";
|
||||
|
|
@ -2960,15 +2899,13 @@ statement
|
|||
|
||||
: K_assign lpvalue '=' expression ';'
|
||||
{ PCAssign*tmp = new PCAssign($2, $4);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
|
||||
| K_deassign lpvalue ';'
|
||||
{ PDeassign*tmp = new PDeassign($2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
|
||||
|
|
@ -2978,14 +2915,12 @@ statement
|
|||
|
||||
| K_force lpvalue '=' expression ';'
|
||||
{ PForce*tmp = new PForce($2, $4);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_release lpvalue ';'
|
||||
{ PRelease*tmp = new PRelease($2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
|
||||
|
|
@ -2997,8 +2932,7 @@ statement
|
|||
|
||||
| K_begin statement_list K_end
|
||||
{ PBlock*tmp = new PBlock(PBlock::BL_SEQ, *$2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $2;
|
||||
$$ = tmp;
|
||||
}
|
||||
|
|
@ -3009,22 +2943,19 @@ statement
|
|||
{ pform_pop_scope();
|
||||
PBlock*tmp = new PBlock(lex_strings.make($3),
|
||||
PBlock::BL_SEQ, *$6);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $3;
|
||||
delete $6;
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_begin K_end
|
||||
{ PBlock*tmp = new PBlock(PBlock::BL_SEQ);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_begin ':' IDENTIFIER K_end
|
||||
{ PBlock*tmp = new PBlock(PBlock::BL_SEQ);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_begin error K_end
|
||||
|
|
@ -3042,75 +2973,64 @@ statement
|
|||
{ pform_pop_scope();
|
||||
PBlock*tmp = new PBlock(lex_strings.make($3),
|
||||
PBlock::BL_PAR, *$6);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $3;
|
||||
delete $6;
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_fork K_join
|
||||
{ PBlock*tmp = new PBlock(PBlock::BL_PAR);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_fork ':' IDENTIFIER K_join
|
||||
{ PBlock*tmp = new PBlock(PBlock::BL_PAR);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $3;
|
||||
$$ = tmp;
|
||||
}
|
||||
|
||||
| K_disable heirarchy_identifier ';'
|
||||
{ PDisable*tmp = new PDisable(*$2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $2;
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_TRIGGER heirarchy_identifier ';'
|
||||
{ PTrigger*tmp = new PTrigger(*$2);
|
||||
tmp->set_file(@2.text);
|
||||
tmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $2;
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_forever statement
|
||||
{ PForever*tmp = new PForever($2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_fork statement_list K_join
|
||||
{ PBlock*tmp = new PBlock(PBlock::BL_PAR, *$2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $2;
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_repeat '(' expression ')' statement
|
||||
{ PRepeat*tmp = new PRepeat($3, $5);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_case '(' expression ')' case_items K_endcase
|
||||
{ PCase*tmp = new PCase(NetCase::EQ, $3, $5);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_casex '(' expression ')' case_items K_endcase
|
||||
{ PCase*tmp = new PCase(NetCase::EQX, $3, $5);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_casez '(' expression ')' case_items K_endcase
|
||||
{ PCase*tmp = new PCase(NetCase::EQZ, $3, $5);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_case '(' expression ')' error K_endcase
|
||||
|
|
@ -3121,14 +3041,12 @@ statement
|
|||
{ yyerrok; }
|
||||
| K_if '(' expression ')' statement_or_null %prec less_than_K_else
|
||||
{ PCondit*tmp = new PCondit($3, $5, 0);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_if '(' expression ')' statement_or_null K_else statement_or_null
|
||||
{ PCondit*tmp = new PCondit($3, $5, $7);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_if '(' error ')' statement_or_null %prec less_than_K_else
|
||||
|
|
@ -3142,8 +3060,7 @@ statement
|
|||
| K_for '(' lpvalue '=' expression ';' expression ';'
|
||||
lpvalue '=' expression ')' statement
|
||||
{ PForStatement*tmp = new PForStatement($3, $5, $7, $9, $11, $13);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_for '(' lpvalue '=' expression ';' expression ';'
|
||||
|
|
@ -3162,6 +3079,7 @@ statement
|
|||
}
|
||||
| K_while '(' expression ')' statement
|
||||
{ PWhile*tmp = new PWhile($3, $5);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_while '(' error ')' statement
|
||||
|
|
@ -3172,8 +3090,7 @@ statement
|
|||
{ PExpr*del = (*$1)[0];
|
||||
assert($1->count() == 1);
|
||||
PDelayStatement*tmp = new PDelayStatement(del, $2);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| event_control statement_or_null
|
||||
|
|
@ -3188,22 +3105,19 @@ statement
|
|||
}
|
||||
| '@' '*' statement_or_null
|
||||
{ PEventStatement*tmp = new PEventStatement;
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
tmp->set_statement($3);
|
||||
$$ = tmp;
|
||||
}
|
||||
| '@' '(' '*' ')' statement_or_null
|
||||
{ PEventStatement*tmp = new PEventStatement;
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
tmp->set_statement($5);
|
||||
$$ = tmp;
|
||||
}
|
||||
| lpvalue '=' expression ';'
|
||||
{ PAssign*tmp = new PAssign($1,$3);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| error '=' expression ';'
|
||||
|
|
@ -3213,8 +3127,7 @@ statement
|
|||
}
|
||||
| lpvalue K_LE expression ';'
|
||||
{ PAssignNB*tmp = new PAssignNB($1,$3);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| error K_LE expression ';'
|
||||
|
|
@ -3226,27 +3139,24 @@ statement
|
|||
{ assert($3->count() == 1);
|
||||
PExpr*del = (*$3)[0];
|
||||
PAssign*tmp = new PAssign($1,del,$4);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| lpvalue K_LE delay1 expression ';'
|
||||
{ assert($3->count() == 1);
|
||||
PExpr*del = (*$3)[0];
|
||||
PAssignNB*tmp = new PAssignNB($1,del,$4);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| lpvalue '=' event_control expression ';'
|
||||
{ PAssign*tmp = new PAssign($1,$3,$4);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| lpvalue '=' K_repeat '(' expression ')' event_control expression ';'
|
||||
{ PAssign*tmp = new PAssign($1,$7,$8);
|
||||
tmp->set_file(@1.text);
|
||||
FILE_NAME(tmp,@1);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
yyerror(@3, "sorry: repeat event control not supported.");
|
||||
delete $5;
|
||||
|
|
@ -3255,31 +3165,27 @@ statement
|
|||
| lpvalue K_LE event_control expression ';'
|
||||
{ yyerror(@1, "sorry: Event controls not supported here.");
|
||||
PAssignNB*tmp = new PAssignNB($1,$4);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| lpvalue K_LE K_repeat '(' expression ')' event_control expression ';'
|
||||
{ yyerror(@1, "sorry: Event controls not supported here.");
|
||||
delete $5;
|
||||
PAssignNB*tmp = new PAssignNB($1,$8);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
$$ = tmp;
|
||||
}
|
||||
| K_wait '(' expression ')' statement_or_null
|
||||
{ PEventStatement*tmp;
|
||||
PEEvent*etmp = new PEEvent(PEEvent::POSITIVE, $3);
|
||||
tmp = new PEventStatement(etmp);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp,@1);
|
||||
tmp->set_statement($5);
|
||||
$$ = tmp;
|
||||
}
|
||||
| SYSTEM_IDENTIFIER '(' expression_list_with_nuls ')' ';'
|
||||
{ PCallTask*tmp = new PCallTask(lex_strings.make($1), *$3);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp,@1);
|
||||
delete $1;
|
||||
delete $3;
|
||||
$$ = tmp;
|
||||
|
|
@ -3287,15 +3193,13 @@ statement
|
|||
| SYSTEM_IDENTIFIER ';'
|
||||
{ svector<PExpr*>pt (0);
|
||||
PCallTask*tmp = new PCallTask(lex_strings.make($1), pt);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp,@1);
|
||||
delete $1;
|
||||
$$ = tmp;
|
||||
}
|
||||
| heirarchy_identifier '(' expression_list_proper ')' ';'
|
||||
{ PCallTask*tmp = new PCallTask(*$1, *$3);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $1;
|
||||
delete $3;
|
||||
$$ = tmp;
|
||||
|
|
@ -3308,16 +3212,14 @@ statement
|
|||
| heirarchy_identifier '(' ')' ';'
|
||||
{ svector<PExpr*>pt (0);
|
||||
PCallTask*tmp = new PCallTask(*$1, pt);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $1;
|
||||
$$ = tmp;
|
||||
}
|
||||
| heirarchy_identifier ';'
|
||||
{ svector<PExpr*>pt (0);
|
||||
PCallTask*tmp = new PCallTask(*$1, pt);
|
||||
tmp->set_file(@1.text);
|
||||
tmp->set_lineno(@1.first_line);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $1;
|
||||
$$ = tmp;
|
||||
}
|
||||
|
|
@ -3670,8 +3572,7 @@ udp_initial
|
|||
{ PExpr*etmp = new PENumber($4);
|
||||
PEIdent*itmp = new PEIdent(lex_strings.make($2));
|
||||
PAssign*atmp = new PAssign(itmp, etmp);
|
||||
atmp->set_file(@2.text);
|
||||
atmp->set_lineno(@2.first_line);
|
||||
FILE_NAME(atmp, @2);
|
||||
delete $2;
|
||||
$$ = atmp;
|
||||
}
|
||||
|
|
|
|||
97
pform.cc
97
pform.cc
|
|
@ -16,9 +16,6 @@
|
|||
* 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: pform.cc,v 1.148 2007/06/12 04:05:45 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -74,6 +71,18 @@ static int pform_time_prec = 0;
|
|||
static char*pform_timescale_file = 0;
|
||||
static unsigned pform_timescale_line = 0;
|
||||
|
||||
static inline void FILE_NAME(LineInfo*obj, const char*file, unsigned lineno)
|
||||
{
|
||||
obj->set_lineno(lineno);
|
||||
obj->set_file(filename_strings.make(file));
|
||||
}
|
||||
|
||||
static inline void FILE_NAME(LineInfo*tmp, const struct vlltype&where)
|
||||
{
|
||||
tmp->set_lineno(where.first_line);
|
||||
tmp->set_file(filename_strings.make(where.text));
|
||||
}
|
||||
|
||||
/*
|
||||
* The scope stack and the following functions handle the processing
|
||||
* of scope. As I enter a scope, the push function is called, and as I
|
||||
|
|
@ -133,7 +142,7 @@ void pform_set_default_nettype(NetNet::Type type,
|
|||
cerr << file<<":"<<lineno << ": : "
|
||||
<< "module " << pform_cur_module->mod_name()
|
||||
<< " starts on line "
|
||||
<< pform_cur_module->get_line() << "." << endl;
|
||||
<< pform_cur_module->get_fileline() << "." << endl;
|
||||
error_count += 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -176,7 +185,7 @@ void pform_set_timescale(int unit, int prec,
|
|||
|
||||
cerr << file << ":" << lineno << ": : "
|
||||
<< " -- module " << (*mod).first
|
||||
<< " declared here: " << mp->get_line() << endl;
|
||||
<< " declared here: " << mp->get_fileline() << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -243,8 +252,7 @@ void pform_startmodule(const char*name, const char*file, unsigned lineno,
|
|||
pform_cur_module->time_precision = pform_time_prec;
|
||||
pform_cur_module->default_nettype = pform_default_nettype;
|
||||
|
||||
pform_cur_module->set_file(file);
|
||||
pform_cur_module->set_lineno(lineno);
|
||||
FILE_NAME(pform_cur_module, file, lineno);
|
||||
pform_cur_module->library_flag = pform_library_flag;
|
||||
|
||||
/* The generate scheme numbering starts with *1*, not
|
||||
|
|
@ -254,7 +262,7 @@ void pform_startmodule(const char*name, const char*file, unsigned lineno,
|
|||
if (warn_timescale && pform_timescale_file
|
||||
&& (strcmp(pform_timescale_file,file) != 0)) {
|
||||
|
||||
cerr << pform_cur_module->get_line() << ": warning: "
|
||||
cerr << pform_cur_module->get_fileline() << ": warning: "
|
||||
<< "timescale for " << name
|
||||
<< " inherited from another file." << endl;
|
||||
cerr << pform_timescale_file << ":" << pform_timescale_line
|
||||
|
|
@ -279,8 +287,7 @@ Module::port_t* pform_module_port_reference(char*name,
|
|||
{
|
||||
Module::port_t*ptmp = new Module::port_t;
|
||||
PEIdent*tmp = new PEIdent(lex_strings.make(name));
|
||||
tmp->set_file(file);
|
||||
tmp->set_lineno(lineno);
|
||||
FILE_NAME(tmp, file, lineno);
|
||||
ptmp->name = lex_strings.make(name);
|
||||
ptmp->expr = svector<PEIdent*>(1);
|
||||
ptmp->expr[0] = tmp;
|
||||
|
|
@ -318,7 +325,7 @@ void pform_endmodule(const char*name)
|
|||
if (test != pform_modules.end()) {
|
||||
ostringstream msg;
|
||||
msg << "Module " << name << " was already declared here: "
|
||||
<< (*test).second->get_line() << endl;
|
||||
<< (*test).second->get_fileline() << endl;
|
||||
VLerror(msg.str().c_str());
|
||||
pform_cur_module = 0;
|
||||
return;
|
||||
|
|
@ -344,8 +351,7 @@ void pform_start_generate_for(const struct vlltype&li,
|
|||
{
|
||||
PGenerate*gen = new PGenerate(scope_generate_counter++);
|
||||
|
||||
gen->set_file(li.text);
|
||||
gen->set_lineno(li.first_line);
|
||||
FILE_NAME(gen, li);
|
||||
|
||||
// For now, assume that generates do not nest.
|
||||
gen->parent = pform_cur_generate;
|
||||
|
|
@ -366,8 +372,7 @@ void pform_start_generate_if(const struct vlltype&li, PExpr*test)
|
|||
{
|
||||
PGenerate*gen = new PGenerate(scope_generate_counter++);
|
||||
|
||||
gen->set_file(li.text);
|
||||
gen->set_lineno(li.first_line);
|
||||
FILE_NAME(gen, li);
|
||||
|
||||
// For now, assume that generates do not nest.
|
||||
gen->parent = pform_cur_generate;
|
||||
|
|
@ -390,8 +395,7 @@ void pform_start_generate_else(const struct vlltype&li)
|
|||
|
||||
PGenerate*gen = new PGenerate(scope_generate_counter++);
|
||||
|
||||
gen->set_file(li.text);
|
||||
gen->set_lineno(li.first_line);
|
||||
FILE_NAME(gen, li);
|
||||
|
||||
// For now, assume that generates do not nest.
|
||||
gen->parent = pform_cur_generate;
|
||||
|
|
@ -468,7 +472,7 @@ PExpr* pform_select_mtm_expr(PExpr*min, PExpr*typ, PExpr*max)
|
|||
}
|
||||
|
||||
if (min_typ_max_warn > 0) {
|
||||
cerr << res->get_line() << ": warning: choosing ";
|
||||
cerr << res->get_fileline() << ": warning: choosing ";
|
||||
switch (min_typ_max_flag) {
|
||||
case MIN:
|
||||
cerr << "min";
|
||||
|
|
@ -761,8 +765,7 @@ void pform_make_udp(perm_string name, bool synchronous_flag,
|
|||
synchronous_flag? NetNet::REG : NetNet::WIRE,
|
||||
NetNet::POUTPUT,
|
||||
IVL_VT_LOGIC);
|
||||
pins[0]->set_file(file);
|
||||
pins[0]->set_lineno(lineno);
|
||||
FILE_NAME(pins[0], file, lineno);
|
||||
|
||||
/* Make the PWire objects for the input ports. */
|
||||
{ list<perm_string>::iterator cur;
|
||||
|
|
@ -775,8 +778,7 @@ void pform_make_udp(perm_string name, bool synchronous_flag,
|
|||
NetNet::WIRE,
|
||||
NetNet::PINPUT,
|
||||
IVL_VT_LOGIC);
|
||||
pins[idx]->set_file(file);
|
||||
pins[idx]->set_lineno(lineno);
|
||||
FILE_NAME(pins[idx], file, lineno);
|
||||
}
|
||||
assert(idx == pins.count());
|
||||
}
|
||||
|
|
@ -913,8 +915,7 @@ void pform_set_net_range(list<perm_string>*names,
|
|||
static void pform_make_event(perm_string name, const char*fn, unsigned ln)
|
||||
{
|
||||
PEvent*event = new PEvent(name);
|
||||
event->set_file(fn);
|
||||
event->set_lineno(ln);
|
||||
FILE_NAME(event, fn, ln);
|
||||
pform_cur_module->events[name] = event;
|
||||
}
|
||||
|
||||
|
|
@ -961,8 +962,7 @@ void pform_makegate(PGBuiltin::Type type,
|
|||
|
||||
cur->strength0(str.str0);
|
||||
cur->strength1(str.str1);
|
||||
cur->set_file(info.file);
|
||||
cur->set_lineno(info.lineno);
|
||||
FILE_NAME(cur, info.file, info.lineno);
|
||||
|
||||
if (pform_cur_generate)
|
||||
pform_cur_generate->add_gate(cur);
|
||||
|
|
@ -1013,8 +1013,7 @@ static void pform_make_modgate(perm_string type,
|
|||
const char*fn, unsigned ln)
|
||||
{
|
||||
PGModule*cur = new PGModule(type, name, wires);
|
||||
cur->set_file(fn);
|
||||
cur->set_lineno(ln);
|
||||
FILE_NAME(cur, fn, ln);
|
||||
cur->set_range(msb,lsb);
|
||||
|
||||
if (overrides && overrides->by_name) {
|
||||
|
|
@ -1055,8 +1054,7 @@ static void pform_make_modgate(perm_string type,
|
|||
}
|
||||
|
||||
PGModule*cur = new PGModule(type, name, pins, npins);
|
||||
cur->set_file(fn);
|
||||
cur->set_lineno(ln);
|
||||
FILE_NAME(cur, fn, ln);
|
||||
cur->set_range(msb,lsb);
|
||||
|
||||
if (overrides && overrides->by_name) {
|
||||
|
|
@ -1161,8 +1159,7 @@ void pform_make_pgassign_list(svector<PExpr*>*alist,
|
|||
tmp = pform_make_pgassign((*alist)[2*idx],
|
||||
(*alist)[2*idx+1],
|
||||
del, str);
|
||||
tmp->set_file(fn);
|
||||
tmp->set_lineno(lineno);
|
||||
FILE_NAME(tmp, fn, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1194,14 +1191,11 @@ void pform_make_reginit(const struct vlltype&li,
|
|||
}
|
||||
|
||||
PEIdent*lval = new PEIdent(sname);
|
||||
lval->set_file(li.text);
|
||||
lval->set_lineno(li.first_line);
|
||||
FILE_NAME(lval, li);
|
||||
PAssign*ass = new PAssign(lval, expr);
|
||||
ass->set_file(li.text);
|
||||
ass->set_lineno(li.first_line);
|
||||
FILE_NAME(ass, li);
|
||||
PProcess*top = new PProcess(PProcess::PR_INITIAL, ass);
|
||||
top->set_file(li.text);
|
||||
top->set_lineno(li.first_line);
|
||||
FILE_NAME(top, li);
|
||||
|
||||
pform_cur_module->add_behavior(top);
|
||||
}
|
||||
|
|
@ -1229,7 +1223,7 @@ void pform_module_define_port(const struct vlltype&li,
|
|||
if (cur) {
|
||||
ostringstream msg;
|
||||
msg << nm << " definition conflicts with "
|
||||
<< "definition at " << cur->get_line()
|
||||
<< "definition at " << cur->get_fileline()
|
||||
<< ".";
|
||||
VLerror(msg.str().c_str());
|
||||
return;
|
||||
|
|
@ -1237,8 +1231,7 @@ void pform_module_define_port(const struct vlltype&li,
|
|||
|
||||
|
||||
cur = new PWire(name, type, port_type, IVL_VT_LOGIC);
|
||||
cur->set_file(li.text);
|
||||
cur->set_lineno(li.first_line);
|
||||
FILE_NAME(cur, li);
|
||||
|
||||
cur->set_signed(signed_flag);
|
||||
|
||||
|
|
@ -1304,7 +1297,7 @@ void pform_makewire(const vlltype&li, const char*nm,
|
|||
if (rc == false) {
|
||||
ostringstream msg;
|
||||
msg << nm << " definition conflicts with "
|
||||
<< "definition at " << cur->get_line()
|
||||
<< "definition at " << cur->get_fileline()
|
||||
<< ".";
|
||||
VLerror(msg.str().c_str());
|
||||
cerr << "XXXX type=" << type <<", curtype=" << cur->get_wire_type() << endl;
|
||||
|
|
@ -1318,8 +1311,7 @@ void pform_makewire(const vlltype&li, const char*nm,
|
|||
cur = new PWire(name, type, pt, dt);
|
||||
}
|
||||
|
||||
cur->set_file(li.text);
|
||||
cur->set_lineno(li.first_line);
|
||||
FILE_NAME(cur, li.text, li.first_line);
|
||||
|
||||
switch (dt) {
|
||||
case IVL_VT_REAL:
|
||||
|
|
@ -1407,12 +1399,10 @@ void pform_makewire(const vlltype&li,
|
|||
PWire*cur = get_wire_in_module(name);
|
||||
if (cur != 0) {
|
||||
PEIdent*lval = new PEIdent(first_name);
|
||||
lval->set_file(li.text);
|
||||
lval->set_lineno(li.first_line);
|
||||
FILE_NAME(lval, li.text, li.first_line);
|
||||
PGAssign*ass = pform_make_pgassign(lval, first->expr,
|
||||
delay, str);
|
||||
ass->set_file(li.text);
|
||||
ass->set_lineno(li.first_line);
|
||||
FILE_NAME(ass, li.text, li.first_line);
|
||||
}
|
||||
|
||||
free(first->name);
|
||||
|
|
@ -1428,8 +1418,7 @@ void pform_set_port_type(perm_string nm, NetNet::PortType pt,
|
|||
PWire*cur = pform_cur_module->get_wire(name);
|
||||
if (cur == 0) {
|
||||
cur = new PWire(name, NetNet::IMPLICIT, NetNet::PIMPLICIT, IVL_VT_LOGIC);
|
||||
cur->set_file(file);
|
||||
cur->set_lineno(lineno);
|
||||
FILE_NAME(cur, file, lineno);
|
||||
pform_cur_module->add_wire(cur);
|
||||
}
|
||||
|
||||
|
|
@ -1518,8 +1507,7 @@ svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
|
|||
curw->set_port_type(pt);
|
||||
} else {
|
||||
curw = new PWire(name, NetNet::IMPLICIT_REG, pt, vtype);
|
||||
curw->set_file(file);
|
||||
curw->set_lineno(lineno);
|
||||
FILE_NAME(curw, file, lineno);
|
||||
pform_cur_module->add_wire(curw);
|
||||
}
|
||||
|
||||
|
|
@ -1666,8 +1654,7 @@ extern PSpecPath* pform_make_specify_path(const struct vlltype&li,
|
|||
bool full_flag, list<perm_string>*dst)
|
||||
{
|
||||
PSpecPath*path = new PSpecPath(src->size(), dst->size());
|
||||
path->set_file(li.text);
|
||||
path->set_lineno(li.first_line);
|
||||
FILE_NAME(path, li.text, li.first_line);
|
||||
|
||||
unsigned idx;
|
||||
list<perm_string>::const_iterator cur;
|
||||
|
|
@ -1895,7 +1882,7 @@ int pform_parse(const char*path, FILE*file)
|
|||
void pform_error_nested_modules()
|
||||
{
|
||||
assert( pform_cur_module != 0 );
|
||||
cerr << pform_cur_module->get_line() << ": error: original module "
|
||||
cerr << pform_cur_module->get_fileline() << ": error: original module "
|
||||
"(" << pform_cur_module->mod_name() << ") defined here." << endl;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ void Statement::dump(ostream&out, unsigned ind) const
|
|||
so just print the C++ typeid and let the user figure
|
||||
it out. */
|
||||
out << setw(ind) << "";
|
||||
out << "/* " << get_line() << ": " << typeid(*this).name()
|
||||
out << "/* " << get_fileline() << ": " << typeid(*this).name()
|
||||
<< " */ ;" << endl;
|
||||
}
|
||||
|
||||
|
|
@ -491,14 +491,14 @@ void PAssign::dump(ostream&out, unsigned ind) const
|
|||
{
|
||||
out << setw(ind) << "";
|
||||
out << *lval() << " = " << delay_ << " " << *rval() << ";";
|
||||
out << " /* " << get_line() << " */" << endl;
|
||||
out << " /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PAssignNB::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "";
|
||||
out << *lval() << " <= " << delay_ << " " << *rval() << ";";
|
||||
out << " /* " << get_line() << " */" << endl;
|
||||
out << " /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PBlock::dump(ostream&out, unsigned ind) const
|
||||
|
|
@ -535,7 +535,7 @@ void PCallTask::dump(ostream&out, unsigned ind) const
|
|||
out << ")";
|
||||
}
|
||||
|
||||
out << "; /* " << get_line() << " */" << endl;
|
||||
out << "; /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PCase::dump(ostream&out, unsigned ind) const
|
||||
|
|
@ -552,7 +552,7 @@ void PCase::dump(ostream&out, unsigned ind) const
|
|||
out << "casez";
|
||||
break;
|
||||
}
|
||||
out << " (" << *expr_ << ") /* " << get_line() << " */" << endl;
|
||||
out << " (" << *expr_ << ") /* " << get_fileline() << " */" << endl;
|
||||
|
||||
for (unsigned idx = 0 ; idx < items_->count() ; idx += 1) {
|
||||
PCase::Item*cur = (*items_)[idx];
|
||||
|
|
@ -596,19 +596,19 @@ void PCondit::dump(ostream&out, unsigned ind) const
|
|||
void PCAssign::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "" << "assign " << *lval_ << " = " << *expr_
|
||||
<< "; /* " << get_line() << " */" << endl;
|
||||
<< "; /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PDeassign::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "" << "deassign " << *lval_ << "; /* "
|
||||
<< get_line() << " */" << endl;
|
||||
<< get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PDelayStatement::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "" << "#" << *delay_ << " /* " <<
|
||||
get_line() << " */";
|
||||
get_fileline() << " */";
|
||||
if (statement_) {
|
||||
out << endl;
|
||||
statement_->dump(out, ind+2);
|
||||
|
|
@ -620,7 +620,7 @@ void PDelayStatement::dump(ostream&out, unsigned ind) const
|
|||
void PDisable::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "" << "disable " << scope_ << "; /* "
|
||||
<< get_line() << " */" << endl;
|
||||
<< get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PEventStatement::dump(ostream&out, unsigned ind) const
|
||||
|
|
@ -648,12 +648,12 @@ void PEventStatement::dump(ostream&out, unsigned ind) const
|
|||
void PForce::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "" << "force " << *lval_ << " = " << *expr_
|
||||
<< "; /* " << get_line() << " */" << endl;
|
||||
<< "; /* " << get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PForever::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "" << "forever /* " << get_line() << " */" << endl;
|
||||
out << setw(ind) << "" << "forever /* " << get_fileline() << " */" << endl;
|
||||
statement_->dump(out, ind+3);
|
||||
}
|
||||
|
||||
|
|
@ -715,7 +715,7 @@ void PFunction::dump(ostream&out, unsigned ind) const
|
|||
void PRelease::dump(ostream&out, unsigned ind) const
|
||||
{
|
||||
out << setw(ind) << "" << "release " << *lval_ << "; /* "
|
||||
<< get_line() << " */" << endl;
|
||||
<< get_fileline() << " */" << endl;
|
||||
}
|
||||
|
||||
void PRepeat::dump(ostream&out, unsigned ind) const
|
||||
|
|
@ -774,7 +774,7 @@ void PProcess::dump(ostream&out, unsigned ind) const
|
|||
break;
|
||||
}
|
||||
|
||||
out << " /* " << get_line() << " */" << endl;
|
||||
out << " /* " << get_fileline() << " */" << endl;
|
||||
|
||||
for (map<perm_string,PExpr*>::const_iterator idx = attributes.begin()
|
||||
; idx != attributes.end() ; idx++ ) {
|
||||
|
|
@ -982,7 +982,7 @@ void Module::dump(ostream&out) const
|
|||
; cur != events.end() ; cur ++ ) {
|
||||
PEvent*ev = (*cur).second;
|
||||
out << " event " << ev->name() << "; // "
|
||||
<< ev->get_line() << endl;
|
||||
<< ev->get_fileline() << endl;
|
||||
}
|
||||
|
||||
// Iterate through and display all the wires.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999-2006 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 1999-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: set_width.cc,v 1.42 2007/01/16 05:44:15 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -39,7 +36,7 @@
|
|||
|
||||
bool NetExpr::set_width(unsigned w, bool)
|
||||
{
|
||||
cerr << get_line() << ": internal warning: "
|
||||
cerr << get_fileline() << ": internal warning: "
|
||||
<<typeid(*this).name() << ": set_width(unsigned) "
|
||||
<< "not implemented." << endl;
|
||||
expr_width(w);
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@
|
|||
* 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: syn-rules.y,v 1.34 2007/01/16 05:44:15 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -147,7 +144,7 @@ static void make_DFF_CE(Design*des, NetProcTop*top, NetEvWait*wclk,
|
|||
NetNet*ce = cexp? cexp->synthesize(des) : 0;
|
||||
|
||||
if (d == 0) {
|
||||
cerr << asn->get_line() << ": internal error: "
|
||||
cerr << asn->get_fileline() << ": internal error: "
|
||||
<< " not a simple signal? " << *asn->rval() << endl;
|
||||
}
|
||||
|
||||
|
|
|
|||
69
synth2.cc
69
synth2.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2005 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2002-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: synth2.cc,v 1.46 2007/03/22 16:08:17 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -40,7 +37,7 @@ bool NetProc::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
const svector<NetEvProbe*>&events)
|
||||
{
|
||||
if (events.count() > 0) {
|
||||
cerr << get_line() << ": error: Events are unaccounted"
|
||||
cerr << get_fileline() << ": error: Events are unaccounted"
|
||||
<< " for in process synthesis." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -49,17 +46,6 @@ bool NetProc::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
return synth_async(des, scope, nex_map, nex_out);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static unsigned find_nexus_in_set(const NetBus&nset, const Nexus*nex)
|
||||
{
|
||||
unsigned idx = 0;
|
||||
for (idx = 0 ; idx < nset.pin_count() ; idx += 1)
|
||||
if (nset.pin(idx).nexus() == nex)
|
||||
return idx;
|
||||
|
||||
return idx;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Async synthesis of assignments is done by synthesizing the rvalue
|
||||
|
|
@ -79,7 +65,7 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
|
|||
|
||||
NetNet*lsig = lval_->sig();
|
||||
if (!lsig) {
|
||||
cerr << get_line() << ": error: "
|
||||
cerr << get_fileline() << ": error: "
|
||||
<< "NetAssignBase::synth_async on unsupported lval ";
|
||||
dump_lval(cerr);
|
||||
cerr << endl;
|
||||
|
|
@ -89,24 +75,13 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope,
|
|||
assert(lval_->more == 0);
|
||||
|
||||
if (debug_synth2) {
|
||||
cerr << get_line() << ": debug: l-value signal is "
|
||||
cerr << get_fileline() << ": debug: l-value signal is "
|
||||
<< lsig->vector_width() << " bits, r-value signal is "
|
||||
<< rsig->vector_width() << " bits." << endl;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* The l-value and r-value map must have the same width. */
|
||||
if (lval_->lwidth() != nex_map->vector_width()) {
|
||||
cerr << get_line() << ": error: Assignment synthesis: "
|
||||
<< "vector width mismatch, "
|
||||
<< lval_->lwidth() << " bits != "
|
||||
<< nex_map->vector_width() << " bits." << endl;
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
/* For now, assume there is exactly one output. */
|
||||
assert(nex_out.pin_count() == 1);
|
||||
#endif
|
||||
|
||||
connect(nex_out.pin(0), rsig->pin(0));
|
||||
|
||||
|
|
@ -241,7 +216,7 @@ bool NetCase::synth_async(Design*des, NetScope*scope,
|
|||
|
||||
NetProc*stmt = statement_map[idx];
|
||||
if (stmt == 0) {
|
||||
cerr << get_line() << ": error: case " << idx
|
||||
cerr << get_fileline() << ": error: case " << idx
|
||||
<< " is not accounted for in asynchronous mux." << endl;
|
||||
des->errors += 1;
|
||||
continue;
|
||||
|
|
@ -321,7 +296,7 @@ bool NetCondit::synth_async(Design*des, NetScope*scope,
|
|||
return true;
|
||||
|
||||
#else
|
||||
cerr << get_line() << ": sorry: "
|
||||
cerr << get_fileline() << ": sorry: "
|
||||
<< "Forgot to implement NetCondit::synth_async" << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
|
|
@ -349,7 +324,7 @@ bool NetProcTop::synth_async(Design*des)
|
|||
statement_->nex_output(nex_set);
|
||||
|
||||
if (debug_synth2) {
|
||||
cerr << get_line() << ": debug: Process has "
|
||||
cerr << get_fileline() << ": debug: Process has "
|
||||
<< nex_set.count() << " outputs." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -529,7 +504,7 @@ bool NetBlock::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
return flag;
|
||||
|
||||
#else
|
||||
cerr << get_line() << ": sorry: "
|
||||
cerr << get_fileline() << ": sorry: "
|
||||
<< "Forgot to implement NetBlock::synth_sync"
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -752,7 +727,7 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
return flag;
|
||||
|
||||
#else
|
||||
cerr << get_line() << ": sorry: "
|
||||
cerr << get_fileline() << ": sorry: "
|
||||
<< "Forgot to implement NetCondit::synth_sync" << endl;
|
||||
des->errors += 1;
|
||||
return false;
|
||||
|
|
@ -764,7 +739,7 @@ bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
const svector<NetEvProbe*>&events_in)
|
||||
{
|
||||
if (events_in.count() > 0) {
|
||||
cerr << get_line() << ": error: Events are unaccounted"
|
||||
cerr << get_fileline() << ": error: Events are unaccounted"
|
||||
<< " for in process synthesis." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -796,9 +771,9 @@ bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
|
||||
if (! statement_input ->contains(tmp_nex)) {
|
||||
if (pclk != 0) {
|
||||
cerr << get_line() << ": error: Too many "
|
||||
cerr << get_fileline() << ": error: Too many "
|
||||
<< "clocks for synchronous logic." << endl;
|
||||
cerr << get_line() << ": : Perhaps an"
|
||||
cerr << get_fileline() << ": : Perhaps an"
|
||||
<< " asynchronous set/reset is misused?" << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
|
|
@ -810,9 +785,9 @@ bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
}
|
||||
|
||||
if (pclk == 0) {
|
||||
cerr << get_line() << ": error: None of the edges"
|
||||
cerr << get_fileline() << ": error: None of the edges"
|
||||
<< " are valid clock inputs." << endl;
|
||||
cerr << get_line() << ": : Perhaps the clock"
|
||||
cerr << get_fileline() << ": : Perhaps the clock"
|
||||
<< " is read by a statement or expression?" << endl;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -823,7 +798,7 @@ bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
ff->attribute(polarity, verinum("INVERT"));
|
||||
|
||||
if (debug_synth2) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Detected a NEGEDGE clock for the synthesized ff."
|
||||
<< endl;
|
||||
}
|
||||
|
|
@ -844,7 +819,7 @@ bool NetEvWait::synth_sync(Design*des, NetScope*scope, NetFF*ff,
|
|||
bool NetProcTop::synth_sync(Design*des)
|
||||
{
|
||||
if (debug_synth2) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Process is apparently synchronous. Making NetFFs."
|
||||
<< endl;
|
||||
}
|
||||
|
|
@ -857,7 +832,7 @@ bool NetProcTop::synth_sync(Design*des)
|
|||
and resets. */
|
||||
|
||||
if (debug_synth2) {
|
||||
cerr << get_line() << ": debug: "
|
||||
cerr << get_fileline() << ": debug: "
|
||||
<< "Top level making a "
|
||||
<< nex_set[0]->vector_width() << "-wide "
|
||||
<< "NetFF device." << endl;
|
||||
|
|
@ -953,7 +928,7 @@ void synth2_f::process(class Design*des, class NetProcTop*top)
|
|||
if (top->is_synchronous()) do {
|
||||
bool flag = top->synth_sync(des);
|
||||
if (! flag) {
|
||||
cerr << top->get_line() << ": error: "
|
||||
cerr << top->get_fileline() << ": error: "
|
||||
<< "Unable to synthesize synchronous process." << endl;
|
||||
des->errors += 1;
|
||||
return;
|
||||
|
|
@ -965,7 +940,7 @@ void synth2_f::process(class Design*des, class NetProcTop*top)
|
|||
if (! top->is_asynchronous()) {
|
||||
bool synth_error_flag = false;
|
||||
if (top->attribute(perm_string::literal("ivl_combinational")).as_ulong() != 0) {
|
||||
cerr << top->get_line() << ": error: "
|
||||
cerr << top->get_fileline() << ": error: "
|
||||
<< "Process is marked combinational,"
|
||||
<< " but isn't really." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -973,7 +948,7 @@ void synth2_f::process(class Design*des, class NetProcTop*top)
|
|||
}
|
||||
|
||||
if (top->attribute(perm_string::literal("ivl_synthesis_on")).as_ulong() != 0) {
|
||||
cerr << top->get_line() << ": error: "
|
||||
cerr << top->get_fileline() << ": error: "
|
||||
<< "Process is marked for synthesis,"
|
||||
<< " but I can't do it." << endl;
|
||||
des->errors += 1;
|
||||
|
|
@ -981,14 +956,14 @@ void synth2_f::process(class Design*des, class NetProcTop*top)
|
|||
}
|
||||
|
||||
if (! synth_error_flag)
|
||||
cerr << top->get_line() << ": warning: "
|
||||
cerr << top->get_fileline() << ": warning: "
|
||||
<< "Process not synthesized." << endl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (! top->synth_async(des)) {
|
||||
cerr << top->get_line() << ": internal error: "
|
||||
cerr << top->get_fileline() << ": internal error: "
|
||||
<< "is_asynchronous does not match "
|
||||
<< "sync_async results." << endl;
|
||||
des->errors += 1;
|
||||
|
|
|
|||
138
t-dll-expr.cc
138
t-dll-expr.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: t-dll-expr.cc,v 1.47 2007/03/22 16:08:18 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -248,7 +245,7 @@ void dll_target::expr_param(const NetEConstParam*net)
|
|||
ivl_parameter_t par = scope_find_param(scope, net->name());
|
||||
|
||||
if (par == 0) {
|
||||
cerr << net->get_line() << ": internal error: "
|
||||
cerr << net->get_fileline() << ": internal error: "
|
||||
<< "Parameter " << net->name() << " missing from "
|
||||
<< ivl_scope_name(scope) << endl;
|
||||
}
|
||||
|
|
@ -472,134 +469,3 @@ void dll_target::expr_unary(const NetEUnary*net)
|
|||
expr_->u_.unary_.sub_ = sub;
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: t-dll-expr.cc,v $
|
||||
* Revision 1.47 2007/03/22 16:08:18 steve
|
||||
* Spelling fixes from Larry
|
||||
*
|
||||
* Revision 1.46 2007/02/20 05:58:36 steve
|
||||
* Handle unary minus of real valued expressions.
|
||||
*
|
||||
* Revision 1.45 2007/02/14 05:59:46 steve
|
||||
* Handle type of ternary expressions properly.
|
||||
*
|
||||
* Revision 1.44 2007/01/16 05:44:15 steve
|
||||
* Major rework of array handling. Memories are replaced with the
|
||||
* more general concept of arrays. The NetMemory and NetEMemory
|
||||
* classes are removed from the ivl core program, and the IVL_LPM_RAM
|
||||
* lpm type is removed from the ivl_target API.
|
||||
*
|
||||
* Revision 1.43 2005/09/14 02:53:15 steve
|
||||
* Support bool expressions and compares handle them optimally.
|
||||
*
|
||||
* Revision 1.42 2005/07/13 04:51:36 steve
|
||||
* Functions get type from their output signal.
|
||||
*
|
||||
* Revision 1.41 2005/07/11 16:56:51 steve
|
||||
* Remove NetVariable and ivl_variable_t structures.
|
||||
*
|
||||
* Revision 1.40 2005/01/24 05:28:31 steve
|
||||
* Remove the NetEBitSel and combine all bit/part select
|
||||
* behavior into the NetESelect node and IVL_EX_SELECT
|
||||
* ivl_target expression type.
|
||||
*
|
||||
* Revision 1.39 2004/06/17 16:06:19 steve
|
||||
* Help system function signedness survive elaboration.
|
||||
*
|
||||
* Revision 1.38 2003/07/26 03:34:43 steve
|
||||
* Start handling pad of expressions in code generators.
|
||||
*
|
||||
* Revision 1.37 2003/06/24 01:38:03 steve
|
||||
* Various warnings fixed.
|
||||
*
|
||||
* Revision 1.36 2003/04/22 04:48:30 steve
|
||||
* Support event names as expressions elements.
|
||||
*
|
||||
* Revision 1.35 2003/03/10 23:40:53 steve
|
||||
* Keep parameter constants for the ivl_target API.
|
||||
*
|
||||
* Revision 1.34 2003/03/01 06:25:30 steve
|
||||
* Add the lex_strings string handler, and put
|
||||
* scope names and system task/function names
|
||||
* into this table. Also, permallocate event
|
||||
* names from the beginning.
|
||||
*
|
||||
* Revision 1.33 2003/02/02 00:19:27 steve
|
||||
* Terminate bits string from ivl_expr_bits.
|
||||
*
|
||||
* Revision 1.32 2003/01/30 16:23:08 steve
|
||||
* Spelling fixes.
|
||||
*
|
||||
* Revision 1.31 2003/01/27 00:14:37 steve
|
||||
* Support in various contexts the $realtime
|
||||
* system task.
|
||||
*
|
||||
* Revision 1.30 2003/01/26 21:15:59 steve
|
||||
* Rework expression parsing and elaboration to
|
||||
* accommodate real/realtime values and expressions.
|
||||
*
|
||||
* Revision 1.29 2002/10/23 01:47:17 steve
|
||||
* Fix synth2 handling of aset/aclr signals where
|
||||
* flip-flops are split by begin-end blocks.
|
||||
*
|
||||
* Revision 1.28 2002/08/12 01:35:00 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.27 2002/08/04 18:28:15 steve
|
||||
* Do not use hierarchical names of memories to
|
||||
* generate vvp labels. -tdll target does not
|
||||
* used hierarchical name string to look up the
|
||||
* memory objects in the design.
|
||||
*
|
||||
* Revision 1.26 2002/06/16 20:39:12 steve
|
||||
* Normalize run-time index expressions for bit selects
|
||||
*
|
||||
* Revision 1.25 2002/06/16 19:19:16 steve
|
||||
* Generate runtime code to normalize indices.
|
||||
*
|
||||
* Revision 1.24 2002/05/29 22:05:54 steve
|
||||
* Offset lvalue index expressions.
|
||||
*
|
||||
* Revision 1.23 2002/04/14 02:56:19 steve
|
||||
* Support signed expressions through to VPI.
|
||||
*
|
||||
* Revision 1.22 2002/01/28 00:52:41 steve
|
||||
* Add support for bit select of parameters.
|
||||
* This leads to a NetESelect node and the
|
||||
* vvp code generator to support that.
|
||||
*
|
||||
* Revision 1.21 2001/12/31 00:08:14 steve
|
||||
* Support $signed cast of expressions.
|
||||
*
|
||||
* Revision 1.20 2001/10/23 04:22:41 steve
|
||||
* Support bit selects of non-0 lsb for vectors.
|
||||
*
|
||||
* Revision 1.19 2001/10/19 21:53:24 steve
|
||||
* Support multiple root modules (Philip Blundell)
|
||||
*
|
||||
* Revision 1.18 2001/09/15 18:27:04 steve
|
||||
* Make configure detect malloc.h
|
||||
*
|
||||
* Revision 1.17 2001/07/27 04:51:44 steve
|
||||
* Handle part select expressions as variants of
|
||||
* NetESignal/IVL_EX_SIGNAL objects, instead of
|
||||
* creating new and useless temporary signals.
|
||||
*
|
||||
* Revision 1.16 2001/07/25 03:10:49 steve
|
||||
* Create a config.h.in file to hold all the config
|
||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.15 2001/07/22 00:17:49 steve
|
||||
* Support the NetESubSignal expressions in vvp.tgt.
|
||||
*
|
||||
* Revision 1.14 2001/07/07 20:20:10 steve
|
||||
* Pass parameters to system functions.
|
||||
*
|
||||
* Revision 1.13 2001/05/17 04:37:02 steve
|
||||
* Behavioral ternary operators for vvp.
|
||||
*
|
||||
* Revision 1.12 2001/05/08 23:59:33 steve
|
||||
* Add ivl and vvp.tgt support for memories in
|
||||
* expressions and l-values. (Stephan Boettcher)
|
||||
*/
|
||||
|
||||
|
|
|
|||
7
t-dll.cc
7
t-dll.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000-2005 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: t-dll.cc,v 1.171 2007/06/02 03:42:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -2236,7 +2233,7 @@ bool dll_target::signal_paths(const NetNet*net)
|
|||
for (unsigned pin = 0; pin < src->src_count(); pin += 1) {
|
||||
const Nexus*nex = src->src_pin(pin).nexus();
|
||||
if (! nex->t_cookie()) {
|
||||
cerr << src->get_line() << ": internal error: "
|
||||
cerr << src->get_fileline() << ": internal error: "
|
||||
<< "No signal connected to pin " << pin
|
||||
<< " of delay path to " << net->name()
|
||||
<< "." << endl;
|
||||
|
|
|
|||
21
target.cc
21
target.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998-2003 Stephen Williams <steve@icarus.com>
|
||||
* Copyright (c) 1998-2007 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
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
* 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: target.cc,v 1.81 2007/06/02 03:42:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
||||
|
|
@ -37,7 +34,7 @@ void target_t::scope(const NetScope*)
|
|||
|
||||
void target_t::event(const NetEvent*ev)
|
||||
{
|
||||
cerr << ev->get_line() << ": error: target (" << typeid(*this).name()
|
||||
cerr << ev->get_fileline() << ": error: target (" << typeid(*this).name()
|
||||
<< "): Unhandled event <" << ev->name() << ">." << endl;
|
||||
}
|
||||
|
||||
|
|
@ -241,7 +238,7 @@ void target_t::proc_case(const NetCase*cur)
|
|||
bool target_t::proc_cassign(const NetCAssign*dev)
|
||||
{
|
||||
cerr << "target (" << typeid(*this).name() << "): ";
|
||||
cerr << dev->get_line();
|
||||
cerr << dev->get_fileline();
|
||||
cerr << ": Target does not support procedural continuous assignment." << endl;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -256,7 +253,7 @@ bool target_t::proc_condit(const NetCondit*condit)
|
|||
|
||||
bool target_t::proc_deassign(const NetDeassign*dev)
|
||||
{
|
||||
cerr << dev->get_line() << ": internal error: "
|
||||
cerr << dev->get_fileline() << ": internal error: "
|
||||
<< "target (" << typeid(*this).name() << "): "
|
||||
<< "Unhandled proc_deassign." << endl;
|
||||
return false;
|
||||
|
|
@ -271,7 +268,7 @@ bool target_t::proc_delay(const NetPDelay*)
|
|||
|
||||
bool target_t::proc_disable(const NetDisable*obj)
|
||||
{
|
||||
cerr << obj->get_line() << ": internal error: "
|
||||
cerr << obj->get_fileline() << ": internal error: "
|
||||
<< "target (" << typeid(*this).name() << "): "
|
||||
<< "does not support disable statements." << endl;
|
||||
return false;
|
||||
|
|
@ -292,7 +289,7 @@ void target_t::proc_forever(const NetForever*)
|
|||
|
||||
bool target_t::proc_release(const NetRelease*dev)
|
||||
{
|
||||
cerr << dev->get_line() << ": internal error: "
|
||||
cerr << dev->get_fileline() << ": internal error: "
|
||||
<< "target (" << typeid(*this).name() << "): "
|
||||
<< "Unhandled proc_release." << endl;
|
||||
return false;
|
||||
|
|
@ -306,7 +303,7 @@ void target_t::proc_repeat(const NetRepeat*)
|
|||
|
||||
bool target_t::proc_trigger(const NetEvTrig*tr)
|
||||
{
|
||||
cerr << tr->get_line() << ": error: target (" << typeid(*this).name()
|
||||
cerr << tr->get_fileline() << ": error: target (" << typeid(*this).name()
|
||||
<< "): Unhandled event trigger." << endl;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -325,7 +322,7 @@ void target_t::proc_utask(const NetUTask*)
|
|||
|
||||
bool target_t::proc_wait(const NetEvWait*tr)
|
||||
{
|
||||
cerr << tr->get_line() << ": error: target (" << typeid(*this).name()
|
||||
cerr << tr->get_fileline() << ": error: target (" << typeid(*this).name()
|
||||
<< "): Unhandled event wait." << endl;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -370,7 +367,7 @@ void expr_scan_t::expr_rparam(const NetECRealParam*that)
|
|||
|
||||
void expr_scan_t::expr_concat(const NetEConcat*that)
|
||||
{
|
||||
cerr << that->get_line() << ": expr_scan_t (" <<
|
||||
cerr << that->get_fileline() << ": expr_scan_t (" <<
|
||||
typeid(*this).name() << "): unhandled expr_concat." << endl;
|
||||
}
|
||||
void expr_scan_t::expr_event(const NetEEvent*)
|
||||
|
|
|
|||
Loading…
Reference in New Issue