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
7a3e57a4
Commit
7a3e57a4
authored
Mar 16, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Synchronizing with the recent version.
parent
8826ed6d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
25 deletions
+29
-25
src/opt/cgt/cgt.h
+2
-1
src/opt/cgt/cgtAig.c
+6
-6
src/opt/cgt/cgtCore.c
+15
-10
src/opt/cgt/cgtDecide.c
+2
-5
src/opt/cgt/cgtInt.h
+2
-1
src/proof/ssw/sswSim.c
+2
-2
No files found.
src/opt/cgt/cgt.h
View file @
7a3e57a4
...
...
@@ -69,7 +69,8 @@ struct Cgt_Par_t_
/*=== cgtCore.c ==========================================================*/
extern
void
Cgt_SetDefaultParams
(
Cgt_Par_t
*
p
);
extern
Vec_Vec_t
*
Cgt_ClockGatingCandidates
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
);
extern
Vec_Vec_t
*
Cgt_ClockGatingCandidates
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
,
Vec_Int_t
*
vUseful
);
extern
Vec_Vec_t
*
Cgt_ClockGatingInt
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
,
Vec_Int_t
*
vUseful
);
extern
Aig_Man_t
*
Cgt_ClockGating
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
);
...
...
src/opt/cgt/cgtAig.c
View file @
7a3e57a4
...
...
@@ -42,17 +42,17 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
void
Cgt_ManDetectCandidates_rec
(
Aig_Man_t
*
pAig
,
Aig_Obj_t
*
pObj
,
int
nLevelMax
,
Vec_Ptr_t
*
vCands
)
void
Cgt_ManDetectCandidates_rec
(
Aig_Man_t
*
pAig
,
Vec_Int_t
*
vUseful
,
Aig_Obj_t
*
pObj
,
int
nLevelMax
,
Vec_Ptr_t
*
vCands
)
{
if
(
Aig_ObjIsTravIdCurrent
(
pAig
,
pObj
)
)
return
;
Aig_ObjSetTravIdCurrent
(
pAig
,
pObj
);
if
(
Aig_ObjIsNode
(
pObj
)
)
{
Cgt_ManDetectCandidates_rec
(
pAig
,
Aig_ObjFanin0
(
pObj
),
nLevelMax
,
vCands
);
Cgt_ManDetectCandidates_rec
(
pAig
,
Aig_ObjFanin1
(
pObj
),
nLevelMax
,
vCands
);
Cgt_ManDetectCandidates_rec
(
pAig
,
vUseful
,
Aig_ObjFanin0
(
pObj
),
nLevelMax
,
vCands
);
Cgt_ManDetectCandidates_rec
(
pAig
,
vUseful
,
Aig_ObjFanin1
(
pObj
),
nLevelMax
,
vCands
);
}
if
(
Aig_ObjLevel
(
pObj
)
<=
nLevelMax
)
if
(
Aig_ObjLevel
(
pObj
)
<=
nLevelMax
&&
(
vUseful
==
NULL
||
Vec_IntEntry
(
vUseful
,
Aig_ObjId
(
pObj
)))
)
Vec_PtrPush
(
vCands
,
pObj
);
}
...
...
@@ -67,13 +67,13 @@ void Cgt_ManDetectCandidates_rec( Aig_Man_t * pAig, Aig_Obj_t * pObj, int nLevel
SeeAlso []
***********************************************************************/
void
Cgt_ManDetectCandidates
(
Aig_Man_t
*
pAig
,
Aig_Obj_t
*
pObj
,
int
nLevelMax
,
Vec_Ptr_t
*
vCands
)
void
Cgt_ManDetectCandidates
(
Aig_Man_t
*
pAig
,
Vec_Int_t
*
vUseful
,
Aig_Obj_t
*
pObj
,
int
nLevelMax
,
Vec_Ptr_t
*
vCands
)
{
Vec_PtrClear
(
vCands
);
if
(
!
Aig_ObjIsNode
(
pObj
)
)
return
;
Aig_ManIncrementTravId
(
pAig
);
Cgt_ManDetectCandidates_rec
(
pAig
,
pObj
,
nLevelMax
,
vCands
);
Cgt_ManDetectCandidates_rec
(
pAig
,
vUseful
,
pObj
,
nLevelMax
,
vCands
);
}
/**Function*************************************************************
...
...
src/opt/cgt/cgtCore.c
View file @
7a3e57a4
...
...
@@ -53,7 +53,7 @@ void Cgt_SetDefaultParams( Cgt_Par_t * p )
p
->
nVarsMin
=
1000
;
// the min number of vars to recycle the SAT solver
p
->
nFlopsMin
=
5
;
// the min number of flops to recycle the SAT solver
p
->
fAreaOnly
=
0
;
// derive clock-gating to minimize area
p
->
fVerbose
=
1
;
// verbosity flag
p
->
fVerbose
=
0
;
// verbosity flag
}
/**Function*************************************************************
...
...
@@ -138,7 +138,7 @@ void Cgt_ClockGatingRangeCheck( Cgt_Man_t * p, int iStart, int nOutputs )
{
nCalls
=
p
->
nCalls
;
pMiter
=
Saig_ManLi
(
p
->
pAig
,
i
);
Cgt_ManDetectCandidates
(
p
->
pAig
,
Aig_ObjFanin0
(
pMiter
),
p
->
pPars
->
nLevelMax
,
vNodes
);
Cgt_ManDetectCandidates
(
p
->
pAig
,
p
->
vUseful
,
Aig_ObjFanin0
(
pMiter
),
p
->
pPars
->
nLevelMax
,
vNodes
);
// go through the candidates of this PO
Vec_PtrForEachEntry
(
Aig_Obj_t
*
,
vNodes
,
pCand
,
k
)
{
...
...
@@ -242,7 +242,7 @@ p->timePrepare += Abc_Clock() - clk;
SeeAlso []
***********************************************************************/
Vec_Vec_t
*
Cgt_ClockGatingCandidates
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
)
Vec_Vec_t
*
Cgt_ClockGatingCandidates
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
,
Vec_Int_t
*
vUseful
)
{
Bar_Progress_t
*
pProgress
=
NULL
;
Cgt_Par_t
Pars
;
...
...
@@ -255,6 +255,7 @@ Vec_Vec_t * Cgt_ClockGatingCandidates( Aig_Man_t * pAig, Aig_Man_t * pCare, Cgt_
if
(
pPars
==
NULL
)
Cgt_SetDefaultParams
(
pPars
=
&
Pars
);
p
=
Cgt_ManCreate
(
pAig
,
pCare
,
pPars
);
p
->
vUseful
=
vUseful
;
p
->
pFrame
=
Cgt_ManDeriveAigForGating
(
p
);
p
->
timeAig
+=
Abc_Clock
()
-
clk
;
assert
(
Aig_ManCoNum
(
p
->
pFrame
)
==
Saig_ManRegNum
(
p
->
pAig
)
);
...
...
@@ -283,17 +284,22 @@ p->timeTotal = Abc_Clock() - clkTotal;
SeeAlso []
***********************************************************************/
Aig_Man_t
*
Cgt_ClockGating
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
)
Vec_Vec_t
*
Cgt_ClockGatingInt
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
,
Vec_Int_t
*
vUseful
)
{
Aig_Man_t
*
pGated
;
Vec_Vec_t
*
vGatesAll
;
Vec_Vec_t
*
vGates
;
int
nNodesUsed
;
//, clk = Abc_Clock();
vGatesAll
=
Cgt_ClockGatingCandidates
(
pAig
,
pCare
,
pPars
);
Vec_Vec_t
*
vGatesAll
,
*
vGates
;
vGatesAll
=
Cgt_ClockGatingCandidates
(
pAig
,
pCare
,
pPars
,
vUseful
);
if
(
pPars
->
fAreaOnly
)
vGates
=
Cgt_ManDecideArea
(
pAig
,
vGatesAll
,
pPars
->
nOdcMax
,
pPars
->
fVerbose
);
else
vGates
=
Cgt_ManDecideSimple
(
pAig
,
vGatesAll
,
pPars
->
nOdcMax
,
pPars
->
fVerbose
);
Vec_VecFree
(
vGatesAll
);
return
vGates
;
}
Aig_Man_t
*
Cgt_ClockGating
(
Aig_Man_t
*
pAig
,
Aig_Man_t
*
pCare
,
Cgt_Par_t
*
pPars
)
{
Aig_Man_t
*
pGated
;
Vec_Vec_t
*
vGates
=
Cgt_ClockGatingInt
(
pAig
,
pCare
,
pPars
,
NULL
);
int
nNodesUsed
;
if
(
pPars
->
fVerbose
)
{
// printf( "Before CG: " );
...
...
@@ -310,7 +316,6 @@ Aig_Man_t * Cgt_ClockGating( Aig_Man_t * pAig, Aig_Man_t * pCare, Cgt_Par_t * pP
Aig_ManNodeNum
(
pGated
)
);
}
Vec_VecFree
(
vGates
);
Vec_VecFree
(
vGatesAll
);
return
pGated
;
}
...
...
src/opt/cgt/cgtDecide.c
View file @
7a3e57a4
...
...
@@ -161,15 +161,12 @@ float Cgt_ManComputeCoverage( Aig_Man_t * pAig, Vec_Vec_t * vGates )
int
nWords
=
1
;
Ssw_Sml_t
*
pSml
;
Vec_Ptr_t
*
vOne
;
int
i
,
nTrans
Total
=
0
,
nTrans
Saved
=
0
;
int
i
,
nTransSaved
=
0
;
pSml
=
Ssw_SmlSimulateSeq
(
pAig
,
0
,
nFrames
,
nWords
);
Vec_VecForEachLevel
(
vGates
,
vOne
,
i
)
{
nTransSaved
+=
Ssw_SmlNodeCountOnesRealVec
(
pSml
,
vOne
);
nTransTotal
+=
32
*
nFrames
*
nWords
;
}
Ssw_SmlStop
(
pSml
);
return
(
float
)
100
.
0
*
nTransSaved
/
nTransTotal
;
return
(
float
)
100
.
0
*
nTransSaved
/
32
/
nFrames
/
nWords
/
Vec_VecSize
(
vGates
)
;
}
/**Function*************************************************************
...
...
src/opt/cgt/cgtInt.h
View file @
7a3e57a4
...
...
@@ -50,6 +50,7 @@ struct Cgt_Man_t_
// user's data
Cgt_Par_t
*
pPars
;
// user's parameters
Aig_Man_t
*
pAig
;
// user's AIG manager
Vec_Int_t
*
vUseful
;
// user's candidate nodes
// user's constraints
Aig_Man_t
*
pCare
;
// constraint cones
Vec_Vec_t
*
vSuppsInv
;
// inverse support of the constraints
...
...
@@ -94,7 +95,7 @@ struct Cgt_Man_t_
////////////////////////////////////////////////////////////////////////
/*=== cgtAig.c ==========================================================*/
extern
void
Cgt_ManDetectCandidates
(
Aig_Man_t
*
pAig
,
Aig_Obj_t
*
pObj
,
int
nLevelMax
,
Vec_Ptr_t
*
vCands
);
extern
void
Cgt_ManDetectCandidates
(
Aig_Man_t
*
pAig
,
Vec_Int_t
*
vUseful
,
Aig_Obj_t
*
pObj
,
int
nLevelMax
,
Vec_Ptr_t
*
vCands
);
extern
Aig_Man_t
*
Cgt_ManDeriveAigForGating
(
Cgt_Man_t
*
p
);
extern
Aig_Man_t
*
Cgt_ManDupPartition
(
Aig_Man_t
*
pAig
,
int
nVarsMin
,
int
nFlopsMin
,
int
iStart
,
Aig_Man_t
*
pCare
,
Vec_Vec_t
*
vSuppsInv
,
int
*
pnOutputs
);
extern
Aig_Man_t
*
Cgt_ManDeriveGatedAig
(
Aig_Man_t
*
pAig
,
Vec_Vec_t
*
vGates
,
int
fReduce
,
int
*
pnUsedNodes
);
...
...
src/proof/ssw/sswSim.c
View file @
7a3e57a4
...
...
@@ -321,7 +321,7 @@ int Ssw_SmlNodeIsZeroFrame( Ssw_Sml_t * p, Aig_Obj_t * pObj, int f )
/**Function*************************************************************
Synopsis [Counts the number of one's in the patte
n
the object.]
Synopsis [Counts the number of one's in the patte
rn of
the object.]
Description []
...
...
@@ -350,7 +350,7 @@ int Ssw_SmlNodeCountOnesReal( Ssw_Sml_t * p, Aig_Obj_t * pObj )
/**Function*************************************************************
Synopsis [Counts the number of one's in the patte
n the object
.]
Synopsis [Counts the number of one's in the patte
rn of the objects
.]
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