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
103fa663
Commit
103fa663
authored
Oct 22, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More accurate level calculation in AIG balancing.
parent
1c564752
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
5 deletions
+64
-5
src/aig/gia/gia.h
+2
-0
src/aig/gia/giaBalance.c
+14
-5
src/aig/gia/giaUtil.c
+48
-0
No files found.
src/aig/gia/gia.h
View file @
103fa663
...
...
@@ -1229,6 +1229,8 @@ extern void Gia_ManSetPhase1( Gia_Man_t * p );
extern
void
Gia_ManCleanPhase
(
Gia_Man_t
*
p
);
extern
int
Gia_ManCheckCoPhase
(
Gia_Man_t
*
p
);
extern
int
Gia_ManLevelNum
(
Gia_Man_t
*
p
);
extern
Vec_Int_t
*
Gia_ManGetCiLevels
(
Gia_Man_t
*
p
);
extern
int
Gia_ManSetLevels
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vCiLevels
);
extern
Vec_Int_t
*
Gia_ManReverseLevel
(
Gia_Man_t
*
p
);
extern
Vec_Int_t
*
Gia_ManRequiredLevel
(
Gia_Man_t
*
p
);
extern
void
Gia_ManCreateValueRefs
(
Gia_Man_t
*
p
);
...
...
src/aig/gia/giaBalance.c
View file @
103fa663
...
...
@@ -521,9 +521,6 @@ void Dam_ManCreatePairs( Dam_Man_t * p, int fVerbose )
int
nPairsAll
=
0
,
nPairsTried
=
0
,
nPairsUsed
=
0
,
nPairsXor
=
0
;
int
nDivsAll
=
0
,
nDivsUsed
=
0
,
nDivsXor
=
0
;
Dam_ManCollectSets
(
p
);
p
->
nLevelMax
=
Gia_ManLevelNum
(
p
->
pGia
);
p
->
vNodLevR
=
Gia_ManReverseLevel
(
p
->
pGia
);
Vec_IntFillExtra
(
p
->
pGia
->
vLevels
,
3
*
Gia_ManObjNum
(
p
->
pGia
)
/
2
,
0
);
vSuper
=
p
->
pGia
->
vSuper
;
vDivs
=
Vec_IntAlloc
(
Gia_ManObjNum
(
p
->
pGia
)
);
vHash
=
Hash_IntManStart
(
Gia_ManObjNum
(
p
->
pGia
)
/
2
);
...
...
@@ -711,7 +708,10 @@ Gia_Man_t * Dam_ManMultiAig( Dam_Man_t * pMan )
Gia_ManFillValue
(
p
);
Gia_ManConst0
(
p
)
->
Value
=
0
;
Gia_ManForEachCi
(
p
,
pObj
,
i
)
{
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
Vec_IntWriteEntry
(
pNew
->
vLevels
,
Abc_Lit2Var
(
pObj
->
Value
),
Gia_ObjLevel
(
p
,
pObj
)
);
}
// create internal nodes
Gia_ManHashStart
(
pNew
);
Gia_ManForEachCo
(
p
,
pObj
,
i
)
...
...
@@ -912,12 +912,15 @@ void Dam_ManUpdate( Dam_Man_t * p, int iDiv )
SeeAlso []
***********************************************************************/
Gia_Man_t
*
Dam_ManAreaBalanceInt
(
Gia_Man_t
*
pGia
,
int
nNewNodesMax
,
int
fVerbose
,
int
fVeryVerbose
)
Gia_Man_t
*
Dam_ManAreaBalanceInt
(
Gia_Man_t
*
pGia
,
Vec_Int_t
*
vCiLevels
,
int
nNewNodesMax
,
int
fVerbose
,
int
fVeryVerbose
)
{
Gia_Man_t
*
pNew
;
Dam_Man_t
*
p
;
int
i
,
iDiv
;
p
=
Dam_ManAlloc
(
pGia
);
p
->
nLevelMax
=
Gia_ManSetLevels
(
p
->
pGia
,
vCiLevels
);
p
->
vNodLevR
=
Gia_ManReverseLevel
(
p
->
pGia
);
Vec_IntFillExtra
(
p
->
pGia
->
vLevels
,
3
*
Gia_ManObjNum
(
p
->
pGia
)
/
2
,
0
);
Dam_ManCreatePairs
(
p
,
fVerbose
);
for
(
i
=
0
;
i
<
nNewNodesMax
&&
Vec_QueTopPriority
(
p
->
vQue
)
>=
2
;
i
++
)
{
...
...
@@ -946,6 +949,11 @@ Gia_Man_t * Dam_ManAreaBalanceInt( Gia_Man_t * pGia, int nNewNodesMax, int fVerb
Gia_Man_t
*
Gia_ManAreaBalance
(
Gia_Man_t
*
p
,
int
fSimpleAnd
,
int
nNewNodesMax
,
int
fVerbose
,
int
fVeryVerbose
)
{
Gia_Man_t
*
pNew0
,
*
pNew
,
*
pNew1
,
*
pNew2
;
Vec_Int_t
*
vCiLevels
;
// determine CI levels
if
(
p
->
pManTime
&&
p
->
vLevels
==
NULL
)
Gia_ManLevelWithBoxes
(
p
);
vCiLevels
=
Gia_ManGetCiLevels
(
p
);
// get the starting manager
pNew0
=
Gia_ManHasMapping
(
p
)
?
(
Gia_Man_t
*
)
Dsm_ManDeriveGia
(
p
,
0
)
:
p
;
if
(
fVerbose
)
Gia_ManPrintStats
(
pNew0
,
NULL
);
...
...
@@ -954,9 +962,10 @@ Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax,
if
(
fVerbose
)
Gia_ManPrintStats
(
pNew
,
NULL
);
if
(
pNew0
!=
p
)
Gia_ManStop
(
pNew0
);
// perform the operation
pNew1
=
Dam_ManAreaBalanceInt
(
pNew
,
nNewNodesMax
,
fVerbose
,
fVeryVerbose
);
pNew1
=
Dam_ManAreaBalanceInt
(
pNew
,
vCiLevels
,
nNewNodesMax
,
fVerbose
,
fVeryVerbose
);
if
(
fVerbose
)
Gia_ManPrintStats
(
pNew1
,
NULL
);
Gia_ManStop
(
pNew
);
Vec_IntFree
(
vCiLevels
);
// derive the final result
pNew2
=
Gia_ManDupNoMuxes
(
pNew1
);
if
(
fVerbose
)
Gia_ManPrintStats
(
pNew2
,
NULL
);
...
...
src/aig/gia/giaUtil.c
View file @
103fa663
...
...
@@ -508,6 +508,54 @@ int Gia_ManLevelNum( Gia_Man_t * p )
/**Function*************************************************************
Synopsis [Assigns levels using CI level information.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Int_t
*
Gia_ManGetCiLevels
(
Gia_Man_t
*
p
)
{
Vec_Int_t
*
vCiLevels
;
Gia_Obj_t
*
pObj
;
int
i
;
if
(
p
->
vLevels
==
NULL
)
return
NULL
;
vCiLevels
=
Vec_IntAlloc
(
Gia_ManCiNum
(
p
)
);
Gia_ManForEachCi
(
p
,
pObj
,
i
)
Vec_IntPush
(
vCiLevels
,
Gia_ObjLevel
(
p
,
pObj
)
);
return
vCiLevels
;
}
int
Gia_ManSetLevels
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vCiLevels
)
{
Gia_Obj_t
*
pObj
;
int
i
;
if
(
vCiLevels
==
NULL
)
return
Gia_ManLevelNum
(
p
);
Gia_ManCleanLevels
(
p
,
Gia_ManObjNum
(
p
)
);
p
->
nLevels
=
0
;
Gia_ManForEachCi
(
p
,
pObj
,
i
)
{
Gia_ObjSetLevel
(
p
,
pObj
,
Vec_IntEntry
(
vCiLevels
,
i
)
);
p
->
nLevels
=
Abc_MaxInt
(
p
->
nLevels
,
Gia_ObjLevel
(
p
,
pObj
)
);
}
Gia_ManForEachObj
(
p
,
pObj
,
i
)
{
if
(
Gia_ObjIsAnd
(
pObj
)
)
Gia_ObjSetGateLevel
(
p
,
pObj
);
else
if
(
Gia_ObjIsCo
(
pObj
)
)
Gia_ObjSetCoLevel
(
p
,
pObj
);
else
continue
;
p
->
nLevels
=
Abc_MaxInt
(
p
->
nLevels
,
Gia_ObjLevel
(
p
,
pObj
)
);
}
return
p
->
nLevels
;
}
/**Function*************************************************************
Synopsis [Compute reverse levels.]
Description []
...
...
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