summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-01-09 13:06:45 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2021-01-09 13:06:45 -0800
commitcd8843c06ce2a37067edb5116f0c735ce3e3b7c7 (patch)
tree04baa507c5321dea5c96a1aafb4ce83bce43c915 /src
parentbf96f0b31d255f56a355a92cb0fc2867eff68e9a (diff)
downloadabc-cd8843c06ce2a37067edb5116f0c735ce3e3b7c7.tar.gz
abc-cd8843c06ce2a37067edb5116f0c735ce3e3b7c7.tar.bz2
abc-cd8843c06ce2a37067edb5116f0c735ce3e3b7c7.zip
Preventing command history from being overwritten by internal scripts.
Diffstat (limited to 'src')
-rw-r--r--src/aig/gia/giaDeep.c19
-rw-r--r--src/base/abc/abcUtil.c6
-rw-r--r--src/base/cmd/cmdHist.c3
-rw-r--r--src/base/main/main.h1
-rw-r--r--src/base/main/mainFrame.c1
5 files changed, 26 insertions, 4 deletions
diff --git a/src/aig/gia/giaDeep.c b/src/aig/gia/giaDeep.c
index aa9e9cb2..eecc598a 100644
--- a/src/aig/gia/giaDeep.c
+++ b/src/aig/gia/giaDeep.c
@@ -74,10 +74,23 @@ Gia_Man_t * Gia_ManDeepSynOne( int nNoImpr, int TimeOut, int nAnds, int Seed, in
pComp = "; &dc2";
sprintf( Command, "&dch%s; &if -a -K %d; &mfs -e -W 20 -L 20%s%s",
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 );
- return NULL;
+ if ( Cmd_CommandExecute(Abc_FrameGetGlobalFrame(), Command) )
+ {
+ 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());
if ( Gia_ManAndNum(pNew) > Gia_ManAndNum(pTemp) )
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index 922b34ae..51d31527 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -3123,7 +3123,9 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops )
int i, k, iNode = 0;
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
//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" );
+ Abc_FrameSetBatchMode( 0 );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) );
Abc_NtkForEachPi( pNtkNew, pObj, i )
@@ -3150,7 +3152,9 @@ Vec_Wec_t * Abc_GiaSynthesize( Vec_Ptr_t * vGias, Gia_Man_t * pMulti )
Abc_Obj_t * pObj, * pFanin;
int i, k, iNode = 0;
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" );
+ Abc_FrameSetBatchMode( 0 );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) );
Abc_NtkForEachPi( pNtkNew, pObj, i )
@@ -3254,9 +3258,11 @@ Gia_Man_t * Abc_SopSynthesizeOne( char * pSop, int fClp )
pNtk = Abc_NtkCreateFromSops( "top", vSops );
Vec_PtrFree( vSops );
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
+ Abc_FrameSetBatchMode( 1 );
if ( fClp )
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "clp; sop" );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2" );
+ Abc_FrameSetBatchMode( 0 );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
return Abc_NtkStrashToGia( pNtkNew );
}
diff --git a/src/base/cmd/cmdHist.c b/src/base/cmd/cmdHist.c
index 218d832f..b8cfc98f 100644
--- a/src/base/cmd/cmdHist.c
+++ b/src/base/cmd/cmdHist.c
@@ -65,7 +65,8 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command )
strncmp(Buffer,"time",4) &&
strncmp(Buffer,"quit",4) &&
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") &&
Buffer[strlen(Buffer)-1] != '?' )
{
diff --git a/src/base/main/main.h b/src/base/main/main.h
index a310972d..f3457e27 100644
--- a/src/base/main/main.h
+++ b/src/base/main/main.h
@@ -111,6 +111,7 @@ extern ABC_DLL char * Abc_FrameReadSpecName();
extern ABC_DLL char * Abc_FrameReadFlag( char * pFlag );
extern ABC_DLL int Abc_FrameIsFlagEnabled( char * pFlag );
extern ABC_DLL int Abc_FrameIsBatchMode();
+extern ABC_DLL void Abc_FrameSetBatchMode( int Mode );
extern ABC_DLL int Abc_FrameIsBridgeMode();
extern ABC_DLL void Abc_FrameSetBridgeMode();
diff --git a/src/base/main/mainFrame.c b/src/base/main/mainFrame.c
index b7d76e93..ba41d4c1 100644
--- a/src/base/main/mainFrame.c
+++ b/src/base/main/mainFrame.c
@@ -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; }
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; }
void Abc_FrameSetBridgeMode() { if ( s_GlobalFrame ) s_GlobalFrame->fBridgeMode = 1; }