Commit 5453820c by Alan Mishchenko

Adding switch &miter -x for XORs outputs of two word-level POs.

parent 3240abdb
......@@ -1163,6 +1163,7 @@ extern Gia_Man_t * Gia_ManDupAndOr( Gia_Man_t * p, int nOuts, int fUseOr
extern Gia_Man_t * Gia_ManDupZeroUndc( Gia_Man_t * p, char * pInit, int fVerbose );
extern Gia_Man_t * Gia_ManMiter2( Gia_Man_t * p, char * pInit, int fVerbose );
extern Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManTransformMiter2( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManTransformToDual( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManChoiceMiter( Vec_Ptr_t * vGias );
extern Gia_Man_t * Gia_ManDupWithConstraints( Gia_Man_t * p, Vec_Int_t * vPoTypes );
......
......@@ -2458,6 +2458,37 @@ Gia_Man_t * Gia_ManTransformMiter( Gia_Man_t * p )
Gia_ManStop( pTemp );
return pNew;
}
Gia_Man_t * Gia_ManTransformMiter2( Gia_Man_t * p )
{
Gia_Man_t * pNew, * pTemp;
Gia_Obj_t * pObj, * pObj2;
int i, iLit, nPart = Gia_ManPoNum(p)/2;
assert( (Gia_ManPoNum(p) & 1) == 0 );
pNew = Gia_ManStart( Gia_ManObjNum(p) );
pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec );
Gia_ManConst0(p)->Value = 0;
Gia_ManHashAlloc( pNew );
Gia_ManForEachCi( p, pObj, i )
pObj->Value = Gia_ManAppendCi( pNew );
Gia_ManForEachAnd( p, pObj, i )
pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
Gia_ManForEachPo( p, pObj, i )
{
if ( i == nPart )
break;
pObj2 = Gia_ManPo( p, nPart + i );
iLit = Gia_ManHashXor( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin0Copy(pObj2) );
Gia_ManAppendCo( pNew, iLit );
}
Gia_ManForEachRi( p, pObj, i )
pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
Gia_ManHashStop( pNew );
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
pNew = Gia_ManCleanup( pTemp = pNew );
Gia_ManStop( pTemp );
return pNew;
}
Gia_Man_t * Gia_ManTransformToDual( Gia_Man_t * p )
{
Gia_Man_t * pNew;
......
......@@ -30199,9 +30199,10 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
int fDualOut = 0;
int fSeq = 0;
int fTrans = 0;
int fTransX = 0;
int fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Idstvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "Idstxvh" ) ) != EOF )
{
switch ( c )
{
......@@ -30225,6 +30226,9 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
case 't':
fTrans ^= 1;
break;
case 'x':
fTransX ^= 1;
break;
case 'v':
fVerbose ^= 1;
break;
......@@ -30251,6 +30255,24 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( 1, "The miter (current AIG) is transformed by XORing POs pair-wise.\n" );
return 0;
}
if ( fTransX )
{
if ( (Gia_ManPoNum(pAbc->pGia) & 1) == 1 )
{
Abc_Print( -1, "Abc_CommandAbc9Miter(): The number of outputs should be even.\n" );
return 0;
}
if ( pAbc->pGia == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Miter(): There is no AIG.\n" );
return 1;
}
pAux = Gia_ManTransformMiter2( pAbc->pGia );
Abc_FrameUpdateGia( pAbc, pAux );
Abc_Print( 1, "The miter (current AIG) is transformed by XORing POs of two word-level outputs.\n" );
return 0;
}
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
......@@ -30288,12 +30310,13 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
Abc_Print( -2, "usage: &miter [-I num] [-dstvh] <file>\n" );
Abc_Print( -2, "usage: &miter [-I num] [-dstxvh] <file>\n" );
Abc_Print( -2, "\t creates miter of two designs (current AIG vs. <file>)\n" );
Abc_Print( -2, "\t-I num : the number of last PIs to replicate [default = %d]\n", nInsDup );
Abc_Print( -2, "\t-d : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
Abc_Print( -2, "\t-s : toggle creating sequential miter [default = %s]\n", fSeq? "yes": "no" );
Abc_Print( -2, "\t-t : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
Abc_Print( -2, "\t-x : toggle XORing POs of two word-level outputs [default = %s]\n", fTransX? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment