summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifSeq.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2006-12-04 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2006-12-04 08:01:00 -0800
commit52e5b91cbbfe587bae80984bb3672e4c1a70203c (patch)
tree0aec31b1121e4eb690f1dc17b3c76617b723fe5e /src/map/if/ifSeq.c
parent44d220d28fa2ee56cb539e03684f021731814f17 (diff)
downloadabc-52e5b91cbbfe587bae80984bb3672e4c1a70203c.tar.gz
abc-52e5b91cbbfe587bae80984bb3672e4c1a70203c.tar.bz2
abc-52e5b91cbbfe587bae80984bb3672e4c1a70203c.zip
Version abc61204
Diffstat (limited to 'src/map/if/ifSeq.c')
-rw-r--r--src/map/if/ifSeq.c170
1 files changed, 170 insertions, 0 deletions
diff --git a/src/map/if/ifSeq.c b/src/map/if/ifSeq.c
new file mode 100644
index 00000000..ce353f49
--- /dev/null
+++ b/src/map/if/ifSeq.c
@@ -0,0 +1,170 @@
+/**CFile****************************************************************
+
+ FileName [ifSeq.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [FPGA mapping based on priority cuts.]
+
+ Synopsis [Sequential mapping.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - November 21, 2006.]
+
+ Revision [$Id: ifSeq.c,v 1.00 2006/11/21 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "if.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+static void If_ObjPerformMappingLI( If_Man_t * p, If_Obj_t * pLatch );
+static void If_ObjPerformMappingLO( If_Man_t * p, If_Obj_t * pLatch, If_Obj_t * pObj );
+static int If_ManMappingSeqConverged( If_Man_t * p );
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Performs sequential mapping.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int If_ManPerformMappingSeq( If_Man_t * p )
+{
+ If_Obj_t * pObj, * pLatch;
+ int i, clkTotal = clock();
+ // set the number of cuts used
+ p->nCutsUsed = p->pPars->nCutsMax;
+ // set arrival times and trivial cuts at const 1 and PIs
+ If_ManConst1(p)->Cuts[0].Delay = 0.0;
+ If_ManForEachPi( p, pObj, i )
+ pObj->Cuts[0].Delay = p->pPars->pTimesArr[i];
+ // set the fanout estimates of the PIs
+ If_ManForEachPi( p, pObj, i )
+ pObj->EstRefs = (float)1.0;
+ // delay oriented mapping
+ p->pPars->fFancy = 1;
+ If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 0 );
+ p->pPars->fFancy = 0;
+
+ // perform iterations over the circuit
+ while ( !If_ManMappingSeqConverged( p ) )
+ {
+ // assign cuts to latches
+ If_ManForEachLatch( p, pLatch, i )
+ If_ObjPerformMappingLI( p, pLatch );
+ // assign cuts to primary inputs
+ If_ManForEachLatch( p, pLatch, i )
+ If_ObjPerformMappingLO( p, pLatch, If_ManPi(p, If_ManPiNum(p) - If_ManPoNum(p) + i) );
+ // map the nodes
+ If_ManForEachNode( p, pObj, i )
+ If_ObjPerformMapping( p, pObj, 0 );
+ }
+
+ if ( p->pPars->fVerbose )
+ {
+ PRT( "Total time", clock() - clkTotal );
+ }
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs sequential mapping.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void If_CutLift( If_Cut_t * pCut )
+{
+ int i;
+ for ( i = 0; i < pCut->nLeaves; i++ )
+ pCut->pLeaves[i] = ((pCut->pLeaves[i] >> 8) << 8) | ((pCut->pLeaves[i] & 255) + 1);
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs sequential mapping.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void If_ObjPerformMappingLI( If_Man_t * p, If_Obj_t * pLatch )
+{
+ If_Obj_t * pFanin;
+ int c;
+ assert( If_ObjIsPo(pLatch) );
+ pFanin = If_ObjFanin0(pLatch);
+ for ( c = 0; c < pFanin->nCuts; c++ )
+ If_CutCopy( pLatch->Cuts + c, pFanin->Cuts + c );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs sequential mapping.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void If_ObjPerformMappingLO( If_Man_t * p, If_Obj_t * pLatch, If_Obj_t * pObj )
+{
+ If_Cut_t * pCut;
+ int c, Limit = IF_MIN( p->nCuts + 1, p->nCutsUsed );
+ assert( If_ObjIsPo(pLatch) );
+ for ( c = 1; c < Limit; c++ )
+ {
+ pCut = pObj->Cuts + c;
+ If_CutCopy( pCut, pLatch->Cuts + c - 1 );
+ If_CutLift( pCut );
+ pCut->Delay -= p->Fi;
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs sequential mapping.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int If_ManMappingSeqConverged( If_Man_t * p )
+{
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+