diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2017-09-18 08:27:05 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2017-09-18 08:27:05 -0700 |
commit | 3a1032c151360c99334c559d93b0068bf4b2a3f5 (patch) | |
tree | a7581775285b0fbc6f37b0f9538e7c9d91a8f7d2 /src/map | |
parent | 7e7ba1562e1c868bd9ece855fb309ea9a409e38d (diff) | |
download | abc-3a1032c151360c99334c559d93b0068bf4b2a3f5.tar.gz abc-3a1032c151360c99334c559d93b0068bf4b2a3f5.tar.bz2 abc-3a1032c151360c99334c559d93b0068bf4b2a3f5.zip |
Maintenance and updates.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/if/if.h | 1 | ||||
-rw-r--r-- | src/map/mio/mio.h | 1 | ||||
-rw-r--r-- | src/map/mio/mioFunc.c | 5 | ||||
-rw-r--r-- | src/map/mio/mioUtils.c | 49 |
4 files changed, 56 insertions, 0 deletions
diff --git a/src/map/if/if.h b/src/map/if/if.h index e822a0ad..0dd5e01c 100644 --- a/src/map/if/if.h +++ b/src/map/if/if.h @@ -267,6 +267,7 @@ struct If_Man_t_ Vec_Int_t * vCutData; // cut data storage int pArrTimeProfile[IF_MAX_FUNC_LUTSIZE]; Vec_Ptr_t * vVisited; + void * pUserMan; // timing manager Tim_Man_t * pManTim; diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h index a957f33c..0704a8d5 100644 --- a/src/map/mio/mio.h +++ b/src/map/mio/mio.h @@ -198,6 +198,7 @@ extern Mio_Gate_t ** Mio_CollectRoots( Mio_Library_t * pLib, int nInputs, fl extern Mio_Cell_t * Mio_CollectRootsNew( Mio_Library_t * pLib, int nInputs, int * pnGates, int fVerbose ); extern Mio_Cell_t * Mio_CollectRootsNewDefault( int nInputs, int * pnGates, int fVerbose ); extern Mio_Cell2_t * Mio_CollectRootsNewDefault2( int nInputs, int * pnGates, int fVerbose ); +extern int Mio_CollectRootsNewDefault3( int nInputs, Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths ); extern word Mio_DeriveTruthTable6( Mio_Gate_t * pGate ); extern void Mio_DeriveTruthTable( Mio_Gate_t * pGate, unsigned uTruthsIn[][2], int nSigns, int nInputs, unsigned uTruthRes[] ); extern void Mio_DeriveGateDelays( Mio_Gate_t * pGate, diff --git a/src/map/mio/mioFunc.c b/src/map/mio/mioFunc.c index 536f5496..c059668c 100644 --- a/src/map/mio/mioFunc.c +++ b/src/map/mio/mioFunc.c @@ -268,6 +268,11 @@ int Mio_GateParseFormula( Mio_Gate_t * pGate ) // derive truth table if ( nPins <= 6 ) pGate->uTruth = Exp_Truth6( nPins, pGate->vExpr, NULL ); + else if ( nPins <= 8 ) + { + pGate->pTruth = ABC_CALLOC( word, 4 ); + Exp_Truth8( nPins, pGate->vExpr, NULL, pGate->pTruth ); + } /* // verify diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c index 428eb92b..22ce244a 100644 --- a/src/map/mio/mioUtils.c +++ b/src/map/mio/mioUtils.c @@ -790,6 +790,55 @@ Mio_Cell2_t * Mio_CollectRootsNewDefault2( int nInputs, int * pnGates, int fVerb SeeAlso [] ***********************************************************************/ +int Mio_CollectRootsNewDefault3( int nInputs, Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths ) +{ + Mio_Library_t * pLib = (Mio_Library_t *)Abc_FrameReadLibGen(); + int i, iGate = 0, nGates = pLib ? Mio_LibraryReadGateNum( pLib ) : 0; + Mio_Gate_t * pGate0, ** ppGates; word * pTruth; + if ( pLib == NULL ) + return 0; + ppGates = ABC_CALLOC( Mio_Gate_t *, nGates ); + Mio_LibraryForEachGate( pLib, pGate0 ) + ppGates[pGate0->Cell] = pGate0; + *pvNames = Vec_PtrAlloc( nGates ); + *pvTruths = Vec_WrdStart( nGates * 4 ); + for ( i = 0; i < nGates; i++ ) + { + pGate0 = ppGates[i]; + if ( pGate0->nInputs > nInputs || pGate0->pTwin ) // skip large and multi-output + continue; + Vec_PtrPush( *pvNames, pGate0->pName ); + pTruth = Vec_WrdEntryP( *pvTruths, iGate++*4 ); + if ( pGate0->nInputs <= 6 ) + pTruth[0] = pTruth[1] = pTruth[2] = pTruth[3] = pGate0->uTruth; + else if ( pGate0->nInputs == 7 ) + { + pTruth[0] = pTruth[2] = pGate0->pTruth[0]; + pTruth[1] = pTruth[3] = pGate0->pTruth[1]; + } + else if ( pGate0->nInputs == 8 ) + memcpy( pTruth, pGate0->pTruth, 4*sizeof(word) ); + } + assert( iGate == nGates ); + assert( Vec_WrdEntry(*pvTruths, 0) == 0 ); + assert( Vec_WrdEntry(*pvTruths, 4) == ~(word)0 ); + assert( Vec_WrdEntry(*pvTruths, 8) == s_Truths6[0] ); + assert( Vec_WrdEntry(*pvTruths, 12) == ~s_Truths6[0] ); + ABC_FREE( ppGates ); + return nGates; +} + +/**Function************************************************************* + + Synopsis [Derives the truth table of the gate.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ word Mio_DeriveTruthTable6( Mio_Gate_t * pGate ) { static unsigned uTruths6[6][2] = { |