mirror of https://github.com/YosysHQ/abc.git
Command "&dg" contributed by Jiun-Hao Chen from NTU.
This commit is contained in:
parent
7fbcde9d22
commit
93f3791fbe
|
|
@ -1827,6 +1827,10 @@ extern void Tas_ManSatPrintStats( Tas_Man_t * p );
|
|||
extern int Tas_ManSolve( Tas_Man_t * p, Gia_Obj_t * pObj, Gia_Obj_t * pObj2 );
|
||||
extern int Tas_ManSolveArray( Tas_Man_t * p, Vec_Ptr_t * vObjs );
|
||||
|
||||
/*=== giaDecGraph.c ===========================================================*/
|
||||
extern Gia_Man_t* Gia_ManDecGraph( Gia_Man_t* p );
|
||||
extern Gia_Man_t* Gia_ManDecGraphFromFile( char* pFileName );
|
||||
|
||||
/*=== giaBound.c ===========================================================*/
|
||||
typedef struct Bnd_Man_t_ Bnd_Man_t;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -113,4 +113,5 @@ SRC += src/aig/gia/giaAig.c \
|
|||
src/aig/gia/giaTtopt.cpp \
|
||||
src/aig/gia/giaUnate.c \
|
||||
src/aig/gia/giaUtil.c \
|
||||
src/aig/gia/giaBound.c
|
||||
src/aig/gia/giaBound.c \
|
||||
src/aig/gia/giaDecGraph.cpp
|
||||
|
|
|
|||
|
|
@ -532,6 +532,7 @@ static int Abc_CommandAbc9Transduction ( Abc_Frame_t * pAbc, int argc, cha
|
|||
static int Abc_CommandAbc9TranStoch ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandAbc9Rrr ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandAbc9Rewire ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandAbc9DecGraph ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
//#endif
|
||||
static int Abc_CommandAbc9LNetMap ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
static int Abc_CommandAbc9Unmap ( Abc_Frame_t * pAbc, int argc, char ** argv );
|
||||
|
|
@ -1352,6 +1353,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
|
|||
Cmd_CommandAdd( pAbc, "ABC9", "&transtoch" , Abc_CommandAbc9TranStoch, 0 );
|
||||
Cmd_CommandAdd( pAbc, "ABC9", "&rrr", Abc_CommandAbc9Rrr, 0 );
|
||||
Cmd_CommandAdd( pAbc, "ABC9", "&rewire" , Abc_CommandAbc9Rewire, 0 );
|
||||
Cmd_CommandAdd( pAbc, "ABC9", "&dg" , Abc_CommandAbc9DecGraph, 0 );
|
||||
//#endif
|
||||
Cmd_CommandAdd( pAbc, "ABC9", "&lnetmap", Abc_CommandAbc9LNetMap, 0 );
|
||||
Cmd_CommandAdd( pAbc, "ABC9", "&unmap", Abc_CommandAbc9Unmap, 0 );
|
||||
|
|
@ -46972,6 +46974,80 @@ usage:
|
|||
return 1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int Abc_CommandAbc9DecGraph( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
Gia_Man_t * pTemp;
|
||||
char * pFileName = NULL;
|
||||
int c, fFile = 0;
|
||||
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "fh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
case 'f':
|
||||
fFile ^= 1;
|
||||
break;
|
||||
case 'h':
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
}
|
||||
if ( argc > globalUtilOptind + 1 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if ( !fFile && argc == globalUtilOptind + 1 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if ( !fFile && pAbc->pGia == NULL )
|
||||
{
|
||||
Abc_Print( -1, "Empty GIA network.\n" );
|
||||
return 1;
|
||||
}
|
||||
if ( fFile && argc == globalUtilOptind + 1 )
|
||||
{
|
||||
FILE * pFile = fopen( argv[globalUtilOptind], "rb" );
|
||||
if ( pFile == NULL )
|
||||
{
|
||||
Abc_Print( -1, "Abc_CommandAbc9BCore(): Cannot open file \"%s\" for reading the simulation information.\n", argv[globalUtilOptind] );
|
||||
return 0;
|
||||
}
|
||||
fclose( pFile );
|
||||
pFileName = argv[globalUtilOptind];
|
||||
}
|
||||
if ( pFileName ) {
|
||||
pTemp = Gia_ManDecGraphFromFile( pFileName );
|
||||
} else {
|
||||
pTemp = Gia_ManDecGraph( pAbc->pGia );
|
||||
}
|
||||
Abc_FrameUpdateGia( pAbc, pTemp );
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
Abc_Print( -2, "usage: &dg [-vhf] <file>\n" );
|
||||
Abc_Print( -2, "\t convert AIG into decision graph structure\n" );
|
||||
Abc_Print( -2, "\t-f : read from file (in IWLS format) [default = %s]\n" , fFile ? "yes" : "no");
|
||||
Abc_Print( -2, "\t-h : prints the command usage\n\n");
|
||||
Abc_Print( -2, "\t This command was contributed by Jiun-Hao Chen from National Taiwan University.\n" );
|
||||
Abc_Print( -2, "\t For more info, please refer to the paper: Jiun-Hao Chen and Jie-Hong R. Jiang,\n");
|
||||
Abc_Print( -2, "\t \"Circuit learning for multi-output Boolean functions\", Proc. IWLS 2025.\n");
|
||||
Abc_Print( -2, "\t https://people.eecs.berkeley.edu/~alanmi/publications/other/iwls25_dg.pdf\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis []
|
||||
|
|
|
|||
Loading…
Reference in New Issue