summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-02-28 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2008-02-28 08:01:00 -0800
commitf65983c2c0810cfb933f696952325a81d2378987 (patch)
tree4e4ea6ec9da3b6906edd476a85d1d301352e1a02 /src/map
parent7d23cc522e416ae1f3d2d53292ef438d1a08b0d7 (diff)
downloadabc-f65983c2c0810cfb933f696952325a81d2378987.tar.gz
abc-f65983c2c0810cfb933f696952325a81d2378987.tar.bz2
abc-f65983c2c0810cfb933f696952325a81d2378987.zip
Version abc80228
Diffstat (limited to 'src/map')
-rw-r--r--src/map/if/if.h4
-rw-r--r--src/map/if/ifTime.c24
-rw-r--r--src/map/if/ifTruth.c36
3 files changed, 63 insertions, 1 deletions
diff --git a/src/map/if/if.h b/src/map/if/if.h
index b3d2d745..19222f3b 100644
--- a/src/map/if/if.h
+++ b/src/map/if/if.h
@@ -170,10 +170,10 @@ struct If_Man_t_
// priority cut
struct If_Cut_t_
{
- float Delay; // delay of the cut
float Area; // area (or area-flow) of the cut
float AveRefs; // the average number of leaf references
float Edge; // the edge flow
+ float Delay; // delay of the cut
unsigned uSign; // cut signature
unsigned Cost : 14; // the user's cost of the cut
unsigned fCompl : 1; // the complemented attribute
@@ -379,8 +379,10 @@ extern int If_ManPerformMappingSeq( If_Man_t * p );
/*=== ifTime.c ============================================================*/
extern float If_CutDelay( If_Man_t * p, If_Cut_t * pCut );
extern void If_CutPropagateRequired( If_Man_t * p, If_Cut_t * pCut, float Required );
+extern void If_CutRotatePins( If_Man_t * p, If_Cut_t * pCut );
/*=== ifTruth.c ===========================================================*/
extern void If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int fCompl0, int fCompl1 );
+extern void If_CutTruthPermute( unsigned * pOut, unsigned * pIn, int nVars, float * pDelays, int * pVars );
/*=== ifUtil.c ============================================================*/
extern void If_ManCleanNodeCopy( If_Man_t * p );
extern void If_ManCleanCutData( If_Man_t * p );
diff --git a/src/map/if/ifTime.c b/src/map/if/ifTime.c
index 3d1dab1b..33bbdf74 100644
--- a/src/map/if/ifTime.c
+++ b/src/map/if/ifTime.c
@@ -221,6 +221,30 @@ void If_CutSortInputPins( If_Man_t * p, If_Cut_t * pCut, int * pPinPerm, float *
}
}
+/**Function*************************************************************
+
+ Synopsis [Sorts the pins in the decreasing order of delays.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void If_CutRotatePins( If_Man_t * p, If_Cut_t * pCut )
+{
+ If_Obj_t * pLeaf;
+ float PinDelays[32];
+// int PinPerm[32];
+ int i;
+ assert( p->pPars->pLutLib && p->pPars->pLutLib->fVarPinDelays && p->pPars->fTruth );
+ If_CutForEachLeaf( p, pCut, pLeaf, i )
+ PinDelays[i] = If_ObjCutBest(pLeaf)->Delay;
+ If_CutTruthPermute( p->puTemp[0], If_CutTruth(pCut), If_CutLeaveNum(pCut), PinDelays, If_CutLeaves(pCut) );
+// If_CutSortInputPins( p, pCut, PinPerm, PinDelays );
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/map/if/ifTruth.c b/src/map/if/ifTruth.c
index f18d8308..a3a7e1ee 100644
--- a/src/map/if/ifTruth.c
+++ b/src/map/if/ifTruth.c
@@ -126,6 +126,42 @@ void If_TruthSwapAdjacentVars( unsigned * pOut, unsigned * pIn, int nVars, int i
/**Function*************************************************************
+ Synopsis [Implements given permutation of variables.]
+
+ Description [Permutes truth table in-place (returns it in pIn).]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void If_CutTruthPermute( unsigned * pOut, unsigned * pIn, int nVars, float * pDelays, int * pVars )
+{
+ unsigned * pTemp;
+ float tTemp;
+ int i, Temp, Counter = 0, fChange = 1;
+ while ( fChange )
+ {
+ fChange = 0;
+ for ( i = 0; i < nVars - 1; i++ )
+ {
+ if ( pDelays[i] >= pDelays[i+1] )
+ continue;
+ tTemp = pDelays[i]; pDelays[i] = pDelays[i+1]; pDelays[i+1] = tTemp;
+ Temp = pVars[i]; pVars[i] = pVars[i+1]; pVars[i+1] = Temp;
+ If_TruthSwapAdjacentVars( pOut, pIn, nVars, i );
+ pTemp = pOut; pOut = pIn; pIn = pTemp;
+ fChange = 1;
+ Counter++;
+ }
+ }
+ if ( Counter & 1 )
+ If_TruthCopy( pOut, pIn, nVars );
+}
+
+
+/**Function*************************************************************
+
Synopsis [Expands the truth table according to the phase.]
Description [The input and output truth tables are in pIn/pOut. The current number