Commit c696ae95 by Alan Mishchenko

Maintenance and updates.

parent 287f9efc
......@@ -1856,7 +1856,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
{
pIfObj->iCopy = Gia_ManFromIfLogicCofVars( pNew, pIfMan, pCutBest, vLeaves, vLeaves2, vCover, vMapping, vMapping2 );
}
else if ( (pIfMan->pPars->fDeriveLuts && pIfMan->pPars->fTruth) || pIfMan->pPars->fUseDsd || pIfMan->pPars->fUseTtPerm )
else if ( (pIfMan->pPars->fDeriveLuts && pIfMan->pPars->fTruth) || pIfMan->pPars->fUseDsd || pIfMan->pPars->fUseTtPerm || pIfMan->pPars->pFuncCell2 )
{
word * pTruth = If_CutTruthW(pIfMan, pCutBest);
if ( pIfMan->pPars->fUseTtPerm )
......@@ -2251,7 +2251,7 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
ABC_FREE( p->pCellStr );
Vec_IntFreeP( &p->vConfigs );
// disable cut minimization when GIA strucure is needed
if ( !pPars->fDelayOpt && !pPars->fDelayOptLut && !pPars->fDsdBalance && !pPars->fUserRecLib && !pPars->fUserSesLib && !pPars->fDeriveLuts && !pPars->fUseDsd && !pPars->fUseTtPerm )
if ( !pPars->fDelayOpt && !pPars->fDelayOptLut && !pPars->fDsdBalance && !pPars->fUserRecLib && !pPars->fUserSesLib && !pPars->fDeriveLuts && !pPars->fUseDsd && !pPars->fUseTtPerm && !pPars->pFuncCell2 )
pPars->fCutMin = 0;
// translate into the mapper
pIfMan = Gia_ManToIf( p, pPars );
......@@ -2291,6 +2291,8 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
If_ManStop( pIfMan );
return NULL;
}
if ( pPars->pFuncWrite )
pPars->pFuncWrite( pIfMan );
// transform the result of mapping into the new network
if ( pIfMan->pPars->fDelayOpt || pIfMan->pPars->fDsdBalance || pIfMan->pPars->fUserRecLib || pIfMan->pPars->fUserSesLib )
pNew = Gia_ManFromIfAig( pIfMan );
......@@ -2304,8 +2306,6 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
If_ManForEachCo( pIfMan, pIfObj, i )
Vec_IntPush( p->vCoArrs, (int)If_ObjArrTime(If_ObjFanin0(pIfObj)) );
}
if ( pPars->pFuncWrite )
pPars->pFuncWrite( pIfMan );
If_ManStop( pIfMan );
// transfer name
assert( pNew->pName == NULL );
......
......@@ -19,6 +19,8 @@
***********************************************************************/
#include "gia.h"
#include "misc/st/st.h"
#include "map/mio/mio.h"
ABC_NAMESPACE_IMPL_START
......@@ -42,6 +44,10 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
int Gia_ManDeriveMatches( Mio_Library_t * pLib, Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths, Vec_Mem_t ** pvTtMem, Vec_Int_t ** pvTt2Match, Vec_Int_t ** pvTt2Match4, Vec_Int_t ** pvConfigs )
{
return 0;
}
Gia_Man_t * Gia_ManIiffTest( char * pFileName, Gia_Man_t * pGia, int nLutSize, int nNumCuts, int fUseGates, int fUseCells, int fVerbose )
{
return NULL;
......
......@@ -35596,16 +35596,17 @@ usage:
***********************************************************************/
int Abc_CommandAbc9Iiff( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern Gia_Man_t * Gia_ManIiffTest( char * pFileName, Gia_Man_t * pGia, int nLutSize, int nNumCuts, int fUseGates, int fUseCells, int fVerbose );
extern Gia_Man_t * Gia_ManIiffTest( char * pFileName, Gia_Man_t * pGia, int nLutSize, int nNumCuts, int fUseGates, int fUseCells, int fUseLuts, int fVerbose );
char * pFileName = NULL;
int nLutSize = 8;
int nNumCuts = 12;
int fUseGates = 0;
int fUseCells = 0;
int fUseLuts = 0;
int c, fVerbose = 0;
Gia_Man_t * pNew;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCgcvh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "KCgclvh" ) ) != EOF )
{
switch ( c )
{
......@@ -35633,6 +35634,9 @@ int Abc_CommandAbc9Iiff( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'c':
fUseCells ^= 1;
break;
case 'l':
fUseLuts ^= 1;
break;
case 'v':
fVerbose ^= 1;
break;
......@@ -35649,7 +35653,7 @@ int Abc_CommandAbc9Iiff( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Iiff(): There is no AIG to map.\n" );
return 1;
}
pNew = Gia_ManIiffTest( pFileName, pAbc->pGia, nLutSize, nNumCuts, fUseGates, fUseCells, fVerbose );
pNew = Gia_ManIiffTest( pFileName, pAbc->pGia, nLutSize, nNumCuts, fUseGates, fUseCells, fUseLuts, fVerbose );
if ( pNew == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Iiff(): Mapping has failed.\n" );
......@@ -35659,12 +35663,13 @@ int Abc_CommandAbc9Iiff( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
Abc_Print( -2, "usage: &iiff [-KC num] [-gcvh] <file>\n" );
Abc_Print( -2, "usage: &iiff [-KC num] [-gclvh] <file>\n" );
Abc_Print( -2, "\t performs techology mapping\n" );
Abc_Print( -2, "\t-K num : the maximum LUT size [default = %d]\n", nLutSize );
Abc_Print( -2, "\t-C num : the maximum cut count [default = %d]\n", nNumCuts );
Abc_Print( -2, "\t-g : toggle using gates [default = %s]\n", fUseGates? "yes": "no" );
Abc_Print( -2, "\t-c : toggle using cells [default = %s]\n", fUseCells? "yes": "no" );
Abc_Print( -2, "\t-l : toggle using LUTs [default = %s]\n", fUseLuts? "yes": "no" );
Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
Abc_Print( -2, "\t<file> : (optional) output file name\n");
......@@ -161,7 +161,7 @@ Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck
{
int i, fCycle = 0;
Abc_Ntk_t * pModel;
fprintf( stdout, "Warning: The network contains hierarchy.\n" );
// fprintf( stdout, "Warning: The network contains hierarchy.\n" );
Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pModel, i )
if ( !Abc_NtkIsAcyclicWithBoxes( pModel ) )
fCycle = 1;
......
......@@ -752,7 +752,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut )
}
if ( !pCut->fUseless &&
(p->pPars->fUseDsd || p->pPars->fUseBat ||
(p->pPars->fUseDsd || p->pPars->pFuncCell2 || p->pPars->fUseBat ||
p->pPars->pLutStruct || p->pPars->fUserRecLib || p->pPars->fUserSesLib ||
p->pPars->fEnableCheck07 || p->pPars->fUseCofVars || p->pPars->fUseAndVars || p->pPars->fUse34Spec ||
p->pPars->fUseDsdTune || p->pPars->fEnableCheck75 || p->pPars->fEnableCheck75u) )
......
......@@ -167,7 +167,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
int fFunc0R, fFunc1R;
int i, k, v, iCutDsd, fChange;
int fSave0 = p->pPars->fDelayOpt || p->pPars->fDelayOptLut || p->pPars->fDsdBalance || p->pPars->fUserRecLib || p->pPars->fUserSesLib ||
p->pPars->fUseDsdTune || p->pPars->fUseCofVars || p->pPars->fUseAndVars || p->pPars->fUse34Spec || p->pPars->pLutStruct != NULL;
p->pPars->fUseDsdTune || p->pPars->fUseCofVars || p->pPars->fUseAndVars || p->pPars->fUse34Spec || p->pPars->pLutStruct || p->pPars->pFuncCell2;
int fUseAndCut = (p->pPars->nAndDelay > 0) || (p->pPars->nAndArea > 0);
assert( !If_ObjIsAnd(pObj->pFanin0) || pObj->pFanin0->pCutSet->nCuts > 0 );
assert( !If_ObjIsAnd(pObj->pFanin1) || pObj->pFanin1->pCutSet->nCuts > 0 );
......@@ -319,7 +319,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( p->pPars->fUseDsd )
pCut->fUseless = If_DsdManCheckDec( p->pIfDsdMan, If_CutDsdLit(p, pCut) );
else if ( p->pPars->pFuncCell2 )
pCut->fUseless = !p->pPars->pFuncCell2( p, (word *)If_CutTruth(p, pCut), pCut->nLeaves, NULL, NULL );
pCut->fUseless = !p->pPars->pFuncCell2( p, (word *)If_CutTruthW(p, pCut), pCut->nLeaves, NULL, NULL );
else
pCut->fUseless = !p->pPars->pFuncCell( p, If_CutTruth(p, pCut), Abc_MaxInt(6, pCut->nLeaves), pCut->nLeaves, p->pPars->pLutStruct );
p->nCutsUselessAll += pCut->fUseless;
......
......@@ -222,6 +222,10 @@ extern void Mio_LibraryMatchesStop( Mio_Library_t * pLib );
extern void Mio_LibraryMatchesStart( Mio_Library_t * pLib, int fPinFilter, int fPinPerm, int fPinQuick );
extern void Mio_LibraryMatchesFetch( Mio_Library_t * pLib, Vec_Mem_t ** pvTtMem, Vec_Wec_t ** pvTt2Match, Mio_Cell2_t ** ppCells, int * pnCells, int fPinFilter, int fPinPerm, int fPinQuick );
extern void Mio_LibraryMatches2Stop( Mio_Library_t * pLib );
extern void Mio_LibraryMatches2Start( Mio_Library_t * pLib );
extern void Mio_LibraryMatches2Fetch( Mio_Library_t * pLib, Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths, Vec_Mem_t ** pvTtMem, Vec_Int_t ** pvTt2Match, Vec_Int_t ** pvTt2Match4, Vec_Int_t ** pvConfigs );
/*=== sclUtil.c =========================================================*/
extern Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl );
extern Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, void * pMio, float Slew, float Gain, int nGatesMin, int fVerbose );
......
......@@ -84,6 +84,12 @@ struct Mio_LibraryStruct_t_
Vec_Wec_t * vTt2Match; // matches for truth tables
Mio_Cell2_t * pCells; // library gates
int nCells; // library gate count
Vec_Ptr_t * vNames;
Vec_Wrd_t * vTruths;
Vec_Mem_t * vTtMem_;
Vec_Int_t * vTt2Match_;
Vec_Int_t * vTt2Match4;
Vec_Int_t * vConfigs;
};
struct Mio_GateStruct_t_
......
......@@ -54,6 +54,7 @@ void Mio_LibraryDelete( Mio_Library_t * pLib )
if ( pLib == NULL )
return;
Mio_LibraryMatchesStop( pLib );
Mio_LibraryMatches2Stop( pLib );
// free the bindings of nodes to gates from this library for all networks
Abc_FrameUnmapAllNetworks( Abc_FrameGetGlobalFrame() );
// free the library
......@@ -1691,6 +1692,49 @@ void Mio_LibraryMatchesFetch( Mio_Library_t * pLib, Vec_Mem_t ** pvTtMem, Vec_We
*pnCells = pLib->nCells; // library gate count
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Mio_LibraryMatches2Stop( Mio_Library_t * pLib )
{
if ( !pLib->vNames )
return;
Vec_PtrFree( pLib->vNames );
Vec_WrdFree( pLib->vTruths );
Vec_MemHashFree( pLib->vTtMem_ );
Vec_MemFree( pLib->vTtMem_ );
Vec_IntFree( pLib->vTt2Match_ );
Vec_IntFree( pLib->vTt2Match4 );
Vec_IntFree( pLib->vConfigs );
}
void Mio_LibraryMatches2Start( Mio_Library_t * pLib )
{
extern int Gia_ManDeriveMatches( Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths, Vec_Mem_t ** pvTtMem, Vec_Int_t ** pvTt2Match, Vec_Int_t ** pvTt2Match4, Vec_Int_t ** pvConfigs );
if ( pLib->vNames )
return;
if ( pLib->vTtMem )
Mio_LibraryMatches2Stop( pLib );
Gia_ManDeriveMatches( &pLib->vNames, &pLib->vTruths, &pLib->vTtMem_, &pLib->vTt2Match_, &pLib->vTt2Match4, &pLib->vConfigs );
}
void Mio_LibraryMatches2Fetch( Mio_Library_t * pLib, Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths, Vec_Mem_t ** pvTtMem, Vec_Int_t ** pvTt2Match, Vec_Int_t ** pvTt2Match4, Vec_Int_t ** pvConfigs )
{
Mio_LibraryMatches2Start( pLib );
*pvNames = pLib->vNames;
*pvTruths = pLib->vTruths;
*pvTtMem = pLib->vTtMem_;
*pvTt2Match = pLib->vTt2Match_;
*pvTt2Match4 = pLib->vTt2Match4;
*pvConfigs = pLib->vConfigs;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
......
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