diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2005-09-05 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2005-09-05 08:01:00 -0700 |
commit | 1260d20cc05fe2d21088cc047c460e85ccdb3b14 (patch) | |
tree | f10ccc3333f78b6e2e089a88c8cf61a47b2f2dcd /src/map/fpga | |
parent | 33012d9530c40817e1fc5230b3e663f7690b2e94 (diff) | |
download | abc-1260d20cc05fe2d21088cc047c460e85ccdb3b14.tar.gz abc-1260d20cc05fe2d21088cc047c460e85ccdb3b14.tar.bz2 abc-1260d20cc05fe2d21088cc047c460e85ccdb3b14.zip |
Version abc50905
Diffstat (limited to 'src/map/fpga')
-rw-r--r-- | src/map/fpga/fpga.c | 10 | ||||
-rw-r--r-- | src/map/fpga/fpgaCore.c | 2 | ||||
-rw-r--r-- | src/map/fpga/fpgaSwitch.c | 39 | ||||
-rw-r--r-- | src/map/fpga/fpgaUtils.c | 2 |
4 files changed, 14 insertions, 39 deletions
diff --git a/src/map/fpga/fpga.c b/src/map/fpga/fpga.c index 6b107498..3d2ca913 100644 --- a/src/map/fpga/fpga.c +++ b/src/map/fpga/fpga.c @@ -56,9 +56,9 @@ static int Fpga_CommandPrintLibrary( Abc_Frame_t * pAbc, int argc, char **argv ) void Fpga_Init( Abc_Frame_t * pAbc ) { // set the default library - //Fpga_LutLib_t s_LutLib = { "lutlib", 6, {0,1,2,4,8,16,32}, {0,1,2,3,4,5,6} }; - Fpga_LutLib_t s_LutLib = { "lutlib", 5, {0,1,1,1,1,1}, {0,1,1,1,1,1} }; - Abc_FrameSetLibLut( pAbc, Fpga_LutLibDup(&s_LutLib) ); + //Fpga_LutLib_t s_LutLib = { "lutlib", 6, {0,1,2,4,8,16,32}, {0,1,2,3,4,5,6} }; + Fpga_LutLib_t s_LutLib = { "lutlib", 5, {0,1,1,1,1,1}, {0,1,1,1,1,1} }; + Abc_FrameSetLibLut( Fpga_LutLibDup(&s_LutLib) ); Cmd_CommandAdd( pAbc, "FPGA mapping", "read_lut", Fpga_CommandReadLibrary, 0 ); Cmd_CommandAdd( pAbc, "FPGA mapping", "print_lut", Fpga_CommandPrintLibrary, 0 ); @@ -150,8 +150,8 @@ int Fpga_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv ) goto usage; } // replace the current library - Fpga_LutLibFree( Abc_FrameReadLibLut(Abc_FrameGetGlobalFrame()) ); - Abc_FrameSetLibLut( Abc_FrameGetGlobalFrame(), pLib ); + Fpga_LutLibFree( Abc_FrameReadLibLut() ); + Abc_FrameSetLibLut( pLib ); return 0; usage: diff --git a/src/map/fpga/fpgaCore.c b/src/map/fpga/fpgaCore.c index 95b9ca49..9ca65379 100644 --- a/src/map/fpga/fpgaCore.c +++ b/src/map/fpga/fpgaCore.c @@ -97,7 +97,7 @@ int Fpga_Mapping( Fpga_Man_t * p ) ***********************************************************************/ int Fpga_MappingPostProcess( Fpga_Man_t * p ) { - int fShowSwitching = 0; + int fShowSwitching = 1; int fRecoverAreaFlow = 1; int fRecoverArea = 1; float aAreaTotalCur, aAreaTotalCur2; diff --git a/src/map/fpga/fpgaSwitch.c b/src/map/fpga/fpgaSwitch.c index 0d2ec3fc..8cc77990 100644 --- a/src/map/fpga/fpgaSwitch.c +++ b/src/map/fpga/fpgaSwitch.c @@ -22,8 +22,6 @@ /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -static float Fpga_CutGetSwitching( Fpga_Cut_t * pCut ); - //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFITIONS /// //////////////////////////////////////////////////////////////////////// @@ -64,10 +62,10 @@ float Fpga_CutRefSwitch( Fpga_Man_t * pMan, Fpga_Node_t * pNode, Fpga_Cut_t * pC Fpga_Node_t * pNodeChild; float aArea; int i; - if ( pCut->nLeaves == 1 ) - return 0; // start the area of this cut - aArea = Fpga_CutGetSwitching( pCut ); + aArea = pNode->Switching; + if ( pCut->nLeaves == 1 ) + return aArea; // go through the children for ( i = 0; i < pCut->nLeaves; i++ ) { @@ -96,10 +94,10 @@ float Fpga_CutDerefSwitch( Fpga_Man_t * pMan, Fpga_Node_t * pNode, Fpga_Cut_t * Fpga_Node_t * pNodeChild; float aArea; int i; - if ( pCut->nLeaves == 1 ) - return 0; // start the area of this cut - aArea = Fpga_CutGetSwitching( pCut ); + aArea = pNode->Switching; + if ( pCut->nLeaves == 1 ) + return aArea; // go through the children for ( i = 0; i < pCut->nLeaves; i++ ) { @@ -112,27 +110,6 @@ float Fpga_CutDerefSwitch( Fpga_Man_t * pMan, Fpga_Node_t * pNode, Fpga_Cut_t * return aArea; } -/**function************************************************************* - - synopsis [Computes the exact area associated with the cut.] - - description [] - - sideeffects [] - - seealso [] - -***********************************************************************/ -float Fpga_CutGetSwitching( Fpga_Cut_t * pCut ) -{ - float Result; - int i; - Result = 0.0; - for ( i = 0; i < pCut->nLeaves; i++ ) - Result += pCut->ppLeaves[i]->Switching; - return Result; -} - /**Function************************************************************* Synopsis [Computes the array of mapping.] @@ -153,10 +130,8 @@ float Fpga_MappingGetSwitching( Fpga_Man_t * pMan, Fpga_NodeVec_t * vMapping ) for ( i = 0; i < vMapping->nSize; i++ ) { pNode = vMapping->pArray[i]; - if ( !Fpga_NodeIsAnd(pNode) ) - continue; // at least one phase has the best cut assigned - assert( pNode->pCutBest != NULL ); + assert( !Fpga_NodeIsAnd(pNode) || pNode->pCutBest != NULL ); // at least one phase is used in the mapping assert( pNode->nRefs > 0 ); // compute the array due to the supergate diff --git a/src/map/fpga/fpgaUtils.c b/src/map/fpga/fpgaUtils.c index 3ea1f2f1..db0f9623 100644 --- a/src/map/fpga/fpgaUtils.c +++ b/src/map/fpga/fpgaUtils.c @@ -314,7 +314,7 @@ float Fpga_MappingSetRefsAndArea( Fpga_Man_t * pMan ) // reconnect the nodes in reverse topological order pMan->vMapping->nSize = 0; - for ( i = LevelMax; i > 0; i-- ) + for ( i = LevelMax; i >= 0; i-- ) for ( pNode = ppStore[i]; pNode; pNode = (Fpga_Node_t *)pNode->pData0 ) Fpga_NodeVecPush( pMan->vMapping, pNode ); free( ppStore ); |