Commit cd8843c0 authored by Alan Mishchenko's avatar Alan Mishchenko

Preventing command history from being overwritten by internal scripts.

parent bf96f0b3
...@@ -74,10 +74,23 @@ Gia_Man_t * Gia_ManDeepSynOne( int nNoImpr, int TimeOut, int nAnds, int Seed, in ...@@ -74,10 +74,23 @@ Gia_Man_t * Gia_ManDeepSynOne( int nNoImpr, int TimeOut, int nAnds, int Seed, in
pComp = "; &dc2"; pComp = "; &dc2";
sprintf( Command, "&dch%s; &if -a -K %d; &mfs -e -W 20 -L 20%s%s", sprintf( Command, "&dch%s; &if -a -K %d; &mfs -e -W 20 -L 20%s%s",
fDch ? " -f" : "", KLut, fFx ? "; &fx" : "", pComp ); fDch ? " -f" : "", KLut, fFx ? "; &fx" : "", pComp );
if ( Cmd_CommandExecute(Abc_FrameGetGlobalFrame(), Command) ) if ( Abc_FrameIsBatchMode() )
{ {
Abc_Print( 1, "Something did not work out with the command \"%s\".\n", Command ); if ( Cmd_CommandExecute(Abc_FrameGetGlobalFrame(), Command) )
return NULL; {
Abc_Print( 1, "Something did not work out with the command \"%s\".\n", Command );
return NULL;
}
}
else
{
Abc_FrameSetBatchMode( 1 );
if ( Cmd_CommandExecute(Abc_FrameGetGlobalFrame(), Command) )
{
Abc_Print( 1, "Something did not work out with the command \"%s\".\n", Command );
return NULL;
}
Abc_FrameSetBatchMode( 0 );
} }
pTemp = Abc_FrameReadGia(Abc_FrameGetGlobalFrame()); pTemp = Abc_FrameReadGia(Abc_FrameGetGlobalFrame());
if ( Gia_ManAndNum(pNew) > Gia_ManAndNum(pTemp) ) if ( Gia_ManAndNum(pNew) > Gia_ManAndNum(pTemp) )
......
...@@ -3123,7 +3123,9 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops ) ...@@ -3123,7 +3123,9 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops )
int i, k, iNode = 0; int i, k, iNode = 0;
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk ); Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
//Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2; map -a" ); //Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2; map -a" );
Abc_FrameSetBatchMode( 1 );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "st; collapse; sop; fx; strash; &get; &ps; &deepsyn -I 4 -J 50 -T 5 -S 111 -t; &ps; &put; map -a" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "st; collapse; sop; fx; strash; &get; &ps; &deepsyn -I 4 -J 50 -T 5 -S 111 -t; &ps; &put; map -a" );
Abc_FrameSetBatchMode( 0 );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() ); pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) ); vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) );
Abc_NtkForEachPi( pNtkNew, pObj, i ) Abc_NtkForEachPi( pNtkNew, pObj, i )
...@@ -3150,7 +3152,9 @@ Vec_Wec_t * Abc_GiaSynthesize( Vec_Ptr_t * vGias, Gia_Man_t * pMulti ) ...@@ -3150,7 +3152,9 @@ Vec_Wec_t * Abc_GiaSynthesize( Vec_Ptr_t * vGias, Gia_Man_t * pMulti )
Abc_Obj_t * pObj, * pFanin; Abc_Obj_t * pObj, * pFanin;
int i, k, iNode = 0; int i, k, iNode = 0;
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk ); Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
Abc_FrameSetBatchMode( 1 );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "compress2rs; dch; map -a; strash; compress2rs; dch; map -a; strash; compress2rs; dch; map -a" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "compress2rs; dch; map -a; strash; compress2rs; dch; map -a; strash; compress2rs; dch; map -a" );
Abc_FrameSetBatchMode( 0 );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() ); pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) ); vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) );
Abc_NtkForEachPi( pNtkNew, pObj, i ) Abc_NtkForEachPi( pNtkNew, pObj, i )
...@@ -3254,9 +3258,11 @@ Gia_Man_t * Abc_SopSynthesizeOne( char * pSop, int fClp ) ...@@ -3254,9 +3258,11 @@ Gia_Man_t * Abc_SopSynthesizeOne( char * pSop, int fClp )
pNtk = Abc_NtkCreateFromSops( "top", vSops ); pNtk = Abc_NtkCreateFromSops( "top", vSops );
Vec_PtrFree( vSops ); Vec_PtrFree( vSops );
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk ); Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
Abc_FrameSetBatchMode( 1 );
if ( fClp ) if ( fClp )
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "clp; sop" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "clp; sop" );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2" );
Abc_FrameSetBatchMode( 0 );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() ); pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
return Abc_NtkStrashToGia( pNtkNew ); return Abc_NtkStrashToGia( pNtkNew );
} }
......
...@@ -65,7 +65,8 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command ) ...@@ -65,7 +65,8 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command )
strncmp(Buffer,"time",4) && strncmp(Buffer,"time",4) &&
strncmp(Buffer,"quit",4) && strncmp(Buffer,"quit",4) &&
strncmp(Buffer,"alias",5) && strncmp(Buffer,"alias",5) &&
// strncmp(Buffer,"source",6) && strncmp(Buffer,"source abc.rc",13) &&
strncmp(Buffer,"source ..\\abc.rc",16) &&
strncmp(Buffer,"history",7) && strncmp(Buffer,"hi ", 3) && strcmp(Buffer,"hi") && strncmp(Buffer,"history",7) && strncmp(Buffer,"hi ", 3) && strcmp(Buffer,"hi") &&
Buffer[strlen(Buffer)-1] != '?' ) Buffer[strlen(Buffer)-1] != '?' )
{ {
......
...@@ -111,6 +111,7 @@ extern ABC_DLL char * Abc_FrameReadSpecName(); ...@@ -111,6 +111,7 @@ extern ABC_DLL char * Abc_FrameReadSpecName();
extern ABC_DLL char * Abc_FrameReadFlag( char * pFlag ); extern ABC_DLL char * Abc_FrameReadFlag( char * pFlag );
extern ABC_DLL int Abc_FrameIsFlagEnabled( char * pFlag ); extern ABC_DLL int Abc_FrameIsFlagEnabled( char * pFlag );
extern ABC_DLL int Abc_FrameIsBatchMode(); extern ABC_DLL int Abc_FrameIsBatchMode();
extern ABC_DLL void Abc_FrameSetBatchMode( int Mode );
extern ABC_DLL int Abc_FrameIsBridgeMode(); extern ABC_DLL int Abc_FrameIsBridgeMode();
extern ABC_DLL void Abc_FrameSetBridgeMode(); extern ABC_DLL void Abc_FrameSetBridgeMode();
......
...@@ -108,6 +108,7 @@ void Abc_FrameSetSignalNames( Vec_Ptr_t * vNames ) { if ( s_GlobalFram ...@@ -108,6 +108,7 @@ void Abc_FrameSetSignalNames( Vec_Ptr_t * vNames ) { if ( s_GlobalFram
void Abc_FrameSetSpecName( char * pFileName ) { ABC_FREE( s_GlobalFrame->pSpecName ); s_GlobalFrame->pSpecName = pFileName; } void Abc_FrameSetSpecName( char * pFileName ) { ABC_FREE( s_GlobalFrame->pSpecName ); s_GlobalFrame->pSpecName = pFileName; }
int Abc_FrameIsBatchMode() { return s_GlobalFrame ? s_GlobalFrame->fBatchMode : 0; } int Abc_FrameIsBatchMode() { return s_GlobalFrame ? s_GlobalFrame->fBatchMode : 0; }
void Abc_FrameSetBatchMode( int Mode ) { if ( s_GlobalFrame ) s_GlobalFrame->fBatchMode = Mode; }
int Abc_FrameIsBridgeMode() { return s_GlobalFrame ? s_GlobalFrame->fBridgeMode : 0; } int Abc_FrameIsBridgeMode() { return s_GlobalFrame ? s_GlobalFrame->fBridgeMode : 0; }
void Abc_FrameSetBridgeMode() { if ( s_GlobalFrame ) s_GlobalFrame->fBridgeMode = 1; } void Abc_FrameSetBridgeMode() { if ( s_GlobalFrame ) s_GlobalFrame->fBridgeMode = 1; }
......
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