mirror of https://github.com/YosysHQ/abc.git
Outputting initial state in Wlc_Ntk_t.
This commit is contained in:
parent
24dbdbae23
commit
65cd556b1d
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Reference in New Issue