mirror of https://github.com/YosysHQ/abc.git
Updated code for lazy man's synthesis.
This commit is contained in:
parent
1ca94c1023
commit
96d7699698
|
|
@ -1360,12 +1360,17 @@ unsigned * Gia_ManComputePoTruthTables( Gia_Man_t * p, int nBytesMax )
|
|||
int Gia_ObjComputeTruthTable_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
|
||||
{
|
||||
word * pTruth0, * pTruth1, * pTruth, * pTruthL;
|
||||
int Value0, Value1;
|
||||
if ( Gia_ObjIsTravIdCurrent(p, pObj) )
|
||||
return pObj->Value;
|
||||
Gia_ObjSetTravIdCurrent(p, pObj);
|
||||
assert( Gia_ObjIsAnd(pObj) );
|
||||
pTruth0 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin0(pObj) );
|
||||
pTruth1 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin1(pObj) );
|
||||
Value0 = Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin0(pObj) );
|
||||
Value1 = Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin1(pObj) );
|
||||
assert( Value0 < Vec_WrdSize(p->vTtMemory) );
|
||||
assert( Value1 < Vec_WrdSize(p->vTtMemory) );
|
||||
pTruth0 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Value0;
|
||||
pTruth1 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Value1;
|
||||
assert( p->nTtWords * p->iTtNum < Vec_WrdSize(p->vTtMemory) );
|
||||
pTruth = Vec_WrdArray(p->vTtMemory) + p->nTtWords * p->iTtNum++;
|
||||
pTruthL = Vec_WrdArray(p->vTtMemory) + p->nTtWords * p->iTtNum;
|
||||
|
|
@ -1387,7 +1392,7 @@ int Gia_ObjComputeTruthTable_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
|
|||
while ( pTruth < pTruthL )
|
||||
*pTruth++ = *pTruth0++ & *pTruth1++;
|
||||
}
|
||||
return p->iTtNum-1;
|
||||
return (pObj->Value = p->iTtNum-1);
|
||||
}
|
||||
unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "misc/vec/vec.h"
|
||||
#include "aig/hop/hop.h"
|
||||
#include "aig/gia/gia.h"
|
||||
#include "misc/st/st.h"
|
||||
#include "misc/st/stmm.h"
|
||||
#include "misc/nm/nm.h"
|
||||
|
|
@ -783,6 +784,16 @@ extern ABC_DLL int Abc_NtkRecIsInTrimMode();
|
|||
extern ABC_DLL int Abc_NtkRecVarNum();
|
||||
extern ABC_DLL Vec_Int_t * Abc_NtkRecMemory();
|
||||
extern ABC_DLL int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTruth, int nVars );
|
||||
/*=== abcRec2.c ==========================================================*/
|
||||
extern ABC_DLL void Abc_NtkRecStart2( Gia_Man_t *p, int nVars, int nCuts, int fTrim );
|
||||
extern ABC_DLL void Abc_NtkRecStop2();
|
||||
extern ABC_DLL void Abc_NtkRecAdd2( Abc_Ntk_t * pNtk, int fUseSOPB );
|
||||
extern ABC_DLL void Abc_NtkRecPs2(int fPrintLib);
|
||||
extern ABC_DLL Gia_Man_t * Abc_NtkRecGetGia();
|
||||
extern ABC_DLL void Abc_NtkRecLibMerge2(Gia_Man_t * pGia);
|
||||
extern ABC_DLL int Abc_NtkRecIsRunning2();
|
||||
extern ABC_DLL int Abc_NtkRecIsInTrimMode2();
|
||||
extern ABC_DLL void Abc_NtkRecFilter2(int nLimit);
|
||||
/*=== abcReconv.c ==========================================================*/
|
||||
extern ABC_DLL Abc_ManCut_t * Abc_NtkManCutStart( int nNodeSizeMax, int nConeSizeMax, int nNodeFanStop, int nConeFanStop );
|
||||
extern ABC_DLL void Abc_NtkManCutStop( Abc_ManCut_t * p );
|
||||
|
|
|
|||
|
|
@ -212,6 +212,14 @@ static int Abc_CommandRecUse ( Abc_Frame_t * pAbc, int argc, cha
|
|||
static int Abc_CommandRecFilter ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandRecMerge ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
|
||||
static int Abc_CommandRecStart2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandRecPs2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandRecAdd2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandRecStop2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandRecDump2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandRecMerge2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandRecFilter2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
|
||||
static int Abc_CommandMap ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandAmap ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandUnmap ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
|
|
@ -661,6 +669,14 @@ void Abc_Init( Abc_Frame_t * pAbc )
|
|||
Cmd_CommandAdd( pAbc, "Choicing", "rec_filter", Abc_CommandRecFilter, 1 );
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_merge", Abc_CommandRecMerge, 1 );
|
||||
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_start2", Abc_CommandRecStart2, 0 );
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_stop2", Abc_CommandRecStop2, 0 );
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_add2", Abc_CommandRecAdd2, 0 );
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_ps2", Abc_CommandRecPs2, 0 );
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_dump2", Abc_CommandRecDump2, 1 );
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_filter2", Abc_CommandRecFilter2, 1 );
|
||||
Cmd_CommandAdd( pAbc, "Choicing", "rec_merge2", Abc_CommandRecMerge2, 1 );
|
||||
|
||||
Cmd_CommandAdd( pAbc, "SC mapping", "map", Abc_CommandMap, 1 );
|
||||
Cmd_CommandAdd( pAbc, "SC mapping", "amap", Abc_CommandAmap, 1 );
|
||||
Cmd_CommandAdd( pAbc, "SC mapping", "unmap", Abc_CommandUnmap, 1 );
|
||||
|
|
@ -12610,6 +12626,473 @@ usage:
|
|||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandRecStart2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
//Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
||||
char * FileName, * pTemp;
|
||||
char ** pArgvNew;
|
||||
int nArgcNew;
|
||||
FILE * pFile;
|
||||
Gia_Man_t * pGia = NULL;
|
||||
int c;
|
||||
int nVars;
|
||||
int nCuts;
|
||||
int fTrim;
|
||||
|
||||
//pNtk = Abc_FrameReadNtk(pAbc);
|
||||
// set defaults
|
||||
nVars = 6;
|
||||
nCuts = 32;
|
||||
fTrim = 0;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "KCth" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'K':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nVars = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nVars < 1 )
|
||||
goto usage;
|
||||
break;
|
||||
case 'C':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nCuts = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nCuts < 1 )
|
||||
goto usage;
|
||||
break;
|
||||
case 't':
|
||||
fTrim ^= 1;
|
||||
break;
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( !(nVars >= 3 && nVars <= 16) )
|
||||
{
|
||||
Abc_Print( -1, "The range of allowed values is 3 <= K <= 16.\n" );
|
||||
return 0;
|
||||
}
|
||||
if ( Abc_NtkRecIsRunning() )
|
||||
{
|
||||
Abc_Print( -1, "The AIG subgraph recording is already started.\n" );
|
||||
return 0;
|
||||
}
|
||||
// if ( pNtk && !Abc_NtkIsStrash(pNtk) )
|
||||
// {
|
||||
// Abc_Print( -1, "This command works only for AIGs; run strashing (\"st\").\n" );
|
||||
// return 0;
|
||||
// }
|
||||
pArgvNew = argv + globalUtilOptind;
|
||||
nArgcNew = argc - globalUtilOptind;
|
||||
if ( nArgcNew != 1 )
|
||||
Abc_Print( 1, "File name is not given on the command line. Start a new record.\n" );
|
||||
else
|
||||
{
|
||||
// get the input file name
|
||||
FileName = pArgvNew[0];
|
||||
// fix the wrong symbol
|
||||
for ( pTemp = FileName; *pTemp; pTemp++ )
|
||||
if ( *pTemp == '>' )
|
||||
*pTemp = '\\';
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
|
||||
if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
|
||||
Abc_Print( 1, "Did you mean \"%s\"?", FileName );
|
||||
Abc_Print( 1, "\n" );
|
||||
return 1;
|
||||
}
|
||||
fclose( pFile );
|
||||
pGia = Gia_ReadAiger( FileName, 0 );
|
||||
if ( pGia == NULL )
|
||||
{
|
||||
Abc_Print( -1, "Reading AIGER has failed.\n" );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Abc_NtkRecStart2( pGia, nVars, nCuts, fTrim );
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: rec_start [-K num] [-C num] [-th]\n" );
|
||||
Abc_Print( -2, "\t starts recording AIG subgraphs (should be called for\n" );
|
||||
Abc_Print( -2, "\t an empty network or after reading in a previous record)\n" );
|
||||
Abc_Print( -2, "\t-K num : the largest number of inputs [default = %d]\n", nVars );
|
||||
Abc_Print( -2, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCuts );
|
||||
Abc_Print( -2, "\t-t : toggles the use of trimming [default = %s]\n", fTrim? "yes": "no" );
|
||||
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandRecStop2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
||||
int c;
|
||||
// set defaults
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( !Abc_NtkRecIsRunning2() )
|
||||
{
|
||||
Abc_Print( -1, "This command works only after calling \"rec_start2\".\n" );
|
||||
return 0;
|
||||
}
|
||||
Abc_NtkRecStop2();
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: rec_stop [-h]\n" );
|
||||
Abc_Print( -2, "\t cleans the internal storage for AIG subgraphs\n" );
|
||||
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandRecAdd2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
||||
int c;
|
||||
int fUseSOPB = 0;
|
||||
// set defaults
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "gh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'g':
|
||||
fUseSOPB = 1;
|
||||
break;
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( !Abc_NtkIsStrash(pNtk) )
|
||||
{
|
||||
Abc_Print( -1, "This command works for AIGs.\n" );
|
||||
return 0;
|
||||
}
|
||||
if ( !Abc_NtkRecIsRunning2() )
|
||||
{
|
||||
Abc_Print( -1, "This command works for AIGs after calling \"rec_start2\".\n" );
|
||||
return 0;
|
||||
}
|
||||
Abc_NtkRecAdd2( pNtk, fUseSOPB);
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: rec_add [-h]\n" );
|
||||
Abc_Print( -2, "\t adds subgraphs from the current network to the set\n" );
|
||||
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandRecPs2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
||||
int c, fPrintLib = 0;
|
||||
// set defaults
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "ph" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'p':
|
||||
fPrintLib ^= 1;
|
||||
break;
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( !Abc_NtkRecIsRunning2() )
|
||||
{
|
||||
Abc_Print( -1, "This command works for AIGs only after calling \"rec_start2\".\n" );
|
||||
return 0;
|
||||
}
|
||||
Abc_NtkRecPs2(fPrintLib);
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: rec_ps [-h]\n" );
|
||||
Abc_Print( -2, "\t prints statistics about the recorded AIG subgraphs\n" );
|
||||
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandRecDump2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
//Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
||||
char * FileName;
|
||||
char ** pArgvNew;
|
||||
int nArgcNew;
|
||||
Gia_Man_t * pGia;
|
||||
int c;
|
||||
|
||||
//pNtk = Abc_FrameReadNtk(pAbc);
|
||||
// set defaults
|
||||
Extra_UtilGetoptReset();
|
||||
|
||||
if ( !Abc_NtkRecIsRunning2() )
|
||||
{
|
||||
Abc_Print( -1, "The AIG subgraph recording is not started.\n" );
|
||||
return 1;
|
||||
}
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
pGia = Abc_NtkRecGetGia();
|
||||
pArgvNew = argv + globalUtilOptind;
|
||||
nArgcNew = argc - globalUtilOptind;
|
||||
if ( nArgcNew != 1 )
|
||||
{
|
||||
Abc_Print( -1, "File name is not given on the command line.\n" );
|
||||
return 1;
|
||||
}
|
||||
else if(Gia_ManPoNum(pGia) == 0)
|
||||
{
|
||||
Abc_Print( 0, "No structure in the library.\n" );
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// get the input file name
|
||||
FileName = pArgvNew[0];
|
||||
Gia_WriteAiger( pGia, FileName, 0, 0 );
|
||||
}
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: rec_dump [-h] <file>\n" );
|
||||
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandRecFilter2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
|
||||
int c, nLimit = 0;
|
||||
// set defaults
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "Fh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'F':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
nLimit = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( nLimit < 0 )
|
||||
goto usage;
|
||||
break;
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( !Abc_NtkRecIsRunning2() )
|
||||
{
|
||||
Abc_Print( -1, "This command works for AIGs only after calling \"rec_start2\".\n" );
|
||||
return 0;
|
||||
}
|
||||
if (!Abc_NtkRecIsInTrimMode2())
|
||||
Abc_Print( 0, "This command works fine only in trim mode. Please call \"rec_start2 -t\" first.\n" );
|
||||
|
||||
Abc_NtkRecFilter2(nLimit);
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: rec_filter [-h]\n" );
|
||||
Abc_Print( -2, "\t filter the library of the recorder\n" );
|
||||
Abc_Print( -2, "\t-F num : the limit number of function class [default = %d]\n", nLimit );
|
||||
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandRecMerge2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
int c;
|
||||
char * FileName, * pTemp;
|
||||
char ** pArgvNew;
|
||||
int nArgcNew;
|
||||
FILE * pFile;
|
||||
Gia_Man_t * pGia = NULL;
|
||||
|
||||
// set defaults
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'h':
|
||||
goto usage;
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( !Abc_NtkRecIsRunning2() )
|
||||
{
|
||||
Abc_Print( -1, "This command works for AIGs only after calling \"rec_start2\".\n" );
|
||||
return 0;
|
||||
}
|
||||
pArgvNew = argv + globalUtilOptind;
|
||||
nArgcNew = argc - globalUtilOptind;
|
||||
if ( nArgcNew != 1 )
|
||||
{
|
||||
Abc_Print( -1, "File name is not given on the command line.\n" );
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// get the input file name
|
||||
FileName = pArgvNew[0];
|
||||
// fix the wrong symbol
|
||||
for ( pTemp = FileName; *pTemp; pTemp++ )
|
||||
if ( *pTemp == '>' )
|
||||
*pTemp = '\\';
|
||||
if ( (pFile = fopen( FileName, "r" )) == NULL )
|
||||
{
|
||||
Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
|
||||
if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
|
||||
Abc_Print( 1, "Did you mean \"%s\"?", FileName );
|
||||
Abc_Print( 1, "\n" );
|
||||
return 1;
|
||||
}
|
||||
fclose( pFile );
|
||||
pGia = Gia_ReadAiger( FileName, 0 );
|
||||
if ( pGia == NULL )
|
||||
{
|
||||
Abc_Print( -1, "Reading AIGER has failed.\n" );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Abc_NtkRecLibMerge2(pGia);
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: rec_merge [-h]\n" );
|
||||
Abc_Print( -2, "\t merge libraries\n" );
|
||||
Abc_Print( -2, "\t-h : print the command usage\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
|
|
|||
|
|
@ -494,7 +494,12 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
|
|||
else if ( pIfMan->pPars->fUserRecLib )
|
||||
{
|
||||
extern Hop_Obj_t * Abc_RecToHop( Hop_Man_t * pMan, If_Man_t * pIfMan, If_Cut_t * pCut, If_Obj_t * pIfObj );
|
||||
pNodeNew->pData = Abc_RecToHop( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, pIfObj);
|
||||
extern Hop_Obj_t * Abc_RecToHop2( Hop_Man_t * pMan, If_Man_t * pIfMan, If_Cut_t * pCut, If_Obj_t * pIfObj );
|
||||
if(Abc_NtkRecIsRunning())
|
||||
pNodeNew->pData = Abc_RecToHop( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, pIfObj);
|
||||
else
|
||||
pNodeNew->pData = Abc_RecToHop2( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, pIfObj);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,23 +0,0 @@
|
|||
struct Abc_Obj_t_ // 6 words
|
||||
{
|
||||
Abc_Obj_t * pCopy; // the copy of this object
|
||||
Abc_Ntk_t * pNtk; // the host network
|
||||
int Id; // the object ID
|
||||
int TravId; // the traversal ID
|
||||
int nRefs; // the number of fanouts
|
||||
unsigned Type : 4; // the object type
|
||||
unsigned fMarkA : 1; // the multipurpose mark
|
||||
unsigned fMarkB : 1; // the multipurpose mark
|
||||
unsigned fPhase : 1; // the flag to mark the phase of equivalent node
|
||||
unsigned fPersist: 1; // marks the persistant AIG node
|
||||
unsigned nFanins : 24; // the level of the node
|
||||
Abc_Obj_t * Fanins[0]; // the array of fanins
|
||||
};
|
||||
|
||||
struct Abc_Pin_t_ // 4 words
|
||||
{
|
||||
Abc_Pin_t * pNext;
|
||||
Abc_Pin_t * pPrev;
|
||||
Abc_Obj_t * pFanin;
|
||||
Abc_Obj_t * pFanout;
|
||||
};
|
||||
|
|
@ -525,9 +525,13 @@ extern int If_ManCountSpecialPos( If_Man_t * p );
|
|||
|
||||
/*=== abcRec.c ============================================================*/
|
||||
extern int If_CutDelayRecCost(If_Man_t* p, If_Cut_t* pCut, If_Obj_t * pObj);
|
||||
extern int If_CutDelayRecCost2(If_Man_t* p, If_Cut_t* pCut, If_Obj_t * pObj);
|
||||
/*=== abcRec2.c ============================================================*/
|
||||
extern int Abc_NtkRecIsRunning();
|
||||
extern int Abc_NtkRecIsRunning2();
|
||||
|
||||
// othe packages
|
||||
extern int Bat_ManCellFuncLookup( unsigned * pTruth, int nVars, int nLeaves );
|
||||
extern int Bat_ManCellFuncLookup( unsigned * pTruth, int nVars, int nLeaves );
|
||||
|
||||
ABC_NAMESPACE_HEADER_END
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,14 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
|
|||
/// if ( p->pPars->pLutStruct )
|
||||
/// pCut->Delay = If_CutDelayLutStruct( p, pCut, p->pPars->pLutStruct, p->pPars->WireDelay );
|
||||
if ( p->pPars->fUserRecLib )
|
||||
pCut->Delay = If_CutDelayRecCost(p, pCut, pObj);
|
||||
{
|
||||
if((Abc_NtkRecIsRunning2()&& Abc_NtkRecIsRunning()) || (!Abc_NtkRecIsRunning2()&& !Abc_NtkRecIsRunning()))
|
||||
assert(0);
|
||||
else if(Abc_NtkRecIsRunning())
|
||||
pCut->Delay = If_CutDelayRecCost(p, pCut, pObj);
|
||||
else
|
||||
pCut->Delay = If_CutDelayRecCost2(p, pCut, pObj);
|
||||
}
|
||||
else if(p->pPars->fDelayOpt)
|
||||
pCut->Delay = If_CutDelaySopCost(p,pCut);
|
||||
else if(p->pPars->nGateSize > 0)
|
||||
|
|
@ -228,7 +235,14 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
|
|||
/// if ( p->pPars->pLutStruct )
|
||||
/// pCut->Delay = If_CutDelayLutStruct( p, pCut, p->pPars->pLutStruct, p->pPars->WireDelay );
|
||||
if ( p->pPars->fUserRecLib )
|
||||
pCut->Delay = If_CutDelayRecCost(p, pCut, pObj);
|
||||
{
|
||||
if((Abc_NtkRecIsRunning2()&& Abc_NtkRecIsRunning()) || (!Abc_NtkRecIsRunning2()&& !Abc_NtkRecIsRunning()))
|
||||
assert(0);
|
||||
else if(Abc_NtkRecIsRunning())
|
||||
pCut->Delay = If_CutDelayRecCost(p, pCut, pObj);
|
||||
else
|
||||
pCut->Delay = If_CutDelayRecCost2(p, pCut, pObj);
|
||||
}
|
||||
else if (p->pPars->fDelayOpt)
|
||||
pCut->Delay = If_CutDelaySopCost(p, pCut);
|
||||
else if(p->pPars->nGateSize > 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue