summaryrefslogtreecommitdiffstats
path: root/src/map/mio
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-11-09 21:17:44 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2016-11-09 21:17:44 -0800
commitc6afb9db639b7ce0ac714e4e63e629b4c8bf1ac1 (patch)
treedbe61b94bc8596f650453ba1a7f727d6ae4cb71e /src/map/mio
parent6cd66183e4304eb66805b8236642bf1f85cfa14f (diff)
downloadabc-c6afb9db639b7ce0ac714e4e63e629b4c8bf1ac1.tar.gz
abc-c6afb9db639b7ce0ac714e4e63e629b4c8bf1ac1.tar.bz2
abc-c6afb9db639b7ce0ac714e4e63e629b4c8bf1ac1.zip
Equivalent fault detection code.
Diffstat (limited to 'src/map/mio')
-rw-r--r--src/map/mio/mio.h1
-rw-r--r--src/map/mio/mioApi.c1
-rw-r--r--src/map/mio/mioRead.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h
index f45cce89..6e16a57f 100644
--- a/src/map/mio/mio.h
+++ b/src/map/mio/mio.h
@@ -112,6 +112,7 @@ extern char * Mio_LibraryReadName ( Mio_Library_t * pLib );
extern int Mio_LibraryReadGateNum ( Mio_Library_t * pLib );
extern Mio_Gate_t * Mio_LibraryReadGates ( Mio_Library_t * pLib );
extern Mio_Gate_t ** Mio_LibraryReadGateArray ( Mio_Library_t * pLib );
+extern Mio_Gate_t * Mio_LibraryReadGateById ( Mio_Library_t * pLib, int iD );
extern Mio_Gate_t * Mio_LibraryReadGateByName ( Mio_Library_t * pLib, char * pName, char * pOutName );
extern char * Mio_LibraryReadSopByName ( Mio_Library_t * pLib, char * pName );
extern Mio_Gate_t * Mio_LibraryReadGateByTruth( Mio_Library_t * pLib, word t );
diff --git a/src/map/mio/mioApi.c b/src/map/mio/mioApi.c
index bb601a05..38e754a6 100644
--- a/src/map/mio/mioApi.c
+++ b/src/map/mio/mioApi.c
@@ -44,6 +44,7 @@ char * Mio_LibraryReadName ( Mio_Library_t * pLib ) { retur
int Mio_LibraryReadGateNum ( Mio_Library_t * pLib ) { return pLib->nGates; }
Mio_Gate_t * Mio_LibraryReadGates ( Mio_Library_t * pLib ) { return pLib->pGates; }
Mio_Gate_t ** Mio_LibraryReadGateArray ( Mio_Library_t * pLib ) { return pLib->ppGatesName;}
+Mio_Gate_t * Mio_LibraryReadGateById ( Mio_Library_t * pLib, int Id ) { assert( pLib->ppGates0[Id]->Cell == Id ); return pLib->ppGates0[Id];}
Mio_Gate_t * Mio_LibraryReadBuf ( Mio_Library_t * pLib ) { return pLib->pGateBuf; }
Mio_Gate_t * Mio_LibraryReadInv ( Mio_Library_t * pLib ) { return pLib->pGateInv; }
Mio_Gate_t * Mio_LibraryReadConst0 ( Mio_Library_t * pLib ) { return pLib->pGate0; }
diff --git a/src/map/mio/mioRead.c b/src/map/mio/mioRead.c
index b170256d..798458f3 100644
--- a/src/map/mio/mioRead.c
+++ b/src/map/mio/mioRead.c
@@ -586,7 +586,10 @@ void Mio_LibrarySortGates( Mio_Library_t * pLib )
int i = 0;
ppGates = ABC_ALLOC( Mio_Gate_t *, pLib->nGates );
Mio_LibraryForEachGate( pLib, pGate )
+ {
+ pGate->Cell = i;
ppGates[i++] = pGate;
+ }
assert( i == pLib->nGates );
// sort gates by name
pLib->ppGates0 = ABC_ALLOC( Mio_Gate_t *, pLib->nGates );