Include s indicator in dump of signed numbers.

This commit is contained in:
steve 2001-12-31 00:02:33 +00:00
parent a3fe753826
commit e20acfc9f9
2 changed files with 24 additions and 9 deletions

View File

@ -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: design_dump.cc,v 1.120 2001/12/03 04:47:14 steve Exp $" #ident "$Id: design_dump.cc,v 1.121 2001/12/31 00:03:05 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -884,6 +884,8 @@ void NetESFunc::dump(ostream&o) const
void NetESignal::dump(ostream&o) const void NetESignal::dump(ostream&o) const
{ {
if (has_sign())
o << "+";
o << name() << "[" << msi_<<":"<<lsi_ << "]"; o << name() << "[" << msi_<<":"<<lsi_ << "]";
} }
@ -970,6 +972,9 @@ void Design::dump(ostream&o) const
/* /*
* $Log: design_dump.cc,v $ * $Log: design_dump.cc,v $
* Revision 1.121 2001/12/31 00:03:05 steve
* Include s indicator in dump of signed numbers.
*
* Revision 1.120 2001/12/03 04:47:14 steve * Revision 1.120 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t * Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings. * objects instead of encoded strings.

View File

@ -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: verinum.cc,v 1.29 2001/11/19 02:54:12 steve Exp $" #ident "$Id: verinum.cc,v 1.30 2001/12/31 00:02:33 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -351,15 +351,16 @@ ostream& operator<< (ostream&o, verinum::V v)
*/ */
ostream& operator<< (ostream&o, const verinum&v) ostream& operator<< (ostream&o, const verinum&v)
{ {
if (v.has_sign()) {
o << "+";
}
/* If the verinum number has a fixed length, dump all the bits /* If the verinum number has a fixed length, dump all the bits
literally. This is how we express the fixed length in the literally. This is how we express the fixed length in the
output. */ output. */
if (v.has_len()) { if (v.has_len()) {
o << v.len() << "'b"; o << v.len();
if (v.has_sign())
o << "'sb";
else
o << "'sb";
if (v.len() == 0) { if (v.len() == 0) {
o << "0"; o << "0";
return o; return o;
@ -374,12 +375,18 @@ ostream& operator<< (ostream&o, const verinum&v)
/* If the number is fully defined (no x or z) then print it /* If the number is fully defined (no x or z) then print it
out as a decimal number. */ out as a decimal number. */
if (v.is_defined()) { if (v.is_defined()) {
if (v.has_sign())
o << "'sd" << v.as_ulong();
else
o << "'d" << v.as_ulong(); o << "'d" << v.as_ulong();
return o; return o;
} }
/* Oh, well. Print the minimum to get the value properly /* Oh, well. Print the minimum to get the value properly
displayed. */ displayed. */
if (v.has_sign())
o << "'sb";
else
o << "'b"; o << "'b";
if (v.len() == 0) { if (v.len() == 0) {
@ -786,6 +793,9 @@ verinum::V operator & (verinum::V l, verinum::V r)
/* /*
* $Log: verinum.cc,v $ * $Log: verinum.cc,v $
* Revision 1.30 2001/12/31 00:02:33 steve
* Include s indicator in dump of signed numbers.
*
* Revision 1.29 2001/11/19 02:54:12 steve * Revision 1.29 2001/11/19 02:54:12 steve
* Handle division and modulus by zero while * Handle division and modulus by zero while
* evaluating run-time constants. * evaluating run-time constants.