diff --git a/netlist.cc b/netlist.cc index a4cf7dd86..721fa4bd7 100644 --- a/netlist.cc +++ b/netlist.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: netlist.cc,v 1.69 1999/09/23 03:56:57 steve Exp $" +#ident "$Id: netlist.cc,v 1.70 1999/09/28 03:11:29 steve Exp $" #endif # include @@ -1020,6 +1020,22 @@ NetETernary* NetETernary::dup_expr() const assert(0); } +NetEUnary::NetEUnary(char op, NetExpr*ex) +: NetExpr(ex->expr_width()), op_(op), expr_(ex) +{ + switch (op_) { + case '!': // Logical not + case '&': // Reduction and + case '|': // Reduction or + case '^': // Reduction XOR + case 'A': // Reduction NAND (~&) + case 'N': // Reduction NOR (~|) + case 'X': // Reduction NXOR (~^) + expr_width(1); + break; + } +} + NetEUnary::~NetEUnary() { delete expr_; @@ -1631,6 +1647,9 @@ NetNet* Design::find_signal(bool (*func)(const NetNet*)) /* * $Log: netlist.cc,v $ + * Revision 1.70 1999/09/28 03:11:29 steve + * Get the bit widths of unary operators that return one bit. + * * Revision 1.69 1999/09/23 03:56:57 steve * Support shift operators. * diff --git a/netlist.h b/netlist.h index 4bcdba3ea..3128b91bd 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: netlist.h,v 1.72 1999/09/25 02:57:30 steve Exp $" +#ident "$Id: netlist.h,v 1.73 1999/09/28 03:11:30 steve Exp $" #endif /* @@ -1427,8 +1427,7 @@ class NetETernary : public NetExpr { class NetEUnary : public NetExpr { public: - NetEUnary(char op, NetExpr*ex) - : NetExpr(ex->expr_width()), op_(op), expr_(ex) { } + NetEUnary(char op, NetExpr*ex); ~NetEUnary(); char op() const { return op_; } @@ -1690,6 +1689,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.73 1999/09/28 03:11:30 steve + * Get the bit widths of unary operators that return one bit. + * * Revision 1.72 1999/09/25 02:57:30 steve * Parse system function calls. *