summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abc.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-05-01 22:44:29 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2021-05-01 22:44:29 -0700
commit7d90895dcf97c726deab121bb042e68abda301e9 (patch)
tree68f6c0bdeec70cb9e142db805e0d22997180257e /src/base/abci/abc.c
parent645752f7d651b07a0ebd7cac827d6ce5dd5bd266 (diff)
downloadabc-7d90895dcf97c726deab121bb042e68abda301e9.tar.gz
abc-7d90895dcf97c726deab121bb042e68abda301e9.tar.bz2
abc-7d90895dcf97c726deab121bb042e68abda301e9.zip
Experiments with LUT mapping for small functions.
Diffstat (limited to 'src/base/abci/abc.c')
-rw-r--r--src/base/abci/abc.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 4297c81d..65aaf360 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -485,6 +485,7 @@ static int Abc_CommandAbc9Of ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Pack ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Edge ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9SatLut ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9MinLut ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Unmap ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Struct ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Trace ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -1208,6 +1209,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC9", "&pack", Abc_CommandAbc9Pack, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&edge", Abc_CommandAbc9Edge, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&satlut", Abc_CommandAbc9SatLut, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&minlut", Abc_CommandAbc9MinLut, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&unmap", Abc_CommandAbc9Unmap, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&struct", Abc_CommandAbc9Struct, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&trace", Abc_CommandAbc9Trace, 0 );
@@ -40821,6 +40823,72 @@ usage:
SeeAlso []
***********************************************************************/
+int Abc_CommandAbc9MinLut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern Gia_Man_t * Gia_ManPerformMinLut( Gia_Man_t * p, int GroupSize, int LutSize, int fVerbose );
+ Gia_Man_t * pTemp;
+ int c, LutSize = 6, GroupSize = 3, fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "KGvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'K':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+ goto usage;
+ }
+ LutSize = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ break;
+ case 'G':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer.\n" );
+ goto usage;
+ }
+ GroupSize = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Empty GIA network.\n" );
+ return 1;
+ }
+ pTemp = Gia_ManPerformMinLut( pAbc->pGia, GroupSize, LutSize, fVerbose );
+ //Abc_FrameUpdateGia( pAbc, pTemp );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &minlut [-KG num] [-vh]\n" );
+ Abc_Print( -2, "\t performs specialized LUT mapping\n" );
+ Abc_Print( -2, "\t-K num : the LUT size for mapping [default = %d]\n", LutSize );
+ Abc_Print( -2, "\t-G num : the output group size [default = %d]\n", GroupSize );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : prints the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int Abc_CommandAbc9Unmap( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern void Gia_ManTestStruct( Gia_Man_t * p );