mirror of
https://github.com/YosysHQ/abc.git
synced 2026-09-02 02:37:25 +02:00
merge
This commit is contained in:
@@ -1028,11 +1028,15 @@ Gia_Man_t * Abc_NtkAigToGia( Abc_Ntk_t * p, int fGiaSimple )
|
||||
}
|
||||
pNode->iTemp = Abc_LitNotCond( pHopObj->iData, Hop_IsComplement( (Hop_Obj_t *)pNode->pData ) );
|
||||
}
|
||||
Vec_PtrFree( vNodes );
|
||||
// create primary outputs
|
||||
Abc_NtkForEachCo( p, pNode, i )
|
||||
Gia_ManAppendCo( pNew, Abc_ObjFanin0(pNode)->iTemp );
|
||||
Gia_ManSetRegNum( pNew, Abc_NtkLatchNum(p) );
|
||||
// copy original IDs
|
||||
pNew->vIdsOrig = Vec_IntStart( Gia_ManObjNum(pNew) );
|
||||
Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
|
||||
Vec_IntWriteEntry( pNew->vIdsOrig, Abc_Lit2Var(pNode->iTemp), Abc_ObjId(pNode) );
|
||||
Vec_PtrFree( vNodes );
|
||||
// finish mapping
|
||||
assert( Gia_ManObjNum(pNew) <= nObjs );
|
||||
assert( pNew->vMapping == NULL );
|
||||
|
||||
@@ -12385,6 +12385,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
// Cba_PrsReadBlifTest();
|
||||
}
|
||||
// Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) );
|
||||
Acb_DataReadTest();
|
||||
return 0;
|
||||
usage:
|
||||
Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
|
||||
|
||||
@@ -92,6 +92,7 @@ struct Acb_Ntk_t_
|
||||
Vec_Wec_t vFanouts; // fanouts
|
||||
Vec_Wec_t vCnfs; // CNF
|
||||
Vec_Str_t vCnf; // CNF
|
||||
Vec_Int_t vSuppOld; // previous support
|
||||
// other
|
||||
Vec_Que_t * vQue; // temporary
|
||||
Vec_Int_t vCover; // temporary
|
||||
@@ -574,6 +575,7 @@ static inline void Acb_NtkFree( Acb_Ntk_t * p )
|
||||
Vec_WecErase( &p->vFanouts );
|
||||
Vec_WecErase( &p->vCnfs );
|
||||
Vec_StrErase( &p->vCnf );
|
||||
Vec_IntErase( &p->vSuppOld );
|
||||
// other
|
||||
Vec_QueFreeP( &p->vQue );
|
||||
Vec_IntErase( &p->vCover );
|
||||
@@ -972,6 +974,7 @@ extern int Acb_NtkComputeLevelD( Acb_Ntk_t * p, Vec_Int_t * vTfo );
|
||||
extern void Acb_NtkUpdateLevelD( Acb_Ntk_t * p, int iObj );
|
||||
extern void Acb_NtkUpdateTiming( Acb_Ntk_t * p, int iObj );
|
||||
|
||||
extern void Acb_NtkPrintNode( Acb_Ntk_t * p, int iObj );
|
||||
extern int Acb_NtkCreateNode( Acb_Ntk_t * p, word uTruth, Vec_Int_t * vSupp );
|
||||
extern void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp );
|
||||
|
||||
|
||||
+10
-15
@@ -433,14 +433,6 @@ void Acb_NtkPrintVec( Acb_Ntk_t * p, Vec_Int_t * vVec, char * pName )
|
||||
printf( "%d ", vVec->pArray[i] );
|
||||
printf( "\n" );
|
||||
}
|
||||
void Acb_NtkPrintNode( Acb_Ntk_t * p, int Node )
|
||||
{
|
||||
int k, iFanin, * pFanins;
|
||||
printf( "Node %d : ", Node );
|
||||
Acb_ObjForEachFaninFast( p, Node, pFanins, iFanin, k )
|
||||
printf( "%d ", iFanin );
|
||||
printf( "\n" );
|
||||
}
|
||||
void Acb_NtkPrintVec2( Acb_Ntk_t * p, Vec_Int_t * vVec, char * pName )
|
||||
{
|
||||
int i;
|
||||
@@ -486,7 +478,8 @@ Vec_Int_t * Acb_NtkDivisors( Acb_Ntk_t * p, int Pivot, int nTfiLevMin, int fDela
|
||||
int k, iFanin, * pFanins;
|
||||
Vec_Int_t * vDivs = Vec_IntAlloc( 100 );
|
||||
Acb_NtkIncTravId( p );
|
||||
if ( fDelay ) // delay-oriented
|
||||
// if ( fDelay ) // delay-oriented
|
||||
if ( 0 ) // delay-oriented
|
||||
{
|
||||
// start from critical fanins
|
||||
assert( Acb_ObjLevelD( p, Pivot ) > 1 );
|
||||
@@ -805,7 +798,7 @@ Vec_Int_t * Acb_NtkWindow( Acb_Ntk_t * p, int Pivot, int nTfiLevs, int nTfoLevs,
|
||||
// mark limited TFO of the divisors
|
||||
vMarked = Acb_ObjMarkTfo( p, vDivs, Pivot, nTfoLevMax, nFanMax );
|
||||
// collect TFO and roots
|
||||
Acb_ObjDeriveTfo( p, Pivot, nTfoLevMax, nFanMax, &vTfo, &vRoots, fDelay );
|
||||
Acb_ObjDeriveTfo( p, Pivot, nTfoLevMax, nFanMax, &vTfo, &vRoots, 0 );//fDelay );
|
||||
if ( fVerbose ) Acb_NtkPrintVec( p, vTfo, "vTfo" );
|
||||
if ( fVerbose ) Acb_NtkPrintVec( p, vRoots, "vRoots" );
|
||||
// collect side inputs of the TFO
|
||||
@@ -1599,8 +1592,8 @@ void Acb_NtkOpt( Acb_Ntk_t * pNtk, Acb_Par_t * pPars )
|
||||
if ( iObj < nNodes && !Vec_BitEntry(vVisited, iObj) && Acb_NtkObjMffcEstimate(pNtk, iObj) >= n )
|
||||
{
|
||||
pMan->nNodes++;
|
||||
//if ( iObj != 7 )
|
||||
// continue;
|
||||
if ( iObj != 103 )
|
||||
continue;
|
||||
//Acb_NtkOptNode( pMan, iObj );
|
||||
while ( (RetValue = Acb_NtkOptNode(pMan, iObj)) && Acb_ObjFaninNum(pNtk, iObj) );
|
||||
Vec_BitWriteEntry( vVisited, iObj, 1 );
|
||||
@@ -1609,14 +1602,16 @@ void Acb_NtkOpt( Acb_Ntk_t * pNtk, Acb_Par_t * pPars )
|
||||
}
|
||||
else
|
||||
{
|
||||
int Value;
|
||||
Acb_NtkUpdateTiming( pNtk, -1 ); // compute delay information
|
||||
while ( Vec_QueTopPriority(pNtk->vQue) > 0 )
|
||||
while ( (Value = (int)Vec_QueTopPriority(pNtk->vQue)) > 0 )
|
||||
{
|
||||
int iObj = Vec_QuePop(pNtk->vQue);
|
||||
if ( !Acb_ObjType(pNtk, iObj) )
|
||||
continue;
|
||||
//if ( iObj != 28 )
|
||||
// continue;
|
||||
if ( iObj != 103 )
|
||||
continue;
|
||||
//printf( "Trying node %4d (%4d) ", iObj, Value );
|
||||
Acb_NtkOptNode( pMan, iObj );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/**CFile****************************************************************
|
||||
|
||||
FileName [acbSets.c]
|
||||
|
||||
SystemName [ABC: Logic synthesis and verification system.]
|
||||
|
||||
PackageName [Hierarchical word-level netlist.]
|
||||
|
||||
Synopsis [Reading data from file.]
|
||||
|
||||
Author [Alan Mishchenko]
|
||||
|
||||
Affiliation [UC Berkeley]
|
||||
|
||||
Date [Ver. 1.0. Started - July 21, 2015.]
|
||||
|
||||
Revision [$Id: acbSets.c,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include "acb.h"
|
||||
|
||||
ABC_NAMESPACE_IMPL_START
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// DECLARATIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Acb_DataReadTest()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
ABC_NAMESPACE_IMPL_END
|
||||
|
||||
+35
-7
@@ -55,11 +55,15 @@ void Acb_ObjCollectTfi_rec( Acb_Ntk_t * p, int iObj, int fTerm )
|
||||
}
|
||||
Vec_Int_t * Acb_ObjCollectTfi( Acb_Ntk_t * p, int iObj, int fTerm )
|
||||
{
|
||||
int i;
|
||||
int i, Node;
|
||||
Vec_IntClear( &p->vArray0 );
|
||||
Acb_NtkIncTravId( p );
|
||||
if ( iObj > 0 )
|
||||
{
|
||||
Vec_IntForEachEntry( &p->vSuppOld, Node, i )
|
||||
Acb_ObjCollectTfi_rec( p, Node, fTerm );
|
||||
Acb_ObjCollectTfi_rec( p, iObj, fTerm );
|
||||
}
|
||||
else
|
||||
Acb_NtkForEachCo( p, iObj, i )
|
||||
Acb_ObjCollectTfi_rec( p, iObj, fTerm );
|
||||
@@ -267,10 +271,12 @@ void Acb_NtkPrintPaths( Acb_Ntk_t * p )
|
||||
int iObj;
|
||||
Acb_NtkForEachObj( p, iObj )
|
||||
{
|
||||
printf( "Obj = %5d : ", iObj );
|
||||
printf( "PathD = %5d ", Acb_ObjPathD(p, iObj) );
|
||||
printf( "PathR = %5d ", Acb_ObjPathR(p, iObj) );
|
||||
printf( "Paths = %5d ", Acb_ObjPathD(p, iObj) + Acb_ObjPathR(p, iObj) );
|
||||
printf( "Obj = %5d : ", iObj );
|
||||
printf( "LevelD = %5d ", Acb_ObjLevelD(p, iObj) );
|
||||
printf( "LevelR = %5d ", Acb_ObjLevelR(p, iObj) );
|
||||
printf( "PathD = %5d ", Acb_ObjPathD(p, iObj) );
|
||||
printf( "PathR = %5d ", Acb_ObjPathR(p, iObj) );
|
||||
printf( "Paths = %5d ", Acb_ObjPathD(p, iObj) * Acb_ObjPathR(p, iObj) );
|
||||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
@@ -323,7 +329,7 @@ void Acb_ObjUpdatePriority( Acb_Ntk_t * p, int iObj )
|
||||
p->vQue = Vec_QueAlloc( 1000 );
|
||||
Vec_QueSetPriority( p->vQue, Vec_FltArrayP(&p->vCounts) );
|
||||
}
|
||||
nPaths = Acb_ObjPathD(p, iObj) + Acb_ObjPathR(p, iObj);
|
||||
nPaths = Acb_ObjPathD(p, iObj) * Acb_ObjPathR(p, iObj);
|
||||
Acb_ObjSetCounts( p, iObj, (float)nPaths );
|
||||
if ( Vec_QueIsMember( p->vQue, iObj ) )
|
||||
{
|
||||
@@ -394,6 +400,14 @@ void Acb_NtkUpdateTiming( Acb_Ntk_t * p, int iObj )
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Acb_NtkPrintNode( Acb_Ntk_t * p, int iObj )
|
||||
{
|
||||
int k, iFanin, * pFanins;
|
||||
printf( "Node %5d : ", iObj );
|
||||
Acb_ObjForEachFaninFast( p, iObj, pFanins, iFanin, k )
|
||||
printf( "%d ", iFanin );
|
||||
printf( "LevelD = %d. LevelR = %d.\n", Acb_ObjLevelD(p, iObj), Acb_ObjLevelR(p, iObj) );
|
||||
}
|
||||
int Acb_NtkCreateNode( Acb_Ntk_t * p, word uTruth, Vec_Int_t * vSupp )
|
||||
{
|
||||
int Pivot = Acb_ObjAlloc( p, ABC_OPER_LUT, Vec_IntSize(vSupp), 0 );
|
||||
@@ -432,14 +446,28 @@ void Acb_NtkResetNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp
|
||||
Acb_NtkResetNode( p, iFanin, 0, NULL );
|
||||
Vec_IntFree( vFanins );
|
||||
}
|
||||
void Acb_NtkSaveSupport( Acb_Ntk_t * p, int iObj )
|
||||
{
|
||||
int k, iFanin, * pFanins;
|
||||
Vec_IntClear( &p->vSuppOld );
|
||||
Acb_ObjForEachFaninFast( p, iObj, pFanins, iFanin, k )
|
||||
Vec_IntPush( &p->vSuppOld, iFanin );
|
||||
}
|
||||
void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp )
|
||||
{
|
||||
//int Level = Acb_ObjLevelD(p, Pivot);
|
||||
Acb_NtkSaveSupport( p, Pivot );
|
||||
//Acb_NtkPrintNode( p, Pivot );
|
||||
Acb_NtkResetNode( p, Pivot, uTruth, vSupp );
|
||||
Acb_ObjComputeLevelD( p, Pivot );
|
||||
//assert( Level > Acb_ObjLevelD(p, Pivot) );
|
||||
//Acb_NtkPrintNode( p, Pivot );
|
||||
if ( p->vQue == NULL )
|
||||
Acb_NtkUpdateLevelD( p, Pivot );
|
||||
else
|
||||
Acb_NtkUpdateTiming( p, Pivot );
|
||||
// Acb_NtkUpdateTiming( p, Pivot );
|
||||
Acb_NtkUpdateTiming( p, -1 );
|
||||
Vec_IntClear( &p->vSuppOld );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -3,4 +3,5 @@ SRC += src/base/acb/acbAbc.c \
|
||||
src/base/acb/acbCom.c \
|
||||
src/base/acb/acbFunc.c \
|
||||
src/base/acb/acbMfs.c \
|
||||
src/base/acb/acbSets.c \
|
||||
src/base/acb/acbUtil.c
|
||||
|
||||
Reference in New Issue
Block a user