mirror of https://github.com/YosysHQ/abc.git
Version abc80430
This commit is contained in:
parent
2b98b81837
commit
de81a1a1fb
16
abc.dsp
16
abc.dsp
|
|
@ -342,6 +342,10 @@ SOURCE=.\src\base\abci\abcQuant.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcReach.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\base\abci\abcRec.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -2034,6 +2038,10 @@ SOURCE=.\src\misc\extra\extraBddCas.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraBddImage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\misc\extra\extraBddKmap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
@ -3250,8 +3258,16 @@ SOURCE=.\src\aig\saig\saigPhase.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\aig\saig\saigRetFwd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\aig\saig\saigRetMin.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\aig\saig\saigScl.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# End Group
|
||||
|
|
|
|||
22
abc.rc
22
abc.rc
|
|
@ -120,17 +120,17 @@ alias resyn2rsdc "b; rs -K 6 -F 2; rw; rs -K 6 -N 2 -F 2; rf; rs -K 8 -F 2; b
|
|||
alias compress2rsdc "b -l; rs -K 6 -F 2 -l; rw -l; rs -K 6 -N 2 -F 2 -l; rf -l; rs -K 8 -F 2 -l; b -l; rs -K 8 -N 2 -F 2 -l; rw -l; rs -K 10 -F 2 -l; rwz -l; rs -K 10 -N 2 -F 2 -l; b -l; rs -K 12 -F 2 -l; rfz -l; rs -K 12 -N 2 -F 2 -l; rwz -l; b -l"
|
||||
|
||||
# temporaries
|
||||
alias reach "st; ps; compress2; ps; qrel; ps; compress2; ps; qreach -v; ps"
|
||||
alias chnew "st; haig_start; resyn2; haig_use"
|
||||
alias chnewrs "st; haig_start; resyn2rs; haig_use"
|
||||
alias stdsd "r test/6in.blif; st; ps; u; bdd; dsd -g; st; ps"
|
||||
alias trec "rec_start; r c.blif; st; rec_add; rec_use"
|
||||
alias trec4 "rec_start -K 4; r i10.blif; st; rec_add; rec_use"
|
||||
alias bmc2 "frames -i -F 10; orpos; iprove"
|
||||
alias reachable "st; ps; compress2; ps; qrel; ps; compress2; ps; qreach -v; ps"
|
||||
alias chnew "st; haig_start; resyn2; haig_use"
|
||||
alias chnewrs "st; haig_start; resyn2rs; haig_use"
|
||||
alias stdsd "r test/6in.blif; st; ps; u; bdd; dsd -g; st; ps"
|
||||
alias trec "rec_start; r c.blif; st; rec_add; rec_use"
|
||||
alias trec4 "rec_start -K 4; r i10.blif; st; rec_add; rec_use"
|
||||
alias bmc2 "frames -i -F 10; orpos; iprove"
|
||||
|
||||
alias pjsolve "scl; dc2; fr; dc2; ic; ic -t; if -a; cs tacas/005_care.aig; mfs; lp; st; ic"
|
||||
alias pjsolve "scl; dc2; fr; dc2; ic; ic -t; if -a; cs tacas/005_care.aig; mfs; lp; st; ic"
|
||||
|
||||
alias t0 "r test/mc1.blif; st; test"
|
||||
alias t1 "r s27mc2.blif; st; test"
|
||||
alias t2 "r i/intel_001.aig; ps; indcut -v"
|
||||
alias t0 "r test/mc1.blif; st; test"
|
||||
alias t1 "r s27mc2.blif; st; test"
|
||||
alias t2 "r i/intel_001.aig; ps; indcut -v"
|
||||
|
||||
|
|
|
|||
|
|
@ -350,10 +350,10 @@ void Aig_ManPrintStats( Aig_Man_t * p )
|
|||
***********************************************************************/
|
||||
void Aig_ManReportImprovement( Aig_Man_t * p, Aig_Man_t * pNew )
|
||||
{
|
||||
printf( "REGs: Beg = %d. End = %d. (R = %6.2f %%). ",
|
||||
printf( "REG: Beg = %5d. End = %5d. (R =%5.1f %%) ",
|
||||
Aig_ManRegNum(p), Aig_ManRegNum(pNew),
|
||||
Aig_ManRegNum(p)? 100.0*(Aig_ManRegNum(p)-Aig_ManRegNum(pNew))/Aig_ManRegNum(p) : 0.0 );
|
||||
printf( "ANDs: Beg = %d. End = %d. (R = %6.2f %%).",
|
||||
printf( "AND: Beg = %6d. End = %6d. (R =%5.1f %%)",
|
||||
Aig_ManNodeNum(p), Aig_ManNodeNum(pNew),
|
||||
Aig_ManNodeNum(p)? 100.0*(Aig_ManNodeNum(p)-Aig_ManNodeNum(pNew))/Aig_ManNodeNum(p) : 0.0 );
|
||||
printf( "\n" );
|
||||
|
|
|
|||
|
|
@ -451,27 +451,17 @@ Aig_Man_t * Aig_ManReduceLaches( Aig_Man_t * p, int fVerbose )
|
|||
Aig_Man_t * pTemp;
|
||||
Vec_Ptr_t * vMap;
|
||||
int nSaved, nCur;
|
||||
if ( fVerbose )
|
||||
printf( "Performing combinational register sweep:\n" );
|
||||
for ( nSaved = 0; (nCur = Aig_ManReduceLachesCount(p)); nSaved += nCur )
|
||||
{
|
||||
if ( fVerbose )
|
||||
{
|
||||
printf( "Saved = %5d. ", nCur );
|
||||
printf( "RBeg = %5d. NBeg = %6d. ", Aig_ManRegNum(p), Aig_ManNodeNum(p) );
|
||||
}
|
||||
vMap = Aig_ManReduceLachesOnce( p );
|
||||
//Aig_ManPrintStats( p );
|
||||
p = Aig_ManRemap( pTemp = p, vMap );
|
||||
//Aig_ManPrintStats( p );
|
||||
Aig_ManStop( pTemp );
|
||||
Vec_PtrFree( vMap );
|
||||
Aig_ManSeqCleanup( p );
|
||||
//Aig_ManPrintStats( p );
|
||||
//printf( "\n" );
|
||||
if ( fVerbose )
|
||||
{
|
||||
printf( "REnd = %5d. NEnd = %6d. ", Aig_ManRegNum(p), Aig_ManNodeNum(p) );
|
||||
printf( "\n" );
|
||||
}
|
||||
Aig_ManReportImprovement( pTemp, p );
|
||||
Aig_ManStop( pTemp );
|
||||
if ( p->nRegs == 0 )
|
||||
break;
|
||||
}
|
||||
|
|
@ -600,6 +590,8 @@ void Aig_ManComputeSccs( Aig_Man_t * p )
|
|||
***********************************************************************/
|
||||
Aig_Man_t * Aig_ManScl( Aig_Man_t * pAig, int fLatchConst, int fLatchEqual, int fVerbose )
|
||||
{
|
||||
extern void Saig_ManReportUselessRegisters( Aig_Man_t * pAig );
|
||||
|
||||
Aig_Man_t * pAigInit, * pAigNew;
|
||||
Aig_Obj_t * pFlop1, * pFlop2;
|
||||
int i, Entry1, Entry2, nTruePis;
|
||||
|
|
@ -633,6 +625,8 @@ Aig_Man_t * Aig_ManScl( Aig_Man_t * pAig, int fLatchConst, int fLatchEqual, int
|
|||
// Aig_ManSeqCleanup( pAigInit );
|
||||
pAigNew = Aig_ManDupRepr( pAigInit, 0 );
|
||||
Aig_ManSeqCleanup( pAigNew );
|
||||
|
||||
Saig_ManReportUselessRegisters( pAigNew );
|
||||
return pAigNew;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -479,14 +479,12 @@ Aig_Man_t * Aig_ManConstReduce( Aig_Man_t * p, int fVerbose )
|
|||
Vec_Ptr_t * vMap;
|
||||
while ( (vMap = Aig_ManTernarySimulate( p, fVerbose )) )
|
||||
{
|
||||
if ( fVerbose )
|
||||
printf( "RBeg = %5d. NBeg = %6d. ", Aig_ManRegNum(p), Aig_ManNodeNum(p) );
|
||||
p = Aig_ManRemap( pTemp = p, vMap );
|
||||
Aig_ManStop( pTemp );
|
||||
Vec_PtrFree( vMap );
|
||||
Aig_ManSeqCleanup( p );
|
||||
if ( fVerbose )
|
||||
printf( "REnd = %5d. NEnd = %6d. \n", Aig_ManRegNum(p), Aig_ManNodeNum(p) );
|
||||
Aig_ManReportImprovement( pTemp, p );
|
||||
Aig_ManStop( pTemp );
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ int Mfx_Perform( Nwk_Man_t * pNtk, Mfx_Par_t * pPars, If_Lib_t * pLutLib )
|
|||
p->nFaninMax = nFaninMax;
|
||||
if ( !pPars->fResub )
|
||||
{
|
||||
pDecPars->nVarsMax = nFaninMax;
|
||||
pDecPars->nVarsMax = (nFaninMax < 3) ? 3 : nFaninMax;
|
||||
pDecPars->fVerbose = pPars->fVerbose;
|
||||
p->vTruth = Vec_IntAlloc( 0 );
|
||||
p->pManDec = Bdc_ManAlloc( pDecPars );
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
SRC += src/aig/saig/saig_.c \
|
||||
src/aig/saig/saigPhase.c \
|
||||
src/aig/saig/saigRetMin.c
|
||||
src/aig/saig/saigRetFwd.c \
|
||||
src/aig/saig/saigRetMin.c \
|
||||
src/aig/saig/saigScl.c
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ static inline int Saig_ManRegNum( Aig_Man_t * p ) { return p->n
|
|||
static inline Aig_Obj_t * Saig_ManLo( Aig_Man_t * p, int i ) { return (Aig_Obj_t *)Vec_PtrEntry(p->vPis, Saig_ManPiNum(p)+i); }
|
||||
static inline Aig_Obj_t * Saig_ManLi( Aig_Man_t * p, int i ) { return (Aig_Obj_t *)Vec_PtrEntry(p->vPos, Saig_ManPoNum(p)+i); }
|
||||
|
||||
static inline int Saig_ObjIsPi( Aig_Man_t * p, Aig_Obj_t * pObj ) { return Aig_ObjIsPi(pObj) && Aig_ObjPioNum(pObj) < Saig_ManPiNum(p); }
|
||||
static inline int Saig_ObjIsPo( Aig_Man_t * p, Aig_Obj_t * pObj ) { return Aig_ObjIsPo(pObj) && Aig_ObjPioNum(pObj) < Saig_ManPoNum(p); }
|
||||
static inline int Saig_ObjIsLo( Aig_Man_t * p, Aig_Obj_t * pObj ) { return Aig_ObjIsPi(pObj) && Aig_ObjPioNum(pObj) >= Saig_ManPiNum(p); }
|
||||
static inline int Saig_ObjIsLi( Aig_Man_t * p, Aig_Obj_t * pObj ) { return Aig_ObjIsPo(pObj) && Aig_ObjPioNum(pObj) >= Saig_ManPoNum(p); }
|
||||
|
||||
// iterator over the primary inputs/outputs
|
||||
#define Saig_ManForEachPi( p, pObj, i ) \
|
||||
Vec_PtrForEachEntryStop( p->vPis, pObj, i, Saig_ManPiNum(p) )
|
||||
|
|
@ -69,7 +74,15 @@ static inline Aig_Obj_t * Saig_ManLi( Aig_Man_t * p, int i ) { return (Aig
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*=== saigPhase.c ==========================================================*/
|
||||
|
||||
extern Aig_Man_t * Saig_ManPhaseAbstract( Aig_Man_t * p, Vec_Int_t * vInits, int nFrames, int fIgnore, int fPrint, int fVerbose );
|
||||
/*=== saigRetFwd.c ==========================================================*/
|
||||
extern Aig_Man_t * Saig_ManRetimeForward( Aig_Man_t * p, int nMaxIters, int fVerbose );
|
||||
/*=== saigRetMin.c ==========================================================*/
|
||||
extern Aig_Man_t * Saig_ManRetimeDupForward( Aig_Man_t * p, Vec_Ptr_t * vCut );
|
||||
extern Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
|
||||
/*=== saigScl.c ==========================================================*/
|
||||
extern void Saig_ManReportUselessRegisters( Aig_Man_t * pAig );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -0,0 +1,242 @@
|
|||
/**CFile****************************************************************
|
||||
|
||||
FileName [saigRetFwd.c]
|
||||
|
||||
SystemName [ABC: Logic synthesis and verification system.]
|
||||
|
||||
PackageName [Sequential AIG package.]
|
||||
|
||||
Synopsis [Most-forward retiming.]
|
||||
|
||||
Author [Alan Mishchenko]
|
||||
|
||||
Affiliation [UC Berkeley]
|
||||
|
||||
Date [Ver. 1.0. Started - June 20, 2005.]
|
||||
|
||||
Revision [$Id: saigRetFwd.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include "saig.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static inline Aig_Obj_t * Aig_ObjFanoutStatic( Aig_Obj_t * pObj, int i ) { return ((Aig_Obj_t **)pObj->pData)[i]; }
|
||||
static inline void Aig_ObjSetFanoutStatic( Aig_Obj_t * pObj, Aig_Obj_t * pFan ) { ((Aig_Obj_t **)pObj->pData)[pObj->nRefs++] = pFan; }
|
||||
|
||||
#define Aig_ObjForEachFanoutStatic( pObj, pFan, i ) \
|
||||
for ( i = 0; (i < (int)(pObj)->nRefs) && ((pFan) = Aig_ObjFanoutStatic(pObj, i)); i++ )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Allocate static fanout for all nodes in the AIG manager.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Aig_Obj_t ** Aig_ManStaticFanoutStart( Aig_Man_t * p )
|
||||
{
|
||||
Aig_Obj_t ** ppFanouts, * pObj;
|
||||
int i, nFanouts, nFanoutsAlloc;
|
||||
// allocate fanouts
|
||||
nFanoutsAlloc = 2 * Aig_ManObjNumMax(p) - Aig_ManPiNum(p) - Aig_ManPoNum(p);
|
||||
ppFanouts = ALLOC( Aig_Obj_t *, nFanoutsAlloc );
|
||||
// mark up storage
|
||||
nFanouts = 0;
|
||||
Aig_ManForEachObj( p, pObj, i )
|
||||
{
|
||||
pObj->pData = ppFanouts + nFanouts;
|
||||
nFanouts += pObj->nRefs;
|
||||
pObj->nRefs = 0;
|
||||
}
|
||||
assert( nFanouts < nFanoutsAlloc );
|
||||
// add fanouts
|
||||
Aig_ManForEachObj( p, pObj, i )
|
||||
{
|
||||
if ( Aig_ObjChild0(pObj) )
|
||||
Aig_ObjSetFanoutStatic( Aig_ObjFanin0(pObj), pObj );
|
||||
if ( Aig_ObjChild1(pObj) )
|
||||
Aig_ObjSetFanoutStatic( Aig_ObjFanin1(pObj), pObj );
|
||||
}
|
||||
return ppFanouts;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Marks the objects reachable from the given object.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Aig_ManMarkAutonomous_rec( Aig_Man_t * p, Aig_Obj_t * pObj )
|
||||
{
|
||||
Aig_Obj_t * pFanout;
|
||||
int i;
|
||||
if ( Aig_ObjIsTravIdCurrent(p, pObj) )
|
||||
return;
|
||||
Aig_ObjSetTravIdCurrent(p, pObj);
|
||||
Aig_ObjForEachFanoutStatic( pObj, pFanout, i )
|
||||
Aig_ManMarkAutonomous_rec( p, pFanout );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Marks with current trav ID nodes reachable from Const1 and PIs.]
|
||||
|
||||
Description [Returns the number of unreachable registers.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Saig_ManMarkAutonomous( Aig_Man_t * p )
|
||||
{
|
||||
Aig_Obj_t ** ppFanouts;
|
||||
Aig_Obj_t * pObj, * pObjLi, * pObjLo;
|
||||
int i;
|
||||
// temporarily connect register outputs to register inputs
|
||||
Saig_ManForEachLiLo( p, pObjLi, pObjLo, i )
|
||||
{
|
||||
pObjLo->pFanin0 = pObjLi;
|
||||
pObjLi->nRefs = 1;
|
||||
}
|
||||
// mark nodes reachable from Const1 and PIs
|
||||
Aig_ManIncrementTravId( p );
|
||||
ppFanouts = Aig_ManStaticFanoutStart( p );
|
||||
Aig_ManMarkAutonomous_rec( p, Aig_ManConst1(p) );
|
||||
Saig_ManForEachPi( p, pObj, i )
|
||||
Aig_ManMarkAutonomous_rec( p, pObj );
|
||||
free( ppFanouts );
|
||||
// disconnect LIs/LOs and label unreachable registers
|
||||
Saig_ManForEachLiLo( p, pObjLi, pObjLo, i )
|
||||
{
|
||||
assert( pObjLo->pFanin0 && pObjLi->nRefs == 1 );
|
||||
pObjLo->pFanin0 = NULL;
|
||||
pObjLi->nRefs = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Derives the cut for forward retiming.]
|
||||
|
||||
Description [Assumes topological ordering of the nodes.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Aig_Man_t * Saig_ManRetimeForwardOne( Aig_Man_t * p, int * pnRegFixed, int * pnRegMoves )
|
||||
{
|
||||
Aig_Man_t * pNew;
|
||||
Vec_Ptr_t * vCut;
|
||||
Aig_Obj_t * pObj, * pFanin;
|
||||
int i;
|
||||
// mark the retimable nodes
|
||||
Saig_ManMarkAutonomous( p );
|
||||
// mark the retimable registers with the fresh trav ID
|
||||
Aig_ManIncrementTravId( p );
|
||||
*pnRegFixed = 0;
|
||||
Saig_ManForEachLo( p, pObj, i )
|
||||
if ( Aig_ObjIsTravIdPrevious(p, pObj) )
|
||||
Aig_ObjSetTravIdCurrent(p, pObj);
|
||||
else
|
||||
(*pnRegFixed)++;
|
||||
// mark all the nodes that can be retimed forward
|
||||
*pnRegMoves = 0;
|
||||
Aig_ManForEachNode( p, pObj, i )
|
||||
if ( Aig_ObjIsTravIdCurrent(p, Aig_ObjFanin0(pObj)) && Aig_ObjIsTravIdCurrent(p, Aig_ObjFanin1(pObj)) )
|
||||
{
|
||||
Aig_ObjSetTravIdCurrent(p, pObj);
|
||||
(*pnRegMoves)++;
|
||||
}
|
||||
// mark the remaining registers
|
||||
Saig_ManForEachLo( p, pObj, i )
|
||||
Aig_ObjSetTravIdCurrent(p, pObj);
|
||||
// find the cut (all such marked objects that fanout into unmarked nodes)
|
||||
vCut = Vec_PtrAlloc( 1000 );
|
||||
Aig_ManIncrementTravId( p );
|
||||
Aig_ManForEachObj( p, pObj, i )
|
||||
{
|
||||
if ( Aig_ObjIsTravIdPrevious(p, pObj) )
|
||||
continue;
|
||||
pFanin = Aig_ObjFanin0(pObj);
|
||||
if ( pFanin && Aig_ObjIsTravIdPrevious(p, pFanin) )
|
||||
{
|
||||
Vec_PtrPush( vCut, pFanin );
|
||||
Aig_ObjSetTravIdCurrent( p, pFanin );
|
||||
}
|
||||
pFanin = Aig_ObjFanin1(pObj);
|
||||
if ( pFanin && Aig_ObjIsTravIdPrevious(p, pFanin) )
|
||||
{
|
||||
Vec_PtrPush( vCut, pFanin );
|
||||
Aig_ObjSetTravIdCurrent( p, pFanin );
|
||||
}
|
||||
}
|
||||
// finally derive the new manager
|
||||
pNew = Saig_ManRetimeDupForward( p, vCut );
|
||||
Vec_PtrFree( vCut );
|
||||
return pNew;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Derives the cut for forward retiming.]
|
||||
|
||||
Description [Assumes topological ordering of the nodes.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Aig_Man_t * Saig_ManRetimeForward( Aig_Man_t * p, int nMaxIters, int fVerbose )
|
||||
{
|
||||
Aig_Man_t * pNew, * pTemp;
|
||||
int i, clk, nRegFixed, nRegMoves = 1;
|
||||
pNew = p;
|
||||
for ( i = 0; i < nMaxIters && nRegMoves > 0; i++ )
|
||||
{
|
||||
clk = clock();
|
||||
pNew = Saig_ManRetimeForwardOne( pTemp = pNew, &nRegFixed, &nRegMoves );
|
||||
if ( fVerbose )
|
||||
{
|
||||
printf( "%2d : And = %6d. Reg = %5d. Unret = %5d. Move = %6d. ",
|
||||
i + 1, Aig_ManNodeNum(pTemp), Aig_ManRegNum(pTemp), nRegFixed, nRegMoves );
|
||||
PRT( "Time", clock() - clk );
|
||||
}
|
||||
if ( pTemp != p )
|
||||
Aig_ManStop( pTemp );
|
||||
}
|
||||
clk = clock();
|
||||
pNew = Aig_ManReduceLaches( pNew, fVerbose );
|
||||
if ( fVerbose )
|
||||
{
|
||||
PRT( "Register sharing time", clock() - clk );
|
||||
}
|
||||
return pNew;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
@ -617,16 +617,16 @@ Aig_Man_t * Saig_ManRetimeMinAreaBackward( Aig_Man_t * pNew, int fVerbose )
|
|||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose )
|
||||
Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose )
|
||||
{
|
||||
Vec_Ptr_t * vCut;
|
||||
Aig_Man_t * pNew, * pTemp, * pCopy;
|
||||
int fChanges;
|
||||
int i, fChanges;
|
||||
pNew = Aig_ManDup( p );
|
||||
// perform several iterations of forward retiming
|
||||
fChanges = 0;
|
||||
if ( !fBackwardOnly )
|
||||
while ( 1 )
|
||||
for ( i = 0; i < nMaxIters; i++ )
|
||||
{
|
||||
vCut = Nwk_ManDeriveRetimingCut( pNew, 1, fVerbose );
|
||||
if ( Vec_PtrSize(vCut) >= Aig_ManRegNum(pNew) )
|
||||
|
|
@ -646,7 +646,7 @@ Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int fForwardOnly, int fBackwar
|
|||
// perform several iterations of backward retiming
|
||||
fChanges = 0;
|
||||
if ( !fForwardOnly && !fInitial )
|
||||
while ( 1 )
|
||||
for ( i = 0; i < nMaxIters; i++ )
|
||||
{
|
||||
vCut = Nwk_ManDeriveRetimingCut( pNew, 0, fVerbose );
|
||||
if ( Vec_PtrSize(vCut) >= Aig_ManRegNum(pNew) )
|
||||
|
|
@ -664,7 +664,7 @@ Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int fForwardOnly, int fBackwar
|
|||
fChanges = 1;
|
||||
}
|
||||
else if ( !fForwardOnly && fInitial )
|
||||
while ( 1 )
|
||||
for ( i = 0; i < nMaxIters; i++ )
|
||||
{
|
||||
pCopy = Aig_ManDup( pNew );
|
||||
pTemp = Saig_ManRetimeMinAreaBackward( pCopy, fVerbose );
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
/**CFile****************************************************************
|
||||
|
||||
FileName [saigScl.c]
|
||||
|
||||
SystemName [ABC: Logic synthesis and verification system.]
|
||||
|
||||
PackageName [Sequential AIG package.]
|
||||
|
||||
Synopsis [Sequential cleanup.]
|
||||
|
||||
Author [Alan Mishchenko]
|
||||
|
||||
Affiliation [UC Berkeley]
|
||||
|
||||
Date [Ver. 1.0. Started - June 20, 2005.]
|
||||
|
||||
Revision [$Id: saigScl.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include "saig.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Report registers useless for SEC.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Saig_ManReportUselessRegisters( Aig_Man_t * pAig )
|
||||
{
|
||||
Aig_Obj_t * pObj, * pDriver;
|
||||
int i, Counter1, Counter2;
|
||||
// set PIO numbers
|
||||
Aig_ManSetPioNumbers( pAig );
|
||||
// check how many POs are driven by a register whose ref count is 1
|
||||
Counter1 = 0;
|
||||
Saig_ManForEachPo( pAig, pObj, i )
|
||||
{
|
||||
pDriver = Aig_ObjFanin0(pObj);
|
||||
if ( Saig_ObjIsLo(pAig, pDriver) && Aig_ObjRefs(pDriver) == 1 )
|
||||
Counter1++;
|
||||
}
|
||||
// check how many PIs have ref count 1 and drive a register
|
||||
Counter2 = 0;
|
||||
Saig_ManForEachLi( pAig, pObj, i )
|
||||
{
|
||||
pDriver = Aig_ObjFanin0(pObj);
|
||||
if ( Saig_ObjIsPi(pAig, pDriver) && Aig_ObjRefs(pDriver) == 1 )
|
||||
Counter2++;
|
||||
}
|
||||
if ( Counter1 )
|
||||
printf( "Network has %d (out of %d) registers driving POs.\n", Counter1, Saig_ManRegNum(pAig) );
|
||||
if ( Counter2 )
|
||||
printf( "Network has %d (out of %d) registers driven by PIs.\n", Counter2, Saig_ManRegNum(pAig) );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
@ -98,6 +98,7 @@ static int Abc_CommandBidec ( Abc_Frame_t * pAbc, int argc, char ** arg
|
|||
static int Abc_CommandOrder ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandMuxes ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandExtSeqDcs ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandReach ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandCone ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandNode ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandTopmost ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
|
|
@ -349,6 +350,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
|
|||
Cmd_CommandAdd( pAbc, "Various", "order", Abc_CommandOrder, 0 );
|
||||
Cmd_CommandAdd( pAbc, "Various", "muxes", Abc_CommandMuxes, 1 );
|
||||
Cmd_CommandAdd( pAbc, "Various", "ext_seq_dcs", Abc_CommandExtSeqDcs, 0 );
|
||||
Cmd_CommandAdd( pAbc, "Various", "reach", Abc_CommandReach, 0 );
|
||||
Cmd_CommandAdd( pAbc, "Various", "cone", Abc_CommandCone, 1 );
|
||||
Cmd_CommandAdd( pAbc, "Various", "node", Abc_CommandNode, 1 );
|
||||
Cmd_CommandAdd( pAbc, "Various", "topmost", Abc_CommandTopmost, 1 );
|
||||
|
|
@ -5594,6 +5596,116 @@ usage:
|
|||
return 1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandReach( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
FILE * pOut, * pErr;
|
||||
Abc_Ntk_t * pNtk;
|
||||
int nBddMax;
|
||||
int nIterMax;
|
||||
int fPartition;
|
||||
int fReorder;
|
||||
int fVerbose;
|
||||
int c;
|
||||
extern void Abc_NtkVerifyUsingBdds( Abc_Ntk_t * pNtk, int nBddMax, int nIterMax, int fPartition, int fReorder, int fVerbose );
|
||||
|
||||
pNtk = Abc_FrameReadNtk(pAbc);
|
||||
pOut = Abc_FrameReadOut(pAbc);
|
||||
pErr = Abc_FrameReadErr(pAbc);
|
||||
|
||||
// set defaults
|
||||
nBddMax = 50000;
|
||||
nIterMax = 1000;
|
||||
fPartition = 1;
|
||||
fReorder = 1;
|
||||
fVerbose = 0;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "BFprvh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'B':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
fprintf( pErr, "Command line switch \"-B\" should be followed by an integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nBddMax = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nBddMax < 0 )
|
||||
goto usage;
|
||||
break;
|
||||
case 'F':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nIterMax = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nIterMax < 0 )
|
||||
goto usage;
|
||||
break;
|
||||
case 'p':
|
||||
fPartition ^= 1;
|
||||
break;
|
||||
case 'r':
|
||||
fReorder ^= 1;
|
||||
break;
|
||||
case 'v':
|
||||
fVerbose ^= 1;
|
||||
break;
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( pNtk == NULL )
|
||||
{
|
||||
fprintf( pErr, "Empty network.\n" );
|
||||
return 1;
|
||||
}
|
||||
if ( Abc_NtkLatchNum(pNtk) == 0 )
|
||||
{
|
||||
fprintf( stdout, "The current network has no latches.\n" );
|
||||
return 0;
|
||||
}
|
||||
if ( !Abc_NtkIsStrash(pNtk) )
|
||||
{
|
||||
fprintf( stdout, "Reachability analysis works only for AIGs (run \"strash\").\n" );
|
||||
return 1;
|
||||
}
|
||||
if ( Abc_NtkPoNum(pNtk) != 1 )
|
||||
{
|
||||
fprintf( stdout, "The sequential miter has more than one output (run \"orpos\").\n" );
|
||||
return 1;
|
||||
}
|
||||
Abc_NtkVerifyUsingBdds( pNtk, nBddMax, nIterMax, fPartition, fReorder, fVerbose );
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
fprintf( pErr, "usage: reach [-BF num] [-prvh]\n" );
|
||||
fprintf( pErr, "\t verifies sequential miter using BDD-based reachability\n" );
|
||||
fprintf( pErr, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", nBddMax );
|
||||
fprintf( pErr, "\t-F num : max number of reachability iterations [default = %d]\n", nIterMax );
|
||||
fprintf( pErr, "\t-p : enable partitioned image computation [default = %s]\n", fPartition? "yes": "no" );
|
||||
fprintf( pErr, "\t-r : enable dynamic BDD variable reordering [default = %s]\n", fReorder? "yes": "no" );
|
||||
fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
|
||||
fprintf( pErr, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
|
@ -11925,10 +12037,11 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
int nStepsMax;
|
||||
int fFastAlgo;
|
||||
int fVerbose;
|
||||
int c;
|
||||
int c, nMaxIters;
|
||||
extern Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
|
||||
extern Abc_Ntk_t * Abc_NtkDarRetimeF( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
|
||||
extern Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
|
||||
extern Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
|
||||
extern Abc_Ntk_t * Abc_NtkDarRetimeMostFwd( Abc_Ntk_t * pNtk, int nMaxIters, int fVerbose );
|
||||
|
||||
pNtk = Abc_FrameReadNtk(pAbc);
|
||||
pOut = Abc_FrameReadOut(pAbc);
|
||||
|
|
@ -11940,13 +12053,25 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
fBackwardOnly = 0;
|
||||
fInitial = 1;
|
||||
nStepsMax = 100000;
|
||||
fFastAlgo = 1;
|
||||
fFastAlgo = 0;
|
||||
nMaxIters = 20;
|
||||
fVerbose = 0;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "Smfbiavh" ) ) != EOF )
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "NSmfbiavh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'N':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
fprintf( pErr, "Command line switch \"-N\" should be followed by a positive integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nMaxIters = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nMaxIters < 0 )
|
||||
goto usage;
|
||||
break;
|
||||
case 'S':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
|
|
@ -12003,11 +12128,12 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
|
||||
// perform the retiming
|
||||
if ( fMinArea )
|
||||
pNtkRes = Abc_NtkDarRetimeMinArea( pNtk, fForwardOnly, fBackwardOnly, fInitial, fVerbose );
|
||||
pNtkRes = Abc_NtkDarRetimeMinArea( pNtk, nMaxIters, fForwardOnly, fBackwardOnly, fInitial, fVerbose );
|
||||
else if ( fFastAlgo )
|
||||
pNtkRes = Abc_NtkDarRetime( pNtk, nStepsMax, fVerbose );
|
||||
else
|
||||
pNtkRes = Abc_NtkDarRetimeF( pNtk, nStepsMax, fVerbose );
|
||||
// pNtkRes = Abc_NtkDarRetimeF( pNtk, nStepsMax, fVerbose );
|
||||
pNtkRes = Abc_NtkDarRetimeMostFwd( pNtk, nMaxIters, fVerbose );
|
||||
if ( pNtkRes == NULL )
|
||||
{
|
||||
fprintf( pErr, "Retiming has failed.\n" );
|
||||
|
|
@ -12018,12 +12144,13 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
return 0;
|
||||
|
||||
usage:
|
||||
fprintf( pErr, "usage: dretime [-S num] [-mfbiavh]\n" );
|
||||
fprintf( pErr, "\t new implementation of min-area retiming\n" );
|
||||
fprintf( pErr, "\t-m : toggle min-area and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" );
|
||||
fprintf( pErr, "usage: dretime [-NS num] [-mfbiavh]\n" );
|
||||
fprintf( pErr, "\t new implementation of min-area (or most-forward) retiming\n" );
|
||||
fprintf( pErr, "\t-m : toggle min-area retiming and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" );
|
||||
fprintf( pErr, "\t-f : enables forward-only retiming [default = %s]\n", fForwardOnly? "yes": "no" );
|
||||
fprintf( pErr, "\t-b : enables backward-only retiming [default = %s]\n", fBackwardOnly? "yes": "no" );
|
||||
fprintf( pErr, "\t-i : enables init state computation [default = %s]\n", fInitial? "yes": "no" );
|
||||
fprintf( pErr, "\t-N num : the max number of one-frame iterations to perform [default = %d]\n", nMaxIters );
|
||||
fprintf( pErr, "\t-S num : the max number of forward retiming steps to perform [default = %d]\n", nStepsMax );
|
||||
fprintf( pErr, "\t-a : enables a fast most-forward algorithm [default = %s]\n", fFastAlgo? "yes": "no" );
|
||||
fprintf( pErr, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
|
||||
|
|
|
|||
|
|
@ -1409,7 +1409,7 @@ Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose )
|
|||
Vec_IntFree( pMan->vFlopNums );
|
||||
pMan->vFlopNums = NULL;
|
||||
|
||||
pMan = Rtm_ManRetime( pTemp = pMan, 1, nStepsMax, 0 );
|
||||
pMan = Rtm_ManRetime( pTemp = pMan, 1, nStepsMax, fVerbose );
|
||||
Aig_ManStop( pTemp );
|
||||
|
||||
// pMan = Aig_ManReduceLaches( pMan, 1 );
|
||||
|
|
@ -1420,40 +1420,6 @@ Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose )
|
|||
return pNtkAig;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Gives the current ABC network to AIG manager for processing.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose )
|
||||
{
|
||||
extern Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
|
||||
Abc_Ntk_t * pNtkAig;
|
||||
Aig_Man_t * pMan, * pTemp;
|
||||
pMan = Abc_NtkToDar( pNtk, 0, 1 );
|
||||
if ( pMan == NULL )
|
||||
return NULL;
|
||||
if ( pMan->vFlopNums )
|
||||
Vec_IntFree( pMan->vFlopNums );
|
||||
pMan->vFlopNums = NULL;
|
||||
|
||||
pMan->nTruePis = Aig_ManPiNum(pMan) - Aig_ManRegNum(pMan);
|
||||
pMan->nTruePos = Aig_ManPoNum(pMan) - Aig_ManRegNum(pMan);
|
||||
|
||||
pMan = Saig_ManRetimeMinArea( pTemp = pMan, fForwardOnly, fBackwardOnly, fInitial, fVerbose );
|
||||
Aig_ManStop( pTemp );
|
||||
|
||||
pNtkAig = Abc_NtkFromDarSeqSweep( pNtk, pMan );
|
||||
Aig_ManStop( pMan );
|
||||
return pNtkAig;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Gives the current ABC network to AIG manager for processing.]
|
||||
|
|
@ -1488,6 +1454,79 @@ Abc_Ntk_t * Abc_NtkDarRetimeF( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose )
|
|||
return pNtkAig;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Gives the current ABC network to AIG manager for processing.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkDarRetimeMostFwd( Abc_Ntk_t * pNtk, int nMaxIters, int fVerbose )
|
||||
{
|
||||
extern Aig_Man_t * Saig_ManRetimeForward( Aig_Man_t * p, int nIters, int fVerbose );
|
||||
|
||||
Abc_Ntk_t * pNtkAig;
|
||||
Aig_Man_t * pMan, * pTemp;
|
||||
pMan = Abc_NtkToDar( pNtk, 0, 1 );
|
||||
if ( pMan == NULL )
|
||||
return NULL;
|
||||
// Aig_ManReduceLachesCount( pMan );
|
||||
if ( pMan->vFlopNums )
|
||||
Vec_IntFree( pMan->vFlopNums );
|
||||
pMan->vFlopNums = NULL;
|
||||
|
||||
pMan->nTruePis = Aig_ManPiNum(pMan) - Aig_ManRegNum(pMan);
|
||||
pMan->nTruePos = Aig_ManPoNum(pMan) - Aig_ManRegNum(pMan);
|
||||
|
||||
pMan = Saig_ManRetimeForward( pTemp = pMan, nMaxIters, fVerbose );
|
||||
Aig_ManStop( pTemp );
|
||||
|
||||
// pMan = Aig_ManReduceLaches( pMan, 1 );
|
||||
// pMan = Aig_ManConstReduce( pMan, 1 );
|
||||
|
||||
pNtkAig = Abc_NtkFromDarSeqSweep( pNtk, pMan );
|
||||
Aig_ManStop( pMan );
|
||||
return pNtkAig;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Gives the current ABC network to AIG manager for processing.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose )
|
||||
{
|
||||
extern Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
|
||||
Abc_Ntk_t * pNtkAig;
|
||||
Aig_Man_t * pMan, * pTemp;
|
||||
pMan = Abc_NtkToDar( pNtk, 0, 1 );
|
||||
if ( pMan == NULL )
|
||||
return NULL;
|
||||
if ( pMan->vFlopNums )
|
||||
Vec_IntFree( pMan->vFlopNums );
|
||||
pMan->vFlopNums = NULL;
|
||||
|
||||
pMan->nTruePis = Aig_ManPiNum(pMan) - Aig_ManRegNum(pMan);
|
||||
pMan->nTruePos = Aig_ManPoNum(pMan) - Aig_ManRegNum(pMan);
|
||||
|
||||
pMan = Saig_ManRetimeMinArea( pTemp = pMan, nMaxIters, fForwardOnly, fBackwardOnly, fInitial, fVerbose );
|
||||
Aig_ManStop( pTemp );
|
||||
|
||||
pNtkAig = Abc_NtkFromDarSeqSweep( pNtk, pMan );
|
||||
Aig_ManStop( pMan );
|
||||
return pNtkAig;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Gives the current ABC network to AIG manager for processing.]
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ Abc_Ntk_t * Abc_NtkFromFpga( Fpga_Man_t * pMan, Abc_Ntk_t * pNtk )
|
|||
ProgressBar * pProgress;
|
||||
Abc_Ntk_t * pNtkNew;
|
||||
Abc_Obj_t * pNode, * pNodeNew;
|
||||
int i;//, nDupGates;
|
||||
int i, nDupGates;
|
||||
// create the new network
|
||||
pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
|
||||
// make the mapper point to the new network
|
||||
|
|
@ -229,9 +229,9 @@ Abc_Ntk_t * Abc_NtkFromFpga( Fpga_Man_t * pMan, Abc_Ntk_t * pNtk )
|
|||
if ( Abc_ObjFanoutNum(pNodeNew) == 0 )
|
||||
Abc_NtkDeleteObj( pNodeNew );
|
||||
// decouple the PO driver nodes to reduce the number of levels
|
||||
// nDupGates = Abc_NtkLogicMakeSimpleCos( pNtkNew, 1 );
|
||||
// if ( nDupGates && Fpga_ManReadVerbose(pMan) )
|
||||
// printf( "Duplicated %d gates to decouple the CO drivers.\n", nDupGates );
|
||||
nDupGates = Abc_NtkLogicMakeSimpleCos( pNtkNew, 1 );
|
||||
if ( nDupGates && Fpga_ManReadVerbose(pMan) )
|
||||
printf( "Duplicated %d gates to decouple the CO drivers.\n", nDupGates );
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ Abc_Ntk_t * Abc_NtkFromIf( If_Man_t * pIfMan, Abc_Ntk_t * pNtk )
|
|||
Abc_Ntk_t * pNtkNew;
|
||||
Abc_Obj_t * pNode, * pNodeNew;
|
||||
Vec_Int_t * vCover;
|
||||
int i;//, nDupGates;
|
||||
int i, nDupGates;
|
||||
// create the new network
|
||||
if ( pIfMan->pPars->fUseBdds || pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
|
||||
pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
|
||||
|
|
@ -223,9 +223,9 @@ Abc_Ntk_t * Abc_NtkFromIf( If_Man_t * pIfMan, Abc_Ntk_t * pNtk )
|
|||
if ( pIfMan->pPars->fUseBdds )
|
||||
Abc_NtkBddReorder( pNtkNew, 0 );
|
||||
// decouple the PO driver nodes to reduce the number of levels
|
||||
// nDupGates = Abc_NtkLogicMakeSimpleCos( pNtkNew, 1 );
|
||||
// if ( nDupGates && If_ManReadVerbose(pIfMan) )
|
||||
// printf( "Duplicated %d gates to decouple the CO drivers.\n", nDupGates );
|
||||
nDupGates = Abc_NtkLogicMakeSimpleCos( pNtkNew, 1 );
|
||||
if ( nDupGates && pIfMan->pPars->fVerbose )
|
||||
printf( "Duplicated %d gates to decouple the CO drivers.\n", nDupGates );
|
||||
return pNtkNew;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,313 @@
|
|||
/**CFile****************************************************************
|
||||
|
||||
FileName [abcReach.c]
|
||||
|
||||
SystemName [ABC: Logic synthesis and verification system.]
|
||||
|
||||
PackageName [Network and node package.]
|
||||
|
||||
Synopsis [Performs reachability analysis.]
|
||||
|
||||
Author [Alan Mishchenko]
|
||||
|
||||
Affiliation [UC Berkeley]
|
||||
|
||||
Date [Ver. 1.0. Started - June 20, 2005.]
|
||||
|
||||
Revision [$Id: abcReach.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include "abc.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Computes the initial state and sets up the variable map.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
DdNode * Abc_NtkInitStateVarMap( DdManager * dd, Abc_Ntk_t * pNtk, int fVerbose )
|
||||
{
|
||||
DdNode ** pbVarsX, ** pbVarsY;
|
||||
DdNode * bTemp, * bProd, * bVar;
|
||||
Abc_Obj_t * pLatch;
|
||||
int i;
|
||||
|
||||
// set the variable mapping for Cudd_bddVarMap()
|
||||
pbVarsX = ALLOC( DdNode *, dd->size );
|
||||
pbVarsY = ALLOC( DdNode *, dd->size );
|
||||
bProd = b1; Cudd_Ref( bProd );
|
||||
Abc_NtkForEachLatch( pNtk, pLatch, i )
|
||||
{
|
||||
pbVarsX[i] = dd->vars[ Abc_NtkPiNum(pNtk) + i ];
|
||||
pbVarsY[i] = dd->vars[ Abc_NtkCiNum(pNtk) + i ];
|
||||
// get the initial value of the latch
|
||||
bVar = Cudd_NotCond( pbVarsX[i], !Abc_LatchIsInit1(pLatch) );
|
||||
bProd = Cudd_bddAnd( dd, bTemp = bProd, bVar ); Cudd_Ref( bProd );
|
||||
Cudd_RecursiveDeref( dd, bTemp );
|
||||
}
|
||||
Cudd_SetVarMap( dd, pbVarsX, pbVarsY, Abc_NtkLatchNum(pNtk) );
|
||||
FREE( pbVarsX );
|
||||
FREE( pbVarsY );
|
||||
|
||||
Cudd_Deref( bProd );
|
||||
return bProd;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
DdNode ** Abc_NtkCreatePartitions( DdManager * dd, Abc_Ntk_t * pNtk, int fReorder, int fVerbose )
|
||||
{
|
||||
DdNode ** pbParts;
|
||||
DdNode * bVar;
|
||||
Abc_Obj_t * pNode;
|
||||
int i;
|
||||
|
||||
// extand the BDD manager to represent NS variables
|
||||
assert( dd->size == Abc_NtkCiNum(pNtk) );
|
||||
Cudd_bddIthVar( dd, Abc_NtkCiNum(pNtk) + Abc_NtkLatchNum(pNtk) - 1 );
|
||||
|
||||
// enable reordering
|
||||
if ( fReorder )
|
||||
Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
|
||||
else
|
||||
Cudd_AutodynDisable( dd );
|
||||
|
||||
// compute the transition relation
|
||||
pbParts = ALLOC( DdNode *, Abc_NtkLatchNum(pNtk) );
|
||||
Abc_NtkForEachLatch( pNtk, pNode, i )
|
||||
{
|
||||
bVar = Cudd_bddIthVar( dd, Abc_NtkCiNum(pNtk) + i );
|
||||
pbParts[i] = Cudd_bddXnor( dd, bVar, Abc_ObjGlobalBdd(Abc_ObjFanin0(pNode)) ); Cudd_Ref( pbParts[i] );
|
||||
}
|
||||
// free the global BDDs
|
||||
Abc_NtkFreeGlobalBdds( pNtk, 0 );
|
||||
|
||||
// reorder and disable reordering
|
||||
if ( fReorder )
|
||||
{
|
||||
if ( fVerbose )
|
||||
fprintf( stdout, "BDD nodes in the partitions before reordering %d.\n", Cudd_SharingSize(pbParts,Abc_NtkLatchNum(pNtk)) );
|
||||
Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
|
||||
Cudd_AutodynDisable( dd );
|
||||
if ( fVerbose )
|
||||
fprintf( stdout, "BDD nodes in the partitions after reordering %d.\n", Cudd_SharingSize(pbParts,Abc_NtkLatchNum(pNtk)) );
|
||||
}
|
||||
return pbParts;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Computes the set of unreachable states.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
DdNode * Abc_NtkComputeReachable( DdManager * dd, Abc_Ntk_t * pNtk, DdNode ** pbParts, DdNode * bInitial, DdNode * bOutput, int nBddMax, int nIterMax, int fPartition, int fReorder, int fVerbose )
|
||||
{
|
||||
int fInternalReorder = 0;
|
||||
Extra_ImageTree_t * pTree;
|
||||
Extra_ImageTree2_t * pTree2;
|
||||
DdNode * bReached, * bCubeCs;
|
||||
DdNode * bCurrent, * bNext, * bTemp;
|
||||
DdNode ** pbVarsY;
|
||||
Abc_Obj_t * pLatch;
|
||||
int i, nIters, nBddSize;
|
||||
int nThreshold = 10000;
|
||||
|
||||
// collect the NS variables
|
||||
// set the variable mapping for Cudd_bddVarMap()
|
||||
pbVarsY = ALLOC( DdNode *, dd->size );
|
||||
Abc_NtkForEachLatch( pNtk, pLatch, i )
|
||||
pbVarsY[i] = dd->vars[ Abc_NtkCiNum(pNtk) + i ];
|
||||
|
||||
// start the image computation
|
||||
bCubeCs = Extra_bddComputeRangeCube( dd, Abc_NtkPiNum(pNtk), Abc_NtkCiNum(pNtk) ); Cudd_Ref( bCubeCs );
|
||||
if ( fPartition )
|
||||
pTree = Extra_bddImageStart( dd, bCubeCs, Abc_NtkLatchNum(pNtk), pbParts, Abc_NtkLatchNum(pNtk), pbVarsY, fVerbose );
|
||||
else
|
||||
pTree2 = Extra_bddImageStart2( dd, bCubeCs, Abc_NtkLatchNum(pNtk), pbParts, Abc_NtkLatchNum(pNtk), pbVarsY, fVerbose );
|
||||
free( pbVarsY );
|
||||
Cudd_RecursiveDeref( dd, bCubeCs );
|
||||
|
||||
// perform reachability analisys
|
||||
bCurrent = bInitial; Cudd_Ref( bCurrent );
|
||||
bReached = bInitial; Cudd_Ref( bReached );
|
||||
for ( nIters = 1; nIters <= nIterMax; nIters++ )
|
||||
{
|
||||
// compute the next states
|
||||
if ( fPartition )
|
||||
bNext = Extra_bddImageCompute( pTree, bCurrent );
|
||||
else
|
||||
bNext = Extra_bddImageCompute2( pTree2, bCurrent );
|
||||
Cudd_Ref( bNext );
|
||||
Cudd_RecursiveDeref( dd, bCurrent );
|
||||
// remap these states into the current state vars
|
||||
bNext = Cudd_bddVarMap( dd, bTemp = bNext ); Cudd_Ref( bNext );
|
||||
Cudd_RecursiveDeref( dd, bTemp );
|
||||
// check if there are any new states
|
||||
if ( Cudd_bddLeq( dd, bNext, bReached ) )
|
||||
break;
|
||||
// check the BDD size
|
||||
nBddSize = Cudd_DagSize(bNext);
|
||||
if ( nBddSize > nBddMax )
|
||||
break;
|
||||
// check the result
|
||||
if ( !Cudd_bddLeq( dd, bNext, Cudd_Not(bOutput) ) )
|
||||
{
|
||||
printf( "The miter is proved REACHABLE in %d iterations. ", nIters );
|
||||
Cudd_RecursiveDeref( dd, bReached );
|
||||
bReached = NULL;
|
||||
break;
|
||||
}
|
||||
// get the new states
|
||||
bCurrent = Cudd_bddAnd( dd, bNext, Cudd_Not(bReached) ); Cudd_Ref( bCurrent );
|
||||
// minimize the new states with the reached states
|
||||
// bCurrent = Cudd_bddConstrain( dd, bTemp = bCurrent, Cudd_Not(bReached) ); Cudd_Ref( bCurrent );
|
||||
// Cudd_RecursiveDeref( dd, bTemp );
|
||||
// add to the reached states
|
||||
bReached = Cudd_bddOr( dd, bTemp = bReached, bNext ); Cudd_Ref( bReached );
|
||||
Cudd_RecursiveDeref( dd, bTemp );
|
||||
Cudd_RecursiveDeref( dd, bNext );
|
||||
if ( fVerbose )
|
||||
fprintf( stdout, "Iteration = %3d. BDD = %5d. ", nIters, nBddSize );
|
||||
if ( fInternalReorder && fReorder && nBddSize > nThreshold )
|
||||
{
|
||||
if ( fVerbose )
|
||||
fprintf( stdout, "Reordering... Before = %5d. ", Cudd_DagSize(bReached) );
|
||||
Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
|
||||
Cudd_AutodynDisable( dd );
|
||||
if ( fVerbose )
|
||||
fprintf( stdout, "After = %5d.\r", Cudd_DagSize(bReached) );
|
||||
nThreshold *= 2;
|
||||
}
|
||||
if ( fVerbose )
|
||||
fprintf( stdout, "\r" );
|
||||
}
|
||||
Cudd_RecursiveDeref( dd, bNext );
|
||||
// undo the image tree
|
||||
if ( fPartition )
|
||||
Extra_bddImageTreeDelete( pTree );
|
||||
else
|
||||
Extra_bddImageTreeDelete2( pTree2 );
|
||||
if ( bReached == NULL )
|
||||
return NULL;
|
||||
// report the stats
|
||||
if ( fVerbose )
|
||||
{
|
||||
double nMints = Cudd_CountMinterm(dd, bReached, Abc_NtkLatchNum(pNtk) );
|
||||
if ( nIters > nIterMax || Cudd_DagSize(bReached) > nBddMax )
|
||||
fprintf( stdout, "Reachability analysis is stopped after %d iterations.\n", nIters );
|
||||
else
|
||||
fprintf( stdout, "Reachability analysis completed in %d iterations.\n", nIters );
|
||||
fprintf( stdout, "Reachable states = %.0f. (Ratio = %.4f %%)\n", nMints, 100.0*nMints/pow(2.0, Abc_NtkLatchNum(pNtk)) );
|
||||
fflush( stdout );
|
||||
}
|
||||
//PRB( dd, bReached );
|
||||
Cudd_Deref( bReached );
|
||||
if ( nIters > nIterMax || Cudd_DagSize(bReached) > nBddMax )
|
||||
printf( "Verified ONLY FOR STATES REACHED in %d iterations. \n", nIters );
|
||||
printf( "The miter is proved unreachable in %d iteration. ", nIters );
|
||||
return bReached;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Performs reachability to see if any .]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Abc_NtkVerifyUsingBdds( Abc_Ntk_t * pNtk, int nBddMax, int nIterMax, int fPartition, int fReorder, int fVerbose )
|
||||
{
|
||||
DdManager * dd;
|
||||
DdNode ** pbParts;
|
||||
DdNode * bOutput, * bReached, * bInitial;
|
||||
int i, clk = clock();
|
||||
|
||||
assert( Abc_NtkIsStrash(pNtk) );
|
||||
assert( Abc_NtkPoNum(pNtk) == 1 );
|
||||
assert( Abc_ObjFanoutNum(Abc_NtkPo(pNtk,0)) == 0 ); // PO should go first
|
||||
|
||||
// compute the global BDDs of the latches
|
||||
dd = Abc_NtkBuildGlobalBdds( pNtk, nBddMax, 1, fReorder, fVerbose );
|
||||
if ( dd == NULL )
|
||||
{
|
||||
printf( "The number of intermediate BDD nodes exceeded the limit (%d).\n", nBddMax );
|
||||
return;
|
||||
}
|
||||
if ( fVerbose )
|
||||
printf( "Shared BDD size is %6d nodes.\n", Cudd_ReadKeys(dd) - Cudd_ReadDead(dd) );
|
||||
|
||||
// save the output BDD
|
||||
bOutput = Abc_ObjGlobalBdd(Abc_NtkPo(pNtk,0)); Cudd_Ref( bOutput );
|
||||
|
||||
// create partitions
|
||||
pbParts = Abc_NtkCreatePartitions( dd, pNtk, fReorder, fVerbose );
|
||||
|
||||
// create the initial state and the variable map
|
||||
bInitial = Abc_NtkInitStateVarMap( dd, pNtk, fVerbose ); Cudd_Ref( bInitial );
|
||||
|
||||
// check the result
|
||||
if ( !Cudd_bddLeq( dd, bInitial, Cudd_Not(bOutput) ) )
|
||||
printf( "The miter is proved REACHABLE in the initial state. " );
|
||||
else
|
||||
{
|
||||
// compute the reachable states
|
||||
bReached = Abc_NtkComputeReachable( dd, pNtk, pbParts, bInitial, bOutput, nBddMax, nIterMax, fPartition, fReorder, fVerbose );
|
||||
if ( bReached != NULL )
|
||||
{
|
||||
Cudd_Ref( bReached );
|
||||
Cudd_RecursiveDeref( dd, bReached );
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup
|
||||
Cudd_RecursiveDeref( dd, bOutput );
|
||||
Cudd_RecursiveDeref( dd, bInitial );
|
||||
for ( i = 0; i < Abc_NtkLatchNum(pNtk); i++ )
|
||||
Cudd_RecursiveDeref( dd, pbParts[i] );
|
||||
free( pbParts );
|
||||
Extra_StopManager( dd );
|
||||
|
||||
// report the runtime
|
||||
PRT( "Time", clock() - clk );
|
||||
fflush( stdout );
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
|
@ -39,6 +39,7 @@ SRC += src/base/abci/abc.c \
|
|||
src/base/abci/abcQuant.c \
|
||||
src/base/abci/abcRec.c \
|
||||
src/base/abci/abcReconv.c \
|
||||
src/base/abci/abcReach.c \
|
||||
src/base/abci/abcRefactor.c \
|
||||
src/base/abci/abcRenode.c \
|
||||
src/base/abci/abcReorder.c \
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ DdNode * Cudd_bddTransferPermute( DdManager * ddSource, DdManager * ddDestinatio
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define PRD(p) printf( "\nDECOMPOSITION TREE:\n\n" ); PrintDecEntry( (p), 0 )
|
||||
#define PRB(f) printf( #f " = " ); Cudd_bddPrint(dd,f); printf( "\n" )
|
||||
#define PRB_(f) printf( #f " = " ); Cudd_bddPrint(dd,f); printf( "\n" )
|
||||
#define PRK(f,n) Cudd_PrintKMap(stdout,dd,(f),Cudd_Not(f),(n),NULL,0); printf( "K-map for function" #f "\n\n" )
|
||||
#define PRK2(f,g,n) Cudd_PrintKMap(stdout,dd,(f),(g),(n),NULL,0); printf( "K-map for function <" #f ", " #g ">\n\n" )
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ long s_EncComputeTime;
|
|||
/// debugging macros ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define PRB(f) printf( #f " = " ); Cudd_bddPrint(dd,f); printf( "\n" )
|
||||
#define PRB_(f) printf( #f " = " ); Cudd_bddPrint(dd,f); printf( "\n" )
|
||||
#define PRK(f,n) Cudd_PrintKMap(stdout,dd,(f),Cudd_Not(f),(n),NULL,0); printf( "K-map for function" #f "\n\n" )
|
||||
#define PRK2(f,g,n) Cudd_PrintKMap(stdout,dd,(f),(g),(n),NULL,0); printf( "K-map for function <" #f ", " #g ">\n\n" )
|
||||
|
||||
|
|
|
|||
|
|
@ -118,6 +118,10 @@ typedef unsigned long long uint64;
|
|||
#define PRTP(a,t,T) printf("%s = ", (a)); printf("%6.2f sec (%6.2f %%)\n", (float)(t)/(float)(CLOCKS_PER_SEC), (T)? 100.0*(t)/(T) : 0.0)
|
||||
#endif
|
||||
|
||||
#ifndef PRB
|
||||
#define PRB(dd,f) printf("%s = ", #f); Extra_bddPrint(dd,f); printf("\n")
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Various Utilities */
|
||||
/*===========================================================================*/
|
||||
|
|
@ -162,6 +166,26 @@ extern int Extra_bddNodePathsUnderCutArray( DdManager * dd, DdNode ** p
|
|||
/* find the profile of a DD (the number of edges crossing each level) */
|
||||
extern int Extra_ProfileWidth( DdManager * dd, DdNode * F, int * Profile, int CutLevel );
|
||||
|
||||
/*=== extraBddImage.c ================================================================*/
|
||||
|
||||
typedef struct Extra_ImageTree_t_ Extra_ImageTree_t;
|
||||
extern Extra_ImageTree_t * Extra_bddImageStart(
|
||||
DdManager * dd, DdNode * bCare,
|
||||
int nParts, DdNode ** pbParts,
|
||||
int nVars, DdNode ** pbVars, int fVerbose );
|
||||
extern DdNode * Extra_bddImageCompute( Extra_ImageTree_t * pTree, DdNode * bCare );
|
||||
extern void Extra_bddImageTreeDelete( Extra_ImageTree_t * pTree );
|
||||
extern DdNode * Extra_bddImageRead( Extra_ImageTree_t * pTree );
|
||||
|
||||
typedef struct Extra_ImageTree2_t_ Extra_ImageTree2_t;
|
||||
extern Extra_ImageTree2_t * Extra_bddImageStart2(
|
||||
DdManager * dd, DdNode * bCare,
|
||||
int nParts, DdNode ** pbParts,
|
||||
int nVars, DdNode ** pbVars, int fVerbose );
|
||||
extern DdNode * Extra_bddImageCompute2( Extra_ImageTree2_t * pTree, DdNode * bCare );
|
||||
extern void Extra_bddImageTreeDelete2( Extra_ImageTree2_t * pTree );
|
||||
extern DdNode * Extra_bddImageRead2( Extra_ImageTree2_t * pTree );
|
||||
|
||||
/*=== extraBddMisc.c ========================================================*/
|
||||
|
||||
extern DdNode * Extra_TransferPermute( DdManager * ddSource, DdManager * ddDestination, DdNode * f, int * Permute );
|
||||
|
|
@ -190,6 +214,7 @@ extern DdNode * Extra_bddCreateOr( DdManager * dd, int nVars );
|
|||
extern DdNode * Extra_bddCreateExor( DdManager * dd, int nVars );
|
||||
extern DdNode * Extra_zddPrimes( DdManager * dd, DdNode * F );
|
||||
extern void Extra_bddPermuteArray( DdManager * dd, DdNode ** bNodesIn, DdNode ** bNodesOut, int nNodes, int *permut );
|
||||
extern DdNode * Extra_bddComputeCube( DdManager * dd, DdNode ** bXVars, int nVars );
|
||||
|
||||
/*=== extraBddKmap.c ================================================================*/
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -961,6 +961,34 @@ void Extra_bddPermuteArray( DdManager * manager, DdNode ** bNodesIn, DdNode ** b
|
|||
} /* end of Extra_bddPermuteArray */
|
||||
|
||||
|
||||
/**Function********************************************************************
|
||||
|
||||
Synopsis [Computes the positive polarty cube composed of the first vars in the array.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
******************************************************************************/
|
||||
DdNode * Extra_bddComputeCube( DdManager * dd, DdNode ** bXVars, int nVars )
|
||||
{
|
||||
DdNode * bRes;
|
||||
DdNode * bTemp;
|
||||
int i;
|
||||
|
||||
bRes = b1; Cudd_Ref( bRes );
|
||||
for ( i = 0; i < nVars; i++ )
|
||||
{
|
||||
bRes = Cudd_bddAnd( dd, bTemp = bRes, bXVars[i] ); Cudd_Ref( bRes );
|
||||
Cudd_RecursiveDeref( dd, bTemp );
|
||||
}
|
||||
|
||||
Cudd_Deref( bRes );
|
||||
return bRes;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Definition of internal functions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
SRC += src/misc/extra/extraBddAuto.c \
|
||||
src/misc/extra/extraBddCas.c \
|
||||
src/misc/extra/extraBddImage.c \
|
||||
src/misc/extra/extraBddKmap.c \
|
||||
src/misc/extra/extraBddMisc.c \
|
||||
src/misc/extra/extraBddSymm.c \
|
||||
|
|
|
|||
|
|
@ -241,21 +241,23 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars )
|
|||
if ( pNtk->pExcare )
|
||||
{
|
||||
Abc_Ntk_t * pTemp;
|
||||
pTemp = Abc_NtkStrash( pNtk->pExcare, 0, 0, 0 );
|
||||
p->pCare = Abc_NtkToDar( pTemp, 0 );
|
||||
Abc_NtkDelete( pTemp );
|
||||
p->vSuppsInv = Aig_ManSupportsInverse( p->pCare );
|
||||
}
|
||||
// if ( pPars->fVerbose )
|
||||
{
|
||||
if ( p->pCare != NULL )
|
||||
printf( "Performing optimization with %d external care clauses.\n", Aig_ManPoNum(p->pCare) );
|
||||
// else
|
||||
// printf( "Performing optimization without constraints.\n" );
|
||||
if ( Abc_NtkPiNum(pNtk->pExcare) != Abc_NtkCiNum(pNtk) )
|
||||
printf( "The PI count of careset (%d) and logic network (%d) differ. Careset is not used.\n",
|
||||
Abc_NtkPiNum(pNtk->pExcare), Abc_NtkCiNum(pNtk) );
|
||||
else
|
||||
{
|
||||
pTemp = Abc_NtkStrash( pNtk->pExcare, 0, 0, 0 );
|
||||
p->pCare = Abc_NtkToDar( pTemp, 0 );
|
||||
Abc_NtkDelete( pTemp );
|
||||
p->vSuppsInv = Aig_ManSupportsInverse( p->pCare );
|
||||
}
|
||||
}
|
||||
if ( p->pCare != NULL )
|
||||
printf( "Performing optimization with %d external care clauses.\n", Aig_ManPoNum(p->pCare) );
|
||||
// prepare the BDC manager
|
||||
if ( !pPars->fResub )
|
||||
{
|
||||
pDecPars->nVarsMax = nFaninMax;
|
||||
pDecPars->nVarsMax = (nFaninMax < 3) ? 3 : nFaninMax;
|
||||
pDecPars->fVerbose = pPars->fVerbose;
|
||||
p->vTruth = Vec_IntAlloc( 0 );
|
||||
p->pManDec = Bdc_ManAlloc( pDecPars );
|
||||
|
|
|
|||
Loading…
Reference in New Issue