Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
08795165
Commit
08795165
authored
Apr 03, 2008
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version abc80403
parent
0080244a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
292 additions
and
233 deletions
+292
-233
abc.dsp
+4
-0
src/aig/aig/aig.h
+9
-7
src/aig/aig/aigDfs.c
+118
-66
src/aig/aig/aigDup.c
+0
-0
src/aig/aig/aigHaig.c
+1
-1
src/aig/aig/aigMan.c
+0
-0
src/aig/aig/aigPart.c
+11
-103
src/aig/aig/aigRetF.c
+1
-1
src/aig/aig/aigUtil.c
+9
-3
src/aig/aig/module.make
+1
-0
src/aig/dar/darMan.c
+1
-0
src/aig/dar/darScript.c
+18
-18
src/aig/fra/fraCec.c
+1
-1
src/aig/fra/fraCore.c
+1
-1
src/aig/fra/fraInd.c
+2
-2
src/aig/fra/fraLcr.c
+28
-3
src/aig/fra/fraMan.c
+1
-0
src/aig/fra/fraSec.c
+6
-4
src/aig/ivy/ivyMan.c
+1
-0
src/aig/ntl/ntlCore.c
+4
-2
src/aig/nwk/nwkDfs.c
+2
-2
src/aig/nwk/nwkMap.c
+6
-2
src/aig/nwk/nwkStrash.c
+1
-1
src/base/abci/abc.c
+54
-7
src/base/abci/abcDar.c
+5
-5
src/base/abci/abcPrint.c
+1
-0
src/misc/hash/hashInt.h
+5
-4
src/sat/fraig/fraigMan.c
+1
-0
No files found.
abc.dsp
View file @
08795165
...
@@ -2946,6 +2946,10 @@ SOURCE=.\src\aig\aig\aigDfs.c
...
@@ -2946,6 +2946,10 @@ SOURCE=.\src\aig\aig\aigDfs.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
SOURCE=.\src\aig\aig\aigDup.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\aig\aigFanout.c
SOURCE=.\src\aig\aig\aigFanout.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
...
...
src/aig/aig/aig.h
View file @
08795165
...
@@ -445,14 +445,13 @@ extern Aig_ManCut_t * Aig_ComputeCuts( Aig_Man_t * pAig, int nCutsMax, int nLea
...
@@ -445,14 +445,13 @@ extern Aig_ManCut_t * Aig_ComputeCuts( Aig_Man_t * pAig, int nCutsMax, int nLea
extern
void
Aig_ManCutStop
(
Aig_ManCut_t
*
p
);
extern
void
Aig_ManCutStop
(
Aig_ManCut_t
*
p
);
/*=== aigDfs.c ==========================================================*/
/*=== aigDfs.c ==========================================================*/
extern
int
Aig_ManVerifyTopoOrder
(
Aig_Man_t
*
p
);
extern
int
Aig_ManVerifyTopoOrder
(
Aig_Man_t
*
p
);
extern
Vec_Ptr_t
*
Aig_ManDfs
(
Aig_Man_t
*
p
);
extern
Vec_Ptr_t
*
Aig_ManDfs
(
Aig_Man_t
*
p
,
int
fNodesOnly
);
extern
Vec_Vec_t
*
Aig_ManLevelize
(
Aig_Man_t
*
p
);
extern
Vec_Vec_t
*
Aig_ManLevelize
(
Aig_Man_t
*
p
);
extern
Vec_Ptr_t
*
Aig_ManDfsPio
(
Aig_Man_t
*
p
);
extern
Vec_Ptr_t
*
Aig_ManDfsNodes
(
Aig_Man_t
*
p
,
Aig_Obj_t
**
ppNodes
,
int
nNodes
);
extern
Vec_Ptr_t
*
Aig_ManDfsNodes
(
Aig_Man_t
*
p
,
Aig_Obj_t
**
ppNodes
,
int
nNodes
);
extern
Vec_Ptr_t
*
Aig_ManDfsChoices
(
Aig_Man_t
*
p
);
extern
Vec_Ptr_t
*
Aig_ManDfsChoices
(
Aig_Man_t
*
p
);
extern
Vec_Ptr_t
*
Aig_ManDfsReverse
(
Aig_Man_t
*
p
);
extern
Vec_Ptr_t
*
Aig_ManDfsReverse
(
Aig_Man_t
*
p
);
extern
int
Aig_ManLevelNum
(
Aig_Man_t
*
p
);
extern
int
Aig_ManLevelNum
(
Aig_Man_t
*
p
);
extern
int
Aig_ManC
ountLevels
(
Aig_Man_t
*
p
);
extern
int
Aig_ManC
hoiceLevel
(
Aig_Man_t
*
p
);
extern
int
Aig_DagSize
(
Aig_Obj_t
*
pObj
);
extern
int
Aig_DagSize
(
Aig_Obj_t
*
pObj
);
extern
int
Aig_SupportSize
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
);
extern
int
Aig_SupportSize
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
);
extern
void
Aig_ConeUnmark_rec
(
Aig_Obj_t
*
pObj
);
extern
void
Aig_ConeUnmark_rec
(
Aig_Obj_t
*
pObj
);
...
@@ -460,6 +459,13 @@ extern Aig_Obj_t * Aig_Transfer( Aig_Man_t * pSour, Aig_Man_t * pDest, Aig_O
...
@@ -460,6 +459,13 @@ extern Aig_Obj_t * Aig_Transfer( Aig_Man_t * pSour, Aig_Man_t * pDest, Aig_O
extern
Aig_Obj_t
*
Aig_Compose
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pRoot
,
Aig_Obj_t
*
pFunc
,
int
iVar
);
extern
Aig_Obj_t
*
Aig_Compose
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pRoot
,
Aig_Obj_t
*
pFunc
,
int
iVar
);
extern
void
Aig_ObjCollectCut
(
Aig_Obj_t
*
pRoot
,
Vec_Ptr_t
*
vLeaves
,
Vec_Ptr_t
*
vNodes
);
extern
void
Aig_ObjCollectCut
(
Aig_Obj_t
*
pRoot
,
Vec_Ptr_t
*
vLeaves
,
Vec_Ptr_t
*
vNodes
);
extern
int
Aig_ObjCollectSuper
(
Aig_Obj_t
*
pObj
,
Vec_Ptr_t
*
vSuper
);
extern
int
Aig_ObjCollectSuper
(
Aig_Obj_t
*
pObj
,
Vec_Ptr_t
*
vSuper
);
/*=== aigDup.c ==========================================================*/
extern
Aig_Man_t
*
Aig_ManDupOrdered
(
Aig_Man_t
*
p
);
extern
Aig_Man_t
*
Aig_ManDupExor
(
Aig_Man_t
*
p
);
extern
Aig_Man_t
*
Aig_ManDupDfs
(
Aig_Man_t
*
p
);
extern
Aig_Man_t
*
Aig_ManDupDfsOrder
(
Aig_Man_t
*
p
,
Aig_Man_t
*
pOrder
);
extern
Aig_Man_t
*
Aig_ManDupLevelized
(
Aig_Man_t
*
p
);
extern
Aig_Man_t
*
Aig_ManDupWithoutPos
(
Aig_Man_t
*
p
);
/*=== aigFanout.c ==========================================================*/
/*=== aigFanout.c ==========================================================*/
extern
void
Aig_ObjAddFanout
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
,
Aig_Obj_t
*
pFanout
);
extern
void
Aig_ObjAddFanout
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
,
Aig_Obj_t
*
pFanout
);
extern
void
Aig_ObjRemoveFanout
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
,
Aig_Obj_t
*
pFanout
);
extern
void
Aig_ObjRemoveFanout
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
,
Aig_Obj_t
*
pFanout
);
...
@@ -472,10 +478,6 @@ extern void Aig_ManHaigRecord( Aig_Man_t * p );
...
@@ -472,10 +478,6 @@ extern void Aig_ManHaigRecord( Aig_Man_t * p );
/*=== aigMan.c ==========================================================*/
/*=== aigMan.c ==========================================================*/
extern
Aig_Man_t
*
Aig_ManStart
(
int
nNodesMax
);
extern
Aig_Man_t
*
Aig_ManStart
(
int
nNodesMax
);
extern
Aig_Man_t
*
Aig_ManStartFrom
(
Aig_Man_t
*
p
);
extern
Aig_Man_t
*
Aig_ManStartFrom
(
Aig_Man_t
*
p
);
extern
Aig_Man_t
*
Aig_ManDupExor
(
Aig_Man_t
*
p
);
extern
Aig_Obj_t
*
Aig_ManDup_rec
(
Aig_Man_t
*
pNew
,
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
);
extern
Aig_Man_t
*
Aig_ManDup
(
Aig_Man_t
*
p
,
int
fOrdered
);
extern
Aig_Man_t
*
Aig_ManDupWithoutPos
(
Aig_Man_t
*
p
);
extern
Aig_Man_t
*
Aig_ManExtractMiter
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pNode1
,
Aig_Obj_t
*
pNode2
);
extern
Aig_Man_t
*
Aig_ManExtractMiter
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pNode1
,
Aig_Obj_t
*
pNode2
);
extern
void
Aig_ManStop
(
Aig_Man_t
*
p
);
extern
void
Aig_ManStop
(
Aig_Man_t
*
p
);
extern
int
Aig_ManCleanup
(
Aig_Man_t
*
p
);
extern
int
Aig_ManCleanup
(
Aig_Man_t
*
p
);
...
...
src/aig/aig/aigDfs.c
View file @
08795165
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
int
Aig_ManVerifyTopoOrder
(
Aig_Man_t
*
p
)
int
Aig_ManVerifyTopoOrder
(
Aig_Man_t
*
p
)
{
{
Aig_Obj_t
*
pObj
,
*
pNext
;
Aig_Obj_t
*
pObj
,
*
pNext
;
int
i
,
iBox
,
iTerm1
,
nTerms
;
int
i
,
k
,
iBox
,
iTerm1
,
nTerms
;
Aig_ManSetPioNumbers
(
p
);
Aig_ManSetPioNumbers
(
p
);
Aig_ManIncrementTravId
(
p
);
Aig_ManIncrementTravId
(
p
);
Aig_ManForEachObj
(
p
,
pObj
,
i
)
Aig_ManForEachObj
(
p
,
pObj
,
i
)
...
@@ -63,7 +63,7 @@ int Aig_ManVerifyTopoOrder( Aig_Man_t * p )
...
@@ -63,7 +63,7 @@ int Aig_ManVerifyTopoOrder( Aig_Man_t * p )
return
0
;
return
0
;
}
}
}
}
else
if
(
Aig_ObjIsPo
(
pObj
)
)
else
if
(
Aig_ObjIsPo
(
pObj
)
||
Aig_ObjIsBuf
(
pObj
)
)
{
{
pNext
=
Aig_ObjFanin0
(
pObj
);
pNext
=
Aig_ObjFanin0
(
pObj
);
if
(
!
Aig_ObjIsTravIdCurrent
(
p
,
pNext
)
)
if
(
!
Aig_ObjIsTravIdCurrent
(
p
,
pNext
)
)
...
@@ -81,9 +81,9 @@ int Aig_ManVerifyTopoOrder( Aig_Man_t * p )
...
@@ -81,9 +81,9 @@ int Aig_ManVerifyTopoOrder( Aig_Man_t * p )
{
{
iTerm1
=
Tim_ManBoxInputFirst
(
p
->
pManTime
,
iBox
);
iTerm1
=
Tim_ManBoxInputFirst
(
p
->
pManTime
,
iBox
);
nTerms
=
Tim_ManBoxInputNum
(
p
->
pManTime
,
iBox
);
nTerms
=
Tim_ManBoxInputNum
(
p
->
pManTime
,
iBox
);
for
(
i
=
0
;
i
<
nTerms
;
i
++
)
for
(
k
=
0
;
k
<
nTerms
;
k
++
)
{
{
pNext
=
Aig_ManPo
(
p
,
iTerm1
+
i
);
pNext
=
Aig_ManPo
(
p
,
iTerm1
+
k
);
assert
(
Tim_ManBoxForCo
(
p
->
pManTime
,
Aig_ObjPioNum
(
pNext
)
)
==
iBox
);
assert
(
Tim_ManBoxForCo
(
p
->
pManTime
,
Aig_ObjPioNum
(
pNext
)
)
==
iBox
);
if
(
!
Aig_ObjIsTravIdCurrent
(
p
,
pNext
)
)
if
(
!
Aig_ObjIsTravIdCurrent
(
p
,
pNext
)
)
{
{
...
@@ -94,7 +94,7 @@ int Aig_ManVerifyTopoOrder( Aig_Man_t * p )
...
@@ -94,7 +94,7 @@ int Aig_ManVerifyTopoOrder( Aig_Man_t * p )
}
}
}
}
}
}
else
else
if
(
!
Aig_ObjIsConst1
(
pObj
)
)
assert
(
0
);
assert
(
0
);
Aig_ObjSetTravIdCurrent
(
p
,
pObj
);
Aig_ObjSetTravIdCurrent
(
p
,
pObj
);
}
}
...
@@ -120,49 +120,53 @@ void Aig_ManDfs_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Vec_Ptr_t * vNodes )
...
@@ -120,49 +120,53 @@ void Aig_ManDfs_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Vec_Ptr_t * vNodes )
assert
(
!
Aig_IsComplement
(
pObj
)
);
assert
(
!
Aig_IsComplement
(
pObj
)
);
if
(
Aig_ObjIsTravIdCurrent
(
p
,
pObj
)
)
if
(
Aig_ObjIsTravIdCurrent
(
p
,
pObj
)
)
return
;
return
;
// if ( Aig_ObjIsPi(pObj) )
// return;
// assert( Aig_ObjIsNode(pObj) || Aig_ObjIsBuf(pObj) );
Aig_ObjSetTravIdCurrent
(
p
,
pObj
);
Aig_ObjSetTravIdCurrent
(
p
,
pObj
);
if
(
p
->
pEquivs
&&
p
->
pEquivs
[
pObj
->
Id
]
)
Aig_ManDfs_rec
(
p
,
p
->
pEquivs
[
pObj
->
Id
],
vNodes
);
Aig_ManDfs_rec
(
p
,
Aig_ObjFanin0
(
pObj
),
vNodes
);
Aig_ManDfs_rec
(
p
,
Aig_ObjFanin0
(
pObj
),
vNodes
);
Aig_ManDfs_rec
(
p
,
Aig_ObjFanin1
(
pObj
),
vNodes
);
Aig_ManDfs_rec
(
p
,
Aig_ObjFanin1
(
pObj
),
vNodes
);
// assert( !Aig_ObjIsTravIdCurrent(p, pObj) ); // loop detection
// Aig_ObjSetTravIdCurrent(p, pObj);
Vec_PtrPush
(
vNodes
,
pObj
);
Vec_PtrPush
(
vNodes
,
pObj
);
}
}
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Collects
internal nodes
in the DFS order.]
Synopsis [Collects
objects of the AIG
in the DFS order.]
Description []
Description [
Works with choice nodes.
]
SideEffects []
SideEffects []
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Vec_Ptr_t
*
Aig_ManDfs
(
Aig_Man_t
*
p
)
Vec_Ptr_t
*
Aig_ManDfs
(
Aig_Man_t
*
p
,
int
fNodesOnly
)
{
{
Vec_Ptr_t
*
vNodes
;
Vec_Ptr_t
*
vNodes
;
Aig_Obj_t
*
pObj
;
Aig_Obj_t
*
pObj
;
int
i
;
int
i
;
Aig_ManIncrementTravId
(
p
);
Aig_ManIncrementTravId
(
p
);
// mark constant and PIs
Aig_ObjSetTravIdCurrent
(
p
,
Aig_ManConst1
(
p
)
);
Aig_ObjSetTravIdCurrent
(
p
,
Aig_ManConst1
(
p
)
);
Aig_ManForEachPi
(
p
,
pObj
,
i
)
// start the array of nodes
Aig_ObjSetTravIdCurrent
(
p
,
pObj
);
vNodes
=
Vec_PtrAlloc
(
Aig_ManObjNumMax
(
p
)
);
// go through the nodes
// mark PIs if they should not be collected
vNodes
=
Vec_PtrAlloc
(
Aig_ManNodeNum
(
p
)
);
if
(
fNodesOnly
)
Aig_ManForEachObj
(
p
,
pObj
,
i
)
Aig_ManForEachPi
(
p
,
pObj
,
i
)
if
(
Aig_ObjIsNode
(
pObj
)
||
Aig_ObjIsBuf
(
pObj
)
)
Aig_ObjSetTravIdCurrent
(
p
,
pObj
);
Aig_ManDfs_rec
(
p
,
pObj
,
vNodes
);
else
Vec_PtrPush
(
vNodes
,
Aig_ManConst1
(
p
)
);
// collect nodes reachable in the DFS order
Aig_ManForEachPo
(
p
,
pObj
,
i
)
Aig_ManDfs_rec
(
p
,
fNodesOnly
?
Aig_ObjFanin0
(
pObj
)
:
pObj
,
vNodes
);
if
(
fNodesOnly
)
assert
(
Vec_PtrSize
(
vNodes
)
==
Aig_ManNodeNum
(
p
)
);
else
assert
(
Vec_PtrSize
(
vNodes
)
==
Aig_ManObjNum
(
p
)
);
return
vNodes
;
return
vNodes
;
}
}
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Levelizes the nodes
Synopsis [Levelizes the nodes
.]
Description []
Description []
...
@@ -178,7 +182,7 @@ Vec_Vec_t * Aig_ManLevelize( Aig_Man_t * p )
...
@@ -178,7 +182,7 @@ Vec_Vec_t * Aig_ManLevelize( Aig_Man_t * p )
int
nLevels
,
i
;
int
nLevels
,
i
;
nLevels
=
Aig_ManLevelNum
(
p
);
nLevels
=
Aig_ManLevelNum
(
p
);
vLevels
=
Vec_VecStart
(
nLevels
+
1
);
vLevels
=
Vec_VecStart
(
nLevels
+
1
);
Aig_ManForEach
Node
(
p
,
pObj
,
i
)
Aig_ManForEach
Obj
(
p
,
pObj
,
i
)
{
{
assert
(
(
int
)
pObj
->
Level
<=
nLevels
);
assert
(
(
int
)
pObj
->
Level
<=
nLevels
);
Vec_VecPush
(
vLevels
,
pObj
->
Level
,
pObj
);
Vec_VecPush
(
vLevels
,
pObj
->
Level
,
pObj
);
...
@@ -188,29 +192,6 @@ Vec_Vec_t * Aig_ManLevelize( Aig_Man_t * p )
...
@@ -188,29 +192,6 @@ Vec_Vec_t * Aig_ManLevelize( Aig_Man_t * p )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Collects internal nodes in the DFS order.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Ptr_t
*
Aig_ManDfsPio
(
Aig_Man_t
*
p
)
{
Vec_Ptr_t
*
vNodes
;
Aig_Obj_t
*
pObj
;
int
i
;
Aig_ManIncrementTravId
(
p
);
vNodes
=
Vec_PtrAlloc
(
Aig_ManObjNumMax
(
p
)
);
Aig_ManForEachPo
(
p
,
pObj
,
i
)
Aig_ManDfs_rec
(
p
,
pObj
,
vNodes
);
return
vNodes
;
}
/**Function*************************************************************
Synopsis [Collects internal nodes and PIs in the DFS order.]
Synopsis [Collects internal nodes and PIs in the DFS order.]
Description []
Description []
...
@@ -368,9 +349,11 @@ int Aig_ManLevelNum( Aig_Man_t * p )
...
@@ -368,9 +349,11 @@ int Aig_ManLevelNum( Aig_Man_t * p )
return
LevelsMax
;
return
LevelsMax
;
}
}
//#if 0
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Computes
the max number of levels in the manager
.]
Synopsis [Computes
levels for AIG with choices and white boxes
.]
Description []
Description []
...
@@ -379,31 +362,100 @@ int Aig_ManLevelNum( Aig_Man_t * p )
...
@@ -379,31 +362,100 @@ int Aig_ManLevelNum( Aig_Man_t * p )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Aig_ManCountLevels
(
Aig_Man_t
*
p
)
void
Aig_ManChoiceLevel_rec
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
)
{
{
Vec_Ptr_t
*
vNodes
;
Aig_Obj_t
*
pNext
;
Aig_Obj_t
*
pObj
;
int
i
,
iBox
,
iTerm1
,
nTerms
,
LevelMax
=
0
;
int
i
,
LevelsMax
,
Level0
,
Level1
;
if
(
Aig_ObjIsTravIdCurrent
(
p
,
pObj
)
)
// initialize the levels
return
;
Aig_ManConst1
(
p
)
->
iData
=
0
;
Aig_ObjSetTravIdCurrent
(
p
,
pObj
);
Aig_ManForEachPi
(
p
,
pObj
,
i
)
if
(
Aig_ObjIsPi
(
pObj
)
)
pObj
->
iData
=
0
;
// compute levels in a DFS order
vNodes
=
Aig_ManDfs
(
p
);
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
{
{
Level0
=
Aig_ObjFanin0
(
pObj
)
->
iData
;
if
(
p
->
pManTime
)
Level1
=
Aig_ObjFanin1
(
pObj
)
->
iData
;
{
pObj
->
iData
=
1
+
Aig_ObjIsExor
(
pObj
)
+
AIG_MAX
(
Level0
,
Level1
);
iBox
=
Tim_ManBoxForCi
(
p
->
pManTime
,
Aig_ObjPioNum
(
pObj
)
);
if
(
iBox
>=
0
)
// this is not a true PI
{
iTerm1
=
Tim_ManBoxInputFirst
(
p
->
pManTime
,
iBox
);
nTerms
=
Tim_ManBoxInputNum
(
p
->
pManTime
,
iBox
);
for
(
i
=
0
;
i
<
nTerms
;
i
++
)
{
pNext
=
Aig_ManPo
(
p
,
iTerm1
+
i
);
Aig_ManChoiceLevel_rec
(
p
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
}
LevelMax
++
;
}
}
// printf( "%d ", pObj->Level );
}
}
Vec_PtrFree
(
vNodes
);
else
if
(
Aig_ObjIsPo
(
pObj
)
)
// get levels of the POs
{
LevelsMax
=
0
;
pNext
=
Aig_ObjFanin0
(
pObj
);
Aig_ManChoiceLevel_rec
(
p
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
}
else
if
(
Aig_ObjIsNode
(
pObj
)
)
{
// get the maximum level of the two fanins
pNext
=
Aig_ObjFanin0
(
pObj
);
Aig_ManChoiceLevel_rec
(
p
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
pNext
=
Aig_ObjFanin1
(
pObj
);
Aig_ManChoiceLevel_rec
(
p
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
LevelMax
++
;
// get the level of the nodes in the choice node
if
(
p
->
pEquivs
&&
(
pNext
=
p
->
pEquivs
[
pObj
->
Id
])
)
{
Aig_ManChoiceLevel_rec
(
p
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
}
}
else
assert
(
0
);
Aig_ObjSetLevel
(
pObj
,
LevelMax
);
}
/**Function*************************************************************
Synopsis [Computes levels for AIG with choices and white boxes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Aig_ManChoiceLevel
(
Aig_Man_t
*
p
)
{
Aig_Obj_t
*
pObj
;
int
i
,
LevelMax
=
0
;
Aig_ManForEachObj
(
p
,
pObj
,
i
)
Aig_ObjSetLevel
(
pObj
,
0
);
Aig_ManSetPioNumbers
(
p
);
Aig_ManIncrementTravId
(
p
);
Aig_ManForEachPo
(
p
,
pObj
,
i
)
Aig_ManForEachPo
(
p
,
pObj
,
i
)
LevelsMax
=
AIG_MAX
(
LevelsMax
,
Aig_ObjFanin0
(
pObj
)
->
iData
);
{
return
LevelsMax
;
Aig_ManChoiceLevel_rec
(
p
,
pObj
);
if
(
LevelMax
<
Aig_ObjLevel
(
pObj
)
)
LevelMax
=
Aig_ObjLevel
(
pObj
);
}
Aig_ManCleanPioNumbers
(
p
);
Aig_ManForEachNode
(
p
,
pObj
,
i
)
assert
(
Aig_ObjLevel
(
pObj
)
>
0
);
return
LevelMax
;
}
}
//#endif
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Counts the number of AIG nodes rooted at this cone.]
Synopsis [Counts the number of AIG nodes rooted at this cone.]
...
...
src/aig/aig/aigDup.c
0 → 100644
View file @
08795165
This diff is collapsed.
Click to expand it.
src/aig/aig/aigHaig.c
View file @
08795165
...
@@ -250,7 +250,7 @@ void Aig_ManHaigRecord( Aig_Man_t * p )
...
@@ -250,7 +250,7 @@ void Aig_ManHaigRecord( Aig_Man_t * p )
Aig_Obj_t
*
pObj
;
Aig_Obj_t
*
pObj
;
int
i
;
int
i
;
// start the HAIG
// start the HAIG
p
->
pManHaig
=
Aig_ManDup
(
p
,
1
);
p
->
pManHaig
=
Aig_ManDup
Ordered
(
p
);
// set the pointers to the HAIG nodes
// set the pointers to the HAIG nodes
Aig_ManForEachObj
(
p
,
pObj
,
i
)
Aig_ManForEachObj
(
p
,
pObj
,
i
)
pObj
->
pHaig
=
pObj
->
pData
;
pObj
->
pHaig
=
pObj
->
pData
;
...
...
src/aig/aig/aigMan.c
View file @
08795165
This diff is collapsed.
Click to expand it.
src/aig/aig/aigPart.c
View file @
08795165
...
@@ -1162,7 +1162,7 @@ Aig_Man_t * Aig_ManChoicePartitioned( Vec_Ptr_t * vAigs, int nPartSize, int nCon
...
@@ -1162,7 +1162,7 @@ Aig_Man_t * Aig_ManChoicePartitioned( Vec_Ptr_t * vAigs, int nPartSize, int nCon
extern
Aig_Man_t
*
Fra_FraigChoice
(
Aig_Man_t
*
pManAig
,
int
nConfMax
,
int
nLevelMax
);
extern
Aig_Man_t
*
Fra_FraigChoice
(
Aig_Man_t
*
pManAig
,
int
nConfMax
,
int
nLevelMax
);
Vec_Ptr_t
*
vOutsTotal
,
*
vOuts
;
Vec_Ptr_t
*
vOutsTotal
,
*
vOuts
;
Aig_Man_t
*
pAigTotal
,
*
pAigPart
,
*
pAig
;
Aig_Man_t
*
pAigTotal
,
*
pAigPart
,
*
pAig
,
*
pTemp
;
Vec_Int_t
*
vPart
,
*
vPartSupp
;
Vec_Int_t
*
vPart
,
*
vPartSupp
;
Vec_Ptr_t
*
vParts
;
Vec_Ptr_t
*
vParts
;
Aig_Obj_t
*
pObj
;
Aig_Obj_t
*
pObj
;
...
@@ -1272,6 +1272,15 @@ Aig_Man_t * Aig_ManChoicePartitioned( Vec_Ptr_t * vAigs, int nPartSize, int nCon
...
@@ -1272,6 +1272,15 @@ Aig_Man_t * Aig_ManChoicePartitioned( Vec_Ptr_t * vAigs, int nPartSize, int nCon
pAig
=
Aig_ManRehash
(
pAigTotal
);
pAig
=
Aig_ManRehash
(
pAigTotal
);
// create the equivalent nodes lists
// create the equivalent nodes lists
Aig_ManMarkValidChoices
(
pAig
);
Aig_ManMarkValidChoices
(
pAig
);
// reconstruct the network
pAig
=
Aig_ManDupDfsOrder
(
pTemp
=
pAig
,
Vec_PtrEntry
(
vAigs
,
0
)
);
Aig_ManStop
(
pTemp
);
// duplicate the timing manager
pTemp
=
Vec_PtrEntry
(
vAigs
,
0
);
if
(
pTemp
->
pManTime
)
pAig
->
pManTime
=
Tim_ManDup
(
pTemp
->
pManTime
,
0
);
// reset levels
Aig_ManChoiceLevel
(
pAig
);
return
pAig
;
return
pAig
;
}
}
...
@@ -1437,107 +1446,6 @@ void Aig_ManChoiceConstructiveOne( Aig_Man_t * pNew, Aig_Man_t * pPrev, Aig_Man_
...
@@ -1437,107 +1446,6 @@ void Aig_ManChoiceConstructiveOne( Aig_Man_t * pNew, Aig_Man_t * pPrev, Aig_Man_
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Computes levels for AIG with choices and white boxes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Aig_ManChoiceLevel_rec
(
Aig_Man_t
*
pNew
,
Aig_Obj_t
*
pObj
)
{
Aig_Obj_t
*
pNext
;
int
i
,
iBox
,
iTerm1
,
nTerms
,
LevelMax
=
0
;
if
(
Aig_ObjIsTravIdCurrent
(
pNew
,
pObj
)
)
return
;
Aig_ObjSetTravIdCurrent
(
pNew
,
pObj
);
if
(
Aig_ObjIsPi
(
pObj
)
)
{
if
(
pNew
->
pManTime
)
{
iBox
=
Tim_ManBoxForCi
(
pNew
->
pManTime
,
Aig_ObjPioNum
(
pObj
)
);
if
(
iBox
>=
0
)
// this is not a true PI
{
iTerm1
=
Tim_ManBoxInputFirst
(
pNew
->
pManTime
,
iBox
);
nTerms
=
Tim_ManBoxInputNum
(
pNew
->
pManTime
,
iBox
);
for
(
i
=
0
;
i
<
nTerms
;
i
++
)
{
pNext
=
Aig_ManPo
(
pNew
,
iTerm1
+
i
);
Aig_ManChoiceLevel_rec
(
pNew
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
}
LevelMax
++
;
}
}
}
else
if
(
Aig_ObjIsPo
(
pObj
)
)
{
pNext
=
Aig_ObjFanin0
(
pObj
);
Aig_ManChoiceLevel_rec
(
pNew
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
}
else
if
(
Aig_ObjIsNode
(
pObj
)
)
{
// get the maximum level of the two fanins
pNext
=
Aig_ObjFanin0
(
pObj
);
Aig_ManChoiceLevel_rec
(
pNew
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
pNext
=
Aig_ObjFanin1
(
pObj
);
Aig_ManChoiceLevel_rec
(
pNew
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
LevelMax
++
;
// get the level of the nodes in the choice node
if
(
pNew
->
pEquivs
&&
(
pNext
=
pNew
->
pEquivs
[
pObj
->
Id
])
)
{
Aig_ManChoiceLevel_rec
(
pNew
,
pNext
);
if
(
LevelMax
<
Aig_ObjLevel
(
pNext
)
)
LevelMax
=
Aig_ObjLevel
(
pNext
);
}
}
else
assert
(
0
);
Aig_ObjSetLevel
(
pObj
,
LevelMax
);
assert
(
!
Aig_ObjIsNode
(
pObj
)
||
LevelMax
>
0
);
}
/**Function*************************************************************
Synopsis [Computes levels for AIG with choices and white boxes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Aig_ManChoiceLevel
(
Aig_Man_t
*
pNew
)
{
Aig_Obj_t
*
pObj
;
int
i
,
LevelMax
=
0
;
Aig_ManForEachObj
(
pNew
,
pObj
,
i
)
Aig_ObjSetLevel
(
pObj
,
0
);
Aig_ManSetPioNumbers
(
pNew
);
Aig_ManIncrementTravId
(
pNew
);
Aig_ManForEachPo
(
pNew
,
pObj
,
i
)
{
Aig_ManChoiceLevel_rec
(
pNew
,
pObj
);
if
(
LevelMax
<
Aig_ObjLevel
(
pObj
)
)
LevelMax
=
Aig_ObjLevel
(
pObj
);
}
Aig_ManCleanPioNumbers
(
pNew
);
return
LevelMax
;
}
/**Function*************************************************************
Synopsis [Constructively accumulates choices.]
Synopsis [Constructively accumulates choices.]
Description []
Description []
...
@@ -1593,7 +1501,7 @@ Aig_Man_t * Aig_ManChoiceConstructive( Vec_Ptr_t * vAigs, int fVerbose )
...
@@ -1593,7 +1501,7 @@ Aig_Man_t * Aig_ManChoiceConstructive( Vec_Ptr_t * vAigs, int fVerbose )
int
i
;
int
i
;
// start AIG with choices
// start AIG with choices
pPrev
=
Vec_PtrEntry
(
vAigs
,
0
);
pPrev
=
Vec_PtrEntry
(
vAigs
,
0
);
pNew
=
Aig_ManDup
(
pPrev
,
1
);
pNew
=
Aig_ManDup
Ordered
(
pPrev
);
// create room for equivalent nodes and representatives
// create room for equivalent nodes and representatives
assert
(
pNew
->
pReprs
==
NULL
);
assert
(
pNew
->
pReprs
==
NULL
);
pNew
->
nReprsAlloc
=
Vec_PtrSize
(
vAigs
)
*
Aig_ManObjNumMax
(
pNew
);
pNew
->
nReprsAlloc
=
Vec_PtrSize
(
vAigs
)
*
Aig_ManObjNumMax
(
pNew
);
...
...
src/aig/aig/aigRetF.c
View file @
08795165
...
@@ -199,7 +199,7 @@ Aig_Man_t * Aig_ManRetimeFrontier( Aig_Man_t * p, int nStepsMax )
...
@@ -199,7 +199,7 @@ Aig_Man_t * Aig_ManRetimeFrontier( Aig_Man_t * p, int nStepsMax )
// remove useless registers
// remove useless registers
Aig_ManSeqCleanup
(
p
);
Aig_ManSeqCleanup
(
p
);
// rehash the nodes
// rehash the nodes
return
Aig_ManDup
(
p
,
1
);
return
Aig_ManDup
Ordered
(
p
);
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
src/aig/aig/aigUtil.c
View file @
08795165
...
@@ -593,6 +593,12 @@ void Aig_ObjPrintVerbose( Aig_Obj_t * pObj, int fHaig )
...
@@ -593,6 +593,12 @@ void Aig_ObjPrintVerbose( Aig_Obj_t * pObj, int fHaig )
printf
(
"constant 1"
);
printf
(
"constant 1"
);
else
if
(
Aig_ObjIsPi
(
pObj
)
)
else
if
(
Aig_ObjIsPi
(
pObj
)
)
printf
(
"PI"
);
printf
(
"PI"
);
else
if
(
Aig_ObjIsPo
(
pObj
)
)
{
printf
(
"PO"
);
printf
(
"%p%s"
,
Aig_ObjFanin0
(
pObj
),
(
Aig_ObjFaninC0
(
pObj
)
?
"
\'
"
:
" "
)
);
}
else
else
printf
(
"AND( %p%s, %p%s )"
,
printf
(
"AND( %p%s, %p%s )"
,
Aig_ObjFanin0
(
pObj
),
(
Aig_ObjFaninC0
(
pObj
)
?
"
\'
"
:
" "
),
Aig_ObjFanin0
(
pObj
),
(
Aig_ObjFaninC0
(
pObj
)
?
"
\'
"
:
" "
),
...
@@ -620,7 +626,7 @@ void Aig_ManPrintVerbose( Aig_Man_t * p, int fHaig )
...
@@ -620,7 +626,7 @@ void Aig_ManPrintVerbose( Aig_Man_t * p, int fHaig )
Aig_ManForEachPi
(
p
,
pObj
,
i
)
Aig_ManForEachPi
(
p
,
pObj
,
i
)
printf
(
" %p"
,
pObj
);
printf
(
" %p"
,
pObj
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
vNodes
=
Aig_ManDfs
(
p
);
vNodes
=
Aig_ManDfs
(
p
,
0
);
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
Aig_ObjPrintVerbose
(
pObj
,
fHaig
),
printf
(
"
\n
"
);
Aig_ObjPrintVerbose
(
pObj
,
fHaig
),
printf
(
"
\n
"
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
@@ -674,7 +680,7 @@ void Aig_ManDumpBlif( Aig_Man_t * p, char * pFileName )
...
@@ -674,7 +680,7 @@ void Aig_ManDumpBlif( Aig_Man_t * p, char * pFileName )
if
(
Aig_ObjIsConst1
(
Aig_ObjFanin0
(
pObj
))
)
if
(
Aig_ObjIsConst1
(
Aig_ObjFanin0
(
pObj
))
)
pConst1
=
Aig_ManConst1
(
p
);
pConst1
=
Aig_ManConst1
(
p
);
// collect nodes in the DFS order
// collect nodes in the DFS order
vNodes
=
Aig_ManDfs
(
p
);
vNodes
=
Aig_ManDfs
(
p
,
1
);
// assign IDs to objects
// assign IDs to objects
Aig_ManConst1
(
p
)
->
iData
=
Counter
++
;
Aig_ManConst1
(
p
)
->
iData
=
Counter
++
;
Aig_ManForEachPi
(
p
,
pObj
,
i
)
Aig_ManForEachPi
(
p
,
pObj
,
i
)
...
@@ -758,7 +764,7 @@ void Aig_ManDumpVerilog( Aig_Man_t * p, char * pFileName )
...
@@ -758,7 +764,7 @@ void Aig_ManDumpVerilog( Aig_Man_t * p, char * pFileName )
if
(
Aig_ObjIsConst1
(
Aig_ObjFanin0
(
pObj
))
)
if
(
Aig_ObjIsConst1
(
Aig_ObjFanin0
(
pObj
))
)
pConst1
=
Aig_ManConst1
(
p
);
pConst1
=
Aig_ManConst1
(
p
);
// collect nodes in the DFS order
// collect nodes in the DFS order
vNodes
=
Aig_ManDfs
(
p
);
vNodes
=
Aig_ManDfs
(
p
,
1
);
// assign IDs to objects
// assign IDs to objects
Aig_ManConst1
(
p
)
->
iData
=
Counter
++
;
Aig_ManConst1
(
p
)
->
iData
=
Counter
++
;
Aig_ManForEachPi
(
p
,
pObj
,
i
)
Aig_ManForEachPi
(
p
,
pObj
,
i
)
...
...
src/aig/aig/module.make
View file @
08795165
SRC
+=
src/aig/aig/aigCheck.c
\
SRC
+=
src/aig/aig/aigCheck.c
\
src/aig/aig/aigCuts.c
\
src/aig/aig/aigCuts.c
\
src/aig/aig/aigDfs.c
\
src/aig/aig/aigDfs.c
\
src/aig/aig/aigDup.c
\
src/aig/aig/aigFanout.c
\
src/aig/aig/aigFanout.c
\
src/aig/aig/aigFrames.c
\
src/aig/aig/aigFrames.c
\
src/aig/aig/aigInter.c
\
src/aig/aig/aigInter.c
\
...
...
src/aig/dar/darMan.c
View file @
08795165
...
@@ -122,6 +122,7 @@ void Dar_ManPrintStats( Dar_Man_t * p )
...
@@ -122,6 +122,7 @@ void Dar_ManPrintStats( Dar_Man_t * p )
// PRTP( "T", p->ClassTimes[i], p->timeEval );
// PRTP( "T", p->ClassTimes[i], p->timeEval );
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
fflush
(
stdout
);
}
}
...
...
src/aig/dar/darScript.c
View file @
08795165
...
@@ -45,9 +45,9 @@ Aig_Man_t * Dar_ManRewriteDefault( Aig_Man_t * pAig )
...
@@ -45,9 +45,9 @@ Aig_Man_t * Dar_ManRewriteDefault( Aig_Man_t * pAig )
Aig_Man_t
*
pTemp
;
Aig_Man_t
*
pTemp
;
Dar_RwrPar_t
Pars
,
*
pPars
=
&
Pars
;
Dar_RwrPar_t
Pars
,
*
pPars
=
&
Pars
;
Dar_ManDefaultRwrParams
(
pPars
);
Dar_ManDefaultRwrParams
(
pPars
);
pAig
=
Aig_ManDup
(
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pAig
);
Dar_ManRewrite
(
pAig
,
pPars
);
Dar_ManRewrite
(
pAig
,
pPars
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
return
pAig
;
return
pAig
;
}
}
...
@@ -80,18 +80,18 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
...
@@ -80,18 +80,18 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
pParsRwr
->
fVerbose
=
fVerbose
;
pParsRwr
->
fVerbose
=
fVerbose
;
pParsRef
->
fVerbose
=
fVerbose
;
pParsRef
->
fVerbose
=
fVerbose
;
pAig
=
Aig_ManDup
(
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
/*
/*
// refactor
// refactor
Dar_ManRefactor( pAig, pParsRef );
Dar_ManRefactor( pAig, pParsRef );
pAig = Aig_ManDup
( pTemp = pAig, 0
);
pAig = Aig_ManDup
Dfs( pTemp = pAig
);
Aig_ManStop( pTemp );
Aig_ManStop( pTemp );
if ( fVerbose ) Aig_ManPrintStats( pAig );
if ( fVerbose ) Aig_ManPrintStats( pAig );
*/
*/
...
@@ -105,7 +105,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
...
@@ -105,7 +105,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
...
@@ -161,7 +161,7 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
...
@@ -161,7 +161,7 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
pParsRwr
->
fVerbose
=
0
;
//fVerbose;
pParsRwr
->
fVerbose
=
0
;
//fVerbose;
pParsRef
->
fVerbose
=
0
;
//fVerbose;
pParsRef
->
fVerbose
=
0
;
//fVerbose;
pAig
=
Aig_ManDup
(
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
// balance
// balance
...
@@ -174,13 +174,13 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
...
@@ -174,13 +174,13 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
// refactor
// refactor
Dar_ManRefactor
(
pAig
,
pParsRef
);
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
...
@@ -197,7 +197,7 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
...
@@ -197,7 +197,7 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
...
@@ -233,7 +233,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
...
@@ -233,7 +233,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
pParsRwr
->
fVerbose
=
0
;
//fVerbose;
pParsRwr
->
fVerbose
=
0
;
//fVerbose;
pParsRef
->
fVerbose
=
0
;
//fVerbose;
pParsRef
->
fVerbose
=
0
;
//fVerbose;
pAig
=
Aig_ManDup
(
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
// balance
// balance
...
@@ -247,13 +247,13 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
...
@@ -247,13 +247,13 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
// refactor
// refactor
Dar_ManRefactor
(
pAig
,
pParsRef
);
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
...
@@ -267,7 +267,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
...
@@ -267,7 +267,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
...
@@ -276,7 +276,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
...
@@ -276,7 +276,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
...
@@ -290,13 +290,13 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
...
@@ -290,13 +290,13 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
// refactor
// refactor
Dar_ManRefactor
(
pAig
,
pParsRef
);
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
// rewrite
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDup
(
pTemp
=
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
...
@@ -330,7 +330,7 @@ Vec_Ptr_t * Dar_ManChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateL
...
@@ -330,7 +330,7 @@ Vec_Ptr_t * Dar_ManChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateL
int
i
;
int
i
;
vAigs
=
Vec_PtrAlloc
(
3
);
vAigs
=
Vec_PtrAlloc
(
3
);
pAig
=
Aig_ManDup
(
pAig
,
0
);
pAig
=
Aig_ManDup
Dfs
(
pAig
);
Vec_PtrPush
(
vAigs
,
pAig
);
Vec_PtrPush
(
vAigs
,
pAig
);
Aig_ManForEachObj
(
pAig
,
pObj
,
i
)
Aig_ManForEachObj
(
pAig
,
pObj
,
i
)
...
...
src/aig/fra/fraCec.c
View file @
08795165
...
@@ -166,7 +166,7 @@ PRT( "Time", clock() - clk );
...
@@ -166,7 +166,7 @@ PRT( "Time", clock() - clk );
// duplicate the AIG
// duplicate the AIG
clk
=
clock
();
clk
=
clock
();
// pAig = Aig_ManDup( pTemp = pAig );
// pAig = Aig_ManDup
Dfs
( pTemp = pAig );
pAig
=
Dar_ManRwsat
(
pTemp
=
pAig
,
0
,
0
);
pAig
=
Dar_ManRwsat
(
pTemp
=
pAig
,
0
,
0
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
if
(
fVerbose
)
...
...
src/aig/fra/fraCore.c
View file @
08795165
...
@@ -369,7 +369,7 @@ Aig_Man_t * Fra_FraigPerform( Aig_Man_t * pManAig, Fra_Par_t * pPars )
...
@@ -369,7 +369,7 @@ Aig_Man_t * Fra_FraigPerform( Aig_Man_t * pManAig, Fra_Par_t * pPars )
Aig_Man_t
*
pManAigNew
;
Aig_Man_t
*
pManAigNew
;
int
clk
;
int
clk
;
if
(
Aig_ManNodeNum
(
pManAig
)
==
0
)
if
(
Aig_ManNodeNum
(
pManAig
)
==
0
)
return
Aig_ManDup
(
pManAig
,
1
);
return
Aig_ManDup
Ordered
(
pManAig
);
clk
=
clock
();
clk
=
clock
();
p
=
Fra_ManStart
(
pManAig
,
pPars
);
p
=
Fra_ManStart
(
pManAig
,
pPars
);
p
->
pManFraig
=
Fra_ManPrepareComb
(
p
);
p
->
pManFraig
=
Fra_ManPrepareComb
(
p
);
...
...
src/aig/fra/fraInd.c
View file @
08795165
...
@@ -343,7 +343,7 @@ Aig_Man_t * Fra_FraigInduction( Aig_Man_t * pManAig, Fra_Ssw_t * pParams )
...
@@ -343,7 +343,7 @@ Aig_Man_t * Fra_FraigInduction( Aig_Man_t * pManAig, Fra_Ssw_t * pParams )
if
(
Aig_ManNodeNum
(
pManAig
)
==
0
)
if
(
Aig_ManNodeNum
(
pManAig
)
==
0
)
{
{
pParams
->
nIters
=
0
;
pParams
->
nIters
=
0
;
return
Aig_ManDup
(
pManAig
,
1
);
return
Aig_ManDup
Ordered
(
pManAig
);
}
}
assert
(
Aig_ManRegNum
(
pManAig
)
>
0
);
assert
(
Aig_ManRegNum
(
pManAig
)
>
0
);
assert
(
pParams
->
nFramesK
>
0
);
assert
(
pParams
->
nFramesK
>
0
);
...
@@ -563,7 +563,7 @@ clk2 = clock();
...
@@ -563,7 +563,7 @@ clk2 = clock();
Aig_Man_t
*
pNew
;
Aig_Man_t
*
pNew
;
char
*
pFileName
=
Ioa_FileNameGenericAppend
(
p
->
pManAig
->
pName
,
"_care.aig"
);
char
*
pFileName
=
Ioa_FileNameGenericAppend
(
p
->
pManAig
->
pName
,
"_care.aig"
);
printf
(
"Care one-hotness clauses will be written into file
\"
%s
\"
.
\n
"
,
pFileName
);
printf
(
"Care one-hotness clauses will be written into file
\"
%s
\"
.
\n
"
,
pFileName
);
pManAigNew
=
Aig_ManDup
(
pManAig
,
1
);
pManAigNew
=
Aig_ManDup
Ordered
(
pManAig
);
pNew
=
Fra_OneHotCreateExdc
(
p
,
p
->
vOneHots
);
pNew
=
Fra_OneHotCreateExdc
(
p
,
p
->
vOneHots
);
Ioa_WriteAiger
(
pNew
,
pFileName
,
0
,
1
);
Ioa_WriteAiger
(
pNew
,
pFileName
,
0
,
1
);
Aig_ManStop
(
pNew
);
Aig_ManStop
(
pNew
);
...
...
src/aig/fra/fraLcr.c
View file @
08795165
...
@@ -251,6 +251,31 @@ int Fra_LcrNodeIsConst( Aig_Obj_t * pObj )
...
@@ -251,6 +251,31 @@ int Fra_LcrNodeIsConst( Aig_Obj_t * pObj )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Duplicates the AIG manager recursively.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Aig_Obj_t
*
Fra_LcrManDup_rec
(
Aig_Man_t
*
pNew
,
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
)
{
Aig_Obj_t
*
pObjNew
;
if
(
pObj
->
pData
)
return
pObj
->
pData
;
Fra_LcrManDup_rec
(
pNew
,
p
,
Aig_ObjFanin0
(
pObj
)
);
if
(
Aig_ObjIsBuf
(
pObj
)
)
return
pObj
->
pData
=
Aig_ObjChild0Copy
(
pObj
);
Fra_LcrManDup_rec
(
pNew
,
p
,
Aig_ObjFanin1
(
pObj
)
);
pObjNew
=
Aig_Oper
(
pNew
,
Aig_ObjChild0Copy
(
pObj
),
Aig_ObjChild1Copy
(
pObj
),
Aig_ObjType
(
pObj
)
);
Aig_Regular
(
pObjNew
)
->
pHaig
=
pObj
->
pHaig
;
return
pObj
->
pData
=
pObjNew
;
}
/**Function*************************************************************
Synopsis [Give the AIG and classes, reduces AIG for partitioning.]
Synopsis [Give the AIG and classes, reduces AIG for partitioning.]
Description [Ignores registers that are not in the classes.
Description [Ignores registers that are not in the classes.
...
@@ -290,7 +315,7 @@ Aig_Man_t * Fra_LcrDeriveAigForPartitioning( Fra_Lcr_t * pLcr )
...
@@ -290,7 +315,7 @@ Aig_Man_t * Fra_LcrDeriveAigForPartitioning( Fra_Lcr_t * pLcr )
{
{
assert
(
Aig_ObjIsPi
(
ppClass
[
c
])
);
assert
(
Aig_ObjIsPi
(
ppClass
[
c
])
);
pObjPo
=
Aig_ManPo
(
pLcr
->
pAig
,
Offset
+
(
long
)
ppClass
[
c
]
->
pNext
);
pObjPo
=
Aig_ManPo
(
pLcr
->
pAig
,
Offset
+
(
long
)
ppClass
[
c
]
->
pNext
);
pObjNew
=
Aig_
ManDup_rec
(
pNew
,
pLcr
->
pAig
,
Aig_ObjFanin0
(
pObjPo
)
);
pObjNew
=
Fra_Lcr
ManDup_rec
(
pNew
,
pLcr
->
pAig
,
Aig_ObjFanin0
(
pObjPo
)
);
pMiter
=
Aig_Exor
(
pNew
,
pMiter
,
pObjNew
);
pMiter
=
Aig_Exor
(
pNew
,
pMiter
,
pObjNew
);
}
}
Aig_ObjCreatePo
(
pNew
,
pMiter
);
Aig_ObjCreatePo
(
pNew
,
pMiter
);
...
@@ -300,7 +325,7 @@ Aig_Man_t * Fra_LcrDeriveAigForPartitioning( Fra_Lcr_t * pLcr )
...
@@ -300,7 +325,7 @@ Aig_Man_t * Fra_LcrDeriveAigForPartitioning( Fra_Lcr_t * pLcr )
{
{
assert
(
Aig_ObjIsPi
(
pObj
)
);
assert
(
Aig_ObjIsPi
(
pObj
)
);
pObjPo
=
Aig_ManPo
(
pLcr
->
pAig
,
Offset
+
(
long
)
pObj
->
pNext
);
pObjPo
=
Aig_ManPo
(
pLcr
->
pAig
,
Offset
+
(
long
)
pObj
->
pNext
);
pMiter
=
Aig_
ManDup_rec
(
pNew
,
pLcr
->
pAig
,
Aig_ObjFanin0
(
pObjPo
)
);
pMiter
=
Fra_Lcr
ManDup_rec
(
pNew
,
pLcr
->
pAig
,
Aig_ObjFanin0
(
pObjPo
)
);
Aig_ObjCreatePo
(
pNew
,
pMiter
);
Aig_ObjCreatePo
(
pNew
,
pMiter
);
}
}
return
pNew
;
return
pNew
;
...
@@ -514,7 +539,7 @@ Aig_Man_t * Fra_FraigLatchCorrespondence( Aig_Man_t * pAig, int nFramesP, int nC
...
@@ -514,7 +539,7 @@ Aig_Man_t * Fra_FraigLatchCorrespondence( Aig_Man_t * pAig, int nFramesP, int nC
if
(
Aig_ManNodeNum
(
pAig
)
==
0
)
if
(
Aig_ManNodeNum
(
pAig
)
==
0
)
{
{
if
(
pnIter
)
*
pnIter
=
0
;
if
(
pnIter
)
*
pnIter
=
0
;
return
Aig_ManDup
(
pAig
,
1
);
return
Aig_ManDup
Ordered
(
pAig
);
}
}
assert
(
Aig_ManRegNum
(
pAig
)
>
0
);
assert
(
Aig_ManRegNum
(
pAig
)
>
0
);
...
...
src/aig/fra/fraMan.c
View file @
08795165
...
@@ -298,6 +298,7 @@ void Fra_ManPrint( Fra_Man_t * p )
...
@@ -298,6 +298,7 @@ void Fra_ManPrint( Fra_Man_t * p )
if
(
p
->
time1
)
{
PRT
(
"time1 "
,
p
->
time1
);
}
if
(
p
->
time1
)
{
PRT
(
"time1 "
,
p
->
time1
);
}
if
(
p
->
nSpeculs
)
if
(
p
->
nSpeculs
)
printf
(
"Speculations = %d.
\n
"
,
p
->
nSpeculs
);
printf
(
"Speculations = %d.
\n
"
,
p
->
nSpeculs
);
fflush
(
stdout
);
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
src/aig/fra/fraSec.c
View file @
08795165
...
@@ -52,7 +52,8 @@ int Fra_FraigSec( Aig_Man_t * p, int nFramesMax, int fRetimeFirst, int fFraiging
...
@@ -52,7 +52,8 @@ int Fra_FraigSec( Aig_Man_t * p, int nFramesMax, int fRetimeFirst, int fFraiging
pPars
->
fLatchCorr
=
fLatchCorr
;
pPars
->
fLatchCorr
=
fLatchCorr
;
pPars
->
fVerbose
=
fVeryVerbose
;
pPars
->
fVerbose
=
fVeryVerbose
;
pNew
=
Aig_ManDup
(
p
,
1
);
pNew
=
Aig_ManDupOrdered
(
p
);
// pNew = Aig_ManDupDfs( p );
if
(
fVerbose
)
if
(
fVerbose
)
{
{
printf
(
"Original miter: Latches = %5d. Nodes = %6d.
\n
"
,
printf
(
"Original miter: Latches = %5d. Nodes = %6d.
\n
"
,
...
@@ -91,7 +92,8 @@ PRT( "Time", clock() - clk );
...
@@ -91,7 +92,8 @@ PRT( "Time", clock() - clk );
clk
=
clock
();
clk
=
clock
();
if
(
pNew
->
nRegs
)
if
(
pNew
->
nRegs
)
{
{
pNew
=
Aig_ManDup
(
pTemp
=
pNew
,
1
);
pNew
=
Aig_ManDupOrdered
(
pTemp
=
pNew
);
// pNew = Aig_ManDupDfs( pTemp = pNew );
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
pNew
=
Fra_FraigLatchCorrespondence
(
pTemp
=
pNew
,
0
,
100000
,
1
,
fVeryVerbose
,
&
nIter
);
pNew
=
Fra_FraigLatchCorrespondence
(
pTemp
=
pNew
,
0
,
100000
,
1
,
fVeryVerbose
,
&
nIter
);
p
->
pSeqModel
=
pTemp
->
pSeqModel
;
pTemp
->
pSeqModel
=
NULL
;
p
->
pSeqModel
=
pTemp
->
pSeqModel
;
pTemp
->
pSeqModel
=
NULL
;
...
@@ -147,7 +149,7 @@ PRT( "Time", clock() - clk );
...
@@ -147,7 +149,7 @@ PRT( "Time", clock() - clk );
// perform rewriting
// perform rewriting
clk
=
clock
();
clk
=
clock
();
pNew
=
Aig_ManDup
(
pTemp
=
pNew
,
1
);
pNew
=
Aig_ManDup
Ordered
(
pTemp
=
pNew
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
pNew
=
Dar_ManRewriteDefault
(
pTemp
=
pNew
);
pNew
=
Dar_ManRewriteDefault
(
pTemp
=
pNew
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
...
@@ -165,7 +167,7 @@ PRT( "Time", clock() - clk );
...
@@ -165,7 +167,7 @@ PRT( "Time", clock() - clk );
clk
=
clock
();
clk
=
clock
();
pNew
=
Rtm_ManRetime
(
pTemp
=
pNew
,
1
,
1000
,
0
);
pNew
=
Rtm_ManRetime
(
pTemp
=
pNew
,
1
,
1000
,
0
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
pNew
=
Aig_ManDup
(
pTemp
=
pNew
,
1
);
pNew
=
Aig_ManDup
Ordered
(
pTemp
=
pNew
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
if
(
fVerbose
)
{
{
...
...
src/aig/ivy/ivyMan.c
View file @
08795165
...
@@ -462,6 +462,7 @@ void Ivy_ManPrintStats( Ivy_Man_t * p )
...
@@ -462,6 +462,7 @@ void Ivy_ManPrintStats( Ivy_Man_t * p )
// printf( "Del = %d. ", p->nDeleted );
// printf( "Del = %d. ", p->nDeleted );
printf
(
"Lev = %3d. "
,
Ivy_ManLatchNum
(
p
)
?
-
1
:
Ivy_ManLevels
(
p
)
);
printf
(
"Lev = %3d. "
,
Ivy_ManLatchNum
(
p
)
?
-
1
:
Ivy_ManLevels
(
p
)
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
fflush
(
stdout
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
...
src/aig/ntl/ntlCore.c
View file @
08795165
...
@@ -39,16 +39,18 @@
...
@@ -39,16 +39,18 @@
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Aig_Man_t
*
Ntl_ManPerformSynthesis
(
Aig_Man_t
*
pAig
)
Aig_Man_t
*
Ntl_ManPerformSynthesis
(
Aig_Man_t
*
pAig
,
int
fBalance
,
int
fUpdateLevel
,
int
fConstruct
,
int
nConfMax
,
int
nLevelMax
,
int
fVerbose
)
{
{
extern
Aig_Man_t
*
Dar_ManBalance
(
Aig_Man_t
*
pAig
,
int
fUpdateLevel
);
extern
Aig_Man_t
*
Dar_ManBalance
(
Aig_Man_t
*
pAig
,
int
fUpdateLevel
);
extern
Aig_Man_t
*
Dar_ManCompress
(
Aig_Man_t
*
pAig
,
int
fBalance
,
int
fUpdateLevel
,
int
fVerbose
);
extern
Aig_Man_t
*
Dar_ManCompress
(
Aig_Man_t
*
pAig
,
int
fBalance
,
int
fUpdateLevel
,
int
fVerbose
);
extern
Aig_Man_t
*
Dar_ManChoice
(
Aig_Man_t
*
pAig
,
int
fBalance
,
int
fUpdateLevel
,
int
fConstruct
,
int
nConfMax
,
int
nLevelMax
,
int
fVerbose
);
Aig_Man_t
*
pTemp
;
Aig_Man_t
*
pTemp
;
// perform synthesis
// perform synthesis
//printf( "Pre-synthesis AIG: " );
//printf( "Pre-synthesis AIG: " );
//Aig_ManPrintStats( pAig );
//Aig_ManPrintStats( pAig );
// pTemp = Dar_ManBalance( pAig, 1 );
// pTemp = Dar_ManBalance( pAig, 1 );
pTemp
=
Dar_ManCompress
(
pAig
,
1
,
1
,
0
);
// pTemp = Dar_ManCompress( pAig, 1, 1, 0 );
pTemp
=
Dar_ManChoice
(
pAig
,
fBalance
,
fUpdateLevel
,
fConstruct
,
nConfMax
,
nLevelMax
,
fVerbose
);
//printf( "Post-synthesis AIG: " );
//printf( "Post-synthesis AIG: " );
//Aig_ManPrintStats( pTemp );
//Aig_ManPrintStats( pTemp );
return
pTemp
;
return
pTemp
;
...
...
src/aig/nwk/nwkDfs.c
View file @
08795165
...
@@ -66,9 +66,9 @@ int Nwk_ManVerifyTopoOrder( Nwk_Man_t * pNtk )
...
@@ -66,9 +66,9 @@ int Nwk_ManVerifyTopoOrder( Nwk_Man_t * pNtk )
{
{
iTerm1
=
Tim_ManBoxInputFirst
(
pNtk
->
pManTime
,
iBox
);
iTerm1
=
Tim_ManBoxInputFirst
(
pNtk
->
pManTime
,
iBox
);
nTerms
=
Tim_ManBoxInputNum
(
pNtk
->
pManTime
,
iBox
);
nTerms
=
Tim_ManBoxInputNum
(
pNtk
->
pManTime
,
iBox
);
for
(
i
=
0
;
i
<
nTerms
;
i
++
)
for
(
k
=
0
;
k
<
nTerms
;
k
++
)
{
{
pNext
=
Nwk_ManCo
(
pNtk
,
iTerm1
+
i
);
pNext
=
Nwk_ManCo
(
pNtk
,
iTerm1
+
k
);
if
(
!
Nwk_ObjIsTravIdCurrent
(
pNext
)
)
if
(
!
Nwk_ObjIsTravIdCurrent
(
pNext
)
)
{
{
printf
(
"Box %d has input %d that is not in a topological order.
\n
"
,
iBox
,
pNext
->
Id
);
printf
(
"Box %d has input %d that is not in a topological order.
\n
"
,
iBox
,
pNext
->
Id
);
...
...
src/aig/nwk/nwkMap.c
View file @
08795165
...
@@ -115,9 +115,13 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf )
...
@@ -115,9 +115,13 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf )
{
{
pIfObj
=
If_ManCreateCi
(
pIfMan
);
pIfObj
=
If_ManCreateCi
(
pIfMan
);
If_ObjSetLevel
(
pIfObj
,
Aig_ObjLevel
(
pNode
)
);
If_ObjSetLevel
(
pIfObj
,
Aig_ObjLevel
(
pNode
)
);
// printf( "pi=%d ", pIfObj->Level );
}
}
else
if
(
Aig_ObjIsPo
(
pNode
)
)
else
if
(
Aig_ObjIsPo
(
pNode
)
)
{
pIfObj
=
If_ManCreateCo
(
pIfMan
,
If_NotCond
(
Aig_ObjFanin0
(
pNode
)
->
pData
,
Aig_ObjFaninC0
(
pNode
)
)
);
pIfObj
=
If_ManCreateCo
(
pIfMan
,
If_NotCond
(
Aig_ObjFanin0
(
pNode
)
->
pData
,
Aig_ObjFaninC0
(
pNode
)
)
);
// printf( "po=%d ", pIfObj->Level );
}
else
if
(
Aig_ObjIsConst1
(
pNode
)
)
else
if
(
Aig_ObjIsConst1
(
pNode
)
)
pIfObj
=
If_ManConst1
(
pIfMan
);
pIfObj
=
If_ManConst1
(
pIfMan
);
else
// add the node to the mapper
else
// add the node to the mapper
...
@@ -130,11 +134,11 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf )
...
@@ -130,11 +134,11 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf )
if
(
Aig_ObjIsChoice
(
p
,
pNode
)
)
if
(
Aig_ObjIsChoice
(
p
,
pNode
)
)
{
{
pIfMan
->
nChoices
++
;
pIfMan
->
nChoices
++
;
for
(
pPrev
=
pNode
,
pFanin
=
p
Node
->
pData
;
pFanin
;
pPrev
=
pFanin
,
pFanin
=
pFanin
->
pData
)
for
(
pPrev
=
pNode
,
pFanin
=
p
->
pEquivs
[
pNode
->
Id
];
pFanin
;
pPrev
=
pFanin
,
pFanin
=
p
->
pEquivs
[
pFanin
->
Id
]
)
If_ObjSetChoice
(
pPrev
->
pData
,
pFanin
->
pData
);
If_ObjSetChoice
(
pPrev
->
pData
,
pFanin
->
pData
);
If_ManCreateChoice
(
pIfMan
,
pNode
->
pData
);
If_ManCreateChoice
(
pIfMan
,
pNode
->
pData
);
}
}
assert
(
If_ObjLevel
(
pIfObj
)
==
Aig_ObjLevel
(
pNode
)
);
//
assert( If_ObjLevel(pIfObj) == Aig_ObjLevel(pNode) );
}
}
return
pIfMan
;
return
pIfMan
;
}
}
...
...
src/aig/nwk/nwkStrash.c
View file @
08795165
...
@@ -127,7 +127,7 @@ Aig_Man_t * Nwk_ManStrash( Nwk_Man_t * pNtk )
...
@@ -127,7 +127,7 @@ Aig_Man_t * Nwk_ManStrash( Nwk_Man_t * pNtk )
pObj
->
pCopy
=
pObjNew
;
pObj
->
pCopy
=
pObjNew
;
}
}
Aig_ManCleanup
(
pMan
);
Aig_ManCleanup
(
pMan
);
// pMan = Aig_ManDup
( pTemp = pMan, 1
);
// pMan = Aig_ManDup
Ordered( pTemp = pMan
);
// Aig_ManStop( pTemp );
// Aig_ManStop( pTemp );
return
pMan
;
return
pMan
;
}
}
...
...
src/base/abci/abc.c
View file @
08795165
...
@@ -14986,15 +14986,56 @@ usage:
...
@@ -14986,15 +14986,56 @@ usage:
int
Abc_CommandAbc8DChoice
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc8DChoice
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
Aig_Man_t
*
pAigNew
;
Aig_Man_t
*
pAigNew
;
int
c
;
int
fBalance
,
fVerbose
,
fUpdateLevel
,
fConstruct
,
c
;
extern
Aig_Man_t
*
Ntl_ManPerformSynthesis
(
Aig_Man_t
*
pAig
);
int
nConfMax
,
nLevelMax
;
extern
Aig_Man_t
*
Ntl_ManPerformSynthesis
(
Aig_Man_t
*
pAig
,
int
fBalance
,
int
fUpdateLevel
,
int
fConstruct
,
int
nConfMax
,
int
nLevelMax
,
int
fVerbose
);
// set defaults
// set defaults
fBalance
=
1
;
fUpdateLevel
=
1
;
fConstruct
=
0
;
nConfMax
=
1000
;
nLevelMax
=
0
;
fVerbose
=
0
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"h"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
CLblcv
h"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
case
'C'
:
if
(
globalUtilOptind
>=
argc
)
{
fprintf
(
stdout
,
"Command line switch
\"
-C
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nConfMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nConfMax
<
0
)
goto
usage
;
break
;
case
'L'
:
if
(
globalUtilOptind
>=
argc
)
{
fprintf
(
stdout
,
"Command line switch
\"
-L
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nLevelMax
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nLevelMax
<
0
)
goto
usage
;
break
;
case
'b'
:
fBalance
^=
1
;
break
;
case
'l'
:
fUpdateLevel
^=
1
;
break
;
case
'c'
:
fConstruct
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
case
'h'
:
goto
usage
;
goto
usage
;
default:
default:
...
@@ -15008,7 +15049,7 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -15008,7 +15049,7 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// get the input file name
// get the input file name
pAigNew
=
Ntl_ManPerformSynthesis
(
pAbc
->
pAbc8Aig
);
pAigNew
=
Ntl_ManPerformSynthesis
(
pAbc
->
pAbc8Aig
,
fBalance
,
fUpdateLevel
,
fConstruct
,
nConfMax
,
nLevelMax
,
fVerbose
);
if
(
pAigNew
==
NULL
)
if
(
pAigNew
==
NULL
)
{
{
printf
(
"Abc_CommandAbc8DChoice(): Tranformation of the AIG has failed.
\n
"
);
printf
(
"Abc_CommandAbc8DChoice(): Tranformation of the AIG has failed.
\n
"
);
...
@@ -15019,9 +15060,15 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -15019,9 +15060,15 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
return
0
;
usage:
usage:
fprintf
(
stdout
,
"usage: *dchoice [-h]
\n
"
);
fprintf
(
stdout
,
"usage: *dchoice [-C num] [-L num] [-blcvh]
\n
"
);
fprintf
(
stdout
,
"
\t
performs AIG-based synthesis and derives choices
\n
"
);
fprintf
(
stdout
,
"
\t
performs AIG-based synthesis and derives choices
\n
"
);
fprintf
(
stdout
,
"
\t
-h : print the command usage
\n
"
);
fprintf
(
stdout
,
"
\t
-C num : the max number of conflicts at a node [default = %d]
\n
"
,
nConfMax
);
fprintf
(
stdout
,
"
\t
-L num : the max level of nodes to consider (0 = not used) [default = %d]
\n
"
,
nLevelMax
);
fprintf
(
stdout
,
"
\t
-b : toggle internal balancing [default = %s]
\n
"
,
fBalance
?
"yes"
:
"no"
);
fprintf
(
stdout
,
"
\t
-l : toggle updating level [default = %s]
\n
"
,
fUpdateLevel
?
"yes"
:
"no"
);
fprintf
(
stdout
,
"
\t
-c : toggle constructive computation of choices [default = %s]
\n
"
,
fConstruct
?
"yes"
:
"no"
);
fprintf
(
stdout
,
"
\t
-v : toggle verbose printout [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
fprintf
(
stdout
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
return
1
;
}
}
...
...
src/base/abci/abcDar.c
View file @
08795165
...
@@ -169,7 +169,7 @@ Abc_Ntk_t * Abc_NtkFromDar( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
...
@@ -169,7 +169,7 @@ Abc_Ntk_t * Abc_NtkFromDar( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
Aig_ManForEachPi
(
pMan
,
pObj
,
i
)
Aig_ManForEachPi
(
pMan
,
pObj
,
i
)
pObj
->
pData
=
Abc_NtkCi
(
pNtkNew
,
i
);
pObj
->
pData
=
Abc_NtkCi
(
pNtkNew
,
i
);
// rebuild the AIG
// rebuild the AIG
vNodes
=
Aig_ManDfs
(
pMan
);
vNodes
=
Aig_ManDfs
(
pMan
,
1
);
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
if
(
Aig_ObjIsBuf
(
pObj
)
)
if
(
Aig_ObjIsBuf
(
pObj
)
)
pObj
->
pData
=
(
Abc_Obj_t
*
)
Aig_ObjChild0Copy
(
pObj
);
pObj
->
pData
=
(
Abc_Obj_t
*
)
Aig_ObjChild0Copy
(
pObj
);
...
@@ -246,7 +246,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeqSweep( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
...
@@ -246,7 +246,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeqSweep( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
Abc_LatchSetInit0
(
pObjNew
);
Abc_LatchSetInit0
(
pObjNew
);
}
}
// rebuild the AIG
// rebuild the AIG
vNodes
=
Aig_ManDfs
(
pMan
);
vNodes
=
Aig_ManDfs
(
pMan
,
1
);
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
if
(
Aig_ObjIsBuf
(
pObj
)
)
if
(
Aig_ObjIsBuf
(
pObj
)
)
pObj
->
pData
=
(
Abc_Obj_t
*
)
Aig_ObjChild0Copy
(
pObj
);
pObj
->
pData
=
(
Abc_Obj_t
*
)
Aig_ObjChild0Copy
(
pObj
);
...
@@ -411,7 +411,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
...
@@ -411,7 +411,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
}
}
Abc_NtkAddDummyBoxNames
(
pNtkNew
);
Abc_NtkAddDummyBoxNames
(
pNtkNew
);
// rebuild the AIG
// rebuild the AIG
vNodes
=
Aig_ManDfs
(
pMan
);
vNodes
=
Aig_ManDfs
(
pMan
,
1
);
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
Vec_PtrForEachEntry
(
vNodes
,
pObj
,
i
)
{
{
// add the first fanin
// add the first fanin
...
@@ -629,7 +629,7 @@ Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars )
...
@@ -629,7 +629,7 @@ Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars )
// Aig_ManStop( pTemp );
// Aig_ManStop( pTemp );
clk
=
clock
();
clk
=
clock
();
pMan
=
Aig_ManDup
(
pTemp
=
pMan
,
0
);
pMan
=
Aig_ManDup
Dfs
(
pTemp
=
pMan
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
//PRT( "time", clock() - clk );
//PRT( "time", clock() - clk );
...
@@ -666,7 +666,7 @@ Abc_Ntk_t * Abc_NtkDRefactor( Abc_Ntk_t * pNtk, Dar_RefPar_t * pPars )
...
@@ -666,7 +666,7 @@ Abc_Ntk_t * Abc_NtkDRefactor( Abc_Ntk_t * pNtk, Dar_RefPar_t * pPars )
// Aig_ManStop( pTemp );
// Aig_ManStop( pTemp );
clk
=
clock
();
clk
=
clock
();
pMan
=
Aig_ManDup
(
pTemp
=
pMan
,
0
);
pMan
=
Aig_ManDup
Dfs
(
pTemp
=
pMan
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
//PRT( "time", clock() - clk );
//PRT( "time", clock() - clk );
...
...
src/base/abci/abcPrint.c
View file @
08795165
...
@@ -293,6 +293,7 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSave
...
@@ -293,6 +293,7 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSave
// if ( Abc_NtkHasSop(pNtk) )
// if ( Abc_NtkHasSop(pNtk) )
// printf( "The total number of cube pairs = %d.\n", Abc_NtkGetCubePairNum(pNtk) );
// printf( "The total number of cube pairs = %d.\n", Abc_NtkGetCubePairNum(pNtk) );
fflush
(
stdout
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
...
src/misc/hash/hashInt.h
View file @
08795165
...
@@ -90,7 +90,7 @@ static inline Hash_Int_t * Hash_IntAlloc( int nBins )
...
@@ -90,7 +90,7 @@ static inline Hash_Int_t * Hash_IntAlloc( int nBins )
p
->
nBins
=
nBins
;
p
->
nBins
=
nBins
;
p
->
fHash
=
Hash_DefaultHashFunc
;
p
->
fHash
=
Hash_DefaultHashFunc
;
p
->
nSize
=
0
;
p
->
nSize
=
0
;
p
->
pArray
=
ALLOC
(
Hash_Int_Entry_t
*
,
nBins
);
p
->
pArray
=
ALLOC
(
Hash_Int_Entry_t
*
,
nBins
+
1
);
for
(
i
=
0
;
i
<
nBins
;
i
++
)
for
(
i
=
0
;
i
<
nBins
;
i
++
)
p
->
pArray
[
i
]
=
NULL
;
p
->
pArray
[
i
]
=
NULL
;
...
@@ -270,17 +270,18 @@ static inline int* Hash_IntEntryPtr( Hash_Int_t *p, int key )
...
@@ -270,17 +270,18 @@ static inline int* Hash_IntEntryPtr( Hash_Int_t *p, int key )
***********************************************************************/
***********************************************************************/
static
inline
void
Hash_IntFree
(
Hash_Int_t
*
p
)
{
static
inline
void
Hash_IntFree
(
Hash_Int_t
*
p
)
{
int
bin
;
int
bin
;
Hash_Int_Entry_t
*
pEntry
;
Hash_Int_Entry_t
*
pEntry
,
*
pTemp
;
// free bins
// free bins
for
(
bin
=
0
;
bin
<
p
->
nBins
;
bin
++
)
{
for
(
bin
=
0
;
bin
<
p
->
nBins
;
bin
++
)
{
pEntry
=
p
->
pArray
[
bin
];
pEntry
=
p
->
pArray
[
bin
];
while
(
pEntry
)
{
while
(
pEntry
)
{
pTemp
=
pEntry
;
pEntry
=
pEntry
->
pNext
;
pEntry
=
pEntry
->
pNext
;
FREE
(
p
Entry
);
FREE
(
p
Temp
);
}
}
}
}
// free hash
// free hash
FREE
(
p
->
pArray
);
FREE
(
p
->
pArray
);
FREE
(
p
);
FREE
(
p
);
...
...
src/sat/fraig/fraigMan.c
View file @
08795165
...
@@ -369,6 +369,7 @@ void Fraig_ManPrintStats( Fraig_Man_t * p )
...
@@ -369,6 +369,7 @@ void Fraig_ManPrintStats( Fraig_Man_t * p )
if
(
p
->
time4
>
0
)
{
Fraig_PrintTime
(
"time4"
,
p
->
time4
);
}
if
(
p
->
time4
>
0
)
{
Fraig_PrintTime
(
"time4"
,
p
->
time4
);
}
// PRT( "Selection ", timeSelect );
// PRT( "Selection ", timeSelect );
// PRT( "Assignment", timeAssign );
// PRT( "Assignment", timeAssign );
fflush
(
stdout
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment