summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-10-22 20:17:09 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-10-22 20:17:09 -0700
commit51be0f4c5258da3ca5724b69fb0d4b2eafdc89fb (patch)
treec3073d8b913d65325627845f2b36a91110e5518d
parent51bf12107397b25a79b0c7b593bd3bf74e68e021 (diff)
downloadabc-51be0f4c5258da3ca5724b69fb0d4b2eafdc89fb.tar.gz
abc-51be0f4c5258da3ca5724b69fb0d4b2eafdc89fb.tar.bz2
abc-51be0f4c5258da3ca5724b69fb0d4b2eafdc89fb.zip
One bug fix and two small changes.
-rw-r--r--src/base/abci/abc.c12
-rw-r--r--src/base/abci/module.make8
-rw-r--r--src/misc/extra/extra.h1
-rw-r--r--src/misc/extra/extraUtilFile.c13
4 files changed, 27 insertions, 7 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index d9ce4163..a3a70ab9 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -13247,6 +13247,8 @@ int Abc_CommandRestore( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
}
Abc_FrameReplaceCurrentNetwork( pAbc, Abc_NtkDup(pAbc->pNtkBackup) );
+ pAbc->nFrames = -1;
+ pAbc->Status = -1;
return 0;
usage:
@@ -25327,7 +25329,8 @@ usage:
***********************************************************************/
int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- Gia_Man_t * pAig;
+ extern void Abc3_ReadShowHie( char * pFileName, int fFlat );
+ Gia_Man_t * pAig = NULL;
FILE * pFile;
char ** pArgvNew;
char * FileName, * pTemp;
@@ -25379,9 +25382,12 @@ int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( fUseMini )
pAig = Gia_ManReadMiniAig( FileName );
- else
+ else if ( Extra_FileIsType( FileName, ".v", NULL, NULL ) )
+ Abc3_ReadShowHie( FileName, fSkipStrash );
+ else
pAig = Gia_AigerRead( FileName, fSkipStrash, 0 );
- Abc_FrameUpdateGia( pAbc, pAig );
+ if ( pAig )
+ Abc_FrameUpdateGia( pAbc, pAig );
return 0;
usage:
diff --git a/src/base/abci/module.make b/src/base/abci/module.make
index 2f75a863..201eafda 100644
--- a/src/base/abci/module.make
+++ b/src/base/abci/module.make
@@ -17,14 +17,14 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcDsd.c \
src/base/abci/abcExtract.c \
src/base/abci/abcFraig.c \
- src/base/abci/abcFx.c \
- src/base/abci/abcFxu.c \
- src/base/abci/abcGen.c \
+ src/base/abci/abcFx.c \
+ src/base/abci/abcFxu.c \
+ src/base/abci/abcGen.c \
src/base/abci/abcHaig.c \
src/base/abci/abcIf.c \
src/base/abci/abcIfif.c \
src/base/abci/abcIfMux.c \
- src/base/abci/abcIvy.c \
+ src/base/abci/abcIvy.c \
src/base/abci/abcLog.c \
src/base/abci/abcLut.c \
src/base/abci/abcLutmin.c \
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h
index c0a7be95..4e36554c 100644
--- a/src/misc/extra/extra.h
+++ b/src/misc/extra/extra.h
@@ -104,6 +104,7 @@ extern char * Extra_FileNameAppend( char * pBase, char * pSuffix );
extern char * Extra_FileNameGeneric( char * FileName );
extern char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix );
extern char * Extra_FileNameWithoutPath( char * FileName );
+extern char * Extra_FilePathWithoutName( char * FileName );
extern int Extra_FileCheck( char * pFileName );
extern int Extra_FileSize( char * pFileName );
extern char * Extra_FileRead( FILE * pFile );
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c
index 18a7f42c..bec8ba1e 100644
--- a/src/misc/extra/extraUtilFile.c
+++ b/src/misc/extra/extraUtilFile.c
@@ -213,6 +213,19 @@ char * Extra_FileNameWithoutPath( char * FileName )
return pRes + 1;
return FileName;
}
+char * Extra_FilePathWithoutName( char * FileName )
+{
+ char * pRes;
+ FileName = Abc_UtilStrsav( FileName );
+ for ( pRes = FileName + strlen(FileName) - 1; pRes >= FileName; pRes-- )
+ if ( *pRes == '\\' || *pRes == '/' )
+ {
+ *pRes = 0;
+ return FileName;
+ }
+ ABC_FREE( FileName );
+ return NULL;
+}
/**Function*************************************************************