Making &mfs work with boxes larger than 6 inputs. Adding option &if -w to print delay profile.

This commit is contained in:
Alan Mishchenko 2019-09-19 16:49:36 -07:00
parent 3a1705e8bb
commit 390adc39ca
5 changed files with 20 additions and 6 deletions

View File

@ -2331,6 +2331,13 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec );
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
// print delay trace
if ( pPars->fVerboseTrace )
{
pNew->pLutLib = pPars->pLutLib;
Gia_ManDelayTraceLutPrint( pNew, 1 );
pNew->pLutLib = NULL;
}
return pNew;
}
Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )

View File

@ -67,7 +67,7 @@ Sfm_Ntk_t * Gia_ManExtractMfs( Gia_Man_t * p )
int nRealPos = nBoxes ? Tim_ManPoNum(pManTime) : Gia_ManPoNum(p);
int i, j, k, curCi, curCo, nBoxIns, nBoxOuts;
int Id, iFan, nMfsVars, nBbIns = 0, nBbOuts = 0, Counter = 0;
assert( !p->pAigExtra || Gia_ManPiNum(p->pAigExtra) <= 6 );
//assert( !p->pAigExtra || Gia_ManPiNum(p->pAigExtra) <= 6 );
if ( pManTime ) Tim_ManBlackBoxIoNum( pManTime, &nBbIns, &nBbOuts );
// skip PIs due to box outputs
Counter += nBbOuts;
@ -148,7 +148,7 @@ Sfm_Ntk_t * Gia_ManExtractMfs( Gia_Man_t * p )
for ( i = 0; i < nBoxIns; i++ )
Vec_IntPush( vLeaves, Gia_ObjId(p->pAigExtra, Gia_ManCi(p->pAigExtra, i)) );
// iterate through box outputs
if ( !Tim_ManBoxIsBlack(pManTime, k) )
if ( !Tim_ManBoxIsBlack(pManTime, k) && Tim_ManBoxInputNum(pManTime, k) <= 6 )
{
for ( j = 0; j < nBoxOuts; j++ )
{

View File

@ -36539,7 +36539,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
}
pPars->pLutLib = (If_LibLut_t *)pAbc->pLibLut;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRDEWSTXYqalepmrsdbgxyofuijkztncvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRDEWSTXYqalepmrsdbgxyofuijkztncvwh" ) ) != EOF )
{
switch ( c )
{
@ -36766,6 +36766,9 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'v':
pPars->fVerbose ^= 1;
break;
case 'w':
pPars->fVerboseTrace ^= 1;
break;
case 'h':
pPars->fHashMapping ^= 1;
break;
@ -37056,7 +37059,7 @@ usage:
sprintf(LutSize, "library" );
else
sprintf(LutSize, "%d", pPars->nLutSize );
Abc_Print( -2, "usage: &if [-KCFAGRTXY num] [-DEW float] [-S str] [-qarlepmsdbgxyofuijkztnchv]\n" );
Abc_Print( -2, "usage: &if [-KCFAGRTXY num] [-DEW float] [-S str] [-qarlepmsdbgxyofuijkztnchvw]\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 );
@ -37097,6 +37100,7 @@ usage:
Abc_Print( -2, "\t-c : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
Abc_Print( -2, "\t-h : toggles rehashing AIG after mapping [default = %s]\n", pPars->fHashMapping? "yes": "no" );
Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggles printing delay trace [default = %s]\n", pPars->fVerboseTrace? "yes": "no" );
return 1;
}
@ -44452,11 +44456,13 @@ int Abc_CommandAbc9Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Mfs(): The current mapping has nodes with more than 6 inputs. Cannot use \"mfs\".\n" );
return 0;
}
/*
if ( pAbc->pGia->pAigExtra && Gia_ManPiNum(pAbc->pGia->pAigExtra) > 6 )
{
Abc_Print( -1, "Abc_CommandAbc9Mfs(): The current white-boxes have more than 6 inputs. Cannot use \"mfs\".\n" );
return 0;
}
*/
pTemp = Gia_ManPerformMfs( pAbc->pGia, pPars );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
@ -44869,7 +44875,7 @@ usage:
***********************************************************************/
int Abc_CommandAbc9AbsCreate( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Gia_Man_t * pTemp = NULL;
//Gia_Man_t * pTemp = NULL;
char * pStr, * pFlopNum;
int c, fVerbose = 0;
Extra_UtilGetoptReset();

View File

@ -143,6 +143,7 @@ struct If_Par_t_
int fDoAverage; // optimize average rather than maximum level
int fHashMapping; // perform AIG hashing after mapping
int fVerbose; // the verbosity flag
int fVerboseTrace; // the verbosity flag
char * pLutStruct; // LUT structure
float WireDelay; // wire delay
// internal parameters

View File

@ -738,7 +738,7 @@ void Tim_ManBlackBoxIoNum( Tim_Man_t * p, int * pnBbIns, int * pnBbOuts )
if ( Tim_ManBoxNum(p) )
Tim_ManForEachBox( p, pBox, i )
{
if ( !pBox->fBlack )
if ( !pBox->fBlack && pBox->nInputs <= 6 )
continue;
*pnBbIns += Tim_ManBoxInputNum( p, i );
*pnBbOuts += Tim_ManBoxOutputNum( p, i );