Commit 4c6804c3 by Alan Mishchenko

Improved gate-sizing.

parent a206287b
......@@ -2455,6 +2455,10 @@ SOURCE=.\src\map\scl\sclBuff.c
# End Source File
# Begin Source File
SOURCE=.\src\map\scl\sclBuffer.c
# End Source File
# Begin Source File
SOURCE=.\src\map\scl\sclDnsize.c
# End Source File
# Begin Source File
......
......@@ -199,6 +199,9 @@ int Map_MatchNodePhase( Map_Man_t * p, Map_Node_t * pNode, int fPhase )
fWorstLimit = pNode->tRequired[fPhase].Worst;
for ( pCut = pNode->pCuts->pNext; pCut; pCut = pCut->pNext )
{
// limit gate sizes based on fanout count
if ( (pNode->nRefs > 8 && pCut->nLeaves > 2) || (pNode->nRefs > 4 && pCut->nLeaves > 3) )
continue;
pMatch = pCut->M + fPhase;
if ( pMatch->pSupers == NULL )
continue;
......
......@@ -121,6 +121,7 @@ extern char * Mio_GateReadSop ( Mio_Gate_t * pGate );
extern word Mio_GateReadTruth ( Mio_Gate_t * pGate );
extern int Mio_GateReadValue ( Mio_Gate_t * pGate );
extern char * Mio_GateReadPinName ( Mio_Gate_t * pGate, int iPin );
extern float Mio_GateReadPinDelay ( Mio_Gate_t * pGate, int iPin );
extern void Mio_GateSetValue ( Mio_Gate_t * pGate, int Value );
extern char * Mio_PinReadName ( Mio_Pin_t * pPin );
extern Mio_PinPhase_t Mio_PinReadPhase ( Mio_Pin_t * pPin );
......
......@@ -198,6 +198,15 @@ char * Mio_GateReadPinName( Mio_Gate_t * pGate, int iPin )
return Mio_PinReadName(pPin);
return NULL;
}
float Mio_GateReadPinDelay( Mio_Gate_t * pGate, int iPin )
{
Mio_Pin_t * pPin;
int i = 0;
Mio_GateForEachPin( pGate, pPin )
if ( i++ == iPin )
return 0.5 * pPin->dDelayBlockRise + 0.5 * pPin->dDelayBlockFall;
return ABC_INFINITY;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
......
SRC += src/map/scl/scl.c \
src/map/scl/sclBuff.c \
src/map/scl/sclBuffer.c \
src/map/scl/sclDnsize.c \
src/map/scl/sclLib.c \
src/map/scl/sclLoad.c \
......
......@@ -556,11 +556,12 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t * pNtkRes;
int Degree, fUseInvs;
int c, fVerbose;
int fOldAlgo = 0;
Degree = 4;
fUseInvs = 0;
fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Nivh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "Naivh" ) ) != EOF )
{
switch ( c )
{
......@@ -575,6 +576,9 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( Degree < 0 )
goto usage;
break;
case 'a':
fOldAlgo ^= 1;
break;
case 'i':
fUseInvs ^= 1;
break;
......@@ -600,7 +604,10 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
}
// modify the current network
pNtkRes = Abc_SclPerformBuffering( pNtk, Degree, fUseInvs, fVerbose );
if ( fOldAlgo )
pNtkRes = Abc_SclPerformBuffering( pNtk, Degree, fUseInvs, fVerbose );
else
pNtkRes = Abc_SclBufPerform( pNtk, fVerbose );
if ( pNtkRes == NULL )
{
Abc_Print( -1, "The command has failed.\n" );
......@@ -611,9 +618,10 @@ int Scl_CommandBuffer( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
fprintf( pAbc->Err, "usage: buffer [-N num] [-ivh]\n" );
fprintf( pAbc->Err, "usage: buffer [-N num] [-aivh]\n" );
fprintf( pAbc->Err, "\t performs buffering of the mapped network\n" );
fprintf( pAbc->Err, "\t-N <num> : the max allowed fanout count of node/buffer [default = %d]\n", Degree );
fprintf( pAbc->Err, "\t-a : toggle using old algorithm [default = %s]\n", fOldAlgo? "yes": "no" );
fprintf( pAbc->Err, "\t-i : toggle using interters instead of buffers [default = %s]\n", fUseInvs? "yes": "no" );
fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
fprintf( pAbc->Err, "\t-h : print the command usage\n");
......
......@@ -375,6 +375,8 @@ static inline void Abc_SclDumpStats( SC_Man * p, char * pFileName, abctime Time
/*=== sclBuff.c ===============================================================*/
extern int Abc_SclCheckNtk( Abc_Ntk_t * p, int fVerbose );
extern Abc_Ntk_t * Abc_SclPerformBuffering( Abc_Ntk_t * p, int Degree, int fUseInvs, int fVerbose );
/*=== sclBuffer.c ===============================================================*/
extern Abc_Ntk_t * Abc_SclBufPerform( Abc_Ntk_t * pNtk, int fVerbose );
/*=== sclDnsize.c ===============================================================*/
extern void Abc_SclDnsizePerform( SC_Lib * pLib, Abc_Ntk_t * pNtk, SC_SizePars * pPars );
/*=== sclLoad.c ===============================================================*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment