Commit e16e3eda by Alan Mishchenko

Removing some old useless code.

parent fabc84d1
......@@ -171,10 +171,6 @@ struct Abc_Ntk_t_
int nObjCounts[ABC_OBJ_NUMBER]; // the number of objects by type
int nObjs; // the number of live objs
int nConstrs; // the number of constraints
int nRealPos; // the number of real POs
float nRealDelay; // temporary mapping data
float nRealLuts; // temporary mapping data
float nRealArea; // temporary mapping data
// the backup network and the step number
Abc_Ntk_t * pNetBackup; // the pointer to the previous backup network
int iStep; // the generation number for the given network
......@@ -212,8 +208,6 @@ struct Abc_Ntk_t_
float * pLutTimes; // arrivals/requireds/slacks using LUT-delay model
Vec_Ptr_t * vOnehots; // names of one-hot-encoded registers
Vec_Int_t * vObjPerm; // permutation saved
Vec_Vec_t * vRealPos; // additional PO info
Vec_Int_t * vRealNodes; // additional PO info
Vec_Int_t * vTopo;
// node attributes
Vec_Ptr_t * vAttrs; // managers of various node attributes (node functionality, global BDDs, etc)
......
......@@ -153,8 +153,7 @@ Abc_Ntk_t * Abc_NtkLogicToNetlist( Abc_Ntk_t * pNtk )
assert( Abc_NtkIsLogic(pNtk) );
// remove dangling nodes
if ( pNtk->vRealNodes == NULL )
Abc_NtkCleanup( pNtk, 0 );
Abc_NtkCleanup( pNtk, 0 );
// make sure the CO names are unique
Abc_NtkCheckUniqueCiNames( pNtk );
......@@ -222,16 +221,6 @@ Abc_Ntk_t * Abc_NtkLogicToNetlist( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pObj, i )
Abc_ObjForEachFanin( pObj, pFanin, k )
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) );
assert( Vec_IntSize(pNtk->vRealNodes) == Vec_IntSize(pNtkNew->vRealNodes) );
}
// duplicate EXDC
if ( pNtk->pExdc )
pNtkNew->pExdc = Abc_NtkToNetlist( pNtk->pExdc );
......
......@@ -113,11 +113,6 @@ Abc_Ntk_t * Abc_NtkStartFrom( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_
// start the network
pNtkNew = Abc_NtkAlloc( Type, Func, 1 );
pNtkNew->nConstrs = pNtk->nConstrs;
pNtkNew->nRealPos = pNtk->nRealPos;
pNtkNew->nRealDelay = pNtk->nRealDelay;
pNtkNew->nRealLuts = pNtk->nRealLuts;
pNtkNew->nRealArea = pNtk->nRealArea;
pNtkNew->vRealPos = pNtk->vRealPos ? Vec_VecDup( pNtk->vRealPos ) : NULL;
// duplicate the name and the spec
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
......@@ -183,11 +178,6 @@ Abc_Ntk_t * Abc_NtkStartFromWithLatches( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, A
// start the network
pNtkNew = Abc_NtkAlloc( Type, Func, 1 );
pNtkNew->nConstrs = pNtk->nConstrs;
pNtkNew->nRealPos = pNtk->nRealPos;
pNtkNew->nRealDelay = pNtk->nRealDelay;
pNtkNew->nRealLuts = pNtk->nRealLuts;
pNtkNew->nRealArea = pNtk->nRealArea;
pNtkNew->vRealPos = pNtk->vRealPos ? Vec_VecDup( pNtk->vRealPos ) : NULL;
// duplicate the name and the spec
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
......@@ -262,11 +252,6 @@ Abc_Ntk_t * Abc_NtkStartFromNoLatches( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc
// start the network
pNtkNew = Abc_NtkAlloc( Type, Func, 1 );
pNtkNew->nConstrs = pNtk->nConstrs;
pNtkNew->nRealPos = pNtk->nRealPos;
pNtkNew->nRealDelay = pNtk->nRealDelay;
pNtkNew->nRealLuts = pNtk->nRealLuts;
pNtkNew->nRealArea = pNtk->nRealArea;
pNtkNew->vRealPos = pNtk->vRealPos ? Vec_VecDup( pNtk->vRealPos ) : NULL;
// duplicate the name and the spec
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
......@@ -465,15 +450,6 @@ Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk )
Abc_ObjForEachFanin( pObj, pFanin, k )
Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
}
// remap the real nodes
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) );
assert( Vec_IntSize(pNtk->vRealNodes) == Vec_IntSize(pNtkNew->vRealNodes) );
}
// duplicate the EXDC Ntk
if ( pNtk->pExdc )
pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
......@@ -1362,8 +1338,6 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
Vec_VecFree( (Vec_Vec_t *)pNtk->vOnehots );
Vec_PtrFreeP( &pNtk->vLtlProperties );
Vec_IntFreeP( &pNtk->vObjPerm );
Vec_VecFreeP( &pNtk->vRealPos );
Vec_IntFreeP( &pNtk->vRealNodes );
Vec_IntFreeP( &pNtk->vTopo );
ABC_FREE( pNtk );
}
......
......@@ -15378,7 +15378,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
fLutMux = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGNDEWSqaflepmrsdbugyojikcnvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGNDEWSqaflepmrsdbugyojiknvh" ) ) != EOF )
{
switch ( c )
{
......@@ -15551,9 +15551,6 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'k':
pPars->fEnableCheck10 ^= 1;
break;
case 'c':
pPars->fEnableRealPos ^= 1;
break;
case 'n':
pPars->fUseDsd ^= 1;
break;
......@@ -15847,7 +15844,6 @@ usage:
Abc_Print( -2, "\t-j : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
Abc_Print( -2, "\t-i : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck08? "yes": "no" );
Abc_Print( -2, "\t-k : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck10? "yes": "no" );
Abc_Print( -2, "\t-c : toggles enabling additional feature [default = %s]\n", pPars->fEnableRealPos? "yes": "no" );
Abc_Print( -2, "\t-n : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : prints the command usage\n");
......@@ -29225,7 +29221,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
}
pPars->pLutLib = (If_LibLut_t *)pAbc->pLibLut;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGDEWSqalepmrsdbgyojikfuczvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGDEWSqalepmrsdbgyojikfuzvh" ) ) != EOF )
{
switch ( c )
{
......@@ -29387,9 +29383,6 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'u':
pPars->fEnableCheck75u ^= 1;
break;
case 'c':
pPars->fEnableRealPos ^= 1;
break;
case 'z':
pPars->fDeriveLuts ^= 1;
break;
......@@ -29616,7 +29609,6 @@ usage:
Abc_Print( -2, "\t-k : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck10? "yes": "no" );
Abc_Print( -2, "\t-f : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75? "yes": "no" );
Abc_Print( -2, "\t-u : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75u? "yes": "no" );
Abc_Print( -2, "\t-c : toggles enabling additional feature [default = %s]\n", pPars->fEnableRealPos? "yes": "no" );
Abc_Print( -2, "\t-z : toggles deriving LUTs when mapping into LUT structures [default = %s]\n", pPars->fDeriveLuts? "yes": "no" );
Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : prints the command usage\n");
......@@ -39,11 +39,6 @@ static Vec_Ptr_t * Abc_NtkFindGoodOrder( Abc_Ntk_t * pNtk );
extern void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose );
extern void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose );
extern void Abc_NtkCollectPoDrivers( If_Man_t * p, Abc_Ntk_t * pNtk );
extern void Abc_NtkCreateChoiceDrivers( If_Man_t * p );
extern void Abc_NtkFreePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtk );
extern void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
......@@ -141,16 +136,11 @@ Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars )
Abc_NtkIfComputeSwitching( pNtk, pIfMan );
// perform FPGA mapping
if ( pPars->fEnableRealPos )
Abc_NtkCollectPoDrivers( pIfMan, pNtk );
Abc_NtkCreateChoiceDrivers( pIfMan );
if ( !If_ManPerformMapping( pIfMan ) )
{
Abc_NtkFreePoDrivers( pIfMan, pNtk );
If_ManStop( pIfMan );
return NULL;
}
Abc_NtkFreePoDrivers( pIfMan, pNtk );
// transform the result of mapping into the new network
pNtkNew = Abc_NtkFromIf( pIfMan, pNtk );
......@@ -322,10 +312,6 @@ Abc_Ntk_t * Abc_NtkFromIf( If_Man_t * pIfMan, Abc_Ntk_t * pNtk )
Extra_ProgressBarStop( pProgress );
Vec_IntFree( vCover );
// update PO drivers
if ( pIfMan->pPars->fEnableRealPos )
Abc_NtkRecreatePoDrivers( pIfMan, pNtkNew );
// remove the constant node if not used
pNodeNew = (Abc_Obj_t *)If_ObjCopy( If_ManConst1(pIfMan) );
if ( Abc_ObjFanoutNum(pNodeNew) == 0 && !Abc_ObjIsNone(pNodeNew) )
......@@ -519,15 +505,6 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
pNodeNew->pData = Abc_NodeIfToHop( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pIfObj );
}
If_ObjSetCopy( pIfObj, pNodeNew );
/*
printf( "%3d : Delay = %d Cutsize = %d\n", pNodeNew->Id, (int)pCutBest->Delay, pCutBest->nLeaves );
{
Abc_Obj_t * pFanin;
int i;
Abc_ObjForEachFanin( pNodeNew, pFanin, i )
printf( "fanin%d = %2d\n", i, pFanin->Id );
}
*/
return pNodeNew;
}
......@@ -642,7 +619,6 @@ Hop_Obj_t * Abc_NodeIfToHop( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_t *
printf( "Abc_NodeIfToHop(): Computing local AIG has failed.\n" );
return NULL;
}
// printf( "%d ", Vec_PtrSize(p->vTemp) );
// clean the cuts
If_CutForEachLeaf( pIfMan, pCut, pLeaf, i )
If_CutSetData( If_ObjCutBest(pLeaf), NULL );
......@@ -754,10 +730,7 @@ Vec_Ptr_t * Abc_NtkFindGoodOrder( Abc_Ntk_t * pNtk )
Abc_NtkIncrementTravId( pNtk );
vNodes = Vec_PtrAlloc( 100 );
Vec_PtrForEachEntry( Abc_Obj_t *, vCos, pNode, i )
{
Abc_NtkFindGoodOrder_rec( Abc_ObjFanin0(pNode), vNodes );
// printf( "%.2f ", Abc_Int2Float((int)pNode->pCopy) );
}
Vec_PtrFree( vCos );
return vNodes;
}
......@@ -811,475 +784,6 @@ void Abc_NtkMarkMux( Abc_Obj_t * pDriver, Abc_Obj_t ** ppNode1, Abc_Obj_t ** ppN
*ppNode2 = Abc_ObjRegular(pNodeT);
}
/**Function*************************************************************
Synopsis [Sets PO drivers.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkCollectPoDrivers( If_Man_t * p, Abc_Ntk_t * pNtk )
{
Vec_Int_t * vTemp;
Abc_Obj_t * pObj, * pDriver;
If_Obj_t * pIfObj;
int i, g, nGroups;
if ( pNtk->nRealPos == 0 )
{
if ( !Abc_FrameReadFlag("silentmode") )
printf( "PO drivers are not defined.\n" );
return;
}
if ( (Abc_NtkPoNum(pNtk) - pNtk->nRealPos) % 5 != 0 )
{
if ( !Abc_FrameReadFlag("silentmode") )
printf( "PO drivers are not divisible by 5.\n" );
return;
}
nGroups = (Abc_NtkPoNum(pNtk) - pNtk->nRealPos) / 5;
if ( !Abc_FrameReadFlag("silentmode") )
printf( "Processing %d groups of PO drivers.\n", nGroups );
// mark the drivers (0 a 1 b 2 c 3 s 4 c)
assert( p->pDriverCuts == NULL );
p->pDriverCuts = ABC_CALLOC( Vec_Int_t *, If_ManObjNum(p) );
for ( g = 0; g < nGroups; g++ )
{
// collect inputs
vTemp = Vec_IntAlloc( 3 );
for ( i = 0; i < 3; i++ )
{
pObj = Abc_NtkPo( pNtk, pNtk->nRealPos + g * 5 + i );
pIfObj = If_Regular( ((If_Obj_t *)pObj->pCopy)->pFanin0 );
Vec_IntPush( vTemp, pIfObj->Id );
}
// Vec_IntSort( vTemp, 0 );
// find output node
pObj = Abc_NtkPo( pNtk, pNtk->nRealPos + g * 5 + 3 );
pIfObj = If_Regular( ((If_Obj_t *)pObj->pCopy)->pFanin0 );
if ( !If_ObjIsConst1(pIfObj) && p->pDriverCuts[pIfObj->Id] == NULL )
p->pDriverCuts[pIfObj->Id] = Vec_IntDup( vTemp );
// find output node
pObj = Abc_NtkPo( pNtk, pNtk->nRealPos + g * 5 + 4 );
pIfObj = If_Regular( ((If_Obj_t *)pObj->pCopy)->pFanin0 );
if ( !If_ObjIsConst1(pIfObj) && p->pDriverCuts[pIfObj->Id] == NULL )
{
p->pDriverCuts[pIfObj->Id] = Vec_IntDup( vTemp );
pIfObj->fDriver = 1;
// printf( "%d ", pIfObj->Id );
}
Vec_IntFree( vTemp );
}
// printf( "\n" );
return;
// highlight inner logic
for ( i = pNtk->nRealPos; i < Abc_NtkPoNum(pNtk); i += 5 )
{
Abc_Obj_t * pNode1, * pNode2;
pObj = Abc_NtkPo( pNtk, i + 4 );
pDriver = Abc_ObjFanin0( pObj );
Abc_NtkMarkMux( pDriver, &pNode1, &pNode2 );
/*
pObj = Abc_NtkPo( pNtk, i + 3 );
pDriver = Abc_ObjFanin0( pObj );
Abc_NtkMarkMux( pDriver, &pNode1, &pNode2 );
if ( pNode1 == NULL )
continue;
assert( Abc_ObjRegular(pNode1) != Abc_ObjRegular(pNode2) );
// Abc_NtkMarkMux( pNode1, &pNode1, &pNode2 );
// Abc_NtkMarkMux( pNode2, &pNode1, &pNode2 );
*/
}
/*
{
Vec_Int_t * vInfo;
int i, k, numPo;
Vec_VecForEachLevelInt( pNtk->vRealPos, vInfo, i )
{
numPo = Vec_IntEntry( vInfo, 0 );
pObj = Abc_NtkPo( pNtk, numPo+2 );
pDriver = Abc_ObjFanin0( pObj );
pIfObj = If_Regular( (If_Obj_t *)pDriver->pCopy );
pIfObj->fSkipCut = 0;
numPo = Vec_IntEntryLast( vInfo );
pObj = Abc_NtkPo( pNtk, numPo+4 );
pDriver = Abc_ObjFanin0( pObj );
pIfObj = If_Regular( (If_Obj_t *)pDriver->pCopy );
pIfObj->fSkipCut = 0;
Vec_IntForEachEntry( vInfo, numPo, k )
{
pObj = Abc_NtkPo( pNtk, numPo+0 );
pDriver = Abc_ObjFanin0( pObj );
pIfObj = If_Regular( (If_Obj_t *)pDriver->pCopy );
pIfObj->fSkipCut = 0;
pObj = Abc_NtkPo( pNtk, numPo+1 );
pDriver = Abc_ObjFanin0( pObj );
pIfObj = If_Regular( (If_Obj_t *)pDriver->pCopy );
pIfObj->fSkipCut = 0;
pObj = Abc_NtkPo( pNtk, numPo+2 );
pDriver = Abc_ObjFanin0( pObj );
pIfObj = If_Regular( (If_Obj_t *)pDriver->pCopy );
pIfObj->fSkipCut = 0;
pObj = Abc_NtkPo( pNtk, numPo+3 );
pDriver = Abc_ObjFanin0( pObj );
pIfObj = If_Regular( (If_Obj_t *)pDriver->pCopy );
pIfObj->fSkipCut = 0;
}
}
}
*/
}
/**Function*************************************************************
Synopsis [Frees PO drivers.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkCreateChoiceDrivers( If_Man_t * p )
{
Vec_Int_t * vVec;
If_Obj_t * pObj, * pTemp;
int i, Counter = 0;
if ( p->pDriverCuts == NULL )
return;
If_ManForEachNode( p, pObj, i )
{
// skip non-choice nodes
if ( pObj->pEquiv == NULL || pObj->nRefs == 0 )
continue;
// find driver cut
vVec = NULL;
for ( pTemp = pObj; pTemp; pTemp = pTemp->pEquiv )
if ( p->pDriverCuts[pTemp->Id] != NULL )
{
vVec = Vec_IntDup( p->pDriverCuts[pTemp->Id] );
break;
}
if ( vVec == NULL )
continue;
// transfer driver cut to the root node
for ( pTemp = pObj; pTemp; pTemp = pTemp->pEquiv )
{
Vec_IntFreeP( &p->pDriverCuts[pTemp->Id] );
p->pDriverCuts[pTemp->Id] = Vec_IntDup( vVec );
}
Vec_IntFree( vVec );
Counter++;
}
// printf( "Choice driver cut updates = %d.\n", Counter );
}
/**Function*************************************************************
Synopsis [Frees PO drivers.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkFreePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtk )
{
If_Obj_t * pObj;
If_Cut_t * pCut;
int i;
if ( p->pDriverCuts == NULL )
return;
pNtk->nRealDelay = p->RequiredGlo;
if ( !Abc_FrameReadFlag("silentmode") )
printf( "Actual delay after mapping = %.2f\n", p->RequiredGlo );
assert( Abc_NtkPoNum(pNtk) == If_ManCoNum(p) - Abc_NtkLatchNum(pNtk) );
// print the cut sizes of the drivers
for ( i = pNtk->nRealPos; i < Abc_NtkPoNum(pNtk); i += 5 )
{
pObj = If_ManCo( p, i + 4 );
pObj = If_Regular(pObj->pFanin0);
if ( !pObj->fDriver )
continue;
pCut = If_ObjCutBest(pObj);
// printf( "%d(%d) ", pObj->Id, pCut->nLeaves );
}
// printf( "\n" );
for ( i = 0; i < If_ManObjNum(p); i++ )
Vec_IntFreeP( &p->pDriverCuts[i] );
ABC_FREE( p->pDriverCuts );
}
/**Function*************************************************************
Synopsis [Returns 1 if pOld is in the TFI of pNew.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_NtkIfCheckTfi_rec( Abc_Obj_t * pNode, Abc_Obj_t * pOld )
{
Abc_Obj_t * pFanin;
int k;
if ( pNode == NULL )
return 0;
if ( pNode == pOld )
return 1;
// check the trivial cases
if ( Abc_ObjIsCi(pNode) )
return 0;
assert( Abc_ObjIsNode(pNode) );
// if this node is already visited, skip
if ( Abc_NodeIsTravIdCurrent( pNode ) )
return 0;
// mark the node as visited
Abc_NodeSetTravIdCurrent( pNode );
// check the children
Abc_ObjForEachFanin( pNode, pFanin, k )
if ( Abc_NtkIfCheckTfi_rec( pFanin, pOld ) )
return 1;
return 0;
}
/**Function*************************************************************
Synopsis [Returns 1 if pOld is in the TFI of pNew.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_NtkIfCheckTfi( Abc_Ntk_t * pNtk, Abc_Obj_t * pOld, Abc_Obj_t * pNew )
{
assert( !Abc_ObjIsComplement(pOld) );
assert( !Abc_ObjIsComplement(pNew) );
Abc_NtkIncrementTravId(pNtk);
return Abc_NtkIfCheckTfi_rec( pNew, pOld );
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkIfCheckRealNodes( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj;
int i, iNode;
for ( i = pNtk->nRealPos; i < Abc_NtkPoNum(pNtk); i += 5 )
{
iNode = Vec_IntEntry( pNtk->vRealNodes, i+3 - pNtk->nRealPos );
pObj = Abc_NtkObj( pNtk, iNode );
assert( Abc_ObjFaninNum(pObj) == 2 );
iNode = Vec_IntEntry( pNtk->vRealNodes, i+4 - pNtk->nRealPos );
pObj = Abc_NtkObj( pNtk, iNode );
assert( Abc_ObjFaninNum(pObj) == 3 );
}
}
/**Function*************************************************************
Synopsis [Restores the structure.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkRecreatePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtkNew )
{
Abc_Obj_t * pNode, * pExor, * pObj, * pFanin, * pFaninNew;
Vec_Ptr_t * vDrivers, * vDriversNew, * vFanins;
Vec_Int_t * vInfo, * vNodeMap, * vDriverInvs;
int i, k, numPo, nRealLuts, fCompl;
float RealLutArea;
if ( pNtkNew->vRealPos == NULL )
{
if ( !Abc_FrameReadFlag("silentmode") )
printf( "Missing key information.\n" );
return;
}
assert( pNtkNew->vRealNodes == NULL );
// create drivers
vDrivers = Vec_PtrStart( pNtkNew->nRealPos );
vDriverInvs = Vec_IntStart( pNtkNew->nRealPos );
pNtkNew->vRealNodes = Vec_IntAlloc( Abc_NtkPoNum(pNtkNew) - pNtkNew->nRealPos );
for ( i = pNtkNew->nRealPos; i < Abc_NtkPoNum(pNtkNew); i++ )
{
pObj = Abc_NtkPo( pNtkNew, i );
if ( Abc_ObjFaninC0(pObj) )
pNode = Abc_NtkCreateNodeInv( pNtkNew, Abc_ObjFanin0(pObj) );
else
pNode = Abc_NtkCreateNodeBuf( pNtkNew, Abc_ObjFanin0(pObj) );
// if ( i % 5 == 4 )
// printf( "%d", Abc_ObjFaninC0(pObj) );
Vec_PtrPush( vDrivers, pNode );
Vec_IntPush( vDriverInvs, Abc_ObjFaninC0(pObj) );
Vec_IntPush( pNtkNew->vRealNodes, Abc_ObjId(pNode) );
}
assert( Vec_PtrSize( vDrivers ) == Abc_NtkPoNum( pNtkNew ) );
// create new logic
vFanins = Vec_PtrAlloc( 2 );
vDriversNew = Vec_PtrStart( Abc_NtkPoNum(pNtkNew) );
Vec_VecForEachLevelInt( pNtkNew->vRealPos, vInfo, i )
{
// find complemented attribute
numPo = Vec_IntEntry( vInfo, 0 );
fCompl = (strstr( Abc_ObjName(Abc_NtkPo(pNtkNew, numPo)), "SUB" ) != NULL);
// consider parts
Vec_IntForEachEntry( vInfo, numPo, k )
{
// update input
if ( k > 0 )
Vec_PtrWriteEntry( vDriversNew, numPo+2, pNode );
// create first XOR
Vec_PtrClear( vFanins );
Vec_PtrPush( vFanins, (Abc_Obj_t *)Vec_PtrEntry(vDrivers, numPo+0) );
Vec_PtrPush( vFanins, (Abc_Obj_t *)Vec_PtrEntry(vDrivers, numPo+1) );
pExor = Abc_NtkCreateNodeExor( pNtkNew, vFanins );
// update polarity
pExor->pData = Hop_NotCond( (Hop_Obj_t *)pExor->pData, fCompl );
// create second XOR
Vec_PtrClear( vFanins );
Vec_PtrPush( vFanins, pExor );
Vec_PtrPush( vFanins, (Abc_Obj_t *)Vec_PtrEntry(vDrivers, numPo+2) );
pNode = Abc_NtkCreateNodeExor( pNtkNew, vFanins );
// update pointers
Vec_PtrWriteEntry( vDriversNew, numPo+3, pNode );
Vec_IntWriteEntry( pNtkNew->vRealNodes, numPo+3 - pNtkNew->nRealPos, Abc_ObjId(pNode) );
// create MUX
pNode = Abc_NtkCreateNodeMux( pNtkNew, pExor,
(Abc_Obj_t *)Vec_PtrEntry(vDrivers, numPo+2),
(Abc_Obj_t *)Vec_PtrEntry(vDrivers, numPo+(fCompl ? 0 : 1)) );
// update pointers
Vec_PtrWriteEntry( vDriversNew, numPo+4, pNode );
Vec_IntWriteEntry( pNtkNew->vRealNodes, numPo+4 - pNtkNew->nRealPos, Abc_ObjId(pNode) );
}
}
Vec_PtrFree( vFanins );
Abc_NtkIfCheckRealNodes( pNtkNew );
// map internal nodes into PO numbers
vNodeMap = Vec_IntStartFull( Abc_NtkObjNumMax(pNtkNew) );
Vec_VecForEachLevelInt( pNtkNew->vRealPos, vInfo, i )
Vec_IntForEachEntryReverse( vInfo, numPo, k )
{
pObj = Abc_NtkPo( pNtkNew, numPo+3 );
Vec_IntWriteEntry( vNodeMap, Abc_ObjId( Abc_ObjFanin0(pObj) ), numPo+3 );
// update the PO pointer
// if ( Abc_ObjFaninC0(pObj) )
// Abc_ObjXorFaninC( pObj, 0 );
// Abc_ObjPatchFanin( pObj, Abc_ObjFanin0(pObj), Vec_PtrEntry(vDriversNew, numPo+3) );
pObj = Abc_NtkPo( pNtkNew, numPo+4 );
Vec_IntWriteEntry( vNodeMap, Abc_ObjId( Abc_ObjFanin0(pObj) ), numPo+4 );
// update the PO pointer
// if ( Abc_ObjFaninC0(pObj) )
// Abc_ObjXorFaninC( pObj, 0 );
// Abc_ObjPatchFanin( pObj, Abc_ObjFanin0(pObj), Vec_PtrEntry(vDriversNew, numPo+4) );
}
// replace logic
Abc_NtkForEachObj( pNtkNew, pObj, i )
{
// if ( Abc_ObjIsPo(pObj) )
// continue;
Abc_ObjForEachFanin( pObj, pFanin, k )
{
if ( !Abc_ObjIsNode(pFanin) || Abc_ObjFaninNum(pFanin) == 0 )
continue;
numPo = Vec_IntEntry( vNodeMap, Abc_ObjId(pFanin) );
if ( numPo == ~0 )
continue;
// get the node and the complemented bit
pFaninNew = (Abc_Obj_t *)Vec_PtrEntry( vDriversNew, numPo );
fCompl = Vec_IntEntry( vDriverInvs, numPo );
if ( fCompl )
pFaninNew = Abc_NtkCreateNodeInv( pNtkNew, pFaninNew );
// else
// pFaninNew = Abc_NtkCreateNodeBuf( pNtkNew, pFaninNew );
if ( !Abc_NtkIfCheckTfi( pNtkNew, pObj, pFaninNew ) )
Abc_ObjPatchFanin( pObj, pFanin, pFaninNew );
}
}
// sweep
Abc_NtkCleanupNodes( pNtkNew, vDriversNew, 0 );
// make sure that all vDriversNew are still present
{
Abc_Obj_t * pObj;
int i;
Vec_PtrForEachEntry( Abc_Obj_t *, vDriversNew, pObj, i )
if ( pObj && Abc_ObjIsNone(pObj) )
assert( 0 );
}
Vec_PtrFree( vDrivers );
Vec_PtrFree( vDriversNew );
Vec_IntFree( vNodeMap );
Vec_IntFree( vDriverInvs );
// count non-trivial LUTs nodes
nRealLuts = -2 * Vec_VecSizeSize(pNtkNew->vRealPos);
RealLutArea = -(p->pPars->pLutLib ? p->pPars->pLutLib->pLutAreas[2] + p->pPars->pLutLib->pLutAreas[3] : 2.0) * Vec_VecSizeSize(pNtkNew->vRealPos);
Abc_NtkForEachNode( pNtkNew, pNode, i )
if ( Abc_ObjFaninNum(pNode) > 1 )
{
nRealLuts++;
RealLutArea += p->pPars->pLutLib->pLutAreas[Abc_ObjFaninNum(pNode)];
}
if ( !Abc_FrameReadFlag("silentmode") )
printf( "The number of real LUTs = %d. Real LUT area = %.2f.\n", nRealLuts, RealLutArea );
pNtkNew->nRealLuts = nRealLuts;
pNtkNew->nRealArea = RealLutArea;
Abc_NtkIfCheckRealNodes( pNtkNew );
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
......
......@@ -226,8 +226,6 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum
Abc_Print( 1," i/o =%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
if ( Abc_NtkConstrNum(pNtk) )
Abc_Print( 1,"(c=%d)", Abc_NtkConstrNum(pNtk) );
// if ( pNtk->nRealPos )
// Abc_Print( 1,"(p=%d)", Abc_NtkPoNum(pNtk) - pNtk->nRealPos );
Abc_Print( 1," lat =%5d", Abc_NtkLatchNum(pNtk) );
if ( Abc_NtkIsNetlist(pNtk) )
{
......
......@@ -972,13 +972,6 @@ int Abc_NtkSweepBufsInvs( Abc_Ntk_t * pNtk, int fVerbose )
pMan = (Hop_Man_t *)pNtk->pManFunc;
// label selected nodes
Abc_NtkIncrementTravId( pNtk );
if ( pNtk->vRealNodes )
{
Abc_Obj_t * pObj;
assert( Vec_IntSize(pNtk->vRealNodes) == Abc_NtkPoNum(pNtk) - pNtk->nRealPos );
Abc_NtkForEachObjVec( pNtk->vRealNodes, pNtk, pObj, i )
Abc_NodeSetTravIdCurrent( pObj );
}
// iterate till no improvement
while ( fChanges )
{
......
......@@ -120,7 +120,7 @@ static Io_MvVar_t * Abc_NtkMvVarDup( Abc_Ntk_t * pNtk, Io_MvVar_t * pVar );
static int Io_MvCharIsSpace( char s ) { return s == ' ' || s == '\t' || s == '\r' || s == '\n'; }
static int Io_MvCharIsMvSymb( char s ) { return s == '(' || s == ')' || s == '{' || s == '}' || s == '-' || s == ',' || s == '!'; }
static Vec_Vec_t * Io_MvExtractBoxInfo( Abc_Ntk_t * pNtk );
//static Vec_Vec_t * Io_MvExtractBoxInfo( Abc_Ntk_t * pNtk );
extern void Abc_NtkStartMvVars( Abc_Ntk_t * pNtk );
......@@ -253,7 +253,7 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
Vec_PtrPush( pNtk->vLtlProperties, pLtlProp );
Vec_PtrFreeP( &vGlobalLtlArray );
pNtk->vRealPos = Io_MvExtractBoxInfo( pNtk );
// pNtk->vRealPos = Io_MvExtractBoxInfo( pNtk );
return pNtk;
}
......@@ -994,7 +994,6 @@ static int Io_MvParseLineOutputs( Io_MvMod_t * p, char * pLine )
Vec_Ptr_t * vTokens = p->pMan->vTokens;
char * pToken;
int i;
p->pNtk->nRealPos = Abc_NtkPoNum(p->pNtk);
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
pToken = (char *)Vec_PtrEntry(vTokens, 0);
assert( !strcmp(pToken, "outputs") );
......@@ -2233,242 +2232,6 @@ static inline int Abc_MapBox2Prev( Vec_Ptr_t * vDrivers, Vec_Int_t * vMapIn, Vec
return Vec_IntEntry( vMapOut, Abc_ObjId(Abc_ObjFanin0(Abc_ObjFanin0(pNode))) );
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static Vec_Vec_t * Io_MvExtractBoxInfo_( Abc_Ntk_t * pNtk )
{
Vec_Int_t * vMapIn, * vMapOut, * vList;
Vec_Ptr_t * vBoxInfo, * vDrivers;
Abc_Obj_t * pObj;
int i, boxId;
// quit if there is no boxes
if ( pNtk->nRealPos == 0 || (Abc_NtkPoNum(pNtk) - pNtk->nRealPos) % 5 != 0 )
return NULL;
// allocate
vBoxInfo = Vec_PtrAlloc( 10 );
vDrivers = Vec_PtrAlloc( Abc_NtkPoNum(pNtk) );
vMapIn = Vec_IntStartFull( Abc_NtkObjNumMax(pNtk) );
vMapOut = Vec_IntStartFull( Abc_NtkObjNumMax(pNtk) );
// collect drivers
Abc_NtkForEachPo( pNtk, pObj, i )
Vec_PtrPush( vDrivers, Abc_ObjFanin0(Abc_ObjFanin0(pObj)) );
// map box signals into box numbers
for ( i = pNtk->nRealPos; i < Abc_NtkPoNum(pNtk); i += 5 )
{
// int k;
// for ( k = 0; k < 5; k++ )
// printf( "%d ", Abc_ObjFanin0(Abc_ObjFanin0(Abc_ObjFanin0(Abc_NtkPo(pNtk,i+k))))->Id );
// printf( "\n" );
Abc_MapBoxSetPrevNext( vDrivers, vMapIn, vMapOut, i );
}
// find those that do not have input mapped
for ( i = pNtk->nRealPos; i < Abc_NtkPoNum(pNtk); i += 5 )
{
if ( Abc_MapBox2Prev( vDrivers, vMapIn, vMapOut, i ) != ~0 )
continue;
// create new list
vList = Vec_IntAlloc( 32 );
boxId = i;
while ( boxId != ~0 )
{
Vec_IntPush( vList, boxId );
boxId = Abc_MapBox2Next( vDrivers, vMapIn, vMapOut, boxId );
}
Vec_PtrPush( vBoxInfo, vList );
//printf( " %d", Vec_IntSize(vList) );
}
//printf( "\n" );
if ( 5 * Vec_VecSizeSize((Vec_Vec_t *)vBoxInfo) != (Abc_NtkPoNum(pNtk) - pNtk->nRealPos) )
printf( "Mismatch in the number of boxes!!!\n" );
// clean up
Vec_IntFree( vMapIn );
Vec_IntFree( vMapOut );
Vec_PtrFree( vDrivers );
return (Vec_Vec_t *)vBoxInfo;
}
/**Function*************************************************************
Synopsis [Compares strings up to the first underscore.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Io_MvExtractCompareStr( char * pName1, char * pName2 )
{
while ( *pName1 && *pName1 != '_' && (*pName1 == *pName2) )
pName1++, pName2++;
return *pName1 - *pName2;
}
/**Function*************************************************************
Synopsis [Returns the first number of the string.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Io_MvExtractReadNum1( char * pName )
{
while ( *pName && (*pName < '0' || *pName > '9') )
pName++;
if ( *pName == 0 )
return -1;
return atoi( pName );
}
/**Function*************************************************************
Synopsis [Returns the second number of the string.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Io_MvExtractReadNum2( char * pName )
{
int Counter = 0;
while ( *pName )
{
Counter += (*pName++ == '_');
if ( Counter == 2 )
break;
}
if ( *pName == 0 )
return -1;
return atoi( pName );
}
/**Function*************************************************************
Synopsis [Procedure used for sorting the nodes in decreasing order of levels.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Io_MvExtractCompareNames( Abc_Obj_t ** pp1, Abc_Obj_t ** pp2 )
{
char * pName1 = (char *)(*pp1)->pCopy;
char * pName2 = (char *)(*pp2)->pCopy;
// int Diff = Io_MvExtractReadNum1(pName1) - Io_MvExtractReadNum1(pName2);
int Diff = Io_MvExtractCompareStr( pName1, pName2 );
if ( Diff < 0 )
return -1;
if ( Diff > 0 )
return 1;
Diff = Io_MvExtractReadNum2(pName1) - Io_MvExtractReadNum2(pName2);
if ( Diff < 0 )
return -1;
if ( Diff > 0 )
return 1;
return 0;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static Vec_Vec_t * Io_MvExtractBoxInfo( Abc_Ntk_t * pNtk )
{
int fVerbose = 0;
Vec_Vec_t * vBoxInfo = NULL;
Vec_Ptr_t * vPetals;
Abc_Obj_t * pObj;
char * pPrev, * pThis;
int i, Level;
// quit if there is no boxes
if ( pNtk->nRealPos == 0 || (Abc_NtkPoNum(pNtk) - pNtk->nRealPos) % 5 != 0 )
return NULL;
// transfer names
Abc_NtkForEachPo( pNtk, pObj, i )
{
pObj->pCopy = (Abc_Obj_t *)Abc_ObjName( Abc_ObjFanin0(pObj) );
pObj->iData = i;
}
// collect POs
vPetals = Vec_PtrAlloc( Abc_NtkPoNum(pNtk) );
for ( i = pNtk->nRealPos; i < Abc_NtkPoNum(pNtk); i += 5 )
Vec_PtrPush( vPetals, Abc_NtkPo(pNtk, i) );
// sort by name
qsort( (void *)Vec_PtrArray(vPetals), Vec_PtrSize(vPetals), sizeof(Abc_Obj_t *),
(int (*)(const void *, const void *)) Io_MvExtractCompareNames );
// sort the POs
Level = -1;
pPrev = "dummy";
vBoxInfo = Vec_VecAlloc( 32 );
Vec_PtrForEachEntry( Abc_Obj_t *, vPetals, pObj, i )
{
pThis = (char *)pObj->pCopy;
if ( Io_MvExtractCompareStr( pPrev, pThis ) )
{
Level++;
if ( fVerbose )
printf( "\n" );
}
Vec_VecPushInt( vBoxInfo, Level, pObj->iData );
if ( fVerbose )
printf( "%s ", (char *)pObj->pCopy );
pPrev = pThis;
}
if ( fVerbose )
printf( "\n" );
if ( 5 * Vec_VecSizeSize(vBoxInfo) != (Abc_NtkPoNum(pNtk) - pNtk->nRealPos) )
printf( "Mismatch in the number of boxes!!!\n" );
// clean up
Vec_PtrFree( vPetals );
// remove names
Abc_NtkForEachPo( pNtk, pObj, i )
{
pObj->pCopy = NULL;
pObj->iData = 0;
}
return vBoxInfo;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
......
......@@ -345,12 +345,6 @@ void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
{
Abc_NtkForEachPo( pNtk, pTerm, i )
{
if ( i && i == pNtk->nRealPos )
{
fprintf( pFile, "\n.outputs" );
LineLength = 8;
NameCounter = 0;
}
pNet = Abc_ObjFanin0(pTerm);
// get the line length after this name is written
AddedLength = strlen(Abc_ObjName(pNet)) + 1;
......@@ -385,18 +379,6 @@ void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
NameCounter++;
}
}
if ( pNtk->vRealNodes )
{
Abc_Obj_t * pObj;
fprintf( pFile, "\n\n" );
assert( Vec_IntSize(pNtk->vRealNodes) == Abc_NtkPoNum(pNtk)-pNtk->nRealPos );
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*************************************************************
......
......@@ -119,7 +119,6 @@ struct If_Par_t_
int fEnableCheck10;// enable additional checking
int fEnableCheck75;// enable additional checking
int fEnableCheck75u;// enable additional checking
int fEnableRealPos;// enable additional feature
int fUseDsd; // compute DSD of the cut functions
int fDeriveLuts; // enables deriving LUT structures
int fVerbose; // the verbosity flag
......@@ -193,7 +192,7 @@ struct If_Man_t_
int fNextRound; // set to 1 after the first round
int nChoices; // the number of choice nodes
Vec_Int_t * vSwitching; // switching activity of each node
Vec_Int_t ** pDriverCuts; // temporary driver cuts
// Vec_Int_t ** pDriverCuts; // temporary driver cuts
int pPerm[3][IF_MAX_LUTSIZE]; // permutations
unsigned uSharedMask; // mask of shared variables
int nShared; // the number of shared variables
......
......@@ -630,7 +630,7 @@ float If_CutDelay( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut )
If_Obj_t * pLeaf;
float Delay, DelayCur;
float * pLutDelays;
int i, Shift, Pin2PinDelay, iLeaf;
int i, Shift, Pin2PinDelay;//, iLeaf;
assert( p->pPars->fSeqMap || pCut->nLeaves > 1 );
Delay = -IF_FLOAT_LARGE;
if ( p->pPars->pLutLib )
......@@ -651,9 +651,9 @@ float If_CutDelay( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut )
{
If_CutForEachLeaf( p, pCut, pLeaf, i )
{
if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
DelayCur = If_ObjCutBest(pLeaf)->Delay + s_ExtraDel[pObj->fDriver][iLeaf];
else
// if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
// DelayCur = If_ObjCutBest(pLeaf)->Delay + s_ExtraDel[pObj->fDriver][iLeaf];
// else
DelayCur = If_ObjCutBest(pLeaf)->Delay + pLutDelays[0];
Delay = IF_MAX( Delay, DelayCur );
}
......@@ -685,9 +685,9 @@ float If_CutDelay( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut )
{
If_CutForEachLeaf( p, pCut, pLeaf, i )
{
if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
DelayCur = If_ObjCutBest(pLeaf)->Delay + ((pObj->fDriver && iLeaf == 2) ? 0.0 : 1.0);
else
// if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
// DelayCur = If_ObjCutBest(pLeaf)->Delay + ((pObj->fDriver && iLeaf == 2) ? 0.0 : 1.0);
// else
DelayCur = If_ObjCutBest(pLeaf)->Delay + 1.0;
Delay = IF_MAX( Delay, DelayCur );
}
......@@ -715,7 +715,7 @@ void If_CutPropagateRequired( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut, fl
If_Obj_t * pLeaf;
float * pLutDelays;
float Required;
int i, Pin2PinDelay, iLeaf;
int i, Pin2PinDelay;//, iLeaf;
assert( !p->pPars->fLiftLeaves );
// compute the pins
if ( p->pPars->pLutLib )
......@@ -737,9 +737,9 @@ void If_CutPropagateRequired( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut, fl
Required = ObjRequired;
If_CutForEachLeaf( p, pCut, pLeaf, i )
{
if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
pLeaf->Required = IF_MIN( pLeaf->Required, Required - s_ExtraDel[pObj->fDriver][iLeaf] );
else
// if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
// pLeaf->Required = IF_MIN( pLeaf->Required, Required - s_ExtraDel[pObj->fDriver][iLeaf] );
// else
pLeaf->Required = IF_MIN( pLeaf->Required, Required - pLutDelays[0] );
}
}
......@@ -760,9 +760,9 @@ void If_CutPropagateRequired( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pCut, fl
Required = ObjRequired;
If_CutForEachLeaf( p, pCut, pLeaf, i )
{
if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
pLeaf->Required = IF_MIN( pLeaf->Required, Required - (float)((pObj->fDriver && iLeaf == 2) ? 0.0 : 1.0) );
else
// if ( p->pDriverCuts && p->pDriverCuts[pObj->Id] && (iLeaf = Vec_IntFind(p->pDriverCuts[pObj->Id], pLeaf->Id)) >= 0 )
// pLeaf->Required = IF_MIN( pLeaf->Required, Required - (float)((pObj->fDriver && iLeaf == 2) ? 0.0 : 1.0) );
// else
pLeaf->Required = IF_MIN( pLeaf->Required, Required - (float)1.0 );
}
}
......
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