Skip to content

Commit

Permalink
Merge pull request #283 from aletempiac/acd66
Browse files Browse the repository at this point in the history
Boolean decomposition into LUT structures
  • Loading branch information
alanminko authored Mar 18, 2024
2 parents 210474b + db72df7 commit 4f0d092
Show file tree
Hide file tree
Showing 15 changed files with 3,597 additions and 122 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ifdef ABC_USE_LIBSTDCXX
endif

$(info $(MSG_PREFIX)Using CFLAGS=$(CFLAGS))
CXXFLAGS += $(CFLAGS) -std=c++17
CXXFLAGS += $(CFLAGS) -std=c++11

SRC :=
GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags
Expand Down
40 changes: 30 additions & 10 deletions src/base/abci/abc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19514,7 +19514,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
If_ManSetDefaultPars( pPars );
pPars->pLutLib = (If_LibLut_t *)Abc_FrameReadLibLut();
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRNTXYZDEWSqaflepmrsdbgxyzuojiktncvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRNTXYZDEWSJqaflepmrsdbgxyuojiktncvh" ) ) != EOF )
{
switch ( c )
{
Expand Down Expand Up @@ -19637,6 +19637,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
pPars->nLutDecSize = atoi(argv[globalUtilOptind]);
pPars->fUserLutDec = 1;
globalUtilOptind++;
if ( pPars->nLutDecSize < 3 || pPars->nLutDecSize > 6 )
goto usage;
Expand Down Expand Up @@ -19688,6 +19689,21 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
break;
case 'J':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-J\" should be followed by string.\n" );
goto usage;
}
pPars->pLutStruct = argv[globalUtilOptind];
pPars->fEnableStructN = 1;
globalUtilOptind++;
if ( strlen(pPars->pLutStruct) != 2 && strlen(pPars->pLutStruct) != 3 )
{
Abc_Print( -1, "Command line switch \"-J\" should be followed by a 2- or 3-char string (e.g. \"66\" or \"666\").\n" );
goto usage;
}
break;
case 'q':
pPars->fPreprocess ^= 1;
break;
Expand Down Expand Up @@ -19730,9 +19746,6 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'y':
pPars->fUserRecLib ^= 1;
break;
case 'z':
pPars->fUserLutDec ^= 1;
break;
case 'u':
pPars->fUserSesLib ^= 1;
break;
Expand Down Expand Up @@ -19868,7 +19881,14 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
return 1;
}
pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
if ( pPars->fEnableStructN )
{
pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck66;
}
else
{
pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
}
pPars->fCutMin = 1;
}

Expand All @@ -19884,9 +19904,9 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "LUT size (%d) must be greater than the LUT decomposition size (%d).\n", pPars->nLutSize, pPars->nLutDecSize );
return 1;
}
if ( pPars->nLutSize < 4 || pPars->nLutSize > 10 )
if ( pPars->nLutSize < 4 || pPars->nLutSize > 11 )
{
Abc_Print( -1, "This feature only works for [4;10]-LUTs.\n" );
Abc_Print( -1, "This feature only works for [4;11]-LUTs.\n" );
return 1;
}
}
Expand Down Expand Up @@ -20053,7 +20073,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
sprintf(LutSize, "library" );
else
sprintf(LutSize, "%d", pPars->nLutSize );
Abc_Print( -2, "usage: if [-KCFAGRNTXYZ num] [-DEW float] [-S str] [-qarlepmsdbgxyzuojiktncvh]\n" );
Abc_Print( -2, "usage: if [-KCFAGRNTXYZ num] [-DEW float] [-S str] [-qarlepmsdbgxyuojiktncvh]\n" );
Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
Expand All @@ -20065,11 +20085,12 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -2, "\t-T num : the type of LUT structures [default = any]\n" );
Abc_Print( -2, "\t-X num : delay of AND-gate in LUT library units [default = %d]\n", pPars->nAndDelay );
Abc_Print( -2, "\t-Y num : area of AND-gate in LUT library units [default = %d]\n", pPars->nAndArea );
Abc_Print( -2, "\t-Z num : the number of LUT inputs for LUT decomposition [default = %d]\n", pPars->nLutDecSize );
Abc_Print( -2, "\t-Z num : the number of LUT inputs for delay-driven LUT decomposition [default = not used]\n" );
Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
Abc_Print( -2, "\t-W float : sets wire delay between adjects LUTs [default = %f]\n", pPars->WireDelay );
Abc_Print( -2, "\t-S str : string representing the LUT structure [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
Abc_Print( -2, "\t-J str : string representing the LUT structure (new method) [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
Abc_Print( -2, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
Abc_Print( -2, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
Expand All @@ -20083,7 +20104,6 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -2, "\t-g : toggles delay optimization by SOP balancing [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
Abc_Print( -2, "\t-x : toggles delay optimization by DSD balancing [default = %s]\n", pPars->fDsdBalance? "yes": "no" );
Abc_Print( -2, "\t-y : toggles delay optimization with recorded library [default = %s]\n", pPars->fUserRecLib? "yes": "no" );
Abc_Print( -2, "\t-z : toggles delay optimization with LUT decomposition [default = %s]\n", pPars->fUserLutDec? "yes": "no" );
Abc_Print( -2, "\t-u : toggles delay optimization with SAT-based library [default = %s]\n", pPars->fUserSesLib? "yes": "no" );
Abc_Print( -2, "\t-o : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
Abc_Print( -2, "\t-j : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
Expand Down
Loading

0 comments on commit 4f0d092

Please sign in to comment.