Commit b9dea5d6 by Alan Mishchenko

Other changes to enable new features in the mapper (bug fix).

parent fbb12a06
...@@ -213,6 +213,7 @@ struct Abc_Ntk_t_ ...@@ -213,6 +213,7 @@ struct Abc_Ntk_t_
Vec_Ptr_t * vOnehots; // names of one-hot-encoded registers Vec_Ptr_t * vOnehots; // names of one-hot-encoded registers
Vec_Int_t * vObjPerm; // permutation saved Vec_Int_t * vObjPerm; // permutation saved
Vec_Vec_t * vRealPos; // additional PO info Vec_Vec_t * vRealPos; // additional PO info
Vec_Int_t * vRealNodes; // additional PO info
// node attributes // node attributes
Vec_Ptr_t * vAttrs; // managers of various node attributes (node functionality, global BDDs, etc) Vec_Ptr_t * vAttrs; // managers of various node attributes (node functionality, global BDDs, etc)
}; };
......
...@@ -219,6 +219,15 @@ Abc_Ntk_t * Abc_NtkLogicToNetlist( Abc_Ntk_t * pNtk ) ...@@ -219,6 +219,15 @@ Abc_Ntk_t * Abc_NtkLogicToNetlist( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pObj, i ) Abc_NtkForEachNode( pNtk, pObj, i )
Abc_ObjForEachFanin( pObj, pFanin, k ) Abc_ObjForEachFanin( pObj, pFanin, k )
Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy->pCopy ); Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy->pCopy );
// remap the real nodess
if ( pNtk->vRealNodes )
{
assert( pNtkNew->vRealNodes == NULL );
pNtkNew->vRealNodes = Vec_IntAlloc( Vec_IntSize(pNtk->vRealNodes) );
Abc_NtkForEachObjVec( pNtk->vRealNodes, pNtk, pObj, i )
Vec_IntPush( pNtkNew->vRealNodes, Abc_ObjId(pObj->pCopy) );
}
// duplicate EXDC // duplicate EXDC
if ( pNtk->pExdc ) if ( pNtk->pExdc )
pNtkNew->pExdc = Abc_NtkToNetlist( pNtk->pExdc ); pNtkNew->pExdc = Abc_NtkToNetlist( pNtk->pExdc );
......
...@@ -1048,6 +1048,7 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk ) ...@@ -1048,6 +1048,7 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
Vec_PtrFreeP( &pNtk->vLtlProperties ); Vec_PtrFreeP( &pNtk->vLtlProperties );
Vec_IntFreeP( &pNtk->vObjPerm ); Vec_IntFreeP( &pNtk->vObjPerm );
Vec_VecFreeP( &pNtk->vRealPos ); Vec_VecFreeP( &pNtk->vRealPos );
Vec_IntFreeP( &pNtk->vRealNodes );
ABC_FREE( pNtk ); ABC_FREE( pNtk );
} }
......
...@@ -1084,9 +1084,11 @@ void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew ) ...@@ -1084,9 +1084,11 @@ void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew )
return; return;
} }
assert( pNtkNew->vRealNodes == NULL );
// create drivers // create drivers
vDrivers = Vec_PtrStart( pNtkNew->nRealPos ); vDrivers = Vec_PtrStart( pNtkNew->nRealPos );
vDriverInvs = Vec_IntStart( pNtkNew->nRealPos ); vDriverInvs = Vec_IntStart( pNtkNew->nRealPos );
pNtkNew->vRealNodes = Vec_IntAlloc( pNtkNew->nRealPos );
for ( i = pNtkNew->nRealPos; i < Abc_NtkPoNum(pNtkNew); i++ ) for ( i = pNtkNew->nRealPos; i < Abc_NtkPoNum(pNtkNew); i++ )
{ {
pObj = Abc_NtkPo( pNtkNew, i ); pObj = Abc_NtkPo( pNtkNew, i );
...@@ -1098,6 +1100,7 @@ void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew ) ...@@ -1098,6 +1100,7 @@ void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew )
// printf( "%d", Abc_ObjFaninC0(pObj) ); // printf( "%d", Abc_ObjFaninC0(pObj) );
Vec_PtrPush( vDrivers, pNode ); Vec_PtrPush( vDrivers, pNode );
Vec_IntPush( vDriverInvs, Abc_ObjFaninC0(pObj) ); Vec_IntPush( vDriverInvs, Abc_ObjFaninC0(pObj) );
Vec_IntPush( pNtkNew->vRealNodes, Abc_ObjId(pNode) );
} }
assert( Vec_PtrSize( vDrivers ) == Abc_NtkPoNum( pNtkNew ) ); assert( Vec_PtrSize( vDrivers ) == Abc_NtkPoNum( pNtkNew ) );
...@@ -1161,6 +1164,8 @@ void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew ) ...@@ -1161,6 +1164,8 @@ void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew )
fCompl = Vec_IntEntry( vDriverInvs, numPo ); fCompl = Vec_IntEntry( vDriverInvs, numPo );
if ( fCompl ) if ( fCompl )
pFaninNew = Abc_NtkCreateNodeInv( pNtkNew, pFaninNew ); pFaninNew = Abc_NtkCreateNodeInv( pNtkNew, pFaninNew );
// else
// pFaninNew = Abc_NtkCreateNodeBuf( pNtkNew, pFaninNew );
if ( !Abc_NtkIfCheckTfi( pNtkNew, pObj, pFaninNew ) ) if ( !Abc_NtkIfCheckTfi( pNtkNew, pObj, pFaninNew ) )
Abc_ObjPatchFanin( pObj, pFanin, pFaninNew ); Abc_ObjPatchFanin( pObj, pFanin, pFaninNew );
......
...@@ -384,6 +384,18 @@ void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches ) ...@@ -384,6 +384,18 @@ void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
NameCounter++; NameCounter++;
} }
} }
if ( pNtk->vRealNodes )
{
Abc_Obj_t * pObj;
fprintf( pFile, "\n\n" );
assert( pNtk->nRealPos >= 0 );
Abc_NtkForEachObjVec( pNtk->vRealNodes, pNtk, pObj, i )
fprintf( pFile, "#INFO %s %s\n",
Abc_ObjName(Abc_ObjFanin0(Abc_NtkPo(pNtk, pNtk->nRealPos+i))),
Abc_ObjName(Abc_ObjFanout0(pObj)) );
fprintf( pFile, "\n" );
}
} }
/**Function************************************************************* /**Function*************************************************************
......
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