summaryrefslogtreecommitdiffstats
path: root/src/base/io/io.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-06-16 15:22:03 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2016-06-16 15:22:03 -0700
commitada21a655f9a6f04b13a5f90758a7b64ab72f221 (patch)
tree4c5a918306396dfc38fa72057561cb17823baf4e /src/base/io/io.c
parente1b51d1863a974f7be203a3cc46727575045e3bd (diff)
downloadabc-ada21a655f9a6f04b13a5f90758a7b64ab72f221.tar.gz
abc-ada21a655f9a6f04b13a5f90758a7b64ab72f221.tar.bz2
abc-ada21a655f9a6f04b13a5f90758a7b64ab72f221.zip
New multi-output PLA reader and preprocessor (read_plamo).
Diffstat (limited to 'src/base/io/io.c')
-rw-r--r--src/base/io/io.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/base/io/io.c b/src/base/io/io.c
index a5a64db6..f5f4c341 100644
--- a/src/base/io/io.c
+++ b/src/base/io/io.c
@@ -43,6 +43,7 @@ static int IoCommandReadEqn ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadFins ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadInit ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadPla ( Abc_Frame_t * pAbc, int argc, char **argv );
+static int IoCommandReadPlaMo ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadTruth ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadVerilog ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadStatus ( Abc_Frame_t * pAbc, int argc, char **argv );
@@ -108,6 +109,7 @@ void Io_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "I/O", "read_fins", IoCommandReadFins, 0 );
Cmd_CommandAdd( pAbc, "I/O", "read_init", IoCommandReadInit, 1 );
Cmd_CommandAdd( pAbc, "I/O", "read_pla", IoCommandReadPla, 1 );
+ Cmd_CommandAdd( pAbc, "I/O", "read_plamo", IoCommandReadPlaMo, 1 );
Cmd_CommandAdd( pAbc, "I/O", "read_truth", IoCommandReadTruth, 1 );
Cmd_CommandAdd( pAbc, "I/O", "read_verilog", IoCommandReadVerilog, 1 );
Cmd_CommandAdd( pAbc, "I/O", "read_status", IoCommandReadStatus, 0 );
@@ -1039,6 +1041,56 @@ usage:
SeeAlso []
***********************************************************************/
+int IoCommandReadPlaMo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern Abc_Ntk_t * Mop_ManTest( char * pFileName, int fVerbose );
+ Abc_Ntk_t * pNtk;
+ int c, fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( argc != globalUtilOptind + 1 )
+ goto usage;
+ // get the input file name
+ pNtk = Mop_ManTest( argv[globalUtilOptind], fVerbose );
+ if ( pNtk == NULL )
+ return 1;
+ // replace the current network
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
+ return 0;
+
+usage:
+ fprintf( pAbc->Err, "usage: read_plamo [-vh] <file>\n" );
+ fprintf( pAbc->Err, "\t reads the network in multi-output PLA\n" );
+ fprintf( pAbc->Err, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes":"no" );
+ fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
+ fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int IoCommandReadTruth( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Abc_Ntk_t * pNtk;