From dc9a08bddcebec73f9298f43bc548e0894c85cbb Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 20 Sep 2014 21:52:39 -0700 Subject: Tuning the flow scripts. --- src/aig/gia/giaScript.c | 74 +++++++++++++++++++++++++++++++++++++++++++++---- src/misc/vec/vecPtr.h | 1 + 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/src/aig/gia/giaScript.c b/src/aig/gia/giaScript.c index 5af50b4f..be5720dd 100644 --- a/src/aig/gia/giaScript.c +++ b/src/aig/gia/giaScript.c @@ -373,6 +373,7 @@ void Gia_ManPerformMap( int nAnds, int nLutSize, int nCutNum, int fVerbose ) { char Command[200]; sprintf( Command, "&unmap; &lf -K %d -C %d -k; &save", nLutSize, nCutNum ); +// sprintf( Command, "&unmap; &if -K %d -C %d; &save", nLutSize, nCutNum ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command ); if ( fVerbose ) { @@ -387,7 +388,7 @@ void Gia_ManPerformMap( int nAnds, int nLutSize, int nCutNum, int fVerbose ) printf( "Mapping with &lf:\n" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); } - if ( (nLutSize == 4 && nAnds < 100000) || (nLutSize == 6 && nAnds < 2000) ) + if ( (nLutSize == 4 && nAnds < 100000) || (nLutSize == 6 && nAnds < 10000) ) { sprintf( Command, "&unmap; &if -sz -S %d%d -K %d -C %d", nLutSize, nLutSize, 2*nLutSize-1, 2*nCutNum ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command ); @@ -492,11 +493,15 @@ void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, in ***********************************************************************/ void Gia_ManPerformFlow2( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fVerbose ) { - char Comm1[100], Comm2[100]; - sprintf( Comm1, "&synch2 -K %d; &lf -mk -E 5 -K %d -C %d; &save", nLutSize, nLutSize, nCutNum ); - sprintf( Comm2, "&dch -f; &lf -mk -E 5 -K %d -C %d; &save", nLutSize, nCutNum+4 ); + char Comm1[100], Comm2[100], Comm3[100], Comm4[100]; + sprintf( Comm1, "&synch2 -K %d; &if -m -K %d -C %d; &save", nLutSize, nLutSize, nCutNum ); + sprintf( Comm2, "&dch -f; &if -m -K %d -C %d; &save", nLutSize, nCutNum+4 ); + sprintf( Comm3, "&synch2 -K %d; &lf -mk -E 5 -K %d -C %d; &save", nLutSize, nLutSize, nCutNum ); + sprintf( Comm4, "&dch -f; &lf -mk -E 5 -K %d -C %d; &save", nLutSize, nCutNum+4 ); // perform synthesis + if ( fVerbose ) + printf( "Trying synthesis...\n" ); if ( fIsMapped ) Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Comm1 ); @@ -509,9 +514,44 @@ void Gia_ManPerformFlow2( int fIsMapped, int nAnds, int nLevels, int nLutSize, i if ( fVerbose ) Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + // return the result + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" ); + if ( fVerbose ) + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + + + // perform balancing + if ( fVerbose ) + printf( "Trying SOP balancing...\n" ); + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st; &sopb -R 10 -C 4" ); + + + // perform synthesis + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Comm3 ); + if ( fVerbose ) + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + // perform synthesis Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" ); - Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Comm1 ); + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Comm2 ); + if ( fVerbose ) + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + + // return the result + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" ); + if ( fVerbose ) + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + if ( nAnds > 100000 ) + return; + + + // perform balancing + if ( fVerbose ) + printf( "Trying SOP balancing...\n" ); + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st; &sopb -R 10" ); + + // perform synthesis + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Comm3 ); if ( fVerbose ) Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); @@ -521,7 +561,31 @@ void Gia_ManPerformFlow2( int fIsMapped, int nAnds, int nLevels, int nLutSize, i if ( fVerbose ) Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + // return the result + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" ); + if ( fVerbose ) + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + if ( nAnds > 50000 ) + return; + + + // perform balancing + if ( fVerbose ) + printf( "Trying SOP balancing...\n" ); + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st; &sopb -R 10" ); + + // perform synthesis + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Comm3 ); + if ( fVerbose ) + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + // perform synthesis + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" ); + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Comm2 ); + if ( fVerbose ) + Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); + + // return the result Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" ); if ( fVerbose ) Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" ); diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index a666f45f..e6125256 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -883,6 +883,7 @@ static void Vec_PtrUniqify( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)() ) p->pArray[k++] = p->pArray[i]; p->nSize = k; } +static void Vec_PtrUniqify2( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)(), void (*Vec_PtrObjFree)(), Vec_Int_t * vCounts ) ___unused; static void Vec_PtrUniqify2( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)(), void (*Vec_PtrObjFree)(), Vec_Int_t * vCounts ) { int i, k; -- cgit v1.2.3