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
*/
#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
# include "config.h"
@ -884,6 +884,8 @@ void NetESFunc::dump(ostream&o) const
void NetESignal::dump(ostream&o) const
{
if (has_sign())
o << "+";
o << name() << "[" << msi_<<":"<<lsi_ << "]";
}
@ -970,6 +972,9 @@ void Design::dump(ostream&o) const
/*
* $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
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#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
# include "config.h"
@ -351,15 +351,16 @@ ostream& operator<< (ostream&o, verinum::V 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
literally. This is how we express the fixed length in the
output. */
if (v.has_len()) {
o << v.len() << "'b";
o << v.len();
if (v.has_sign())
o << "'sb";
else
o << "'sb";
if (v.len() == 0) {
o << "0";
return o;
@ -374,13 +375,19 @@ ostream& operator<< (ostream&o, const verinum&v)
/* If the number is fully defined (no x or z) then print it
out as a decimal number. */
if (v.is_defined()) {
o << "'d" << v.as_ulong();
if (v.has_sign())
o << "'sd" << v.as_ulong();
else
o << "'d" << v.as_ulong();
return o;
}
/* Oh, well. Print the minimum to get the value properly
displayed. */
o << "'b";
if (v.has_sign())
o << "'sb";
else
o << "'b";
if (v.len() == 0) {
o << "0";
@ -786,6 +793,9 @@ verinum::V operator & (verinum::V l, verinum::V r)
/*
* $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
* Handle division and modulus by zero while
* evaluating run-time constants.