Commit 81b263e3 by Alan Mishchenko

Fixing the problem with outputting word-level CEXes after retiming.

parent 4d8c72d0
...@@ -2475,24 +2475,40 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -2475,24 +2475,40 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
} }
fprintf( pFile, "\n"); fprintf( pFile, "\n");
fprintf( pFile, "# COUNTEREXAMPLE LENGTH: %u\n", pCex->iFrame+1); fprintf( pFile, "# COUNTEREXAMPLE LENGTH: %u\n", pCex->iFrame+1);
// output flop values (unaffected by the minimization)
if ( (vNamesIn = Abc_FrameReadCexCiNames(pAbc)) != NULL ) if ( (vNamesIn = Abc_FrameReadCexCiNames(pAbc)) != NULL )
{
// output flop values (unaffected by the minimization)
Vec_PtrForEachEntryStart( char *, vNamesIn, pObjName, i, Abc_NtkPiNum(pNtk) ) Vec_PtrForEachEntryStart( char *, vNamesIn, pObjName, i, Abc_NtkPiNum(pNtk) )
IoCommandPrintLatchName( pFile, pNtk, NULL, pObjName, pCex, pCare ); IoCommandPrintLatchName( pFile, pNtk, NULL, pObjName, pCex, pCare );
// output PI values (while skipping the minimized ones)
for ( f = 0; f <= pCex->iFrame; f++ )
Vec_PtrForEachEntryStop( char *, vNamesIn, pObjName, i, Abc_NtkPiNum(pNtk) )
{
// skip names with "_init" in the end
int NameLen = strlen(pObjName);
if ( NameLen > 5 && !strncmp(pObjName+NameLen-5, "_init", 5) )
continue;
if ( !pCare || Abc_InfoHasBit(pCare->pData, pCare->nRegs+pCare->nPis*f + i) )
fprintf( pFile, "%s@%d=%c\n", pObjName, f, '0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs+pCex->nPis*f + i) );
}
}
else else
{
// output flop values (unaffected by the minimization)
Abc_NtkForEachLatch( pNtk, pObj, i ) Abc_NtkForEachLatch( pNtk, pObj, i )
IoCommandPrintLatchName( pFile, pNtk, pObj, Abc_ObjName(Abc_ObjFanout0(pObj)), pCex, pCare ); IoCommandPrintLatchName( pFile, pNtk, pObj, Abc_ObjName(Abc_ObjFanout0(pObj)), pCex, pCare );
// output PI values (while skipping the minimized ones) // output PI values (while skipping the minimized ones)
for ( f = 0; f <= pCex->iFrame; f++ ) for ( f = 0; f <= pCex->iFrame; f++ )
Abc_NtkForEachPi( pNtk, pObj, i ) Abc_NtkForEachPi( pNtk, pObj, i )
{ {
// skip names with "_init" in the end // skip names with "_init" in the end
int NameLen = strlen(Abc_ObjName(pObj)); int NameLen = strlen(Abc_ObjName(pObj));
if ( NameLen > 5 && !strncmp(Abc_ObjName(pObj)+NameLen-5, "_init", 5) ) if ( NameLen > 5 && !strncmp(Abc_ObjName(pObj)+NameLen-5, "_init", 5) )
continue; continue;
if ( !pCare || Abc_InfoHasBit(pCare->pData, pCare->nRegs+pCare->nPis*f + i) ) if ( !pCare || Abc_InfoHasBit(pCare->pData, pCare->nRegs+pCare->nPis*f + i) )
fprintf( pFile, "%s@%d=%c\n", Abc_ObjName(pObj), f, '0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs+pCex->nPis*f + i) ); fprintf( pFile, "%s@%d=%c\n", Abc_ObjName(pObj), f, '0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs+pCex->nPis*f + i) );
} }
}
Abc_CexFreeP( &pCare ); Abc_CexFreeP( &pCare );
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment