summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-02-02 16:20:19 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2016-02-02 16:20:19 -0800
commit094c68f921b4ff20010cd4523edce88bda1983d5 (patch)
treee4459e3291ca64bae684efea89161daf03bb9b3d
parentc81b6cb51574a5ff97e735263eb76864958572bd (diff)
downloadabc-094c68f921b4ff20010cd4523edce88bda1983d5.tar.gz
abc-094c68f921b4ff20010cd4523edce88bda1983d5.tar.bz2
abc-094c68f921b4ff20010cd4523edce88bda1983d5.zip
Supporting X-valued constants in Wlc_Ntk_t.
-rw-r--r--src/base/wlc/wlcWriteVer.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/base/wlc/wlcWriteVer.c b/src/base/wlc/wlcWriteVer.c
index 3f303e5a..1651c842 100644
--- a/src/base/wlc/wlcWriteVer.c
+++ b/src/base/wlc/wlcWriteVer.c
@@ -208,9 +208,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
fprintf( pFile, "x" );
}
else
- fprintf( pFile, "%-16s = %d\'%sh", Wlc_ObjName(p, i), Wlc_ObjRange(pObj), Wlc_ObjIsSigned(pObj) ? "s":"" );
-
- Abc_TtPrintHexArrayRev( pFile, (word *)Wlc_ObjConstValue(pObj), (Wlc_ObjRange(pObj) + 3) / 4 );
+ Abc_TtPrintHexArrayRev( pFile, (word *)Wlc_ObjConstValue(pObj), (Wlc_ObjRange(pObj) + 3) / 4 );
}
else if ( pObj->Type == WLC_OBJ_ROTATE_R || pObj->Type == WLC_OBJ_ROTATE_L )
{
@@ -360,9 +358,18 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
fprintf( pFile, "%s", Wlc_ObjName(p, Wlc_ObjId(p, Wlc_NtkPi(p, Vec_IntEntry(p->vInits, i-Wlc_NtkPiNum(p))))));
else
{
- fprintf( pFile, "%d\'b", Wlc_ObjRange(pObj) );
- for ( k = Wlc_ObjRange(pObj)-1; k >= 0; k-- )
- fprintf( pFile, "%c", p->pInits[iFanin + k] );
+ if ( p->pInits[0] == 'x' || p->pInits[0] == 'X' )
+ {
+ fprintf( pFile, "%d\'h", Wlc_ObjRange(pObj) );
+ for ( k = 0; k < (Wlc_ObjRange(pObj) + 3) / 4; k++ )
+ fprintf( pFile, "x" );
+ }
+ else
+ {
+ fprintf( pFile, "%d\'b", Wlc_ObjRange(pObj) );
+ for ( k = Wlc_ObjRange(pObj)-1; k >= 0; k-- )
+ fprintf( pFile, "%c", p->pInits[iFanin + k] );
+ }
}
fprintf( pFile, ";\n" );
iFanin += Wlc_ObjRange(pObj);