summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2006-02-22 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2006-02-22 08:01:00 -0800
commit9e6f8406e80c55455c464b01033040a88fd12c40 (patch)
tree5aba441c0d358e48bc9d6fc56f027af792b4c536 /src/map
parent8eef7f8326e715ea4e9e84f46487cf4657601c25 (diff)
downloadabc-9e6f8406e80c55455c464b01033040a88fd12c40.tar.gz
abc-9e6f8406e80c55455c464b01033040a88fd12c40.tar.bz2
abc-9e6f8406e80c55455c464b01033040a88fd12c40.zip
Version abc60222
Diffstat (limited to 'src/map')
-rw-r--r--src/map/fpga/fpga.h1
-rw-r--r--src/map/fpga/fpgaCut.c3
-rw-r--r--src/map/fpga/fpgaTruth.c60
3 files changed, 64 insertions, 0 deletions
diff --git a/src/map/fpga/fpga.h b/src/map/fpga/fpga.h
index 874a2d79..51868188 100644
--- a/src/map/fpga/fpga.h
+++ b/src/map/fpga/fpga.h
@@ -147,6 +147,7 @@ extern float Fpga_LutLibReadLutArea( Fpga_LutLib_t * p, int Size );
extern float Fpga_LutLibReadLutDelay( Fpga_LutLib_t * p, int Size );
/*=== fpgaTruth.c =============================================================*/
extern void * Fpga_TruthsCutBdd( void * dd, Fpga_Cut_t * pCut );
+extern int Fpga_CutVolume( Fpga_Cut_t * pCut );
/*=== fpgaUtil.c =============================================================*/
extern int Fpga_ManCheckConsistency( Fpga_Man_t * p );
extern void Fpga_ManCleanData0( Fpga_Man_t * pMan );
diff --git a/src/map/fpga/fpgaCut.c b/src/map/fpga/fpgaCut.c
index cff22b27..2f686711 100644
--- a/src/map/fpga/fpgaCut.c
+++ b/src/map/fpga/fpgaCut.c
@@ -767,7 +767,10 @@ int Fpga_CutCountAll( Fpga_Man_t * pMan )
for ( pNode = pMan->pBins[i]; pNode; pNode = pNode->pNext )
for ( pCut = pNode->pCuts; pCut; pCut = pCut->pNext )
if ( pCut->nLeaves > 1 ) // skip the elementary cuts
+ {
+// Fpga_CutVolume( pCut );
nCuts++;
+ }
return nCuts;
}
diff --git a/src/map/fpga/fpgaTruth.c b/src/map/fpga/fpgaTruth.c
index d889ea41..11660731 100644
--- a/src/map/fpga/fpgaTruth.c
+++ b/src/map/fpga/fpgaTruth.c
@@ -94,12 +94,72 @@ void * Fpga_TruthsCutBdd( void * dd, Fpga_Cut_t * pCut )
Cudd_RecursiveDeref( dd, (DdNode*)pCut->uSign );
pCut->uSign = 0;
}
+ printf( "%d ", vVisited->nSize );
+
Fpga_NodeVecFree( vVisited );
Cudd_Deref( bFunc );
return bFunc;
}
+/**Function*************************************************************
+
+ Synopsis [Recursively derives the truth table for the cut.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Fpga_CutVolume_rec( Fpga_Cut_t * pCut, Fpga_NodeVec_t * vVisited )
+{
+ assert( !Fpga_IsComplement(pCut) );
+ if ( pCut->fMark )
+ return;
+ pCut->fMark = 1;
+ Fpga_CutVolume_rec( Fpga_CutRegular(pCut->pOne), vVisited );
+ Fpga_CutVolume_rec( Fpga_CutRegular(pCut->pTwo), vVisited );
+ Fpga_NodeVecPush( vVisited, (Fpga_Node_t *)pCut );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Derives the truth table for one cut.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Fpga_CutVolume( Fpga_Cut_t * pCut )
+{
+ Fpga_NodeVec_t * vVisited;
+ int Volume, i;
+ assert( pCut->nLeaves > 1 );
+ // set the leaf variables
+ for ( i = 0; i < pCut->nLeaves; i++ )
+ pCut->ppLeaves[i]->pCuts->fMark = 1;
+ // recursively compute the function
+ vVisited = Fpga_NodeVecAlloc( 10 );
+ Fpga_CutVolume_rec( pCut, vVisited );
+ // clean the marks
+ for ( i = 0; i < pCut->nLeaves; i++ )
+ pCut->ppLeaves[i]->pCuts->fMark = 0;
+ for ( i = 0; i < vVisited->nSize; i++ )
+ {
+ pCut = (Fpga_Cut_t *)vVisited->pArray[i];
+ pCut->fMark = 0;
+ }
+ Volume = vVisited->nSize;
+ printf( "%d ", Volume );
+ Fpga_NodeVecFree( vVisited );
+ return Volume;
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////