summaryrefslogtreecommitdiffstats
path: root/src/base/abc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-12-08 14:10:41 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2014-12-08 14:10:41 -0800
commit1398de7c46d3b2f4e63a6b10965f1e9f4d62742c (patch)
tree91897fd6383960f6fb11322500756781250612b0 /src/base/abc
parent3e2fad35748982c032ad30d8ccc6d5216213dff2 (diff)
downloadabc-1398de7c46d3b2f4e63a6b10965f1e9f4d62742c.tar.gz
abc-1398de7c46d3b2f4e63a6b10965f1e9f4d62742c.tar.bz2
abc-1398de7c46d3b2f4e63a6b10965f1e9f4d62742c.zip
Integrating barrier buffers.
Diffstat (limited to 'src/base/abc')
-rw-r--r--src/base/abc/abc.h3
-rw-r--r--src/base/abc/abcCheck.c2
-rw-r--r--src/base/abc/abcDfs.c4
-rw-r--r--src/base/abc/abcFunc.c27
-rw-r--r--src/base/abc/abcHie.c1
-rw-r--r--src/base/abc/abcUtil.c2
6 files changed, 32 insertions, 7 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h
index eb21b091..6acdedad 100644
--- a/src/base/abc/abc.h
+++ b/src/base/abc/abc.h
@@ -172,6 +172,7 @@ struct Abc_Ntk_t_
int nObjs; // the number of live objs
int nConstrs; // the number of constraints
int nBarBufs; // the number of barrier buffers
+ int nBarBufs2; // the number of barrier buffers
// 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
@@ -356,7 +357,7 @@ static inline int Abc_ObjIsLatch( Abc_Obj_t * pObj ) { return pO
static inline int Abc_ObjIsBox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_LATCH || pObj->Type == ABC_OBJ_WHITEBOX || pObj->Type == ABC_OBJ_BLACKBOX; }
static inline int Abc_ObjIsWhitebox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_WHITEBOX;}
static inline int Abc_ObjIsBlackbox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BLACKBOX;}
-static inline int Abc_ObjIsBarBuf( Abc_Obj_t * pObj ) { assert( Abc_NtkIsMappedLogic(pObj->pNtk) ); return Vec_IntSize(&pObj->vFanins) == 1 && pObj->pData == NULL; }
+static inline int Abc_ObjIsBarBuf( Abc_Obj_t * pObj ) { assert( Abc_NtkIsLogic(pObj->pNtk) ); return Vec_IntSize(&pObj->vFanins) == 1 && pObj->pData == NULL; }
static inline void Abc_ObjBlackboxToWhitebox( Abc_Obj_t * pObj ) { assert( Abc_ObjIsBlackbox(pObj) ); pObj->Type = ABC_OBJ_WHITEBOX; pObj->pNtk->nObjCounts[ABC_OBJ_BLACKBOX]--; pObj->pNtk->nObjCounts[ABC_OBJ_WHITEBOX]++; }
// working with fanin/fanout edges
diff --git a/src/base/abc/abcCheck.c b/src/base/abc/abcCheck.c
index 99fcae4a..fca3b8dc 100644
--- a/src/base/abc/abcCheck.c
+++ b/src/base/abc/abcCheck.c
@@ -527,6 +527,8 @@ int Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
// the node should have a function assigned unless it is an AIG
if ( pNode->pData == NULL )
{
+ if ( Abc_ObjIsBarBuf(pNode) )
+ return 1;
fprintf( stdout, "NodeCheck: An internal node \"%s\" does not have a logic function.\n", Abc_ObjNameNet(pNode) );
return 0;
}
diff --git a/src/base/abc/abcDfs.c b/src/base/abc/abcDfs.c
index 4508f334..fb7cd3f6 100644
--- a/src/base/abc/abcDfs.c
+++ b/src/base/abc/abcDfs.c
@@ -1178,7 +1178,7 @@ int Abc_NtkLevel_rec( Abc_Obj_t * pNode )
if ( pNode->Level < (unsigned)Level )
pNode->Level = Level;
}
- if ( Abc_ObjFaninNum(pNode) > 0 )
+ if ( Abc_ObjFaninNum(pNode) > 0 && !Abc_ObjIsBarBuf(pNode) )
pNode->Level++;
return pNode->Level;
}
@@ -1216,7 +1216,7 @@ int Abc_NtkLevelReverse_rec( Abc_Obj_t * pNode )
if ( pNode->Level < (unsigned)Level )
pNode->Level = Level;
}
- if ( Abc_ObjFaninNum(pNode) > 0 )
+ if ( Abc_ObjFaninNum(pNode) > 0 && !Abc_ObjIsBarBuf(pNode) )
pNode->Level++;
return pNode->Level;
}
diff --git a/src/base/abc/abcFunc.c b/src/base/abc/abcFunc.c
index 5891c5bd..d7b22b04 100644
--- a/src/base/abc/abcFunc.c
+++ b/src/base/abc/abcFunc.c
@@ -136,6 +136,8 @@ int Abc_NtkSopToBdd( Abc_Ntk_t * pNtk )
// convert each node from SOP to BDD
Abc_NtkForEachNode( pNtk, pNode, i )
{
+ if ( Abc_ObjIsBarBuf(pNode) )
+ continue;
assert( pNode->pData );
if ( Abc_ObjFaninNum(pNode) > 10 )
{
@@ -379,6 +381,8 @@ int Abc_NtkBddToSop( Abc_Ntk_t * pNtk, int fDirect )
vCube = Vec_StrAlloc( 100 );
Abc_NtkForEachNode( pNtk, pNode, i )
{
+ if ( Abc_ObjIsBarBuf(pNode) )
+ continue;
assert( pNode->pData );
bFunc = (DdNode *)pNode->pData;
pNode->pNext = (Abc_Obj_t *)Abc_ConvertBddToSop( pManNew, dd, bFunc, bFunc, Abc_ObjFaninNum(pNode), 0, vCube, fMode );
@@ -400,6 +404,8 @@ int Abc_NtkBddToSop( Abc_Ntk_t * pNtk, int fDirect )
// transfer from next to data
Abc_NtkForEachNode( pNtk, pNode, i )
{
+ if ( Abc_ObjIsBarBuf(pNode) )
+ continue;
Cudd_RecursiveDeref( dd, (DdNode *)pNode->pData );
pNode->pData = pNode->pNext;
pNode->pNext = NULL;
@@ -513,7 +519,7 @@ void Abc_NtkLogicMakeDirectSops( Abc_Ntk_t * pNtk )
// check if there are nodes with complemented SOPs
fFound = 0;
Abc_NtkForEachNode( pNtk, pNode, i )
- if ( Abc_SopIsComplement((char *)pNode->pData) )
+ if ( !Abc_ObjIsBarBuf(pNode) && Abc_SopIsComplement((char *)pNode->pData) )
{
fFound = 1;
break;
@@ -530,7 +536,7 @@ void Abc_NtkLogicMakeDirectSops( Abc_Ntk_t * pNtk )
// change the cover of negated nodes
vCube = Vec_StrAlloc( 100 );
Abc_NtkForEachNode( pNtk, pNode, i )
- if ( Abc_SopIsComplement((char *)pNode->pData) )
+ if ( !Abc_ObjIsBarBuf(pNode) && Abc_SopIsComplement((char *)pNode->pData) )
{
bFunc = Abc_ConvertSopToBdd( dd, (char *)pNode->pData, NULL ); Cudd_Ref( bFunc );
pNode->pData = Abc_ConvertBddToSop( (Mem_Flex_t *)pNtk->pManFunc, dd, bFunc, bFunc, Abc_ObjFaninNum(pNode), 0, vCube, 1 );
@@ -620,6 +626,8 @@ int Abc_NtkSopToAig( Abc_Ntk_t * pNtk )
// convert each node from SOP to BDD
Abc_NtkForEachNode( pNtk, pNode, i )
{
+ if ( Abc_ObjIsBarBuf(pNode) )
+ continue;
assert( pNode->pData );
pNode->pData = Abc_ConvertSopToAig( pMan, (char *)pNode->pData );
if ( pNode->pData == NULL )
@@ -726,6 +734,7 @@ int Abc_NtkAigToBdd( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode;
Hop_Man_t * pMan;
+ DdNode * pFunc;
DdManager * dd, * ddTemp = NULL;
Vec_Int_t * vFanins = NULL;
int nFaninsMax, i, k, iVar;
@@ -753,7 +762,9 @@ int Abc_NtkAigToBdd( Abc_Ntk_t * pNtk )
// convert each node from SOP to BDD
Abc_NtkForEachNode( pNtk, pNode, i )
{
- DdNode * pFunc = Abc_ConvertAigToBdd( ddTemp, (Hop_Obj_t *)pNode->pData );
+ if ( Abc_ObjIsBarBuf(pNode) )
+ continue;
+ pFunc = Abc_ConvertAigToBdd( ddTemp, (Hop_Obj_t *)pNode->pData );
if ( pFunc == NULL )
{
printf( "Abc_NtkAigToBdd: Error while converting AIG into BDD.\n" );
@@ -944,12 +955,18 @@ Gia_Man_t * Abc_NtkAigToGia( Abc_Ntk_t * p )
// find the number of objects
nObjs = 1 + Abc_NtkCiNum(p) + Abc_NtkCoNum(p);
Abc_NtkForEachNode( p, pNode, i )
- nObjs += Hop_DagSize( (Hop_Obj_t *)pNode->pData );
+ nObjs += Abc_ObjIsBarBuf(pNode) ? 1 : Hop_DagSize( (Hop_Obj_t *)pNode->pData );
vMapping = Vec_IntStart( nObjs );
// iterate through nodes used in the mapping
vNodes = Abc_NtkDfs( p, 0 );
Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
+ if ( Abc_ObjIsBarBuf(pNode) )
+ {
+ assert( !Abc_ObjFaninC0(pNode) );
+ pNode->iTemp = Gia_ManAppendBuf( pNew, Abc_ObjFanin0(pNode)->iTemp );
+ continue;
+ }
Abc_ObjForEachFanin( pNode, pFanin, k )
Hop_ManPi(pHopMan, k)->iData = pFanin->iTemp;
pHopObj = Hop_Regular( (Hop_Obj_t *)pNode->pData );
@@ -1068,6 +1085,8 @@ int Abc_NtkMapToSop( Abc_Ntk_t * pNtk )
// update the nodes
Abc_NtkForEachNode( pNtk, pNode, i )
{
+ if ( Abc_ObjIsBarBuf(pNode) )
+ continue;
pSop = Mio_GateReadSop((Mio_Gate_t *)pNode->pData);
assert( Abc_SopGetVarNum(pSop) == Abc_ObjFaninNum(pNode) );
pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, pSop );
diff --git a/src/base/abc/abcHie.c b/src/base/abc/abcHie.c
index dc22930c..32b5d310 100644
--- a/src/base/abc/abcHie.c
+++ b/src/base/abc/abcHie.c
@@ -271,6 +271,7 @@ void Abc_NtkFlattenLogicHierarchy_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, in
// process the blackbox
if ( Abc_NtkHasBlackbox(pNtk) )
{
+ printf( "Flatting black box \"%s\".\n", pNtk->pName );
// duplicate the blackbox
assert( Abc_NtkBoxNum(pNtk) == 1 );
pObj = Abc_NtkBox( pNtk, 0 );
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index bf3ce301..9309f1e8 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -340,6 +340,8 @@ double Abc_NtkGetMappedArea( Abc_Ntk_t * pNtk )
TotalArea = 0.0;
Abc_NtkForEachNode( pNtk, pObj, i )
{
+ if ( Abc_ObjIsBarBuf(pObj) )
+ continue;
// assert( pObj->pData );
if ( pObj->pData == NULL )
{