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
15a356fa
Commit
15a356fa
authored
Dec 26, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving switching activity computation.
parent
efc1c858
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
27 deletions
+26
-27
src/aig/gia/gia.h
+2
-0
src/aig/gia/giaIf.c
+11
-0
src/aig/gia/giaMan.c
+1
-0
src/aig/gia/giaSwitch.c
+12
-27
No files found.
src/aig/gia/gia.h
View file @
15a356fa
...
@@ -145,6 +145,7 @@ struct Gia_Man_t_
...
@@ -145,6 +145,7 @@ struct Gia_Man_t_
Gia_Man_t
*
pAigExtra
;
// combinational logic of holes
Gia_Man_t
*
pAigExtra
;
// combinational logic of holes
Vec_Flt_t
*
vInArrs
;
// PI arrival times
Vec_Flt_t
*
vInArrs
;
// PI arrival times
Vec_Flt_t
*
vOutReqs
;
// PO required times
Vec_Flt_t
*
vOutReqs
;
// PO required times
Vec_Int_t
*
vSwitching
;
// switching activity
int
*
pTravIds
;
// separate traversal ID representation
int
*
pTravIds
;
// separate traversal ID representation
int
nTravIdsAlloc
;
// the number of trav IDs allocated
int
nTravIdsAlloc
;
// the number of trav IDs allocated
Vec_Ptr_t
*
vNamesIn
;
// the input names
Vec_Ptr_t
*
vNamesIn
;
// the input names
...
@@ -1201,6 +1202,7 @@ extern int Gia_SweeperRun( Gia_Man_t * p, Vec_Int_t * vProbeIds,
...
@@ -1201,6 +1202,7 @@ extern int Gia_SweeperRun( Gia_Man_t * p, Vec_Int_t * vProbeIds,
/*=== giaSwitch.c ============================================================*/
/*=== giaSwitch.c ============================================================*/
extern
float
Gia_ManEvaluateSwitching
(
Gia_Man_t
*
p
);
extern
float
Gia_ManEvaluateSwitching
(
Gia_Man_t
*
p
);
extern
float
Gia_ManComputeSwitching
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nPref
,
int
fProbOne
);
extern
float
Gia_ManComputeSwitching
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nPref
,
int
fProbOne
);
extern
Vec_Int_t
*
Gia_ManComputeSwitchProbs
(
Gia_Man_t
*
pGia
,
int
nFrames
,
int
nPref
,
int
fProbOne
);
/*=== giaTim.c ===========================================================*/
/*=== giaTim.c ===========================================================*/
extern
Gia_Man_t
*
Gia_ManDupNormalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupNormalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupUnnormalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupUnnormalize
(
Gia_Man_t
*
p
);
...
...
src/aig/gia/giaIf.c
View file @
15a356fa
...
@@ -1496,6 +1496,17 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
...
@@ -1496,6 +1496,17 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
Gia_ManStop
(
p
);
Gia_ManStop
(
p
);
return
NULL
;
return
NULL
;
}
}
// compute switching for the IF objects
if
(
pPars
->
fPower
)
{
Gia_Obj_t
*
pObj
;
int
i
;
assert
(
pIfMan
->
vSwitching
==
NULL
);
pIfMan
->
vSwitching
=
Vec_IntStart
(
If_ManObjNum
(
pIfMan
)
);
Gia_ManForEachObj
(
p
,
pObj
,
i
)
if
(
~
Gia_ObjValue
(
pObj
)
)
Vec_IntWriteEntry
(
pIfMan
->
vSwitching
,
Gia_ObjValue
(
pObj
),
Vec_IntEntry
(
p
->
vSwitching
,
i
)
);
// Vec_IntFreeP( &p->vSwitching );
}
if
(
p
->
pManTime
)
if
(
p
->
pManTime
)
pIfMan
->
pManTim
=
Tim_ManDup
(
(
Tim_Man_t
*
)
p
->
pManTime
,
0
);
pIfMan
->
pManTim
=
Tim_ManDup
(
(
Tim_Man_t
*
)
p
->
pManTime
,
0
);
if
(
!
If_ManPerformMapping
(
pIfMan
)
)
if
(
!
If_ManPerformMapping
(
pIfMan
)
)
...
...
src/aig/gia/giaMan.c
View file @
15a356fa
...
@@ -79,6 +79,7 @@ void Gia_ManStop( Gia_Man_t * p )
...
@@ -79,6 +79,7 @@ void Gia_ManStop( Gia_Man_t * p )
assert
(
p
->
pManTime
==
NULL
);
assert
(
p
->
pManTime
==
NULL
);
Vec_PtrFreeFree
(
p
->
vNamesIn
);
Vec_PtrFreeFree
(
p
->
vNamesIn
);
Vec_PtrFreeFree
(
p
->
vNamesOut
);
Vec_PtrFreeFree
(
p
->
vNamesOut
);
Vec_IntFreeP
(
&
p
->
vSwitching
);
Vec_IntFreeP
(
&
p
->
vSuper
);
Vec_IntFreeP
(
&
p
->
vSuper
);
Vec_IntFreeP
(
&
p
->
vStore
);
Vec_IntFreeP
(
&
p
->
vStore
);
Vec_IntFreeP
(
&
p
->
vClassNew
);
Vec_IntFreeP
(
&
p
->
vClassNew
);
...
...
src/aig/gia/giaSwitch.c
View file @
15a356fa
...
@@ -655,13 +655,9 @@ Vec_Int_t * Gia_ManSwiSimulate( Gia_Man_t * pAig, Gia_ParSwi_t * pPars )
...
@@ -655,13 +655,9 @@ Vec_Int_t * Gia_ManSwiSimulate( Gia_Man_t * pAig, Gia_ParSwi_t * pPars )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Vec_Int_t
*
Saig_ManComputeSwitchProbs
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nPref
,
int
fProbOne
)
Vec_Int_t
*
Gia_ManComputeSwitchProbs
(
Gia_Man_t
*
pGia
,
int
nFrames
,
int
nPref
,
int
fProbOne
)
{
{
Gia_ParSwi_t
Pars
,
*
pPars
=
&
Pars
;
Gia_ParSwi_t
Pars
,
*
pPars
=
&
Pars
;
Vec_Int_t
*
vSwitching
,
*
vResult
;
Gia_Man_t
*
p
;
Aig_Obj_t
*
pObj
;
int
i
;
// set the default parameters
// set the default parameters
Gia_ManSetDefaultParamsSwi
(
pPars
);
Gia_ManSetDefaultParamsSwi
(
pPars
);
// override some of the defaults
// override some of the defaults
...
@@ -682,10 +678,19 @@ Vec_Int_t * Saig_ManComputeSwitchProbs( Aig_Man_t * pAig, int nFrames, int nPref
...
@@ -682,10 +678,19 @@ Vec_Int_t * Saig_ManComputeSwitchProbs( Aig_Man_t * pAig, int nFrames, int nPref
pPars
->
fProbOne
=
0
;
// disable computing probabiblity of being one
pPars
->
fProbOne
=
0
;
// disable computing probabiblity of being one
pPars
->
fProbTrans
=
1
;
// enable computing transition probability
pPars
->
fProbTrans
=
1
;
// enable computing transition probability
}
}
// perform the computation of switching activity
return
Gia_ManSwiSimulate
(
pGia
,
pPars
);
}
Vec_Int_t
*
Saig_ManComputeSwitchProbs
(
Aig_Man_t
*
pAig
,
int
nFrames
,
int
nPref
,
int
fProbOne
)
{
Vec_Int_t
*
vSwitching
,
*
vResult
;
Gia_Man_t
*
p
;
Aig_Obj_t
*
pObj
;
int
i
;
// translate AIG into the intermediate form (takes care of choices if present!)
// translate AIG into the intermediate form (takes care of choices if present!)
p
=
Gia_ManFromAigSwitch
(
pAig
);
p
=
Gia_ManFromAigSwitch
(
pAig
);
// perform the computation of switching activity
// perform the computation of switching activity
vSwitching
=
Gia_Man
SwiSimulate
(
p
,
pPars
);
vSwitching
=
Gia_Man
ComputeSwitchProbs
(
p
,
nFrames
,
nPref
,
fProbOne
);
// transfer the computed result to the original AIG
// transfer the computed result to the original AIG
vResult
=
Vec_IntStart
(
Aig_ManObjNumMax
(
pAig
)
);
vResult
=
Vec_IntStart
(
Aig_ManObjNumMax
(
pAig
)
);
Aig_ManForEachObj
(
pAig
,
pObj
,
i
)
Aig_ManForEachObj
(
pAig
,
pObj
,
i
)
...
@@ -742,33 +747,13 @@ float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbO
...
@@ -742,33 +747,13 @@ float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbO
Vec_Int_t
*
vSwitching
;
Vec_Int_t
*
vSwitching
;
float
*
pSwitching
,
Switch
,
SwitchTotal
=
0
.
0
;
//, SwitchTotal2 = 0.0;
float
*
pSwitching
,
Switch
,
SwitchTotal
=
0
.
0
;
//, SwitchTotal2 = 0.0;
int
i
;
int
i
;
Gia_ParSwi_t
Pars
,
*
pPars
=
&
Pars
;
ABC_FREE
(
p
->
pSwitching
);
// set the default parameters
Gia_ManSetDefaultParamsSwi
(
pPars
);
// override some of the defaults
pPars
->
nIters
=
nFrames
;
// set number of total timeframes
pPars
->
nPref
=
nPref
;
// set number of first timeframes to skip
// decide what should be computed
if
(
fProbOne
)
{
// if the user asked to compute propability of 1, we do not need transition information
pPars
->
fProbOne
=
1
;
// enable computing probabiblity of being one
pPars
->
fProbTrans
=
0
;
// disable computing transition probability
}
else
{
// if the user asked for transition propabability, we do not need to compute probability of 1
pPars
->
fProbOne
=
0
;
// disable computing probabiblity of being one
pPars
->
fProbTrans
=
1
;
// enable computing transition probability
}
// derives the DFS ordered AIG
// derives the DFS ordered AIG
Gia_ManCreateRefs
(
p
);
Gia_ManCreateRefs
(
p
);
// pDfs = Gia_ManDupOrderDfs( p );
// pDfs = Gia_ManDupOrderDfs( p );
pDfs
=
Gia_ManDup
(
p
);
pDfs
=
Gia_ManDup
(
p
);
assert
(
Gia_ManObjNum
(
pDfs
)
==
Gia_ManObjNum
(
p
)
);
assert
(
Gia_ManObjNum
(
pDfs
)
==
Gia_ManObjNum
(
p
)
);
// perform the computation of switching activity
// perform the computation of switching activity
vSwitching
=
Gia_Man
SwiSimulate
(
pDfs
,
pPars
);
vSwitching
=
Gia_Man
ComputeSwitchProbs
(
pDfs
,
nFrames
,
nPref
,
fProbOne
);
// transfer the computed result to the original AIG
// transfer the computed result to the original AIG
p
->
pSwitching
=
ABC_CALLOC
(
unsigned
char
,
Gia_ManObjNum
(
p
)
);
p
->
pSwitching
=
ABC_CALLOC
(
unsigned
char
,
Gia_ManObjNum
(
p
)
);
pSwitching
=
(
float
*
)
vSwitching
->
pArray
;
pSwitching
=
(
float
*
)
vSwitching
->
pArray
;
...
...
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