diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-05-12 20:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-05-12 20:01:00 -0700 |
commit | 37b6c727f1276d9d97a79a8f40271aee446a4ba4 (patch) | |
tree | 069004bcd7c14e786e9d67e1d407ce2bef4688c0 /src | |
parent | cb899ec848984b194a9c227c7a01f147454ce591 (diff) | |
download | abc-37b6c727f1276d9d97a79a8f40271aee446a4ba4.tar.gz abc-37b6c727f1276d9d97a79a8f40271aee446a4ba4.tar.bz2 abc-37b6c727f1276d9d97a79a8f40271aee446a4ba4.zip |
Version abc80512_2
Diffstat (limited to 'src')
-rw-r--r-- | src/aig/fra/fraCore.c | 6 | ||||
-rw-r--r-- | src/aig/ivy/ivyFraig.c | 6 | ||||
-rw-r--r-- | src/base/abc/abc.h | 2 | ||||
-rw-r--r-- | src/base/abc/abcBlifMv.c | 127 | ||||
-rw-r--r-- | src/base/abci/abc.c | 14 | ||||
-rw-r--r-- | src/base/abci/abcDar.c | 4 | ||||
-rw-r--r-- | src/base/abci/abcMiter.c | 105 | ||||
-rw-r--r-- | src/base/abci/abcRr.c | 2 | ||||
-rw-r--r-- | src/base/abci/abcVerify.c | 12 |
9 files changed, 231 insertions, 47 deletions
diff --git a/src/aig/fra/fraCore.c b/src/aig/fra/fraCore.c index 75de8a71..11e69b59 100644 --- a/src/aig/fra/fraCore.c +++ b/src/aig/fra/fraCore.c @@ -77,6 +77,12 @@ int Fra_FraigMiterStatus( Aig_Man_t * p ) CountNonConst0++; continue; } + // check if the output is a primary input + if ( p->nRegs == 0 && Aig_ObjIsPi(Aig_Regular(pChild)) ) + { + CountNonConst0++; + continue; + } // check if the output can be not constant 0 if ( Aig_Regular(pChild)->fPhase != (unsigned)Aig_IsComplement(pChild) ) { diff --git a/src/aig/ivy/ivyFraig.c b/src/aig/ivy/ivyFraig.c index 46dddab2..d049d660 100644 --- a/src/aig/ivy/ivyFraig.c +++ b/src/aig/ivy/ivyFraig.c @@ -1815,6 +1815,12 @@ int Ivy_FraigMiterStatus( Ivy_Man_t * pMan ) CountConst0++; continue; } + // check if the output is a primary input + if ( Ivy_ObjIsPi(Ivy_Regular(pObjNew)) ) + { + CountNonConst0++; + continue; + } // check if the output can be constant 0 if ( Ivy_Regular(pObjNew)->fPhase != (unsigned)Ivy_IsComplement(pObjNew) ) { diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h index 10bab783..15043266 100644 --- a/src/base/abc/abc.h +++ b/src/base/abc/abc.h @@ -648,7 +648,7 @@ extern int Abc_NodeMinimumBase( Abc_Obj_t * pNode ); extern int Abc_NtkRemoveDupFanins( Abc_Ntk_t * pNtk ); extern int Abc_NodeRemoveDupFanins( Abc_Obj_t * pNode ); /*=== abcMiter.c ==========================================================*/ -extern Abc_Ntk_t * Abc_NtkMiter( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic ); +extern Abc_Ntk_t * Abc_NtkMiter( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic, int fMulti ); extern void Abc_NtkMiterAddCone( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkMiter, Abc_Obj_t * pNode ); extern Abc_Ntk_t * Abc_NtkMiterAnd( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOr, int fCompl2 ); extern Abc_Ntk_t * Abc_NtkMiterCofactor( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues ); diff --git a/src/base/abc/abcBlifMv.c b/src/base/abc/abcBlifMv.c index 48ec58c0..428fc6af 100644 --- a/src/base/abc/abcBlifMv.c +++ b/src/base/abc/abcBlifMv.c @@ -162,7 +162,11 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj ) // skip space if present if ( *pSop == ' ' ) pSop++; - Index = Abc_StringGetNumber( &pSop ); + // assume don't-care constant to be zero + if ( *pSop == '-' ) + Index = 0; + else + Index = Abc_StringGetNumber( &pSop ); assert( Index < nValues ); pValues[Index] = Abc_AigConst1(pNtkNew); // save the values in the fanout net @@ -365,6 +369,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) Abc_Ntk_t * pNtkNew; Abc_Obj_t * pObj, * pTemp, * pBit, * pNet; int i, k, v, nValues, nValuesMax, nBits; + int nCount1, nCount2; assert( Abc_NtkIsNetlist(pNtk) ); assert( Abc_NtkHasBlifMv(pNtk) ); @@ -393,12 +398,15 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) pNtkNew->pName = Extra_UtilStrsav( pNtk->pName ); // pNtkNew->pSpec = Extra_UtilStrsav( pNtk->pName ); + nCount1 = nCount2 = 0; // encode the CI nets Abc_NtkIncrementTravId( pNtk ); if ( fUsePositional ) { Abc_NtkForEachCi( pNtk, pObj, i ) { + if ( !Abc_ObjIsPi(pObj) ) + continue; pNet = Abc_ObjFanout0(pObj); nValues = Abc_ObjMvVarNum(pNet); pValues = ALLOC( Abc_Obj_t *, nValues ); @@ -413,11 +421,32 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) // mark the net Abc_NodeSetTravIdCurrent( pNet ); } + Abc_NtkForEachCi( pNtk, pObj, i ) + { + if ( Abc_ObjIsPi(pObj) ) + continue; + pNet = Abc_ObjFanout0(pObj); + nValues = Abc_ObjMvVarNum(pNet); + pValues = ALLOC( Abc_Obj_t *, nValues ); + // create PIs for the values + for ( v = 0; v < nValues; v++ ) + { + pValues[v] = Abc_NtkCreateBo( pNtkNew ); + Abc_NtkConvertAssignName( pValues[v], pNet, v ); + nCount1++; + } + // save the values in the fanout net + pNet->pCopy = (Abc_Obj_t *)pValues; + // mark the net + Abc_NodeSetTravIdCurrent( pNet ); + } } else { Abc_NtkForEachCi( pNtk, pObj, i ) { + if ( !Abc_ObjIsPi(pObj) ) + continue; pNet = Abc_ObjFanout0(pObj); nValues = Abc_ObjMvVarNum(pNet); pValues = ALLOC( Abc_Obj_t *, nValues ); @@ -443,6 +472,36 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) // mark the net Abc_NodeSetTravIdCurrent( pNet ); } + Abc_NtkForEachCi( pNtk, pObj, i ) + { + if ( Abc_ObjIsPi(pObj) ) + continue; + pNet = Abc_ObjFanout0(pObj); + nValues = Abc_ObjMvVarNum(pNet); + pValues = ALLOC( Abc_Obj_t *, nValues ); + // create PIs for the encoding bits + nBits = Extra_Base2Log( nValues ); + for ( k = 0; k < nBits; k++ ) + { + pBits[k] = Abc_NtkCreateBo( pNtkNew ); + Abc_NtkConvertAssignName( pBits[k], pNet, k ); + nCount1++; + } + // encode the values + for ( v = 0; v < nValues; v++ ) + { + pValues[v] = Abc_AigConst1(pNtkNew); + for ( k = 0; k < nBits; k++ ) + { + pBit = Abc_ObjNotCond( pBits[k], (v&(1<<k)) == 0 ); + pValues[v] = Abc_AigAnd( pNtkNew->pManFunc, pValues[v], pBit ); + } + } + // save the values in the fanout net + pNet->pCopy = (Abc_Obj_t *)pValues; + // mark the net + Abc_NodeSetTravIdCurrent( pNet ); + } } // process nodes in the topological order @@ -459,6 +518,8 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) { Abc_NtkForEachCo( pNtk, pObj, i ) { + if ( !Abc_ObjIsPo(pObj) ) + continue; pNet = Abc_ObjFanin0(pObj); // skip marked nets if ( Abc_NodeIsTravIdCurrent(pNet) ) @@ -473,11 +534,32 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) Abc_NtkConvertAssignName( pTemp, pNet, v ); } } + Abc_NtkForEachCo( pNtk, pObj, i ) + { + if ( Abc_ObjIsPo(pObj) ) + continue; + pNet = Abc_ObjFanin0(pObj); + // skip marked nets + if ( Abc_NodeIsTravIdCurrent(pNet) ) + continue; + Abc_NodeSetTravIdCurrent( pNet ); + nValues = Abc_ObjMvVarNum(pNet); + pValues = (Abc_Obj_t **)pNet->pCopy; + for ( v = 0; v < nValues; v++ ) + { + pTemp = Abc_NtkCreateBi( pNtkNew ); + Abc_ObjAddFanin( pTemp, pValues[v] ); + Abc_NtkConvertAssignName( pTemp, pNet, v ); + nCount2++; + } + } } else { Abc_NtkForEachCo( pNtk, pObj, i ) { + if ( !Abc_ObjIsPo(pObj) ) + continue; pNet = Abc_ObjFanin0(pObj); // skip marked nets if ( Abc_NodeIsTravIdCurrent(pNet) ) @@ -497,6 +579,49 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk ) Abc_NtkConvertAssignName( pTemp, pNet, k ); } } + Abc_NtkForEachCo( pNtk, pObj, i ) + { + if ( Abc_ObjIsPo(pObj) ) + continue; + pNet = Abc_ObjFanin0(pObj); + // skip marked nets + if ( Abc_NodeIsTravIdCurrent(pNet) ) + continue; + Abc_NodeSetTravIdCurrent( pNet ); + nValues = Abc_ObjMvVarNum(pNet); + pValues = (Abc_Obj_t **)pNet->pCopy; + nBits = Extra_Base2Log( nValues ); + for ( k = 0; k < nBits; k++ ) + { + pBit = Abc_ObjNot( Abc_AigConst1(pNtkNew) ); + for ( v = 0; v < nValues; v++ ) + if ( v & (1<<k) ) + pBit = Abc_AigOr( pNtkNew->pManFunc, pBit, pValues[v] ); + pTemp = Abc_NtkCreateBi( pNtkNew ); + Abc_ObjAddFanin( pTemp, pBit ); + Abc_NtkConvertAssignName( pTemp, pNet, k ); + nCount2++; + } + } + } + + if ( Abc_NtkLatchNum(pNtk) ) + { + Abc_Obj_t * pLatch, * pObjLi, * pObjLo; + int i; + assert( nCount1 == nCount2 ); + for ( i = 0; i < nCount1; i++ ) + { + // create latch + pLatch = Abc_NtkCreateLatch( pNtkNew ); + Abc_LatchSetInit0( pLatch ); + Abc_ObjAssignName( pLatch, Abc_ObjName(pLatch), NULL ); + // connect + pObjLi = Abc_NtkCo( pNtkNew, Abc_NtkCoNum(pNtkNew)-nCount1+i ); + pObjLo = Abc_NtkCi( pNtkNew, Abc_NtkCiNum(pNtkNew)-nCount1+i ); + Abc_ObjAddFanin( pLatch, pObjLi ); + Abc_ObjAddFanin( pObjLo, pLatch ); + } } // cleanup diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 5725aaf0..151e9ddc 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -4668,6 +4668,7 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv ) int fCheck; int fComb; int fImplic; + int fMulti; int nPartSize; pNtk = Abc_FrameReadNtk(pAbc); @@ -4678,9 +4679,10 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv ) fComb = 1; fCheck = 1; fImplic = 0; + fMulti = 0; nPartSize = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Pcih" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "Pcmih" ) ) != EOF ) { switch ( c ) { @@ -4698,6 +4700,9 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv ) case 'c': fComb ^= 1; break; + case 'm': + fMulti ^= 1; + break; case 'i': fImplic ^= 1; break; @@ -4712,7 +4717,7 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv ) return 1; // compute the miter - pNtkRes = Abc_NtkMiter( pNtk1, pNtk2, fComb, nPartSize, fImplic ); + pNtkRes = Abc_NtkMiter( pNtk1, pNtk2, fComb, nPartSize, fImplic, fMulti ); if ( fDelete1 ) Abc_NtkDelete( pNtk1 ); if ( fDelete2 ) Abc_NtkDelete( pNtk2 ); @@ -4731,11 +4736,12 @@ usage: strcpy( Buffer, "unused" ); else sprintf( Buffer, "%d", nPartSize ); - fprintf( pErr, "usage: miter [-P num] [-cih] <file1> <file2>\n" ); + fprintf( pErr, "usage: miter [-P num] [-cimh] <file1> <file2>\n" ); fprintf( pErr, "\t computes the miter of the two circuits\n" ); fprintf( pErr, "\t-P num : output partition size [default = %s]\n", Buffer ); fprintf( pErr, "\t-c : toggles deriving combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" ); fprintf( pErr, "\t-i : toggles deriving implication miter (file1 => file2) [default = %s]\n", fImplic? "yes": "no" ); + fprintf( pErr, "\t-m : toggles creating multi-output miters [default = %s]\n", fMulti? "yes": "no" ); fprintf( pErr, "\t-h : print the command usage\n"); fprintf( pErr, "\tfile1 : (optional) the file with the first network\n"); fprintf( pErr, "\tfile2 : (optional) the file with the second network\n"); @@ -14132,7 +14138,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - fprintf( pErr, "usage: dprove [-F num] [-T num] [-carmfwvh]\n" ); + fprintf( pErr, "usage: dprove [-F num] [-T num] [-cbarmfwvh]\n" ); fprintf( pErr, "\t performs SEC on the sequential miter\n" ); fprintf( pErr, "\t-F num : the limit on the depth of induction [default = %d]\n", nFrames ); fprintf( pErr, "\t-T num : the approximate runtime limit (in seconds) [default = %d]\n", TimeLimit ); diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c index ef1fbebc..13683e4f 100644 --- a/src/base/abci/abcDar.c +++ b/src/base/abci/abcDar.c @@ -1033,7 +1033,7 @@ int Abc_NtkDarCec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fPartition, int fVe if ( pNtk2 != NULL ) { // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); @@ -1380,7 +1380,7 @@ int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fPhase int RetValue; // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); diff --git a/src/base/abci/abcMiter.c b/src/base/abci/abcMiter.c index 3e3c9580..9bab238b 100644 --- a/src/base/abci/abcMiter.c +++ b/src/base/abci/abcMiter.c @@ -24,10 +24,10 @@ /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -static Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic ); -static void Abc_NtkMiterPrepare( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize ); +static Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic, int fMulti ); +static void Abc_NtkMiterPrepare( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize, int fMulti ); static void Abc_NtkMiterAddOne( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkMiter ); -static void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize, int fImplic ); +static void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize, int fImplic, int fMulti ); static void Abc_NtkAddFrame( Abc_Ntk_t * pNetNew, Abc_Ntk_t * pNet, int iFrame ); // to be exported @@ -50,7 +50,7 @@ static void Abc_NtkAddFrame2( Abc_Ntk_t * pNtkFrames, Abc_Ntk_t * pNtk, i SeeAlso [] ***********************************************************************/ -Abc_Ntk_t * Abc_NtkMiter( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic ) +Abc_Ntk_t * Abc_NtkMiter( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic, int fMulti ) { Abc_Ntk_t * pTemp = NULL; int fRemove1, fRemove2; @@ -63,7 +63,7 @@ Abc_Ntk_t * Abc_NtkMiter( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int n fRemove1 = (!Abc_NtkIsStrash(pNtk1)) && (pNtk1 = Abc_NtkStrash(pNtk1, 0, 0, 0)); fRemove2 = (!Abc_NtkIsStrash(pNtk2)) && (pNtk2 = Abc_NtkStrash(pNtk2, 0, 0, 0)); if ( pNtk1 && pNtk2 ) - pTemp = Abc_NtkMiterInt( pNtk1, pNtk2, fComb, nPartSize, fImplic ); + pTemp = Abc_NtkMiterInt( pNtk1, pNtk2, fComb, nPartSize, fImplic, fMulti ); if ( fRemove1 ) Abc_NtkDelete( pNtk1 ); if ( fRemove2 ) Abc_NtkDelete( pNtk2 ); return pTemp; @@ -80,7 +80,7 @@ Abc_Ntk_t * Abc_NtkMiter( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int n SeeAlso [] ***********************************************************************/ -Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic ) +Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, int nPartSize, int fImplic, int fMulti ) { char Buffer[1000]; Abc_Ntk_t * pNtkMiter; @@ -94,10 +94,10 @@ Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, in pNtkMiter->pName = Extra_UtilStrsav(Buffer); // perform strashing - Abc_NtkMiterPrepare( pNtk1, pNtk2, pNtkMiter, fComb, nPartSize ); + Abc_NtkMiterPrepare( pNtk1, pNtk2, pNtkMiter, fComb, nPartSize, fMulti ); Abc_NtkMiterAddOne( pNtk1, pNtkMiter ); Abc_NtkMiterAddOne( pNtk2, pNtkMiter ); - Abc_NtkMiterFinalize( pNtk1, pNtk2, pNtkMiter, fComb, nPartSize, fImplic ); + Abc_NtkMiterFinalize( pNtk1, pNtk2, pNtkMiter, fComb, nPartSize, fImplic, fMulti ); Abc_AigCleanup(pNtkMiter->pManFunc); // make sure that everything is okay @@ -121,7 +121,7 @@ Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, in SeeAlso [] ***********************************************************************/ -void Abc_NtkMiterPrepare( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize ) +void Abc_NtkMiterPrepare( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize, int fMulti ) { Abc_Obj_t * pObj, * pObjNew; int i; @@ -146,10 +146,21 @@ void Abc_NtkMiterPrepare( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtk } if ( nPartSize <= 0 ) { - // create the only PO - pObjNew = Abc_NtkCreatePo( pNtkMiter ); - // add the PO name - Abc_ObjAssignName( pObjNew, "miter", NULL ); + // create POs + if ( fMulti ) + { + Abc_NtkForEachCo( pNtk1, pObj, i ) + { + pObjNew = Abc_NtkCreatePo( pNtkMiter ); + Abc_ObjAssignName( pObjNew, "miter", Abc_ObjName(pObjNew) ); + } + + } + else + { + pObjNew = Abc_NtkCreatePo( pNtkMiter ); + Abc_ObjAssignName( pObjNew, "miter", NULL ); + } } } else @@ -167,10 +178,21 @@ void Abc_NtkMiterPrepare( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtk } if ( nPartSize <= 0 ) { - // create the only PO - pObjNew = Abc_NtkCreatePo( pNtkMiter ); - // add the PO name - Abc_ObjAssignName( pObjNew, "miter", NULL ); + // create POs + if ( fMulti ) + { + Abc_NtkForEachPo( pNtk1, pObj, i ) + { + pObjNew = Abc_NtkCreatePo( pNtkMiter ); + Abc_ObjAssignName( pObjNew, "miter", Abc_ObjName(pObjNew) ); + } + + } + else + { + pObjNew = Abc_NtkCreatePo( pNtkMiter ); + Abc_ObjAssignName( pObjNew, "miter", NULL ); + } } // create the latches Abc_NtkForEachLatch( pNtk1, pObj, i ) @@ -250,11 +272,12 @@ void Abc_NtkMiterAddCone( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkMiter, Abc_Obj_t * p SeeAlso [] ***********************************************************************/ -void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize, int fImplic ) +void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNtkMiter, int fComb, int nPartSize, int fImplic, int fMulti ) { Vec_Ptr_t * vPairs; Abc_Obj_t * pMiter, * pNode; int i; + assert( nPartSize == 0 || fMulti == 0 ); // collect the PO pairs from both networks vPairs = Vec_PtrAlloc( 100 ); if ( fComb ) @@ -262,9 +285,17 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt // collect the CO nodes for the miter Abc_NtkForEachCo( pNtk1, pNode, i ) { - Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); - pNode = Abc_NtkCo( pNtk2, i ); - Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); + if ( fMulti ) + { + pMiter = Abc_AigXor( pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild0Copy(Abc_NtkCo(pNtk2, i)) ); + Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,i), pMiter ); + } + else + { + Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); + pNode = Abc_NtkCo( pNtk2, i ); + Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); + } } } else @@ -272,9 +303,17 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt // collect the PO nodes for the miter Abc_NtkForEachPo( pNtk1, pNode, i ) { - Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); - pNode = Abc_NtkPo( pNtk2, i ); - Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); + if ( fMulti ) + { + pMiter = Abc_AigXor( pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild0Copy(Abc_NtkCo(pNtk2, i)) ); + Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,i), pMiter ); + } + else + { + Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); + pNode = Abc_NtkPo( pNtk2, i ); + Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) ); + } } // connect new latches Abc_NtkForEachLatch( pNtk1, pNode, i ) @@ -285,9 +324,11 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt // add the miter if ( nPartSize <= 0 ) { - pMiter = Abc_AigMiter( pNtkMiter->pManFunc, vPairs, fImplic ); - Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter ); - Vec_PtrFree( vPairs ); + if ( !fMulti ) + { + pMiter = Abc_AigMiter( pNtkMiter->pManFunc, vPairs, fImplic ); + Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter ); + } } else { @@ -320,8 +361,8 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt Abc_ObjAssignName( pNode, "miter_", Buffer ); } Vec_PtrFree( vPairsPart ); - Vec_PtrFree( vPairs ); } + Vec_PtrFree( vPairs ); } @@ -361,7 +402,7 @@ Abc_Ntk_t * Abc_NtkMiterAnd( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOr, int pNtkMiter->pName = Extra_UtilStrsav(Buffer); // perform strashing - Abc_NtkMiterPrepare( pNtk1, pNtk2, pNtkMiter, 1, -1 ); + Abc_NtkMiterPrepare( pNtk1, pNtk2, pNtkMiter, 1, -1, 0 ); Abc_NtkMiterAddOne( pNtk1, pNtkMiter ); Abc_NtkMiterAddOne( pNtk2, pNtkMiter ); // Abc_NtkMiterFinalize( pNtk1, pNtk2, pNtkMiter, 1 ); @@ -420,7 +461,7 @@ Abc_Ntk_t * Abc_NtkMiterCofactor( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues ) pRoot = Abc_NtkCo( pNtk, 0 ); // perform strashing - Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1 ); + Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1, 0 ); // set the first cofactor Vec_IntForEachEntry( vPiValues, Value, i ) { @@ -488,7 +529,7 @@ Abc_Ntk_t * Abc_NtkMiterForCofactors( Abc_Ntk_t * pNtk, int Out, int In1, int In pRoot = Abc_NtkCo( pNtk, Out ); // perform strashing - Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1 ); + Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1, 0 ); // set the first cofactor Abc_NtkCi(pNtk, In1)->pCopy = Abc_ObjNot( Abc_AigConst1(pNtkMiter) ); if ( In2 >= 0 ) @@ -553,7 +594,7 @@ Abc_Ntk_t * Abc_NtkMiterQuantify( Abc_Ntk_t * pNtk, int In, int fExist ) pRoot = Abc_NtkCo( pNtk, 0 ); // perform strashing - Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1 ); + Abc_NtkMiterPrepare( pNtk, pNtk, pNtkMiter, 1, -1, 0 ); // set the first cofactor Abc_NtkCi(pNtk, In)->pCopy = Abc_ObjNot( Abc_AigConst1(pNtkMiter) ); // add the first cofactor diff --git a/src/base/abci/abcRr.c b/src/base/abci/abcRr.c index 80d234f1..c33444df 100644 --- a/src/base/abci/abcRr.c +++ b/src/base/abci/abcRr.c @@ -354,7 +354,7 @@ int Abc_NtkRRProve( Abc_RRMan_t * p ) Abc_NtkRRUpdate( pWndCopy, p->pNode->pCopy->pCopy, p->pFanin->pCopy->pCopy, p->pFanout? p->pFanout->pCopy->pCopy : NULL ); if ( !Abc_NtkIsDfsOrdered(pWndCopy) ) Abc_NtkReassignIds(pWndCopy); - p->pMiter = Abc_NtkMiter( p->pWnd, pWndCopy, 1, 0, 0 ); + p->pMiter = Abc_NtkMiter( p->pWnd, pWndCopy, 1, 0, 0, 0 ); Abc_NtkDelete( pWndCopy ); clk = clock(); RetValue = Abc_NtkMiterProve( &p->pMiter, p->pParams ); diff --git a/src/base/abci/abcVerify.c b/src/base/abci/abcVerify.c index c05d539e..328d2907 100644 --- a/src/base/abci/abcVerify.c +++ b/src/base/abci/abcVerify.c @@ -52,7 +52,7 @@ void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nI int RetValue; // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 0, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 0, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); @@ -120,7 +120,7 @@ void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fV int RetValue; // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 0, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 0, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); @@ -225,7 +225,7 @@ void Abc_NtkCecFraigPart( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, in assert( nPartSize > 0 ); // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, nPartSize, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, nPartSize, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); @@ -342,7 +342,7 @@ void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds // pParams->fVerbose = 1; // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 1, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 1, 1, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); @@ -457,7 +457,7 @@ void Abc_NtkSecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nI int RetValue; // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); @@ -539,7 +539,7 @@ int Abc_NtkSecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nFr int RetValue; // get the miter of the two networks - pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0 ); + pMiter = Abc_NtkMiter( pNtk1, pNtk2, 0, 0, 0, 0 ); if ( pMiter == NULL ) { printf( "Miter computation has failed.\n" ); |