Commit f421d2a1 by Alan Mishchenko

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

parent d96d3e3f
...@@ -1151,6 +1151,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn ) ...@@ -1151,6 +1151,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
int nFFins = 0, nFFouts = 0, curPi = 0, curPo = 0, nFf2Regs = 0; int nFFins = 0, nFFouts = 0, curPi = 0, curPo = 0, nFf2Regs = 0;
int nBitCis = 0, nBitCos = 0, fAdded = 0; int nBitCis = 0, nBitCos = 0, fAdded = 0;
int iFirstAddPi = -1; // remembers the first additional PI that stands for DC-flop output int iFirstAddPi = -1; // remembers the first additional PI that stands for DC-flop output
int iFirstFlop = -1; // remembers the first flop of the design
Wlc_BstPar_t Par, * pPar = &Par; Wlc_BstPar_t Par, * pPar = &Par;
Wlc_BstParDefault( pPar ); Wlc_BstParDefault( pPar );
pPar = pParIn ? pParIn : pPar; pPar = pParIn ? pParIn : pPar;
...@@ -2118,11 +2119,13 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn ) ...@@ -2118,11 +2119,13 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
if ( p->pInits ) if ( p->pInits )
{ {
int Length = strlen(p->pInits); int Length = strlen(p->pInits);
// remember the place in the array where the first PI begins
iFirstAddPi = Vec_PtrSize(pNew->vNamesIn);
for ( i = 0; i < Length; i++ ) for ( i = 0; i < Length; i++ )
if ( p->pInits[i] == 'x' || p->pInits[i] == 'X' ) if ( p->pInits[i] == 'x' || p->pInits[i] == 'X' )
{ {
char Buffer[100]; //char Buffer[100];
sprintf( Buffer, "%s%d", "init", i ); //sprintf( Buffer, "%s%d", "init", i );
//Vec_PtrPush( pNew->vNamesIn, Abc_UtilStrsav(Buffer) ); //Vec_PtrPush( pNew->vNamesIn, Abc_UtilStrsav(Buffer) );
// save NULL at this time - to be overwritten later // save NULL at this time - to be overwritten later
//printf( "Adding NULL in position %d\n", Vec_PtrSize(pNew->vNamesIn) ); //printf( "Adding NULL in position %d\n", Vec_PtrSize(pNew->vNamesIn) );
...@@ -2130,7 +2133,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn ) ...@@ -2130,7 +2133,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
fAdded = 1; fAdded = 1;
} }
// remember the place in the array where the first real flop is // remember the place in the array where the first real flop is
iFirstAddPi = Vec_PtrSize(pNew->vNamesIn); iFirstFlop = Vec_PtrSize(pNew->vNamesIn);
} }
Wlc_NtkForEachCi( p, pObj, i ) Wlc_NtkForEachCi( p, pObj, i )
if ( !Wlc_ObjIsPi(pObj) ) if ( !Wlc_ObjIsPi(pObj) )
...@@ -2202,17 +2205,18 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn ) ...@@ -2202,17 +2205,18 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
// finish creating names of additional primary inputs // finish creating names of additional primary inputs
if ( p->pInits ) if ( p->pInits )
{ {
int Length = strlen(p->pInits); int k = iFirstAddPi, Length = strlen(p->pInits);
assert( iFirstAddPi >= 0 ); assert( iFirstAddPi >= 0 && iFirstFlop >= 0 );
for ( i = 0; i < Length; i++ ) for ( i = 0; i < Length; i++ )
if ( p->pInits[i] == 'x' || p->pInits[i] == 'X' ) if ( p->pInits[i] == 'x' || p->pInits[i] == 'X' )
{ {
char Buffer[1000]; char Buffer[1000];
sprintf( Buffer, "%s_init", (char *)Vec_PtrEntry(pNew->vNamesIn, iFirstAddPi+i) ); sprintf( Buffer, "%s_init", (char *)Vec_PtrEntry(pNew->vNamesIn, iFirstFlop+i) );
assert( Vec_PtrEntry(pNew->vNamesIn, iFirstAddPi-Length+i) == NULL ); assert( Vec_PtrEntry(pNew->vNamesIn, k) == NULL );
Vec_PtrWriteEntry( pNew->vNamesIn, iFirstAddPi-Length+i, Abc_UtilStrsav(Buffer) ); Vec_PtrWriteEntry( pNew->vNamesIn, k++, Abc_UtilStrsav(Buffer) );
//printf( "Replacing NULL in position %d\n", iFirstAddPi-Length+i ); //printf( "Replacing NULL in position %d\n", iFirstAddPi-Length+i );
} }
assert( k == iFirstFlop );
} }
// create output names // create output names
pNew->vNamesOut = Vec_PtrAlloc( Gia_ManCoNum(pNew) ); pNew->vNamesOut = Vec_PtrAlloc( Gia_ManCoNum(pNew) );
......
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