summaryrefslogtreecommitdiffstats
path: root/src/map/mio
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-11-08 19:59:34 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2015-11-08 19:59:34 -0800
commit3c9f7d2bc8180462635eda6e1c7ae5b4208f2078 (patch)
treecdf01221b53d206703b4a749187a6f871bf1e753 /src/map/mio
parent81e1f9fef3eda8af31a5535f7bdd6754b76f2a5d (diff)
downloadabc-3c9f7d2bc8180462635eda6e1c7ae5b4208f2078.tar.gz
abc-3c9f7d2bc8180462635eda6e1c7ae5b4208f2078.tar.bz2
abc-3c9f7d2bc8180462635eda6e1c7ae5b4208f2078.zip
Extending and improving timing manager.
Diffstat (limited to 'src/map/mio')
-rw-r--r--src/map/mio/mio.h1
-rw-r--r--src/map/mio/mioApi.c2
-rw-r--r--src/map/mio/mioRead.c1
-rw-r--r--src/map/mio/mioUtils.c40
4 files changed, 43 insertions, 1 deletions
diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h
index 669f8bc7..0baf73ec 100644
--- a/src/map/mio/mio.h
+++ b/src/map/mio/mio.h
@@ -199,6 +199,7 @@ extern void Mio_LibraryShiftDelay( Mio_Library_t * pLib, double Shi
extern void Mio_LibraryMultiArea( Mio_Library_t * pLib, double Multi );
extern void Mio_LibraryMultiDelay( Mio_Library_t * pLib, double Multi );
extern void Mio_LibraryTransferDelays( Mio_Library_t * pLibD, Mio_Library_t * pLibS );
+extern void Mio_LibraryTransferCellIds();
/*=== sclUtil.c =========================================================*/
extern Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl );
diff --git a/src/map/mio/mioApi.c b/src/map/mio/mioApi.c
index 8af85193..4b469ba2 100644
--- a/src/map/mio/mioApi.c
+++ b/src/map/mio/mioApi.c
@@ -180,7 +180,7 @@ word * Mio_GateReadTruthP ( Mio_Gate_t * pGate ) { return
int Mio_GateReadValue ( Mio_Gate_t * pGate ) { return pGate->Value; }
int Mio_GateReadCell ( Mio_Gate_t * pGate ) { return pGate->Cell; }
void Mio_GateSetValue ( Mio_Gate_t * pGate, int Value ) { pGate->Value = Value; }
-void Mio_GateSetCell ( Mio_Gate_t * pGate, int Cell ) { pGate->Value = Cell; }
+void Mio_GateSetCell ( Mio_Gate_t * pGate, int Cell ) { pGate->Cell = Cell; }
int Mio_GateIsInv ( Mio_Gate_t * pGate ) { return pGate->uTruth == ABC_CONST(0x5555555555555555); }
/**Function*************************************************************
diff --git a/src/map/mio/mioRead.c b/src/map/mio/mioRead.c
index 0364d363..f9a16b18 100644
--- a/src/map/mio/mioRead.c
+++ b/src/map/mio/mioRead.c
@@ -347,6 +347,7 @@ Mio_Gate_t * Mio_LibraryReadGate( char ** ppToken, int fExtendedFormat )
// allocate the gate structure
pGate = ABC_CALLOC( Mio_Gate_t, 1 );
+ pGate->Cell = -1;
// read the name
pToken = strtok( NULL, " \t\r\n" );
diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c
index 16a5502f..623b7c84 100644
--- a/src/map/mio/mioUtils.c
+++ b/src/map/mio/mioUtils.c
@@ -22,6 +22,7 @@
#include "exp.h"
#include "misc/util/utilTruth.h"
#include "opt/dau/dau.h"
+#include "map/scl/sclLib.h"
ABC_NAMESPACE_IMPL_START
@@ -1305,6 +1306,45 @@ void Nf_ManPrepareLibraryTest2()
}
+/**Function*************************************************************
+
+ Synopsis [Install library.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Mio_LibraryTransferCellIds()
+{
+ Mio_Gate_t * pGate;
+ Mio_Library_t * pLib = (Mio_Library_t *)Abc_FrameReadLibGen();
+ SC_Lib * pScl = (SC_Lib *)Abc_FrameReadLibScl();
+ int CellId;
+ if ( pScl == NULL )
+ {
+ printf( "SC library cannot be found.\n" );
+ return;
+ }
+ if ( pLib == NULL )
+ {
+ printf( "Genlib library cannot be found.\n" );
+ return;
+ }
+ Mio_LibraryForEachGate( pLib, pGate )
+ {
+ if ( Mio_GateReadPinNum(pGate) == 0 )
+ continue;
+ CellId = Abc_SclCellFind( pScl, Mio_GateReadName(pGate) );
+ if ( CellId < 0 )
+ printf( "Cannot find cell ID of gate %s.\n", Mio_GateReadName(pGate) );
+ else
+ Mio_GateSetCell( pGate, CellId );
+ }
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///