summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaSwitch.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-06-23 18:05:51 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-06-23 18:05:51 -0700
commit2edf2a970ee3663ef0725f22972a10083ed81fbf (patch)
tree2402fa5950e37128a19d279a52cffdd4613cfa52 /src/aig/gia/giaSwitch.c
parentf79d8e4b0443bda2249735e34545ed2197cbe5ea (diff)
downloadabc-2edf2a970ee3663ef0725f22972a10083ed81fbf.tar.gz
abc-2edf2a970ee3663ef0725f22972a10083ed81fbf.tar.bz2
abc-2edf2a970ee3663ef0725f22972a10083ed81fbf.zip
Improvements to power-aware mapping.
Diffstat (limited to 'src/aig/gia/giaSwitch.c')
-rw-r--r--src/aig/gia/giaSwitch.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/aig/gia/giaSwitch.c b/src/aig/gia/giaSwitch.c
index e5b1eb22..58acbb69 100644
--- a/src/aig/gia/giaSwitch.c
+++ b/src/aig/gia/giaSwitch.c
@@ -80,7 +80,7 @@ void Gia_ManSetDefaultParamsSwi( Gia_ParSwi_t * p )
p->nWords = 10; // the number of machine words of simulatation data
p->nIters = 48; // the number of all timeframes to simulate
p->nPref = 16; // the number of first timeframes to skip when computing switching
- p->nRandPiFactor = 2; // primary input transition probability (-1=3/8; 0=1/2; 1=1/4; 2=1/8, etc)
+ p->nRandPiFactor = 0; // primary input transition probability (-1=3/8; 0=1/2; 1=1/4; 2=1/8, etc)
p->fProbOne = 0; // compute probability of signal being one (if 0, compute probability of switching)
p->fProbTrans = 1; // compute signal transition probability (if 0, compute transition probability using probability of being one)
p->fVerbose = 0; // enables verbose output
@@ -740,6 +740,7 @@ float Gia_ManEvaluateSwitching( Gia_Man_t * p )
SeeAlso []
***********************************************************************/
+/*
float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbOne )
{
Gia_Man_t * pDfs;
@@ -776,6 +777,27 @@ float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbO
Gia_ManStop( pDfs );
return SwitchTotal;
}
+*/
+float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbOne )
+{
+ Vec_Int_t * vSwitching = Gia_ManComputeSwitchProbs( p, nFrames, nPref, fProbOne );
+ float * pSwi = (float *)Vec_IntArray(vSwitching), SwiTotal = 0;
+ Gia_Obj_t * pObj;
+ int i, k, iFan;
+ if ( Gia_ManHasMapping(p) )
+ {
+ Gia_ManForEachLut( p, i )
+ Gia_LutForEachFanin( p, i, iFan, k )
+ SwiTotal += pSwi[iFan];
+ }
+ else
+ {
+ Gia_ManForEachAnd( p, pObj, i )
+ SwiTotal += pSwi[Gia_ObjFaninId0(pObj, i)] + pSwi[Gia_ObjFaninId1(pObj, i)];
+ }
+ Vec_IntFree( vSwitching );
+ return SwiTotal;
+}
/**Function*************************************************************