From 65cd556b1d96a316353fdab1b681702a4bf1d419 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 26 Jan 2015 09:14:51 -0800 Subject: Outputting initial state in Wlc_Ntk_t. --- src/base/wlc/wlcWriteVer.c | 53 ++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/src/base/wlc/wlcWriteVer.c b/src/base/wlc/wlcWriteVer.c index 8352e4ac..35365e7c 100644 --- a/src/base/wlc/wlcWriteVer.c +++ b/src/base/wlc/wlcWriteVer.c @@ -330,30 +330,6 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p ) } fprintf( pFile, " ;\n" ); } - Wlc_NtkForEachCi( p, pObj, i ) - { - char * pName = Wlc_ObjName(p, Wlc_ObjId(p, pObj)); - assert( i == Wlc_ObjCiId(pObj) ); - if ( pObj->Type == WLC_OBJ_PI ) - continue; - fprintf( pFile, " " ); - fprintf( pFile, "CPL_FF" ); - if ( Wlc_ObjRange(pObj) > 1 ) - fprintf( pFile, "#%d%*s", Wlc_ObjRange(pObj), 4 - Abc_Base10Log(Wlc_ObjRange(pObj)+1), "" ); - else - fprintf( pFile, " " ); - fprintf( pFile, " reg%d (", i ); - fprintf( pFile, " .q( %s ),", pName ); - fprintf( pFile, " .qbar()," ); - fprintf( pFile, " .d( %s ),", Wlc_ObjName(p, Wlc_ObjId(p, Wlc_ObjFoToFi(p, pObj))) ); - fprintf( pFile, " .clk( %s ),", "1\'b0" ); - fprintf( pFile, " .arst( %s ),", "1\'b0" ); - if ( p->vInits ) - fprintf( pFile, " .arstval( %s_init )", pName ); - else - fprintf( pFile, " .arstval( %s )", "1\'b0" ); - fprintf( pFile, " ) ;\n" ); - } iFanin = 0; assert( !p->vInits || Wlc_NtkFfNum(p) == Vec_IntSize(p->vInits) ); if ( p->vInits ) @@ -378,11 +354,32 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p ) } fprintf( pFile, ";\n" ); iFanin += Wlc_ObjRange(pObj); - - //printf( "%d %d %s\n", iFanin, Wlc_ObjRange(pObj), Wlc_ObjName(p, Wlc_ObjId(p, pObj)) ); } - k = (int)strlen(p->pInits); - //assert( !p->vInits || iFanin == (int)strlen(p->pInits) ); + Wlc_NtkForEachCi( p, pObj, i ) + { + char * pName = Wlc_ObjName(p, Wlc_ObjId(p, pObj)); + assert( i == Wlc_ObjCiId(pObj) ); + if ( pObj->Type == WLC_OBJ_PI ) + continue; + fprintf( pFile, " " ); + fprintf( pFile, "CPL_FF" ); + if ( Wlc_ObjRange(pObj) > 1 ) + fprintf( pFile, "#%d%*s", Wlc_ObjRange(pObj), 4 - Abc_Base10Log(Wlc_ObjRange(pObj)+1), "" ); + else + fprintf( pFile, " " ); + fprintf( pFile, " reg%d (", i ); + fprintf( pFile, " .q( %s ),", pName ); + fprintf( pFile, " .qbar()," ); + fprintf( pFile, " .d( %s ),", Wlc_ObjName(p, Wlc_ObjId(p, Wlc_ObjFoToFi(p, pObj))) ); + fprintf( pFile, " .clk( %s ),", "1\'b0" ); + fprintf( pFile, " .arst( %s ),", "1\'b0" ); + if ( p->vInits ) + fprintf( pFile, " .arstval( %s_init )", pName ); + else + fprintf( pFile, " .arstval( %s )", "1\'b0" ); + fprintf( pFile, " ) ;\n" ); + } + assert( !p->vInits || iFanin == (int)strlen(p->pInits) ); fprintf( pFile, "endmodule\n\n" ); } void Wlc_WriteVer( Wlc_Ntk_t * p, char * pFileName ) -- cgit v1.2.3