Unary reduction operators are all 1-bit results.
This commit is contained in:
parent
e00aedd99b
commit
f28f5e01e5
10
netlist.cc
10
netlist.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: netlist.cc,v 1.176 2001/11/19 01:54:14 steve Exp $"
|
#ident "$Id: netlist.cc,v 1.177 2001/11/19 04:26:46 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -2326,6 +2326,11 @@ const NetExpr* NetETernary::false_expr() const
|
||||||
NetEUnary::NetEUnary(char op, NetExpr*ex)
|
NetEUnary::NetEUnary(char op, NetExpr*ex)
|
||||||
: NetExpr(ex->expr_width()), op_(op), expr_(ex)
|
: NetExpr(ex->expr_width()), op_(op), expr_(ex)
|
||||||
{
|
{
|
||||||
|
switch (op_) {
|
||||||
|
case '!':
|
||||||
|
expr_width(1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NetEUnary::~NetEUnary()
|
NetEUnary::~NetEUnary()
|
||||||
|
|
@ -2402,6 +2407,9 @@ const NetProc*NetTaskDef::proc() const
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: netlist.cc,v $
|
* $Log: netlist.cc,v $
|
||||||
|
* Revision 1.177 2001/11/19 04:26:46 steve
|
||||||
|
* Unary reduction operators are all 1-bit results.
|
||||||
|
*
|
||||||
* Revision 1.176 2001/11/19 01:54:14 steve
|
* Revision 1.176 2001/11/19 01:54:14 steve
|
||||||
* Port close cropping behavior from mcrgb
|
* Port close cropping behavior from mcrgb
|
||||||
* Move window array reset to libmc.
|
* Move window array reset to libmc.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: netlist.h,v 1.224 2001/11/14 03:28:49 steve Exp $"
|
#ident "$Id: netlist.h,v 1.225 2001/11/19 04:26:46 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2445,6 +2445,7 @@ class NetEUReduce : public NetEUnary {
|
||||||
NetEUReduce(char op, NetExpr*ex);
|
NetEUReduce(char op, NetExpr*ex);
|
||||||
~NetEUReduce();
|
~NetEUReduce();
|
||||||
|
|
||||||
|
virtual bool set_width(unsigned w);
|
||||||
virtual NetNet* synthesize(Design*);
|
virtual NetNet* synthesize(Design*);
|
||||||
virtual NetEConst* eval_tree();
|
virtual NetEConst* eval_tree();
|
||||||
|
|
||||||
|
|
@ -2861,6 +2862,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: netlist.h,v $
|
* $Log: netlist.h,v $
|
||||||
|
* Revision 1.225 2001/11/19 04:26:46 steve
|
||||||
|
* Unary reduction operators are all 1-bit results.
|
||||||
|
*
|
||||||
* Revision 1.224 2001/11/14 03:28:49 steve
|
* Revision 1.224 2001/11/14 03:28:49 steve
|
||||||
* DLL target support for force and release.
|
* DLL target support for force and release.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
16
set_width.cc
16
set_width.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: set_width.cc,v 1.19 2001/07/27 04:51:44 steve Exp $"
|
#ident "$Id: set_width.cc,v 1.20 2001/11/19 04:26:46 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -330,6 +330,8 @@ bool NetEUnary::set_width(unsigned w)
|
||||||
flag = expr_->set_width(w);
|
flag = expr_->set_width(w);
|
||||||
expr_width(w);
|
expr_width(w);
|
||||||
break;
|
break;
|
||||||
|
case '!':
|
||||||
|
return w == 1;
|
||||||
default:
|
default:
|
||||||
flag = expr_width() == w;
|
flag = expr_width() == w;
|
||||||
break;
|
break;
|
||||||
|
|
@ -338,9 +340,21 @@ bool NetEUnary::set_width(unsigned w)
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unary reduction operators allow its operand to have any width. The
|
||||||
|
* result is defined to be 1.
|
||||||
|
*/
|
||||||
|
bool NetEUReduce::set_width(unsigned w)
|
||||||
|
{
|
||||||
|
return w == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: set_width.cc,v $
|
* $Log: set_width.cc,v $
|
||||||
|
* Revision 1.20 2001/11/19 04:26:46 steve
|
||||||
|
* Unary reduction operators are all 1-bit results.
|
||||||
|
*
|
||||||
* Revision 1.19 2001/07/27 04:51:44 steve
|
* Revision 1.19 2001/07/27 04:51:44 steve
|
||||||
* Handle part select expressions as variants of
|
* Handle part select expressions as variants of
|
||||||
* NetESignal/IVL_EX_SIGNAL objects, instead of
|
* NetESignal/IVL_EX_SIGNAL objects, instead of
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue