summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abc.h232
-rw-r--r--src/base/abc/abcAig.c52
-rw-r--r--src/base/abc/abcBlifMv.c59
-rw-r--r--src/base/abc/abcCheck.c79
-rw-r--r--src/base/abc/abcDfs.c46
-rw-r--r--src/base/abc/abcFanio.c9
-rw-r--r--src/base/abc/abcFunc.c100
-rw-r--r--src/base/abc/abcHie.c15
-rw-r--r--src/base/abc/abcInt.h8
-rw-r--r--src/base/abc/abcLatch.c41
-rw-r--r--src/base/abc/abcLib.c35
-rw-r--r--src/base/abc/abcMinBase.c31
-rw-r--r--src/base/abc/abcNames.c69
-rw-r--r--src/base/abc/abcNetlist.c25
-rw-r--r--src/base/abc/abcNtk.c188
-rw-r--r--src/base/abc/abcObj.c135
-rw-r--r--src/base/abc/abcRefs.c19
-rw-r--r--src/base/abc/abcShow.c119
-rw-r--r--src/base/abc/abcSop.c25
-rw-r--r--src/base/abc/abcUtil.c61
-rw-r--r--src/base/abc/abc_.c5
-rw-r--r--src/base/abci/abc.c10887
-rw-r--r--src/base/abci/abcAbc8.c24
-rw-r--r--src/base/abci/abcAttach.c15
-rw-r--r--src/base/abci/abcAuto.c5
-rw-r--r--src/base/abci/abcBalance.c62
-rw-r--r--src/base/abci/abcBidec.c14
-rw-r--r--src/base/abci/abcBm.c2047
-rw-r--r--src/base/abci/abcBmc.c7
-rw-r--r--src/base/abci/abcCas.c5
-rw-r--r--src/base/abci/abcCascade.c284
-rw-r--r--src/base/abci/abcClpSop.c53
-rw-r--r--src/base/abci/abcCollapse.c (renamed from src/base/abci/abcClpBdd.c)9
-rw-r--r--src/base/abci/abcCut.c31
-rw-r--r--src/base/abci/abcDar.c588
-rw-r--r--src/base/abci/abcDebug.c8
-rw-r--r--src/base/abci/abcDprove2.c405
-rw-r--r--src/base/abci/abcDress.c5
-rw-r--r--src/base/abci/abcDress2.c435
-rw-r--r--src/base/abci/abcDsd.c49
-rw-r--r--src/base/abci/abcEspresso.c5
-rw-r--r--src/base/abci/abcExtract.c5
-rw-r--r--src/base/abci/abcFlop.c (renamed from src/base/abci/abc_.c)24
-rw-r--r--src/base/abci/abcFpga.c13
-rw-r--r--src/base/abci/abcFpgaFast.c17
-rw-r--r--src/base/abci/abcFraig.c73
-rw-r--r--src/base/abci/abcFxu.c25
-rw-r--r--src/base/abci/abcGen.c13
-rw-r--r--src/base/abci/abcHaig.c59
-rw-r--r--src/base/abci/abcIf.c130
-rw-r--r--src/base/abci/abcIfMux.c422
-rw-r--r--src/base/abci/abcIvy.c52
-rw-r--r--src/base/abci/abcLog.c215
-rw-r--r--src/base/abci/abcLut.c39
-rw-r--r--src/base/abci/abcLutmin.c61
-rw-r--r--src/base/abci/abcMap.c25
-rw-r--r--src/base/abci/abcMeasure.c13
-rw-r--r--src/base/abci/abcMerge.c15
-rw-r--r--src/base/abci/abcMini.c9
-rw-r--r--src/base/abci/abcMiter.c59
-rw-r--r--src/base/abci/abcMulti.c27
-rw-r--r--src/base/abci/abcMv.c5
-rw-r--r--src/base/abci/abcNtbdd.c33
-rw-r--r--src/base/abci/abcOdc.c40
-rw-r--r--src/base/abci/abcOrder.c9
-rw-r--r--src/base/abci/abcPart.c103
-rw-r--r--src/base/abci/abcPlace.c11
-rw-r--r--src/base/abci/abcPrint.c81
-rw-r--r--src/base/abci/abcProve.c13
-rw-r--r--src/base/abci/abcQbf.c5
-rw-r--r--src/base/abci/abcQuant.c41
-rw-r--r--src/base/abci/abcReach.c5
-rw-r--r--src/base/abci/abcRec.c17
-rw-r--r--src/base/abci/abcReconv.c47
-rw-r--r--src/base/abci/abcRefactor.c23
-rw-r--r--src/base/abci/abcRenode.c5
-rw-r--r--src/base/abci/abcReorder.c12
-rw-r--r--src/base/abci/abcRestruct.c95
-rw-r--r--src/base/abci/abcResub.c193
-rw-r--r--src/base/abci/abcRewrite.c27
-rw-r--r--src/base/abci/abcRr.c54
-rw-r--r--src/base/abci/abcSat.c49
-rw-r--r--src/base/abci/abcScorr.c454
-rw-r--r--src/base/abci/abcSense.c26
-rw-r--r--src/base/abci/abcSpeedup.c (renamed from src/base/abci/abcDelay.c)74
-rw-r--r--src/base/abci/abcStrash.c124
-rw-r--r--src/base/abci/abcSweep.c56
-rw-r--r--src/base/abci/abcSymm.c8
-rw-r--r--src/base/abci/abcTiming.c35
-rw-r--r--src/base/abci/abcUnate.c5
-rw-r--r--src/base/abci/abcUnreach.c15
-rw-r--r--src/base/abci/abcVerify.c97
-rw-r--r--src/base/abci/abcXsim.c15
-rw-r--r--src/base/abci/fahout cut.c357
-rw-r--r--src/base/abci/module.make12
-rw-r--r--src/base/cmd/cmd.c92
-rw-r--r--src/base/cmd/cmd.h30
-rw-r--r--src/base/cmd/cmdAlias.c6
-rw-r--r--src/base/cmd/cmdApi.c19
-rw-r--r--src/base/cmd/cmdFlag.c10
-rw-r--r--src/base/cmd/cmdHist.c8
-rw-r--r--src/base/cmd/cmdInt.h14
-rw-r--r--src/base/cmd/cmdLoad.c226
-rw-r--r--src/base/cmd/cmdPlugin.c629
-rw-r--r--src/base/cmd/cmdUtils.c60
-rw-r--r--src/base/cmd/module.make2
-rw-r--r--src/base/io/io.c279
-rw-r--r--src/base/io/ioAbc.h26
-rw-r--r--src/base/io/ioInt.h8
-rw-r--r--src/base/io/ioReadAiger.c27
-rw-r--r--src/base/io/ioReadBaf.c15
-rw-r--r--src/base/io/ioReadBblif.c15
-rw-r--r--src/base/io/ioReadBench.c61
-rw-r--r--src/base/io/ioReadBlif.c113
-rw-r--r--src/base/io/ioReadBlifAig.c77
-rw-r--r--src/base/io/ioReadBlifMv.c380
-rw-r--r--src/base/io/ioReadDsd.c13
-rw-r--r--src/base/io/ioReadEdif.c103
-rw-r--r--src/base/io/ioReadEqn.c31
-rw-r--r--src/base/io/ioReadPla.c45
-rw-r--r--src/base/io/ioReadVerilog.c10
-rw-r--r--src/base/io/ioUtil.c83
-rw-r--r--src/base/io/ioWriteAiger.c12
-rw-r--r--src/base/io/ioWriteBaf.c15
-rw-r--r--src/base/io/ioWriteBblif.c11
-rw-r--r--src/base/io/ioWriteBench.c11
-rw-r--r--src/base/io/ioWriteBlif.c169
-rw-r--r--src/base/io/ioWriteBlifMv.c59
-rw-r--r--src/base/io/ioWriteBook.c99
-rw-r--r--src/base/io/ioWriteCnf.c7
-rw-r--r--src/base/io/ioWriteDot.c67
-rw-r--r--src/base/io/ioWriteEqn.c9
-rw-r--r--src/base/io/ioWriteGml.c5
-rw-r--r--src/base/io/ioWriteList.c5
-rw-r--r--src/base/io/ioWritePla.c11
-rw-r--r--src/base/io/ioWriteSmv.c265
-rw-r--r--src/base/io/ioWriteVerilog.c19
-rw-r--r--src/base/io/module.make3
-rw-r--r--src/base/main/libSupport.c16
-rw-r--r--src/base/main/main.c115
-rw-r--r--src/base/main/main.h46
-rw-r--r--src/base/main/mainFrame.c115
-rw-r--r--src/base/main/mainInit.c17
-rw-r--r--src/base/main/mainInt.h40
-rw-r--r--src/base/main/mainLib.c93
-rw-r--r--src/base/main/mainMC.c5
-rw-r--r--src/base/main/mainUtils.c35
-rw-r--r--src/base/main/module.make1
-rw-r--r--src/base/seq/seq.h18
-rw-r--r--src/base/seq/seqAigCore.c34
-rw-r--r--src/base/seq/seqAigIter.c5
-rw-r--r--src/base/seq/seqCreate.c13
-rw-r--r--src/base/seq/seqFpgaCore.c37
-rw-r--r--src/base/seq/seqFpgaIter.c5
-rw-r--r--src/base/seq/seqInt.h16
-rw-r--r--src/base/seq/seqLatch.c5
-rw-r--r--src/base/seq/seqMan.c7
-rw-r--r--src/base/seq/seqMapCore.c37
-rw-r--r--src/base/seq/seqMapIter.c5
-rw-r--r--src/base/seq/seqMaxMeanCycle.c7
-rw-r--r--src/base/seq/seqRetCore.c15
-rw-r--r--src/base/seq/seqRetIter.c23
-rw-r--r--src/base/seq/seqShare.c17
-rw-r--r--src/base/seq/seqUtil.c5
-rw-r--r--src/base/temp.c83
-rw-r--r--src/base/ver/ver.h16
-rw-r--r--src/base/ver/verCore.c173
-rw-r--r--src/base/ver/verFormula.c33
-rw-r--r--src/base/ver/verParse.c5
-rw-r--r--src/base/ver/verStream.c5
-rw-r--r--src/base/ver/verWords.c5
-rw-r--r--src/base/ver/ver_.c5
172 files changed, 16660 insertions, 7279 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h
index 73a487e9..6dcb3881 100644
--- a/src/base/abc/abc.h
+++ b/src/base/abc/abc.h
@@ -21,6 +21,7 @@
#ifndef __ABC_H__
#define __ABC_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -31,10 +32,10 @@
#include <assert.h>
#include <time.h>
+#include "vec.h"
#include "cuddInt.h"
#include "hop.h"
#include "extra.h"
-#include "vec.h"
#include "stmm.h"
#include "nm.h"
@@ -42,9 +43,10 @@
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+
+ABC_NAMESPACE_HEADER_START
+
// network types
typedef enum {
@@ -109,15 +111,9 @@ typedef enum {
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
-//typedef int bool;
-#ifndef __cplusplus
-#ifndef bool
-#define bool int
-#endif
-#endif
-
typedef struct Abc_Lib_t_ Abc_Lib_t;
typedef struct Abc_Ntk_t_ Abc_Ntk_t;
+struct Abc_Obj_t_;
typedef struct Abc_Obj_t_ Abc_Obj_t;
typedef struct Abc_Aig_t_ Abc_Aig_t;
typedef struct Abc_ManTime_t_ Abc_ManTime_t;
@@ -152,7 +148,10 @@ struct Abc_Obj_t_ // 12 words
Vec_Int_t vFanins; // the array of fanins
Vec_Int_t vFanouts; // the array of fanouts
// miscellaneous
+ union {
void * pData; // the network specific data (SOP, BDD, gate, equiv class, etc)
+ int iData;
+ };
Abc_Obj_t * pNext; // the next pointer in the hash table
union { // temporary store for user's data
Abc_Obj_t * pCopy; // the copy of this object
@@ -178,9 +177,10 @@ struct Abc_Ntk_t_
Vec_Ptr_t * vCis; // the array of combinational inputs (PIs, latches)
Vec_Ptr_t * vCos; // the array of combinational outputs (POs, asserts, latches)
Vec_Ptr_t * vPios; // the array of PIOs
- Vec_Ptr_t * vAsserts; // the array of assertions
Vec_Ptr_t * vBoxes; // the array of boxes
+ Vec_Ptr_t * vLtlProperties;
// the number of living objects
+ int nConstrs; // the number of constraints (model checking only)
int nObjs; // the number of live objs
int nObjCounts[ABC_OBJ_NUMBER]; // the number of objects by type
// the backup network and the step number
@@ -202,7 +202,8 @@ struct Abc_Ntk_t_
Vec_Int_t * vLevelsR; // level in the reverse topological order (for AIGs)
Vec_Ptr_t * vSupps; // CO support information
int * pModel; // counter-example (for miters)
- void * pSeqModel; // counter-example (for sequential miters)
+ Abc_Cex_t * pSeqModel; // counter-example (for sequential miters)
+ Vec_Ptr_t * pSeqModelVec; // vector of counter-examples (for sequential miters)
Abc_Ntk_t * pExdc; // the EXDC network (if given)
void * pExcare; // the EXDC network (if given)
void * pData; // misc
@@ -230,8 +231,10 @@ struct Abc_Lib_t_
////////////////////////////////////////////////////////////////////////
// transforming floats into ints and back
-static inline int Abc_Float2Int( float Val ) { return *((int *)&Val); }
-static inline float Abc_Int2Float( int Num ) { return *((float *)&Num); }
+//static inline int Abc_Float2Int( float Val ) { return *((int *)&Val); }
+//static inline float Abc_Int2Float( int Num ) { return *((float *)&Num); }
+static inline int Abc_Float2Int( float Val ) { union { int x; float y; } v; v.y = Val; return v.x; }
+static inline float Abc_Int2Float( int Num ) { union { int x; float y; } v; v.x = Num; return v.y; }
static inline int Abc_BitWordNum( int nBits ) { return (nBits>>5) + ((nBits&31) > 0); }
static inline int Abc_TruthWordNum( int nVars ) { return nVars <= 5 ? 1 : (1 << (nVars - 5)); }
static inline int Abc_InfoHasBit( unsigned * p, int i ) { return (p[(i)>>5] & (1<<((i) & 31))) > 0; }
@@ -252,25 +255,25 @@ static inline int Abc_InfoIsOrOne( unsigned * p, unsigned * q, int nWord
static inline int Abc_InfoIsOrOne3( unsigned * p, unsigned * q, unsigned * r, int nWords ){ int i; for ( i = nWords - 1; i >= 0; i-- ) if ( ~(p[i] | q[i] | r[i]) ) return 0; return 1; }
// checking the network type
-static inline bool Abc_NtkIsNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_NETLIST; }
-static inline bool Abc_NtkIsLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_LOGIC; }
-static inline bool Abc_NtkIsStrash( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_STRASH; }
-
-static inline bool Abc_NtkHasSop( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP; }
-static inline bool Abc_NtkHasBdd( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BDD; }
-static inline bool Abc_NtkHasAig( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG; }
-static inline bool Abc_NtkHasMapping( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP; }
-static inline bool Abc_NtkHasBlifMv( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLIFMV; }
-static inline bool Abc_NtkHasBlackbox( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLACKBOX; }
-
-static inline bool Abc_NtkIsSopNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP && pNtk->ntkType == ABC_NTK_NETLIST; }
-static inline bool Abc_NtkIsAigNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG && pNtk->ntkType == ABC_NTK_NETLIST; }
-static inline bool Abc_NtkIsMappedNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP && pNtk->ntkType == ABC_NTK_NETLIST; }
-static inline bool Abc_NtkIsBlifMvNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLIFMV && pNtk->ntkType == ABC_NTK_NETLIST; }
-static inline bool Abc_NtkIsSopLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP && pNtk->ntkType == ABC_NTK_LOGIC ; }
-static inline bool Abc_NtkIsBddLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BDD && pNtk->ntkType == ABC_NTK_LOGIC ; }
-static inline bool Abc_NtkIsAigLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG && pNtk->ntkType == ABC_NTK_LOGIC ; }
-static inline bool Abc_NtkIsMappedLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP && pNtk->ntkType == ABC_NTK_LOGIC ; }
+static inline int Abc_NtkIsNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_NETLIST; }
+static inline int Abc_NtkIsLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_LOGIC; }
+static inline int Abc_NtkIsStrash( Abc_Ntk_t * pNtk ) { return pNtk->ntkType == ABC_NTK_STRASH; }
+
+static inline int Abc_NtkHasSop( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP; }
+static inline int Abc_NtkHasBdd( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BDD; }
+static inline int Abc_NtkHasAig( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG; }
+static inline int Abc_NtkHasMapping( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP; }
+static inline int Abc_NtkHasBlifMv( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLIFMV; }
+static inline int Abc_NtkHasBlackbox( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLACKBOX; }
+
+static inline int Abc_NtkIsSopNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP && pNtk->ntkType == ABC_NTK_NETLIST; }
+static inline int Abc_NtkIsAigNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG && pNtk->ntkType == ABC_NTK_NETLIST; }
+static inline int Abc_NtkIsMappedNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP && pNtk->ntkType == ABC_NTK_NETLIST; }
+static inline int Abc_NtkIsBlifMvNetlist( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BLIFMV && pNtk->ntkType == ABC_NTK_NETLIST; }
+static inline int Abc_NtkIsSopLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_SOP && pNtk->ntkType == ABC_NTK_LOGIC ; }
+static inline int Abc_NtkIsBddLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_BDD && pNtk->ntkType == ABC_NTK_LOGIC ; }
+static inline int Abc_NtkIsAigLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_AIG && pNtk->ntkType == ABC_NTK_LOGIC ; }
+static inline int Abc_NtkIsMappedLogic( Abc_Ntk_t * pNtk ) { return pNtk->ntkFunc == ABC_FUNC_MAP && pNtk->ntkType == ABC_NTK_LOGIC ; }
// reading data members of the network
static inline char * Abc_NtkName( Abc_Ntk_t * pNtk ) { return pNtk->pName; }
@@ -293,7 +296,6 @@ static inline int Abc_NtkPiNum( Abc_Ntk_t * pNtk ) { return Ve
static inline int Abc_NtkPoNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vPos); }
static inline int Abc_NtkCiNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vCis); }
static inline int Abc_NtkCoNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vCos); }
-static inline int Abc_NtkAssertNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vAsserts); }
static inline int Abc_NtkBoxNum( Abc_Ntk_t * pNtk ) { return Vec_PtrSize(pNtk->vBoxes); }
static inline int Abc_NtkBiNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_BI]; }
static inline int Abc_NtkBoNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_BO]; }
@@ -302,8 +304,9 @@ static inline int Abc_NtkNodeNum( Abc_Ntk_t * pNtk ) { return pN
static inline int Abc_NtkLatchNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_LATCH]; }
static inline int Abc_NtkWhiteboxNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_WHITEBOX]; }
static inline int Abc_NtkBlackboxNum( Abc_Ntk_t * pNtk ) { return pNtk->nObjCounts[ABC_OBJ_BLACKBOX]; }
-static inline bool Abc_NtkIsComb( Abc_Ntk_t * pNtk ) { return Abc_NtkLatchNum(pNtk) == 0; }
-static inline bool Abc_NtkHasOnlyLatchBoxes(Abc_Ntk_t * pNtk ){ return Abc_NtkLatchNum(pNtk) == Abc_NtkBoxNum(pNtk); }
+static inline int Abc_NtkIsComb( Abc_Ntk_t * pNtk ) { return Abc_NtkLatchNum(pNtk) == 0; }
+static inline int Abc_NtkHasOnlyLatchBoxes(Abc_Ntk_t * pNtk ){ return Abc_NtkLatchNum(pNtk) == Abc_NtkBoxNum(pNtk); }
+static inline int Abc_NtkConstrNum( Abc_Ntk_t * pNtk ) { return pNtk->nConstrs; }
// creating simple objects
extern ABC_DLL Abc_Obj_t * Abc_NtkCreateObj( Abc_Ntk_t * pNtk, Abc_ObjType_t Type );
@@ -324,11 +327,10 @@ static inline Abc_Obj_t * Abc_NtkPi( Abc_Ntk_t * pNtk, int i ) { return (A
static inline Abc_Obj_t * Abc_NtkPo( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vPos, i ); }
static inline Abc_Obj_t * Abc_NtkCi( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCis, i ); }
static inline Abc_Obj_t * Abc_NtkCo( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vCos, i ); }
-static inline Abc_Obj_t * Abc_NtkAssert( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vAsserts, i );}
static inline Abc_Obj_t * Abc_NtkBox( Abc_Ntk_t * pNtk, int i ) { return (Abc_Obj_t *)Vec_PtrEntry( pNtk->vBoxes, i ); }
// working with complemented attributes of objects
-static inline bool Abc_ObjIsComplement( Abc_Obj_t * p ) { return (bool)((ABC_PTRUINT_T)p & (ABC_PTRUINT_T)01); }
+static inline int Abc_ObjIsComplement( Abc_Obj_t * p ) { return (int )((ABC_PTRUINT_T)p & (ABC_PTRUINT_T)01); }
static inline Abc_Obj_t * Abc_ObjRegular( Abc_Obj_t * p ) { return (Abc_Obj_t *)((ABC_PTRUINT_T)p & ~(ABC_PTRUINT_T)01); }
static inline Abc_Obj_t * Abc_ObjNot( Abc_Obj_t * p ) { return (Abc_Obj_t *)((ABC_PTRUINT_T)p ^ (ABC_PTRUINT_T)01); }
static inline Abc_Obj_t * Abc_ObjNotCond( Abc_Obj_t * p, int c ) { return (Abc_Obj_t *)((ABC_PTRUINT_T)p ^ (ABC_PTRUINT_T)(c!=0)); }
@@ -352,21 +354,21 @@ static inline void Abc_ObjSetCopy( Abc_Obj_t * pObj, Abc_Obj_t * pCopy )
static inline void Abc_ObjSetData( Abc_Obj_t * pObj, void * pData ) { pObj->pData = pData; }
// checking the object type
-static inline bool Abc_ObjIsPio( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PIO; }
-static inline bool Abc_ObjIsPi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PI; }
-static inline bool Abc_ObjIsPo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PO; }
-static inline bool Abc_ObjIsBi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BI; }
-static inline bool Abc_ObjIsBo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BO; }
-static inline bool Abc_ObjIsAssert( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_ASSERT; }
-static inline bool Abc_ObjIsCi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PI || pObj->Type == ABC_OBJ_BO; }
-static inline bool Abc_ObjIsCo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PO || pObj->Type == ABC_OBJ_BI || pObj->Type == ABC_OBJ_ASSERT; }
-static inline bool Abc_ObjIsTerm( Abc_Obj_t * pObj ) { return Abc_ObjIsCi(pObj) || Abc_ObjIsCo(pObj); }
-static inline bool Abc_ObjIsNet( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_NET; }
-static inline bool Abc_ObjIsNode( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_NODE; }
-static inline bool Abc_ObjIsLatch( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_LATCH; }
-static inline bool Abc_ObjIsBox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_LATCH || pObj->Type == ABC_OBJ_WHITEBOX || pObj->Type == ABC_OBJ_BLACKBOX; }
-static inline bool Abc_ObjIsWhitebox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_WHITEBOX;}
-static inline bool Abc_ObjIsBlackbox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BLACKBOX;}
+static inline int Abc_ObjIsPio( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PIO; }
+static inline int Abc_ObjIsPi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PI; }
+static inline int Abc_ObjIsPo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PO; }
+static inline int Abc_ObjIsBi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BI; }
+static inline int Abc_ObjIsBo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BO; }
+static inline int Abc_ObjIsAssert( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_ASSERT; }
+static inline int Abc_ObjIsCi( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PI || pObj->Type == ABC_OBJ_BO; }
+static inline int Abc_ObjIsCo( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_PO || pObj->Type == ABC_OBJ_BI || pObj->Type == ABC_OBJ_ASSERT; }
+static inline int Abc_ObjIsTerm( Abc_Obj_t * pObj ) { return Abc_ObjIsCi(pObj) || Abc_ObjIsCo(pObj); }
+static inline int Abc_ObjIsNet( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_NET; }
+static inline int Abc_ObjIsNode( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_NODE; }
+static inline int Abc_ObjIsLatch( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_LATCH; }
+static inline int Abc_ObjIsBox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_LATCH || pObj->Type == ABC_OBJ_WHITEBOX || pObj->Type == ABC_OBJ_BLACKBOX; }
+static inline int Abc_ObjIsWhitebox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_WHITEBOX;}
+static inline int Abc_ObjIsBlackbox( Abc_Obj_t * pObj ) { return pObj->Type == ABC_OBJ_BLACKBOX;}
static inline void Abc_ObjBlackboxToWhitebox( Abc_Obj_t * pObj ) { assert( Abc_ObjIsBlackbox(pObj) ); pObj->Type = ABC_OBJ_WHITEBOX; pObj->pNtk->nObjCounts[ABC_OBJ_BLACKBOX]--; pObj->pNtk->nObjCounts[ABC_OBJ_WHITEBOX]++; }
// working with fanin/fanout edges
@@ -383,9 +385,9 @@ static inline Abc_Obj_t * Abc_ObjFanin0( Abc_Obj_t * pObj ) { return (A
static inline Abc_Obj_t * Abc_ObjFanin1( Abc_Obj_t * pObj ) { return (Abc_Obj_t *)pObj->pNtk->vObjs->pArray[ pObj->vFanins.pArray[1] ]; }
static inline Abc_Obj_t * Abc_ObjFanin0Ntk( Abc_Obj_t * pObj ) { return (Abc_NtkIsNetlist(pObj->pNtk)? Abc_ObjFanin0(pObj) : pObj); }
static inline Abc_Obj_t * Abc_ObjFanout0Ntk( Abc_Obj_t * pObj ) { return (Abc_NtkIsNetlist(pObj->pNtk)? Abc_ObjFanout0(pObj) : pObj); }
-static inline bool Abc_ObjFaninC0( Abc_Obj_t * pObj ) { return pObj->fCompl0; }
-static inline bool Abc_ObjFaninC1( Abc_Obj_t * pObj ) { return pObj->fCompl1; }
-static inline bool Abc_ObjFaninC( Abc_Obj_t * pObj, int i ) { assert( i >=0 && i < 2 ); return i? pObj->fCompl1 : pObj->fCompl0; }
+static inline int Abc_ObjFaninC0( Abc_Obj_t * pObj ) { return pObj->fCompl0; }
+static inline int Abc_ObjFaninC1( Abc_Obj_t * pObj ) { return pObj->fCompl1; }
+static inline int Abc_ObjFaninC( Abc_Obj_t * pObj, int i ) { assert( i >=0 && i < 2 ); return i? pObj->fCompl1 : pObj->fCompl0; }
static inline void Abc_ObjSetFaninC( Abc_Obj_t * pObj, int i ){ assert( i >=0 && i < 2 ); if ( i ) pObj->fCompl1 = 1; else pObj->fCompl0 = 1; }
static inline void Abc_ObjXorFaninC( Abc_Obj_t * pObj, int i ){ assert( i >=0 && i < 2 ); if ( i ) pObj->fCompl1^= 1; else pObj->fCompl0^= 1; }
static inline Abc_Obj_t * Abc_ObjChild( Abc_Obj_t * pObj, int i ) { return Abc_ObjNotCond( Abc_ObjFanin(pObj,i), Abc_ObjFaninC(pObj,i) );}
@@ -400,9 +402,9 @@ static inline Abc_Obj_t * Abc_ObjChild1Data( Abc_Obj_t * pObj ) { return Ab
//static inline Hop_Obj_t * Abc_ObjChild1Equiv( Abc_Obj_t * pObj ) { return Hop_NotCond( Abc_ObjFanin1(pObj)->pEquiv, Abc_ObjFaninC1(pObj) ); }
// checking the AIG node types
-static inline bool Abc_AigNodeIsConst( Abc_Obj_t * pNode ) { assert(Abc_NtkIsStrash(Abc_ObjRegular(pNode)->pNtk)); return Abc_ObjRegular(pNode)->Type == ABC_OBJ_CONST1; }
-static inline bool Abc_AigNodeIsAnd( Abc_Obj_t * pNode ) { assert(!Abc_ObjIsComplement(pNode)); assert(Abc_NtkIsStrash(pNode->pNtk)); return Abc_ObjFaninNum(pNode) == 2; }
-static inline bool Abc_AigNodeIsChoice( Abc_Obj_t * pNode ) { assert(!Abc_ObjIsComplement(pNode)); assert(Abc_NtkIsStrash(pNode->pNtk)); return pNode->pData != NULL && Abc_ObjFanoutNum(pNode) > 0; }
+static inline int Abc_AigNodeIsConst( Abc_Obj_t * pNode ) { assert(Abc_NtkIsStrash(Abc_ObjRegular(pNode)->pNtk)); return Abc_ObjRegular(pNode)->Type == ABC_OBJ_CONST1; }
+static inline int Abc_AigNodeIsAnd( Abc_Obj_t * pNode ) { assert(!Abc_ObjIsComplement(pNode)); assert(Abc_NtkIsStrash(pNode->pNtk)); return Abc_ObjFaninNum(pNode) == 2; }
+static inline int Abc_AigNodeIsChoice( Abc_Obj_t * pNode ) { assert(!Abc_ObjIsComplement(pNode)); assert(Abc_NtkIsStrash(pNode->pNtk)); return pNode->pData != NULL && Abc_ObjFanoutNum(pNode) > 0; }
// handling persistent nodes
static inline int Abc_NodeIsPersistant( Abc_Obj_t * pNode ) { assert( Abc_AigNodeIsAnd(pNode) ); return pNode->fPersist; }
@@ -413,18 +415,18 @@ static inline void Abc_NodeClearPersistant( Abc_Obj_t * pNode ) { assert(
static inline void Abc_NodeSetTravId( Abc_Obj_t * pNode, int TravId ) { pNode->TravId = TravId; }
static inline void Abc_NodeSetTravIdCurrent( Abc_Obj_t * pNode ) { pNode->TravId = pNode->pNtk->nTravIds; }
static inline void Abc_NodeSetTravIdPrevious( Abc_Obj_t * pNode ) { pNode->TravId = pNode->pNtk->nTravIds - 1; }
-static inline bool Abc_NodeIsTravIdCurrent( Abc_Obj_t * pNode ) { return (bool)(pNode->TravId == pNode->pNtk->nTravIds); }
-static inline bool Abc_NodeIsTravIdPrevious( Abc_Obj_t * pNode ) { return (bool)(pNode->TravId == pNode->pNtk->nTravIds - 1); }
+static inline int Abc_NodeIsTravIdCurrent( Abc_Obj_t * pNode ) { return (int )(pNode->TravId == pNode->pNtk->nTravIds); }
+static inline int Abc_NodeIsTravIdPrevious( Abc_Obj_t * pNode ) { return (int )(pNode->TravId == pNode->pNtk->nTravIds - 1); }
// checking initial state of the latches
static inline void Abc_LatchSetInitNone( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_NONE; }
static inline void Abc_LatchSetInit0( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_ZERO; }
static inline void Abc_LatchSetInit1( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_ONE; }
static inline void Abc_LatchSetInitDc( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); pLatch->pData = (void *)ABC_INIT_DC; }
-static inline bool Abc_LatchIsInitNone( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_NONE; }
-static inline bool Abc_LatchIsInit0( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ZERO; }
-static inline bool Abc_LatchIsInit1( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ONE; }
-static inline bool Abc_LatchIsInitDc( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_DC; }
+static inline int Abc_LatchIsInitNone( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_NONE; }
+static inline int Abc_LatchIsInit0( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ZERO; }
+static inline int Abc_LatchIsInit1( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ONE; }
+static inline int Abc_LatchIsInitDc( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_DC; }
static inline int Abc_LatchInit( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return (int)(ABC_PTRINT_T)pLatch->pData; }
// global BDDs of the nodes
@@ -488,8 +490,6 @@ static inline void Abc_ObjSetMvVar( Abc_Obj_t * pObj, void * pV) { Vec_At
for ( i = 0; (i < Abc_NtkPoNum(pNtk)) && (((pPo) = Abc_NtkPo(pNtk, i)), 1); i++ )
#define Abc_NtkForEachCo( pNtk, pCo, i ) \
for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i)), 1); i++ )
-#define Abc_NtkForEachAssert( pNtk, pObj, i ) \
- for ( i = 0; (i < Vec_PtrSize((pNtk)->vAsserts)) && (((pObj) = Abc_NtkAssert(pNtk, i)), 1); i++ )
// fanin and fanouts
#define Abc_ObjForEachFanin( pObj, pFanin, i ) \
for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFanin(pObj, i)), 1); i++ )
@@ -510,7 +510,7 @@ static inline void Abc_ObjSetMvVar( Abc_Obj_t * pObj, void * pV) { Vec_At
extern ABC_DLL Abc_Aig_t * Abc_AigAlloc( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_AigFree( Abc_Aig_t * pMan );
extern ABC_DLL int Abc_AigCleanup( Abc_Aig_t * pMan );
-extern ABC_DLL bool Abc_AigCheck( Abc_Aig_t * pMan );
+extern ABC_DLL int Abc_AigCheck( Abc_Aig_t * pMan );
extern ABC_DLL int Abc_AigLevel( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Obj_t * Abc_AigConst1( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Obj_t * Abc_AigAnd( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
@@ -521,13 +521,13 @@ extern ABC_DLL Abc_Obj_t * Abc_AigOr( Abc_Aig_t * pMan, Abc_Obj_t * p0, A
extern ABC_DLL Abc_Obj_t * Abc_AigXor( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 );
extern ABC_DLL Abc_Obj_t * Abc_AigMux( Abc_Aig_t * pMan, Abc_Obj_t * pC, Abc_Obj_t * p1, Abc_Obj_t * p0 );
extern ABC_DLL Abc_Obj_t * Abc_AigMiter( Abc_Aig_t * pMan, Vec_Ptr_t * vPairs, int fImplic );
-extern ABC_DLL void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, bool fUpdateLevel );
+extern ABC_DLL void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, int fUpdateLevel );
extern ABC_DLL void Abc_AigDeleteNode( Abc_Aig_t * pMan, Abc_Obj_t * pOld );
extern ABC_DLL void Abc_AigRehash( Abc_Aig_t * pMan );
-extern ABC_DLL bool Abc_AigNodeHasComplFanoutEdge( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_AigNodeHasComplFanoutEdgeTrav( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_AigNodeHasComplFanoutEdge( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_AigNodeHasComplFanoutEdgeTrav( Abc_Obj_t * pNode );
extern ABC_DLL void Abc_AigPrintNode( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_AigNodeIsAcyclic( Abc_Obj_t * pNode, Abc_Obj_t * pRoot );
+extern ABC_DLL int Abc_AigNodeIsAcyclic( Abc_Obj_t * pNode, Abc_Obj_t * pRoot );
extern ABC_DLL void Abc_AigCheckFaninOrder( Abc_Aig_t * pMan );
extern ABC_DLL void Abc_AigSetNodePhases( Abc_Ntk_t * pNtk );
extern ABC_DLL Vec_Ptr_t * Abc_AigUpdateStart( Abc_Aig_t * pMan, Vec_Ptr_t ** pvUpdatedNets );
@@ -545,13 +545,13 @@ extern ABC_DLL int Abc_NtkConvertToBlifMv( Abc_Ntk_t * pNtk );
extern ABC_DLL char * Abc_NodeConvertSopToMvSop( int nVars, Vec_Int_t * vSop0, Vec_Int_t * vSop1 );
extern ABC_DLL int Abc_NodeEvalMvCost( int nVars, Vec_Int_t * vSop0, Vec_Int_t * vSop1 );
/*=== abcBalance.c ==========================================================*/
-extern ABC_DLL Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective, bool fUpdateLevel );
+extern ABC_DLL Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, int fDuplicate, int fSelective, int fUpdateLevel );
/*=== abcCheck.c ==========================================================*/
-extern ABC_DLL bool Abc_NtkCheck( Abc_Ntk_t * pNtk );
-extern ABC_DLL bool Abc_NtkCheckRead( Abc_Ntk_t * pNtk );
-extern ABC_DLL bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk );
-extern ABC_DLL bool Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj );
-extern ABC_DLL bool Abc_NtkCompareSignals( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOnlyPis, int fComb );
+extern ABC_DLL int Abc_NtkCheck( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkCheckRead( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkDoCheck( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj );
+extern ABC_DLL int Abc_NtkCompareSignals( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOnlyPis, int fComb );
extern ABC_DLL int Abc_NtkIsAcyclicHierarchy( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkCheckUniqueCiNames( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkCheckUniqueCoNames( Abc_Ntk_t * pNtk );
@@ -564,6 +564,9 @@ extern ABC_DLL void * Abc_NodeGetCuts( void * p, Abc_Obj_t * pObj, i
extern ABC_DLL void Abc_NodeGetCutsSeq( void * p, Abc_Obj_t * pObj, int fFirst );
extern ABC_DLL void * Abc_NodeReadCuts( void * p, Abc_Obj_t * pObj );
extern ABC_DLL void Abc_NodeFreeCuts( void * p, Abc_Obj_t * pObj );
+/*=== abcDar.c ============================================================*/
+extern ABC_DLL int Abc_NtkPhaseFrameNum( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkDarPrintCone( Abc_Ntk_t * pNtk );
/*=== abcDelay.c ==========================================================*/
extern ABC_DLL float Abc_NtkDelayTraceLut( Abc_Ntk_t * pNtk, int fUseLutLib );
/*=== abcDfs.c ==========================================================*/
@@ -577,15 +580,15 @@ extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsSeqReverse( Abc_Ntk_t * pNtk );
extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsIter( Abc_Ntk_t * pNtk, int fCollectAll );
extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsIterNodes( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots );
extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsHie( Abc_Ntk_t * pNtk, int fCollectAll );
-extern ABC_DLL bool Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk );
extern ABC_DLL Vec_Ptr_t * Abc_NtkSupport( Abc_Ntk_t * pNtk );
extern ABC_DLL Vec_Ptr_t * Abc_NtkNodeSupport( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes );
extern ABC_DLL Vec_Ptr_t * Abc_AigDfs( Abc_Ntk_t * pNtk, int fCollectAll, int fCollectCos );
-extern ABC_DLL Vec_Vec_t * Abc_DfsLevelized( Abc_Obj_t * pNode, bool fTfi );
+extern ABC_DLL Vec_Vec_t * Abc_DfsLevelized( Abc_Obj_t * pNode, int fTfi );
extern ABC_DLL Vec_Vec_t * Abc_NtkLevelize( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkLevel( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkLevelReverse( Abc_Ntk_t * pNtk );
-extern ABC_DLL bool Abc_NtkIsAcyclic( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkIsAcyclic( Abc_Ntk_t * pNtk );
extern ABC_DLL Vec_Ptr_t * Abc_AigGetLevelizedOrder( Abc_Ntk_t * pNtk, int fCollectCis );
/*=== abcFanio.c ==========================================================*/
extern ABC_DLL void Abc_ObjAddFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin );
@@ -626,7 +629,7 @@ extern ABC_DLL Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy( Abc_Ntk_t * pNtk
extern ABC_DLL Abc_Ntk_t * Abc_NtkConvertBlackboxes( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Ntk_t * Abc_NtkInsertNewLogic( Abc_Ntk_t * pNtkH, Abc_Ntk_t * pNtkL );
/*=== abcLatch.c ==========================================================*/
-extern ABC_DLL bool Abc_NtkLatchIsSelfFeed( Abc_Obj_t * pLatch );
+extern ABC_DLL int Abc_NtkLatchIsSelfFeed( Abc_Obj_t * pLatch );
extern ABC_DLL int Abc_NtkCountSelfFeedLatches( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkRemoveSelfFeedLatches( Abc_Ntk_t * pNtk );
extern ABC_DLL Vec_Int_t * Abc_NtkCollectLatchValues( Abc_Ntk_t * pNtk );
@@ -642,6 +645,8 @@ extern ABC_DLL int Abc_LibAddModel( Abc_Lib_t * pLib, Abc_Ntk_t *
extern ABC_DLL Abc_Ntk_t * Abc_LibFindModelByName( Abc_Lib_t * pLib, char * pName );
extern ABC_DLL int Abc_LibFindTopLevelModels( Abc_Lib_t * pLib );
extern ABC_DLL Abc_Ntk_t * Abc_LibDeriveRoot( Abc_Lib_t * pLib );
+/*=== abcLog.c ==========================================================*/
+extern ABC_DLL void Abc_NtkWriteLogFile( char * pFileName, Abc_Cex_t * pSeqCex, int Status, char * pCommand );
/*=== abcMiter.c ==========================================================*/
extern ABC_DLL int Abc_NtkMinimumBase( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NodeMinimumBase( Abc_Obj_t * pNode );
@@ -658,6 +663,7 @@ extern ABC_DLL Abc_Ntk_t * Abc_NtkMiterQuantifyPis( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkMiterIsConstant( Abc_Ntk_t * pMiter );
extern ABC_DLL void Abc_NtkMiterReport( Abc_Ntk_t * pMiter );
extern ABC_DLL Abc_Ntk_t * Abc_NtkFrames( Abc_Ntk_t * pNtk, int nFrames, int fInitial, int fVerbose );
+extern ABC_DLL int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd );
/*=== abcNames.c ====================================================*/
extern ABC_DLL char * Abc_ObjName( Abc_Obj_t * pNode );
extern ABC_DLL char * Abc_ObjAssignName( Abc_Obj_t * pObj, char * pName, char * pSuffix );
@@ -674,7 +680,6 @@ extern ABC_DLL int Abc_NodeCompareNames( Abc_Obj_t ** pp1, Abc_Ob
extern ABC_DLL void Abc_NtkOrderObjsByName( Abc_Ntk_t * pNtk, int fComb );
extern ABC_DLL void Abc_NtkAddDummyPiNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkAddDummyPoNames( Abc_Ntk_t * pNtk );
-extern ABC_DLL void Abc_NtkAddDummyAssertNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkAddDummyBoxNames( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkShortNames( Abc_Ntk_t * pNtk );
/*=== abcNetlist.c ==========================================================*/
@@ -728,15 +733,21 @@ extern ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeAnd( Abc_Ntk_t * pNtk, Vec_Pt
extern ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeOr( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins );
extern ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeExor( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins );
extern ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeMux( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodeC, Abc_Obj_t * pNode1, Abc_Obj_t * pNode0 );
-extern ABC_DLL bool Abc_NodeIsConst( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NodeIsConst0( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NodeIsConst1( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NodeIsBuf( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NodeIsInv( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsConst( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsConst0( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsConst1( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsBuf( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsInv( Abc_Obj_t * pNode );
extern ABC_DLL void Abc_NodeComplement( Abc_Obj_t * pNode );
+/*=== abcOdc.c ==========================================================*/
+typedef struct Odc_Man_t_ Odc_Man_t;
+extern ABC_DLL Odc_Man_t * Abc_NtkDontCareAlloc( int nVarsMax, int nLevels, int fVerbose, int fVeryVerbose );
+extern ABC_DLL void Abc_NtkDontCareClear( Odc_Man_t * p );
+extern ABC_DLL void Abc_NtkDontCareFree( Odc_Man_t * p );
+extern ABC_DLL int Abc_NtkDontCareCompute( Odc_Man_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, unsigned * puTruth );
/*=== abcPrint.c ==========================================================*/
extern ABC_DLL float Abc_NtkMfsTotalSwitching( Abc_Ntk_t * pNtk );
-extern ABC_DLL void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch );
+extern ABC_DLL void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch );
extern ABC_DLL void Abc_NtkPrintIo( FILE * pFile, Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkPrintLatch( FILE * pFile, Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkPrintFanio( FILE * pFile, Abc_Ntk_t * pNtk );
@@ -768,7 +779,7 @@ extern ABC_DLL void Abc_NtkManCutStop( Abc_ManCut_t * p );
extern ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadCutLarge( Abc_ManCut_t * p );
extern ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadCutSmall( Abc_ManCut_t * p );
extern ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadVisited( Abc_ManCut_t * p );
-extern ABC_DLL Vec_Ptr_t * Abc_NodeFindCut( Abc_ManCut_t * p, Abc_Obj_t * pRoot, bool fContain );
+extern ABC_DLL Vec_Ptr_t * Abc_NodeFindCut( Abc_ManCut_t * p, Abc_Obj_t * pRoot, int fContain );
extern ABC_DLL void Abc_NodeConeCollect( Abc_Obj_t ** ppRoots, int nRoots, Vec_Ptr_t * vFanins, Vec_Ptr_t * vVisited, int fIncludeFanins );
extern ABC_DLL DdNode * Abc_NodeConeBdd( DdManager * dd, DdNode ** pbVars, Abc_Obj_t * pNode, Vec_Ptr_t * vFanins, Vec_Ptr_t * vVisited );
extern ABC_DLL DdNode * Abc_NodeConeDcs( DdManager * dd, DdNode ** pbVarsX, DdNode ** pbVarsY, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, Vec_Ptr_t * vVisited );
@@ -783,7 +794,7 @@ extern ABC_DLL void Abc_NodeMffcConeSupp( Abc_Obj_t * pNode, Vec_P
extern ABC_DLL int Abc_NodeDeref_rec( Abc_Obj_t * pNode );
extern ABC_DLL int Abc_NodeRef_rec( Abc_Obj_t * pNode );
/*=== abcRefactor.c ==========================================================*/
-extern ABC_DLL int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose );
+extern ABC_DLL int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose );
/*=== abcRewrite.c ==========================================================*/
extern ABC_DLL int Abc_NtkRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable );
/*=== abcSat.c ==========================================================*/
@@ -814,15 +825,15 @@ extern ABC_DLL int Abc_SopGetVarNum( char * pSop );
extern ABC_DLL int Abc_SopGetPhase( char * pSop );
extern ABC_DLL int Abc_SopGetIthCareLit( char * pSop, int i );
extern ABC_DLL void Abc_SopComplement( char * pSop );
-extern ABC_DLL bool Abc_SopIsComplement( char * pSop );
-extern ABC_DLL bool Abc_SopIsConst0( char * pSop );
-extern ABC_DLL bool Abc_SopIsConst1( char * pSop );
-extern ABC_DLL bool Abc_SopIsBuf( char * pSop );
-extern ABC_DLL bool Abc_SopIsInv( char * pSop );
-extern ABC_DLL bool Abc_SopIsAndType( char * pSop );
-extern ABC_DLL bool Abc_SopIsOrType( char * pSop );
+extern ABC_DLL int Abc_SopIsComplement( char * pSop );
+extern ABC_DLL int Abc_SopIsConst0( char * pSop );
+extern ABC_DLL int Abc_SopIsConst1( char * pSop );
+extern ABC_DLL int Abc_SopIsBuf( char * pSop );
+extern ABC_DLL int Abc_SopIsInv( char * pSop );
+extern ABC_DLL int Abc_SopIsAndType( char * pSop );
+extern ABC_DLL int Abc_SopIsOrType( char * pSop );
extern ABC_DLL int Abc_SopIsExorType( char * pSop );
-extern ABC_DLL bool Abc_SopCheck( char * pSop, int nFanins );
+extern ABC_DLL int Abc_SopCheck( char * pSop, int nFanins );
extern ABC_DLL char * Abc_SopFromTruthBin( char * pTruth );
extern ABC_DLL char * Abc_SopFromTruthHex( char * pTruth );
extern ABC_DLL char * Abc_SopEncoderPos( Extra_MmFlex_t * pMan, int iValue, int nValues );
@@ -892,12 +903,12 @@ extern ABC_DLL void Abc_NtkCleanMarkA( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Obj_t * Abc_NodeFindCoFanout( Abc_Obj_t * pNode );
extern ABC_DLL Abc_Obj_t * Abc_NodeFindNonCoFanout( Abc_Obj_t * pNode );
extern ABC_DLL Abc_Obj_t * Abc_NodeHasUniqueCoFanout( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NtkLogicHasSimpleCos( Abc_Ntk_t * pNtk );
-extern ABC_DLL int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, bool fDuplicate );
+extern ABC_DLL int Abc_NtkLogicHasSimpleCos( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, int fDuplicate );
extern ABC_DLL void Abc_VecObjPushUniqueOrderByLevel( Vec_Ptr_t * p, Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NodeIsExorType( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NodeIsMuxType( Abc_Obj_t * pNode );
-extern ABC_DLL bool Abc_NodeIsMuxControlType( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsExorType( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsMuxType( Abc_Obj_t * pNode );
+extern ABC_DLL int Abc_NodeIsMuxControlType( Abc_Obj_t * pNode );
extern ABC_DLL Abc_Obj_t * Abc_NodeRecognizeMux( Abc_Obj_t * pNode, Abc_Obj_t ** ppNodeT, Abc_Obj_t ** ppNodeE );
extern ABC_DLL int Abc_NtkPrepareTwoNtks( FILE * pErr, Abc_Ntk_t * pNtk, char ** argv, int argc, Abc_Ntk_t ** ppNtk1, Abc_Ntk_t ** ppNtk2, int * pfDelete1, int * pfDelete2 );
extern ABC_DLL void Abc_NodeCollectFanins( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes );
@@ -911,13 +922,18 @@ extern ABC_DLL Vec_Int_t * Abc_NtkGetCiIds( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_NtkReassignIds( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_ObjPointerCompare( void ** pp1, void ** pp2 );
extern ABC_DLL void Abc_NtkTransferCopy( Abc_Ntk_t * pNtk );
+
/*=== abcVerify.c ==========================================================*/
extern ABC_DLL int * Abc_NtkVerifyGetCleanModel( Abc_Ntk_t * pNtk, int nFrames );
extern ABC_DLL int * Abc_NtkVerifySimulatePattern( Abc_Ntk_t * pNtk, int * pModel );
+extern ABC_DLL int Abc_NtkIsTrueCex( Abc_Ntk_t * pNtk, Abc_Cex_t * pCex );
+extern ABC_DLL int Abc_NtkIsValidCex( Abc_Ntk_t * pNtk, Abc_Cex_t * pCex );
+
+
+
+ABC_NAMESPACE_HEADER_END
+
-#ifdef __cplusplus
-}
-#endif
#endif
diff --git a/src/base/abc/abcAig.c b/src/base/abc/abcAig.c
index a3188901..956a26b9 100644
--- a/src/base/abc/abcAig.c
+++ b/src/base/abc/abcAig.c
@@ -20,6 +20,8 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
/*
AIG is an And-Inv Graph with structural hashing.
It is always structurally hashed. It means that at any time:
@@ -203,7 +205,7 @@ int Abc_AigCleanup( Abc_Aig_t * pMan )
if ( Abc_ObjFanoutNum(pAnd) == 0 )
Vec_PtrPush( vDangles, pAnd );
// process the dangling nodes and their MFFCs
- Vec_PtrForEachEntry( vDangles, pAnd, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDangles, pAnd, i )
Abc_AigDeleteNode( pMan, pAnd );
Vec_PtrFree( vDangles );
return nNodesOld - pMan->nEntries;
@@ -220,7 +222,7 @@ int Abc_AigCleanup( Abc_Aig_t * pMan )
SeeAlso []
***********************************************************************/
-bool Abc_AigCheck( Abc_Aig_t * pMan )
+int Abc_AigCheck( Abc_Aig_t * pMan )
{
Abc_Obj_t * pObj, * pAnd;
int i, nFanins, Counter;
@@ -265,7 +267,7 @@ bool Abc_AigCheck( Abc_Aig_t * pMan )
// if the node is a choice node, nodes in its class should not have fanouts
Abc_NtkForEachNode( pMan->pNtkAig, pObj, i )
if ( Abc_AigNodeIsChoice(pObj) )
- for ( pAnd = pObj->pData; pAnd; pAnd = pAnd->pData )
+ for ( pAnd = (Abc_Obj_t *)pObj->pData; pAnd; pAnd = (Abc_Obj_t *)pAnd->pData )
if ( Abc_ObjFanoutNum(pAnd) > 0 )
{
printf( "Abc_AigCheck: Representative %s", Abc_ObjName(pAnd) );
@@ -796,12 +798,12 @@ Abc_Obj_t * Abc_AigMiter( Abc_Aig_t * pMan, Vec_Ptr_t * vPairs, int fImplic )
if ( fImplic )
{
for ( i = 0; i < vPairs->nSize; i += 2 )
- vPairs->pArray[i/2] = Abc_AigAnd( pMan, vPairs->pArray[i], Abc_ObjNot(vPairs->pArray[i+1]) );
+ vPairs->pArray[i/2] = Abc_AigAnd( pMan, (Abc_Obj_t *)vPairs->pArray[i], Abc_ObjNot((Abc_Obj_t *)vPairs->pArray[i+1]) );
}
else
{
for ( i = 0; i < vPairs->nSize; i += 2 )
- vPairs->pArray[i/2] = Abc_AigXor( pMan, vPairs->pArray[i], vPairs->pArray[i+1] );
+ vPairs->pArray[i/2] = Abc_AigXor( pMan, (Abc_Obj_t *)vPairs->pArray[i], (Abc_Obj_t *)vPairs->pArray[i+1] );
}
vPairs->nSize = vPairs->nSize/2;
return Abc_AigMiter_rec( pMan, (Abc_Obj_t **)vPairs->pArray, vPairs->nSize );
@@ -827,7 +829,7 @@ Abc_Obj_t * Abc_AigMiter2( Abc_Aig_t * pMan, Vec_Ptr_t * vPairs )
pMiter = Abc_ObjNot( Abc_AigConst1(pMan->pNtkAig) );
for ( i = 0; i < vPairs->nSize; i += 2 )
{
- pXor = Abc_AigXor( pMan, vPairs->pArray[i], vPairs->pArray[i+1] );
+ pXor = Abc_AigXor( pMan, (Abc_Obj_t *)vPairs->pArray[i], (Abc_Obj_t *)vPairs->pArray[i+1] );
pMiter = Abc_AigOr( pMan, pMiter, pXor );
}
return pMiter;
@@ -847,7 +849,7 @@ Abc_Obj_t * Abc_AigMiter2( Abc_Aig_t * pMan, Vec_Ptr_t * vPairs )
SeeAlso []
***********************************************************************/
-void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, bool fUpdateLevel )
+void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, int fUpdateLevel )
{
assert( Vec_PtrSize(pMan->vStackReplaceOld) == 0 );
assert( Vec_PtrSize(pMan->vStackReplaceNew) == 0 );
@@ -860,8 +862,8 @@ void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, bool
// process the replacements
while ( Vec_PtrSize(pMan->vStackReplaceOld) )
{
- pOld = Vec_PtrPop( pMan->vStackReplaceOld );
- pNew = Vec_PtrPop( pMan->vStackReplaceNew );
+ pOld = (Abc_Obj_t *)Vec_PtrPop( pMan->vStackReplaceOld );
+ pNew = (Abc_Obj_t *)Vec_PtrPop( pMan->vStackReplaceNew );
Abc_AigReplace_int( pMan, pOld, pNew, fUpdateLevel );
}
if ( fUpdateLevel )
@@ -893,7 +895,7 @@ void Abc_AigReplace_int( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, i
assert( Abc_ObjFanoutNum(pOld) > 0 );
// look at the fanouts of old node
Abc_NodeCollectFanouts( pOld, pMan->vNodes );
- Vec_PtrForEachEntry( pMan->vNodes, pFanout, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pMan->vNodes, pFanout, k )
{
if ( Abc_ObjIsCo(pFanout) )
{
@@ -984,7 +986,7 @@ void Abc_AigDeleteNode( Abc_Aig_t * pMan, Abc_Obj_t * pNode )
assert( Abc_ObjFanoutNum(pNode) == 0 );
// when deleting an old node that is scheduled for replacement, remove it from the replacement queue
- Vec_PtrForEachEntry( pMan->vStackReplaceOld, pTemp, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pMan->vStackReplaceOld, pTemp, i )
if ( pNode == pTemp )
{
// remove the entry from the replacement array
@@ -998,7 +1000,7 @@ void Abc_AigDeleteNode( Abc_Aig_t * pMan, Abc_Obj_t * pNode )
}
// when deleting a new node that should replace another node, do not delete
- Vec_PtrForEachEntry( pMan->vStackReplaceNew, pTemp, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pMan->vStackReplaceNew, pTemp, i )
if ( pNode == Abc_ObjRegular(pTemp) )
return;
@@ -1057,7 +1059,7 @@ void Abc_AigUpdateLevel_int( Abc_Aig_t * pMan )
{
if ( Vec_PtrSize(vVec) == 0 )
continue;
- Vec_PtrForEachEntry( vVec, pNode, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVec, pNode, k )
{
if ( pNode == NULL )
continue;
@@ -1113,7 +1115,7 @@ void Abc_AigUpdateLevelR_int( Abc_Aig_t * pMan )
{
if ( Vec_PtrSize(vVec) == 0 )
continue;
- Vec_PtrForEachEntry( vVec, pNode, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVec, pNode, k )
{
if ( pNode == NULL )
continue;
@@ -1168,8 +1170,8 @@ void Abc_AigRemoveFromLevelStructure( Vec_Vec_t * vStruct, Abc_Obj_t * pNode )
Abc_Obj_t * pTemp;
int m;
assert( pNode->fMarkA );
- vVecTemp = Vec_VecEntry( vStruct, pNode->Level );
- Vec_PtrForEachEntry( vVecTemp, pTemp, m )
+ vVecTemp = (Vec_Ptr_t *)Vec_VecEntry( vStruct, pNode->Level );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVecTemp, pTemp, m )
{
if ( pTemp != pNode )
continue;
@@ -1197,8 +1199,8 @@ void Abc_AigRemoveFromLevelStructureR( Vec_Vec_t * vStruct, Abc_Obj_t * pNode )
Abc_Obj_t * pTemp;
int m;
assert( pNode->fMarkB );
- vVecTemp = Vec_VecEntry( vStruct, Abc_ObjReverseLevel(pNode) );
- Vec_PtrForEachEntry( vVecTemp, pTemp, m )
+ vVecTemp = (Vec_Ptr_t *)Vec_VecEntry( vStruct, Abc_ObjReverseLevel(pNode) );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVecTemp, pTemp, m )
{
if ( pTemp != pNode )
continue;
@@ -1224,7 +1226,7 @@ void Abc_AigRemoveFromLevelStructureR( Vec_Vec_t * vStruct, Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_AigNodeHasComplFanoutEdge( Abc_Obj_t * pNode )
+int Abc_AigNodeHasComplFanoutEdge( Abc_Obj_t * pNode )
{
Abc_Obj_t * pFanout;
int i, iFanin;
@@ -1251,7 +1253,7 @@ bool Abc_AigNodeHasComplFanoutEdge( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_AigNodeHasComplFanoutEdgeTrav( Abc_Obj_t * pNode )
+int Abc_AigNodeHasComplFanoutEdgeTrav( Abc_Obj_t * pNode )
{
Abc_Obj_t * pFanout;
int i, iFanin;
@@ -1313,7 +1315,7 @@ void Abc_AigPrintNode( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_AigNodeIsAcyclic( Abc_Obj_t * pNode, Abc_Obj_t * pRoot )
+int Abc_AigNodeIsAcyclic( Abc_Obj_t * pNode, Abc_Obj_t * pRoot )
{
Abc_Obj_t * pFanin0, * pFanin1;
Abc_Obj_t * pChild00, * pChild01;
@@ -1498,3 +1500,11 @@ int Abc_AigCountNext( Abc_Aig_t * pMan )
////////////////////////////////////////////////////////////////////////
+void Abc_NtkHelloWorld( Abc_Ntk_t * pNtk )
+{
+ printf( "Hello, World!\n" );
+}
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcBlifMv.c b/src/base/abc/abcBlifMv.c
index d4bbebf0..946e3f75 100644
--- a/src/base/abc/abcBlifMv.c
+++ b/src/base/abc/abcBlifMv.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -61,8 +64,8 @@ void Abc_NtkStartMvVars( Abc_Ntk_t * pNtk )
***********************************************************************/
void Abc_NtkFreeMvVars( Abc_Ntk_t * pNtk )
{
- void * pUserMan;
- pUserMan = Abc_NtkAttrFree( pNtk, VEC_ATTR_GLOBAL_BDD, 0 );
+ Extra_MmFlex_t * pUserMan;
+ pUserMan = (Extra_MmFlex_t *)Abc_NtkAttrFree( pNtk, VEC_ATTR_GLOBAL_BDD, 0 );
Extra_MmFlexStop( pUserMan );
}
@@ -93,8 +96,8 @@ void Abc_NtkSetMvVarValues( Abc_Obj_t * pObj, int nValues )
if ( Abc_ObjMvVar(pObj) != NULL )
return;
// create the structure
- pFlex = Abc_NtkMvVarMan( pObj->pNtk );
- pVarStruct = (void *)Extra_MmFlexEntryFetch( pFlex, sizeof(struct temp) );
+ pFlex = (Extra_MmFlex_t *)Abc_NtkMvVarMan( pObj->pNtk );
+ pVarStruct = (struct temp *)Extra_MmFlexEntryFetch( pFlex, sizeof(struct temp) );
pVarStruct->nValues = nValues;
pVarStruct->pNames = NULL;
Abc_ObjSetMvVar( pObj, pVarStruct );
@@ -150,7 +153,7 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
pValues[k] = Abc_ObjNot( Abc_AigConst1(pNtkNew) );
// get the BLIF-MV formula
- pSop = pObj->pData;
+ pSop = (char *)pObj->pData;
// skip the value line
// while ( *pSop++ != '\n' );
@@ -170,7 +173,7 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
Index = Abc_StringGetNumber( &pSop );
assert( Index < nValues );
////////////////////////////////////////////
- // adding ABC_FREE variables for binary ND-constants
+ // adding free variables for binary ND-constants
if ( fAddFreeVars && nValues == 2 && *pSop == '-' )
{
pValues[1] = Abc_NtkCreatePi(pNtkNew);
@@ -243,7 +246,7 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
{
Index = Abc_StringGetNumber( &pSop );
assert( Index < nValuesF );
- pTemp2 = Abc_AigOr( pNtkNew->pManFunc, pTemp2, pValuesF[Index] );
+ pTemp2 = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pTemp2, pValuesF[Index] );
assert( *pSop == ')' || *pSop == ',' );
if ( *pSop == ',' )
pSop++;
@@ -266,7 +269,7 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
assert( nValuesF == nValuesF2 );
pTemp2 = Abc_ObjNot( Abc_AigConst1(pNtkNew) );
for ( v = 0; v < nValues; v++ )
- pTemp2 = Abc_AigOr( pNtkNew->pManFunc, pTemp2, Abc_AigAnd(pNtkNew->pManFunc, pValuesF[v], pValuesF2[v]) );
+ pTemp2 = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pTemp2, Abc_AigAnd((Abc_Aig_t *)pNtkNew->pManFunc, pValuesF[v], pValuesF2[v]) );
}
else
{
@@ -275,7 +278,7 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
pTemp2 = pValuesF[Index];
}
// compute the compute
- pTemp = Abc_AigAnd( pNtkNew->pManFunc, pTemp, pTemp2 );
+ pTemp = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pTemp, pTemp2 );
// advance the reading point
assert( *pSop == ' ' );
pSop++;
@@ -293,14 +296,14 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
pValuesF = (Abc_Obj_t **)pFanin->pCopy;
assert( nValuesF == nValues ); // should be guaranteed by the parser
for ( k = 0; k < nValuesF; k++ )
- pValues[k] = Abc_AigOr( pNtkNew->pManFunc, pValues[k], Abc_AigAnd(pNtkNew->pManFunc, pTemp, pValuesF[k]) );
+ pValues[k] = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pValues[k], Abc_AigAnd((Abc_Aig_t *)pNtkNew->pManFunc, pTemp, pValuesF[k]) );
}
else
{
// get the output value
Index = Abc_StringGetNumber( &pSop );
assert( Index < nValues );
- pValues[Index] = Abc_AigOr( pNtkNew->pManFunc, pValues[Index], pTemp );
+ pValues[Index] = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pValues[Index], pTemp );
}
// advance the reading point
assert( *pSop == '\n' );
@@ -315,7 +318,7 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
{
if ( k == Def )
continue;
- pTemp = Abc_AigAnd( pNtkNew->pManFunc, pTemp, Abc_ObjNot(pValues[k]) );
+ pTemp = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pTemp, Abc_ObjNot(pValues[k]) );
}
// assign the default value
@@ -330,7 +333,7 @@ int Abc_NodeStrashBlifMv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj )
pValuesF = (Abc_Obj_t **)pFanin->pCopy;
assert( nValuesF == nValues ); // should be guaranteed by the parser
for ( k = 0; k < nValuesF; k++ )
- pValues[k] = Abc_AigOr( pNtkNew->pManFunc, pValues[k], Abc_AigAnd(pNtkNew->pManFunc, pTemp, pValuesF[k]) );
+ pValues[k] = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pValues[k], Abc_AigAnd((Abc_Aig_t *)pNtkNew->pManFunc, pTemp, pValuesF[k]) );
}
}
@@ -484,7 +487,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
for ( k = 0; k < nBits; k++ )
{
pBit = Abc_ObjNotCond( pBits[k], (v&(1<<k)) == 0 );
- pValues[v] = Abc_AigAnd( pNtkNew->pManFunc, pValues[v], pBit );
+ pValues[v] = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pValues[v], pBit );
}
}
// save the values in the fanout net
@@ -517,7 +520,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
for ( k = 0; k < nBits; k++ )
{
pBit = Abc_ObjNotCond( pBits[k], (v&(1<<k)) == 0 );
- pValues[v] = Abc_AigAnd( pNtkNew->pManFunc, pValues[v], pBit );
+ pValues[v] = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pValues[v], pBit );
}
}
// save the values in the fanout net
@@ -528,7 +531,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
}
// process nodes in the topological order
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
if ( !Abc_NodeStrashBlifMv( pNtkNew, pObj ) )
{
Abc_NtkDelete( pNtkNew );
@@ -602,7 +605,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
pBit = Abc_ObjNot( Abc_AigConst1(pNtkNew) );
for ( v = 0; v < nValues; v++ )
if ( v & (1<<k) )
- pBit = Abc_AigOr( pNtkNew->pManFunc, pBit, pValues[v] );
+ pBit = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pBit, pValues[v] );
pTemp = Abc_NtkCreatePo( pNtkNew );
Abc_ObjAddFanin( pTemp, pBit );
if ( nValuesMax == 2 )
@@ -628,7 +631,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
pBit = Abc_ObjNot( Abc_AigConst1(pNtkNew) );
for ( v = 0; v < nValues; v++ )
if ( v & (1<<k) )
- pBit = Abc_AigOr( pNtkNew->pManFunc, pBit, pValues[v] );
+ pBit = Abc_AigOr( (Abc_Aig_t *)pNtkNew->pManFunc, pBit, pValues[v] );
pTemp = Abc_NtkCreateBi( pNtkNew );
Abc_ObjAddFanin( pTemp, pBit );
if ( nValuesMax == 2 )
@@ -645,7 +648,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
Vec_Ptr_t * vTemp;
Abc_Obj_t * pLatch, * pObjLi, * pObjLo;
int i;
- // move ABC_FREE vars to the front among the PIs
+ // move free vars to the front among the PIs
vTemp = Vec_PtrAlloc( Vec_PtrSize(pNtkNew->vPis) );
Abc_NtkForEachPi( pNtkNew, pObj, i )
if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) == 0 )
@@ -656,7 +659,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
assert( Vec_PtrSize(vTemp) == Vec_PtrSize(pNtkNew->vPis) );
Vec_PtrFree( pNtkNew->vPis );
pNtkNew->vPis = vTemp;
- // move ABC_FREE vars to the front among the CIs
+ // move free vars to the front among the CIs
vTemp = Vec_PtrAlloc( Vec_PtrSize(pNtkNew->vCis) );
Abc_NtkForEachCi( pNtkNew, pObj, i )
if ( strncmp( Abc_ObjName(pObj), "free_var_", 9 ) == 0 )
@@ -690,7 +693,7 @@ Abc_Ntk_t * Abc_NtkStrashBlifMv( Abc_Ntk_t * pNtk )
ABC_FREE( pObj->pCopy );
// remove dangling nodes
- i = Abc_AigCleanup(pNtkNew->pManFunc);
+ i = Abc_AigCleanup((Abc_Aig_t *)pNtkNew->pManFunc);
// printf( "Cleanup removed %d nodes.\n", i );
// Abc_NtkReassignIds( pNtkNew );
@@ -781,7 +784,7 @@ Abc_Ntk_t * Abc_NtkSkeletonBlifMv( Abc_Ntk_t * pNtk )
for ( v = 0; v < nValues; v++ )
{
pNodeNew = Abc_NtkCreateNode( pNtkNew );
- pNodeNew->pData = Abc_SopEncoderPos( pNtkNew->pManFunc, v, nValues );
+ pNodeNew->pData = Abc_SopEncoderPos( (Extra_MmFlex_t *)pNtkNew->pManFunc, v, nValues );
pNetNew = Abc_NtkCreateNet( pNtkNew );
pTermNew = Abc_NtkCreateBi( pNtkNew );
Abc_ObjAddFanin( pNodeNew, pNet->pCopy );
@@ -803,7 +806,7 @@ Abc_Ntk_t * Abc_NtkSkeletonBlifMv( Abc_Ntk_t * pNtk )
for ( k = 0; k < nBits; k++ )
{
pNodeNew = Abc_NtkCreateNode( pNtkNew );
- pNodeNew->pData = Abc_SopEncoderLog( pNtkNew->pManFunc, k, nValues );
+ pNodeNew->pData = Abc_SopEncoderLog( (Extra_MmFlex_t *)pNtkNew->pManFunc, k, nValues );
pNetNew = Abc_NtkCreateNet( pNtkNew );
pTermNew = Abc_NtkCreateBi( pNtkNew );
Abc_ObjAddFanin( pNodeNew, pNet->pCopy );
@@ -828,7 +831,7 @@ Abc_Ntk_t * Abc_NtkSkeletonBlifMv( Abc_Ntk_t * pNtk )
Abc_NodeSetTravIdCurrent( pNet );
nValues = Abc_ObjMvVarNum(pNet);
pNodeNew = Abc_NtkCreateNode( pNtkNew );
- pNodeNew->pData = Abc_SopDecoderPos( pNtkNew->pManFunc, nValues );
+ pNodeNew->pData = Abc_SopDecoderPos( (Extra_MmFlex_t *)pNtkNew->pManFunc, nValues );
for ( v = 0; v < nValues; v++ )
{
pTermNew = Abc_NtkCreateBo( pNtkNew );
@@ -852,7 +855,7 @@ Abc_Ntk_t * Abc_NtkSkeletonBlifMv( Abc_Ntk_t * pNtk )
nValues = Abc_ObjMvVarNum(pNet);
nBits = Extra_Base2Log( nValues );
pNodeNew = Abc_NtkCreateNode( pNtkNew );
- pNodeNew->pData = Abc_SopDecoderLog( pNtkNew->pManFunc, nValues );
+ pNodeNew->pData = Abc_SopDecoderLog( (Extra_MmFlex_t *)pNtkNew->pManFunc, nValues );
for ( k = 0; k < nBits; k++ )
{
pTermNew = Abc_NtkCreateBo( pNtkNew );
@@ -995,13 +998,13 @@ int Abc_NtkConvertToBlifMv( Abc_Ntk_t * pNtk )
*pCur++ = 0;
assert( pCur - pBlifMv == nSize );
// update the node representation
- Cudd_RecursiveDeref( pNtk->pManFunc, pNode->pData );
+ Cudd_RecursiveDeref( (DdManager *)pNtk->pManFunc, (DdNode *)pNode->pData );
pNode->pData = pBlifMv;
}
// update the functionality type
pNtk->ntkFunc = ABC_FUNC_BLIFMV;
- Cudd_Quit( pNtk->pManFunc );
+ Cudd_Quit( (DdManager *)pNtk->pManFunc );
pNtk->pManFunc = pMmFlex;
Vec_StrFree( vCube );
@@ -1152,3 +1155,5 @@ int Abc_NodeEvalMvCost( int nVars, Vec_Int_t * vSop0, Vec_Int_t * vSop1 )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcCheck.c b/src/base/abc/abcCheck.c
index a43cc9eb..aa264314 100644
--- a/src/base/abc/abcCheck.c
+++ b/src/base/abc/abcCheck.c
@@ -22,21 +22,24 @@
#include "main.h"
//#include "seq.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static bool Abc_NtkCheckNames( Abc_Ntk_t * pNtk );
-static bool Abc_NtkCheckPis( Abc_Ntk_t * pNtk );
-static bool Abc_NtkCheckPos( Abc_Ntk_t * pNtk );
-//static bool Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj );
-static bool Abc_NtkCheckNet( Abc_Ntk_t * pNtk, Abc_Obj_t * pNet );
-static bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode );
-static bool Abc_NtkCheckLatch( Abc_Ntk_t * pNtk, Abc_Obj_t * pLatch );
+static int Abc_NtkCheckNames( Abc_Ntk_t * pNtk );
+static int Abc_NtkCheckPis( Abc_Ntk_t * pNtk );
+static int Abc_NtkCheckPos( Abc_Ntk_t * pNtk );
+//static int Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj );
+static int Abc_NtkCheckNet( Abc_Ntk_t * pNtk, Abc_Obj_t * pNet );
+static int Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode );
+static int Abc_NtkCheckLatch( Abc_Ntk_t * pNtk, Abc_Obj_t * pLatch );
-static bool Abc_NtkComparePis( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
-static bool Abc_NtkComparePos( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
-static bool Abc_NtkCompareLatches( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
+static int Abc_NtkComparePis( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
+static int Abc_NtkComparePos( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
+static int Abc_NtkCompareLatches( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
static inline char * Abc_ObjNameNet( Abc_Obj_t * pObj ) { return (Abc_ObjIsNode(pObj) && Abc_NtkIsNetlist(pObj->pNtk)) ? Abc_ObjName(Abc_ObjFanout0(pObj)) : Abc_ObjName(pObj); }
@@ -55,7 +58,7 @@ static inline char * Abc_ObjNameNet( Abc_Obj_t * pObj ) { return (Abc_ObjIsNode(
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheck( Abc_Ntk_t * pNtk )
+int Abc_NtkCheck( Abc_Ntk_t * pNtk )
{
return !Abc_FrameIsFlagEnabled( "check" ) || Abc_NtkDoCheck( pNtk );
}
@@ -71,7 +74,7 @@ bool Abc_NtkCheck( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckRead( Abc_Ntk_t * pNtk )
+int Abc_NtkCheckRead( Abc_Ntk_t * pNtk )
{
return !Abc_FrameIsFlagEnabled( "checkread" ) || Abc_NtkDoCheck( pNtk );
}
@@ -87,7 +90,7 @@ bool Abc_NtkCheckRead( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk )
+int Abc_NtkDoCheck( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj, * pNet, * pNode;
int i;
@@ -122,7 +125,7 @@ bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk )
fprintf( stdout, "in procedure Abc_NtkCreateObj() and in the user's code.\n" );
return 0;
}
- if ( Abc_NtkPoNum(pNtk) + Abc_NtkAssertNum(pNtk) + Abc_NtkLatchNum(pNtk) != Abc_NtkCoNum(pNtk) )
+ if ( Abc_NtkPoNum(pNtk) + Abc_NtkLatchNum(pNtk) != Abc_NtkCoNum(pNtk) )
{
fprintf( stdout, "NetworkCheck: Number of COs does not match number of POs, asserts, and latches.\n" );
fprintf( stdout, "One possible reason is that latches are added twice:\n" );
@@ -171,7 +174,7 @@ bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk )
// check the nodes
if ( Abc_NtkIsStrash(pNtk) )
- Abc_AigCheck( pNtk->pManFunc );
+ Abc_AigCheck( (Abc_Aig_t *)pNtk->pManFunc );
else
{
Abc_NtkForEachNode( pNtk, pNode, i )
@@ -232,7 +235,7 @@ bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckNames( Abc_Ntk_t * pNtk )
+int Abc_NtkCheckNames( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj = NULL; // Ensure pObj isn't used uninitialized.
Vec_Int_t * vNameIds;
@@ -306,7 +309,7 @@ bool Abc_NtkCheckNames( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckPis( Abc_Ntk_t * pNtk )
+int Abc_NtkCheckPis( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj;
int i;
@@ -354,7 +357,7 @@ bool Abc_NtkCheckPis( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckPos( Abc_Ntk_t * pNtk )
+int Abc_NtkCheckPos( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj;
int i;
@@ -408,11 +411,11 @@ bool Abc_NtkCheckPos( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj )
+int Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj )
{
Abc_Obj_t * pFanin, * pFanout;
- int i, Value = 1;
- int k;
+ int Value = 1;
+ int i, k;
// check the network
if ( pObj->pNtk != pNtk )
@@ -487,7 +490,7 @@ bool Abc_NtkCheckObj( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckNet( Abc_Ntk_t * pNtk, Abc_Obj_t * pNet )
+int Abc_NtkCheckNet( Abc_Ntk_t * pNtk, Abc_Obj_t * pNet )
{
if ( Abc_ObjFaninNum(pNet) == 0 )
{
@@ -513,7 +516,7 @@ bool Abc_NtkCheckNet( Abc_Ntk_t * pNtk, Abc_Obj_t * pNet )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
+int Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
{
// detect internal nodes that do not have nets
if ( Abc_NtkIsNetlist(pNtk) && Abc_ObjFanoutNum(pNode) == 0 )
@@ -530,7 +533,7 @@ bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
// the netlist and SOP logic network should have SOPs
if ( Abc_NtkHasSop(pNtk) )
{
- if ( !Abc_SopCheck( pNode->pData, Abc_ObjFaninNum(pNode) ) )
+ if ( !Abc_SopCheck( (char *)pNode->pData, Abc_ObjFaninNum(pNode) ) )
{
fprintf( stdout, "NodeCheck: SOP check for node \"%s\" has failed.\n", Abc_ObjNameNet(pNode) );
return 0;
@@ -538,7 +541,7 @@ bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
}
else if ( Abc_NtkHasBdd(pNtk) )
{
- int nSuppSize = Cudd_SupportSize(pNtk->pManFunc, pNode->pData);
+ int nSuppSize = Cudd_SupportSize((DdManager *)pNtk->pManFunc, (DdNode *)pNode->pData);
if ( nSuppSize > Abc_ObjFaninNum(pNode) )
{
fprintf( stdout, "NodeCheck: BDD of the node \"%s\" has incorrect support size.\n", Abc_ObjNameNet(pNode) );
@@ -563,7 +566,7 @@ bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCheckLatch( Abc_Ntk_t * pNtk, Abc_Obj_t * pLatch )
+int Abc_NtkCheckLatch( Abc_Ntk_t * pNtk, Abc_Obj_t * pLatch )
{
int Value = 1;
// check whether the object is a latch
@@ -629,7 +632,7 @@ bool Abc_NtkCheckLatch( Abc_Ntk_t * pNtk, Abc_Obj_t * pLatch )
SeeAlso []
***********************************************************************/
-bool Abc_NtkComparePis( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
+int Abc_NtkComparePis( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
{
Abc_Obj_t * pObj1;
int i;
@@ -662,7 +665,7 @@ bool Abc_NtkComparePis( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
SeeAlso []
***********************************************************************/
-bool Abc_NtkComparePos( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
+int Abc_NtkComparePos( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
{
Abc_Obj_t * pObj1;
int i;
@@ -695,7 +698,7 @@ bool Abc_NtkComparePos( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCompareBoxes( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
+int Abc_NtkCompareBoxes( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
{
Abc_Obj_t * pObj1;
int i;
@@ -733,7 +736,7 @@ bool Abc_NtkCompareBoxes( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
SeeAlso []
***********************************************************************/
-bool Abc_NtkCompareSignals( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOnlyPis, int fComb )
+int Abc_NtkCompareSignals( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOnlyPis, int fComb )
{
Abc_NtkOrderObjsByName( pNtk1, fComb );
Abc_NtkOrderObjsByName( pNtk2, fComb );
@@ -778,7 +781,7 @@ int Abc_NtkIsAcyclicHierarchy_rec( Abc_Ntk_t * pNtk )
{
if ( Abc_ObjIsLatch(pObj) )
continue;
- pNtkNext = pObj->pData;
+ pNtkNext = (Abc_Ntk_t *)pObj->pData;
assert( pNtkNext != NULL );
if ( pNtkNext->fHiePath )
return 0;
@@ -807,14 +810,14 @@ int Abc_NtkIsAcyclicHierarchy( Abc_Ntk_t * pNtk )
int i, RetValue;
assert( Abc_NtkIsNetlist(pNtk) && pNtk->pDesign );
// clear the modules
- Vec_PtrForEachEntry( pNtk->pDesign->vModules, pTemp, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pTemp, i )
pTemp->fHieVisited = pTemp->fHiePath = 0;
// traverse
pNtk->fHiePath = 1;
RetValue = Abc_NtkIsAcyclicHierarchy_rec( pNtk );
pNtk->fHiePath = 0;
// clear the modules
- Vec_PtrForEachEntry( pNtk->pDesign->vModules, pTemp, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pTemp, i )
pTemp->fHieVisited = pTemp->fHiePath = 0;
return RetValue;
}
@@ -855,9 +858,9 @@ int Abc_NtkCheckUniqueCiNames( Abc_Ntk_t * pNtk )
vNames = Vec_PtrAlloc( Abc_NtkCiNum(pNtk) );
Abc_NtkForEachCi( pNtk, pObj, i )
Vec_PtrPush( vNames, Abc_ObjName(pObj) );
- Vec_PtrSort( vNames, Abc_NtkNamesCompare );
+ Vec_PtrSort( vNames, (int (*)())Abc_NtkNamesCompare );
for ( i = 1; i < Abc_NtkCiNum(pNtk); i++ )
- if ( !strcmp( Vec_PtrEntry(vNames,i-1), Vec_PtrEntry(vNames,i) ) )
+ if ( !strcmp( (const char *)Vec_PtrEntry(vNames,i-1), (const char *)Vec_PtrEntry(vNames,i) ) )
{
printf( "Abc_NtkCheck: Repeated CI names: %s and %s.\n", (char*)Vec_PtrEntry(vNames,i-1), (char*)Vec_PtrEntry(vNames,i) );
fRetValue = 0;
@@ -886,11 +889,11 @@ int Abc_NtkCheckUniqueCoNames( Abc_Ntk_t * pNtk )
vNames = Vec_PtrAlloc( Abc_NtkCoNum(pNtk) );
Abc_NtkForEachCo( pNtk, pObj, i )
Vec_PtrPush( vNames, Abc_ObjName(pObj) );
- Vec_PtrSort( vNames, Abc_NtkNamesCompare );
+ Vec_PtrSort( vNames, (int (*)())Abc_NtkNamesCompare );
for ( i = 1; i < Abc_NtkCoNum(pNtk); i++ )
{
// printf( "%s\n", Vec_PtrEntry(vNames,i) );
- if ( !strcmp( Vec_PtrEntry(vNames,i-1), Vec_PtrEntry(vNames,i) ) )
+ if ( !strcmp( (const char *)Vec_PtrEntry(vNames,i-1), (const char *)Vec_PtrEntry(vNames,i) ) )
{
printf( "Abc_NtkCheck: Repeated CO names: %s and %s.\n", (char*)Vec_PtrEntry(vNames,i-1), (char*)Vec_PtrEntry(vNames,i) );
fRetValue = 0;
@@ -939,3 +942,5 @@ int Abc_NtkCheckUniqueCioNames( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcDfs.c b/src/base/abc/abcDfs.c
index 50ebef6d..20b361fb 100644
--- a/src/base/abc/abcDfs.c
+++ b/src/base/abc/abcDfs.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -128,7 +131,7 @@ Vec_Ptr_t * Abc_NtkDfsNodes( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNodes, int nNodes
Abc_NodeSetTravIdCurrent(ppNodes[i]);
Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(ppNodes[i])), vNodes );
}
- else if ( Abc_ObjIsNode(ppNodes[i]) )
+ else if ( Abc_ObjIsNode(ppNodes[i]) || Abc_ObjIsCi(ppNodes[i]) )
Abc_NtkDfs_rec( ppNodes[i], vNodes );
}
return vNodes;
@@ -237,7 +240,7 @@ void Abc_NtkDfsReverseNodes_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes )
// add the node after the fanins have been added
// Vec_PtrPush( vNodes, pNode );
Vec_PtrFillExtra( vNodes, pNode->Level + 1, NULL );
- pNode->pCopy = Vec_PtrEntry( vNodes, pNode->Level );
+ pNode->pCopy = (Abc_Obj_t *)Vec_PtrEntry( vNodes, pNode->Level );
Vec_PtrWriteEntry( vNodes, pNode->Level, pNode );
}
@@ -306,14 +309,14 @@ Vec_Ptr_t * Abc_NtkDfsReverseNodesContained( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNo
Abc_NodeSetTravIdCurrent( pObj );
// add to the array
assert( pObj->Level == 0 );
- pObj->pCopy = Vec_PtrEntry( vNodes, pObj->Level );
+ pObj->pCopy = (Abc_Obj_t *)Vec_PtrEntry( vNodes, pObj->Level );
Vec_PtrWriteEntry( vNodes, pObj->Level, pObj );
}
// iterate through the levels
for ( i = 0; i <= nLevels; i++ )
{
// iterate through the nodes on each level
- for ( pObj = Vec_PtrEntry(vNodes, i); pObj; pObj = pObj->pCopy )
+ for ( pObj = (Abc_Obj_t *)Vec_PtrEntry(vNodes, i); pObj; pObj = pObj->pCopy )
{
// iterate through the fanouts of each node
Abc_ObjForEachFanout( pObj, pFanout, k )
@@ -337,7 +340,7 @@ Vec_Ptr_t * Abc_NtkDfsReverseNodesContained( Abc_Ntk_t * pNtk, Abc_Obj_t ** ppNo
if ( Abc_ObjIsCo(pFanout) )
pFanout->Level = nLevels + 1;
// add to the array
- pFanout->pCopy = Vec_PtrEntry( vNodes, pFanout->Level );
+ pFanout->pCopy = (Abc_Obj_t *)Vec_PtrEntry( vNodes, pFanout->Level );
Vec_PtrWriteEntry( vNodes, pFanout->Level, pFanout );
// handle the COs
if ( Abc_ObjIsCo(pFanout) )
@@ -494,7 +497,7 @@ void Abc_NtkDfs_iter( Vec_Ptr_t * vStack, Abc_Obj_t * pRoot, Vec_Ptr_t * vNodes
{
// get the node and its fanin
iFanin = (int)(ABC_PTRINT_T)Vec_PtrPop(vStack);
- pNode = Vec_PtrPop(vStack);
+ pNode = (Abc_Obj_t *)Vec_PtrPop(vStack);
assert( !Abc_ObjIsNet(pNode) );
// add it to the array of nodes if we finished
if ( iFanin == Abc_ObjFaninNum(pNode) )
@@ -578,7 +581,7 @@ Vec_Ptr_t * Abc_NtkDfsIterNodes( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots )
Abc_NtkIncrementTravId( pNtk );
vNodes = Vec_PtrAlloc( 1000 );
vStack = Vec_PtrAlloc( 1000 );
- Vec_PtrForEachEntry( vRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
if ( !Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pObj)) )
Abc_NtkDfs_iter( vStack, Abc_ObjRegular(pObj), vNodes );
Vec_PtrFree( vStack );
@@ -657,7 +660,7 @@ Vec_Ptr_t * Abc_NtkDfsHie( Abc_Ntk_t * pNtk, int fCollectAll )
SeeAlso []
***********************************************************************/
-bool Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk )
+int Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode, * pFanin;
int i, k;
@@ -675,7 +678,7 @@ bool Abc_NtkIsDfsOrdered( Abc_Ntk_t * pNtk )
return 0;
// check the choices of the node
if ( Abc_NtkIsStrash(pNtk) && Abc_AigNodeIsChoice(pNode) )
- for ( pFanin = pNode->pData; pFanin; pFanin = pFanin->pData )
+ for ( pFanin = (Abc_Obj_t *)pNode->pData; pFanin; pFanin = (Abc_Obj_t *)pFanin->pData )
if ( !Abc_NodeIsTravIdCurrent(pFanin) )
return 0;
// mark the node as visited
@@ -832,7 +835,7 @@ void Abc_AigDfs_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes )
Abc_AigDfs_rec( pFanin, vNodes );
// visit the equivalent nodes
if ( Abc_AigNodeIsChoice( pNode ) )
- for ( pFanin = pNode->pData; pFanin; pFanin = pFanin->pData )
+ for ( pFanin = (Abc_Obj_t *)pNode->pData; pFanin; pFanin = (Abc_Obj_t *)pFanin->pData )
Abc_AigDfs_rec( pFanin, vNodes );
// add the node after the fanins have been added
Vec_PtrPush( vNodes, pNode );
@@ -921,7 +924,7 @@ void Abc_DfsLevelizedTfo_rec( Abc_Obj_t * pNode, Vec_Vec_t * vLevels )
SeeAlso []
***********************************************************************/
-Vec_Vec_t * Abc_DfsLevelized( Abc_Obj_t * pNode, bool fTfi )
+Vec_Vec_t * Abc_DfsLevelized( Abc_Obj_t * pNode, int fTfi )
{
Vec_Vec_t * vLevels;
Abc_Obj_t * pFanout;
@@ -1118,7 +1121,7 @@ int Abc_NtkLevelReverse( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NtkIsAcyclic_rec( Abc_Obj_t * pNode )
+int Abc_NtkIsAcyclic_rec( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
Abc_Obj_t * pFanin;
@@ -1157,7 +1160,7 @@ bool Abc_NtkIsAcyclic_rec( Abc_Obj_t * pNode )
// visit choices
if ( Abc_NtkIsStrash(pNode->pNtk) && Abc_AigNodeIsChoice(pNode) )
{
- for ( pFanin = pNode->pData; pFanin; pFanin = pFanin->pData )
+ for ( pFanin = (Abc_Obj_t *)pNode->pData; pFanin; pFanin = (Abc_Obj_t *)pFanin->pData )
{
// check if the fanin is visited
if ( Abc_NodeIsTravIdPrevious(pFanin) )
@@ -1194,10 +1197,11 @@ bool Abc_NtkIsAcyclic_rec( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NtkIsAcyclic( Abc_Ntk_t * pNtk )
+int Abc_NtkIsAcyclic( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode;
- int fAcyclic, i;
+ int fAcyclic;
+ int i;
// set the traversal ID for this DFS ordering
Abc_NtkIncrementTravId( pNtk );
Abc_NtkIncrementTravId( pNtk );
@@ -1247,16 +1251,16 @@ int Abc_NodeSetChoiceLevel_rec( Abc_Obj_t * pNode, int fMaximum )
Level = 1 + ABC_MAX( Level1, Level2 );
if ( pNode->pData )
{
- LevelE = Abc_NodeSetChoiceLevel_rec( pNode->pData, fMaximum );
+ LevelE = Abc_NodeSetChoiceLevel_rec( (Abc_Obj_t *)pNode->pData, fMaximum );
if ( fMaximum )
Level = ABC_MAX( Level, LevelE );
else
Level = ABC_MIN( Level, LevelE );
// set the level of all equivalent nodes to be the same minimum
- for ( pTemp = pNode->pData; pTemp; pTemp = pTemp->pData )
- pTemp->pCopy = (void *)(ABC_PTRINT_T)Level;
+ for ( pTemp = (Abc_Obj_t *)pNode->pData; pTemp; pTemp = (Abc_Obj_t *)pTemp->pData )
+ pTemp->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Level;
}
- pNode->pCopy = (void *)(ABC_PTRINT_T)Level;
+ pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Level;
return Level;
}
@@ -1331,7 +1335,7 @@ Vec_Ptr_t * Abc_AigGetLevelizedOrder( Abc_Ntk_t * pNtk, int fCollectCis )
}
// recollect nodes
vNodes = Vec_PtrStart( Abc_NtkNodeNum(pNtk) );
- Vec_PtrForEachEntryStart( vLevels, pNode, i, !fCollectCis )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, vLevels, pNode, i, !fCollectCis )
for ( ; pNode; pNode = pNode->pCopy )
Vec_PtrPush( vNodes, pNode );
Vec_PtrFree( vLevels );
@@ -1388,3 +1392,5 @@ int Abc_NtkPrintSubraphSizes( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcFanio.c b/src/base/abc/abcFanio.c
index 6c75cf3f..ee6f4173 100644
--- a/src/base/abc/abcFanio.c
+++ b/src/base/abc/abcFanio.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -274,14 +277,14 @@ void Abc_ObjTransferFanout( Abc_Obj_t * pNodeFrom, Abc_Obj_t * pNodeTo )
assert( !Abc_ObjIsPo(pNodeFrom) && !Abc_ObjIsPo(pNodeTo) );
assert( pNodeFrom->pNtk == pNodeTo->pNtk );
assert( pNodeFrom != pNodeTo );
- assert( Abc_ObjFanoutNum(pNodeFrom) > 0 );
+ assert( !Abc_ObjIsNode(pNodeFrom) || Abc_ObjFanoutNum(pNodeFrom) > 0 );
// get the fanouts of the old node
nFanoutsOld = Abc_ObjFanoutNum(pNodeTo);
vFanouts = Vec_PtrAlloc( nFanoutsOld );
Abc_NodeCollectFanouts( pNodeFrom, vFanouts );
// patch the fanin of each of them
for ( i = 0; i < vFanouts->nSize; i++ )
- Abc_ObjPatchFanin( vFanouts->pArray[i], pNodeFrom, pNodeTo );
+ Abc_ObjPatchFanin( (Abc_Obj_t *)vFanouts->pArray[i], pNodeFrom, pNodeTo );
assert( Abc_ObjFanoutNum(pNodeFrom) == 0 );
assert( Abc_ObjFanoutNum(pNodeTo) == nFanoutsOld + vFanouts->nSize );
Vec_PtrFree( vFanouts );
@@ -338,3 +341,5 @@ int Abc_ObjFanoutFaninNum( Abc_Obj_t * pFanout, Abc_Obj_t * pFanin )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcFunc.c b/src/base/abc/abcFunc.c
index df46fc06..35ea8332 100644
--- a/src/base/abc/abcFunc.c
+++ b/src/base/abc/abcFunc.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -66,16 +69,16 @@ int Abc_NtkSopToBdd( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pNode, i )
{
assert( pNode->pData );
- pNode->pData = Abc_ConvertSopToBdd( dd, pNode->pData );
+ pNode->pData = Abc_ConvertSopToBdd( dd, (char *)pNode->pData );
if ( pNode->pData == NULL )
{
printf( "Abc_NtkSopToBdd: Error while converting SOP into BDD.\n" );
return 0;
}
- Cudd_Ref( pNode->pData );
+ Cudd_Ref( (DdNode *)pNode->pData );
}
- Extra_MmFlexStop( pNtk->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)pNtk->pManFunc );
pNtk->pManFunc = dd;
// update the network type
@@ -164,7 +167,7 @@ void Abc_NtkLogicMakeDirectSops( Abc_Ntk_t * pNtk )
// check if there are nodes with complemented SOPs
fFound = 0;
Abc_NtkForEachNode( pNtk, pNode, i )
- if ( Abc_SopIsComplement(pNode->pData) )
+ if ( Abc_SopIsComplement((char *)pNode->pData) )
{
fFound = 1;
break;
@@ -181,12 +184,12 @@ void Abc_NtkLogicMakeDirectSops( Abc_Ntk_t * pNtk )
// change the cover of negated nodes
vCube = Vec_StrAlloc( 100 );
Abc_NtkForEachNode( pNtk, pNode, i )
- if ( Abc_SopIsComplement(pNode->pData) )
+ if ( Abc_SopIsComplement((char *)pNode->pData) )
{
- bFunc = Abc_ConvertSopToBdd( dd, pNode->pData ); Cudd_Ref( bFunc );
- pNode->pData = Abc_ConvertBddToSop( pNtk->pManFunc, dd, bFunc, bFunc, Abc_ObjFaninNum(pNode), 0, vCube, 1 );
+ bFunc = Abc_ConvertSopToBdd( dd, (char *)pNode->pData ); Cudd_Ref( bFunc );
+ pNode->pData = Abc_ConvertBddToSop( (Extra_MmFlex_t *)pNtk->pManFunc, dd, bFunc, bFunc, Abc_ObjFaninNum(pNode), 0, vCube, 1 );
Cudd_RecursiveDeref( dd, bFunc );
- assert( !Abc_SopIsComplement(pNode->pData) );
+ assert( !Abc_SopIsComplement((char *)pNode->pData) );
}
Vec_StrFree( vCube );
Extra_StopManager( dd );
@@ -211,7 +214,7 @@ int Abc_NtkBddToSop( Abc_Ntk_t * pNtk, int fDirect )
{
Abc_Obj_t * pNode;
Extra_MmFlex_t * pManNew;
- DdManager * dd = pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNtk->pManFunc;
DdNode * bFunc;
Vec_Str_t * vCube;
int i, fMode;
@@ -232,7 +235,7 @@ int Abc_NtkBddToSop( Abc_Ntk_t * pNtk, int fDirect )
Abc_NtkForEachNode( pNtk, pNode, i )
{
assert( pNode->pData );
- bFunc = pNode->pData;
+ bFunc = (DdNode *)pNode->pData;
pNode->pNext = (Abc_Obj_t *)Abc_ConvertBddToSop( pManNew, dd, bFunc, bFunc, Abc_ObjFaninNum(pNode), 0, vCube, fMode );
if ( pNode->pNext == NULL )
{
@@ -252,7 +255,7 @@ int Abc_NtkBddToSop( Abc_Ntk_t * pNtk, int fDirect )
// transfer from next to data
Abc_NtkForEachNode( pNtk, pNode, i )
{
- Cudd_RecursiveDeref( dd, pNode->pData );
+ Cudd_RecursiveDeref( dd, (DdNode *)pNode->pData );
pNode->pData = pNode->pNext;
pNode->pNext = NULL;
}
@@ -482,8 +485,8 @@ int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFani
void Abc_NodeBddToCnf( Abc_Obj_t * pNode, Extra_MmFlex_t * pMmMan, Vec_Str_t * vCube, int fAllPrimes, char ** ppSop0, char ** ppSop1 )
{
assert( Abc_NtkHasBdd(pNode->pNtk) );
- *ppSop0 = Abc_ConvertBddToSop( pMmMan, pNode->pNtk->pManFunc, pNode->pData, pNode->pData, Abc_ObjFaninNum(pNode), fAllPrimes, vCube, 0 );
- *ppSop1 = Abc_ConvertBddToSop( pMmMan, pNode->pNtk->pManFunc, pNode->pData, pNode->pData, Abc_ObjFaninNum(pNode), fAllPrimes, vCube, 1 );
+ *ppSop0 = Abc_ConvertBddToSop( pMmMan, (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData, (DdNode *)pNode->pData, Abc_ObjFaninNum(pNode), fAllPrimes, vCube, 0 );
+ *ppSop1 = Abc_ConvertBddToSop( pMmMan, (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData, (DdNode *)pNode->pData, Abc_ObjFaninNum(pNode), fAllPrimes, vCube, 1 );
}
@@ -563,14 +566,14 @@ int Abc_NtkSopToAig( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pNode, i )
{
assert( pNode->pData );
- pNode->pData = Abc_ConvertSopToAig( pMan, pNode->pData );
+ pNode->pData = Abc_ConvertSopToAig( pMan, (char *)pNode->pData );
if ( pNode->pData == NULL )
{
printf( "Abc_NtkSopToAig: Error while converting SOP into AIG.\n" );
return 0;
}
}
- Extra_MmFlexStop( pNtk->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)pNtk->pManFunc );
pNtk->pManFunc = pMan;
// update the network type
@@ -595,27 +598,32 @@ Hop_Obj_t * Abc_ConvertSopToAigInternal( Hop_Man_t * pMan, char * pSop )
Hop_Obj_t * pAnd, * pSum;
int i, Value, nFanins;
char * pCube;
- int fExor = Abc_SopIsExorType(pSop);
// get the number of variables
nFanins = Abc_SopGetVarNum(pSop);
- // go through the cubes of the node's SOP
- pSum = Hop_ManConst0(pMan);
- Abc_SopForEachCube( pSop, nFanins, pCube )
+ if ( Abc_SopIsExorType(pSop) )
+ {
+ pSum = Hop_ManConst0(pMan);
+ for ( i = 0; i < nFanins; i++ )
+ pSum = Hop_Exor( pMan, pSum, Hop_IthVar(pMan,i) );
+ }
+ else
{
- // create the AND of literals
- pAnd = Hop_ManConst1(pMan);
- Abc_CubeForEachVar( pCube, Value, i )
+ // go through the cubes of the node's SOP
+ pSum = Hop_ManConst0(pMan);
+ Abc_SopForEachCube( pSop, nFanins, pCube )
{
- if ( Value == '1' )
- pAnd = Hop_And( pMan, pAnd, Hop_IthVar(pMan,i) );
- else if ( Value == '0' )
- pAnd = Hop_And( pMan, pAnd, Hop_Not(Hop_IthVar(pMan,i)) );
- }
- // add to the sum of cubes
- if ( fExor )
- pSum = Hop_Exor( pMan, pSum, pAnd );
- else
+ // create the AND of literals
+ pAnd = Hop_ManConst1(pMan);
+ Abc_CubeForEachVar( pCube, Value, i )
+ {
+ if ( Value == '1' )
+ pAnd = Hop_And( pMan, pAnd, Hop_IthVar(pMan,i) );
+ else if ( Value == '0' )
+ pAnd = Hop_And( pMan, pAnd, Hop_Not(Hop_IthVar(pMan,i)) );
+ }
+ // add to the sum of cubes
pSum = Hop_Or( pMan, pSum, pAnd );
+ }
}
// decide whether to complement the result
if ( Abc_SopIsComplement(pSop) )
@@ -675,32 +683,32 @@ int Abc_NtkAigToBdd( Abc_Ntk_t * pNtk )
dd = Cudd_Init( nFaninsMax, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
// set the mapping of elementary AIG nodes into the elementary BDD nodes
- pMan = pNtk->pManFunc;
+ pMan = (Hop_Man_t *)pNtk->pManFunc;
assert( Hop_ManPiNum(pMan) >= nFaninsMax );
for ( i = 0; i < nFaninsMax; i++ )
{
Hop_ManPi(pMan, i)->pData = Cudd_bddIthVar(dd, i);
- Cudd_Ref( Hop_ManPi(pMan, i)->pData );
+ Cudd_Ref( (DdNode *)Hop_ManPi(pMan, i)->pData );
}
// convert each node from SOP to BDD
Abc_NtkForEachNode( pNtk, pNode, i )
{
assert( pNode->pData );
- pNode->pData = Abc_ConvertAigToBdd( dd, pNode->pData );
+ pNode->pData = Abc_ConvertAigToBdd( dd, (Hop_Obj_t *)pNode->pData );
if ( pNode->pData == NULL )
{
printf( "Abc_NtkSopToBdd: Error while converting SOP into BDD.\n" );
return 0;
}
- Cudd_Ref( pNode->pData );
+ Cudd_Ref( (DdNode *)pNode->pData );
}
// dereference intermediate BDD nodes
for ( i = 0; i < nFaninsMax; i++ )
- Cudd_RecursiveDeref( dd, Hop_ManPi(pMan, i)->pData );
+ Cudd_RecursiveDeref( dd, (DdNode *) Hop_ManPi(pMan, i)->pData );
- Hop_ManStop( pNtk->pManFunc );
+ Hop_ManStop( (Hop_Man_t *)pNtk->pManFunc );
pNtk->pManFunc = dd;
// update the network type
@@ -727,7 +735,7 @@ void Abc_ConvertAigToBdd_rec1( DdManager * dd, Hop_Obj_t * pObj )
Abc_ConvertAigToBdd_rec1( dd, Hop_ObjFanin0(pObj) );
Abc_ConvertAigToBdd_rec1( dd, Hop_ObjFanin1(pObj) );
pObj->pData = Cudd_bddAnd( dd, (DdNode *)Hop_ObjChild0Copy(pObj), (DdNode *)Hop_ObjChild1Copy(pObj) );
- Cudd_Ref( pObj->pData );
+ Cudd_Ref( (DdNode *)pObj->pData );
assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
Hop_ObjSetMarkA( pObj );
}
@@ -750,7 +758,7 @@ void Abc_ConvertAigToBdd_rec2( DdManager * dd, Hop_Obj_t * pObj )
return;
Abc_ConvertAigToBdd_rec2( dd, Hop_ObjFanin0(pObj) );
Abc_ConvertAigToBdd_rec2( dd, Hop_ObjFanin1(pObj) );
- Cudd_RecursiveDeref( dd, pObj->pData );
+ Cudd_RecursiveDeref( dd, (DdNode *)pObj->pData );
pObj->pData = NULL;
assert( Hop_ObjIsMarkA(pObj) ); // loop detection
Hop_ObjClearMarkA( pObj );
@@ -805,7 +813,7 @@ void Abc_ConvertAigToAig_rec( Abc_Ntk_t * pNtkAig, Hop_Obj_t * pObj )
return;
Abc_ConvertAigToAig_rec( pNtkAig, Hop_ObjFanin0(pObj) );
Abc_ConvertAigToAig_rec( pNtkAig, Hop_ObjFanin1(pObj) );
- pObj->pData = Abc_AigAnd( pNtkAig->pManFunc, (Abc_Obj_t *)Hop_ObjChild0Copy(pObj), (Abc_Obj_t *)Hop_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, (Abc_Obj_t *)Hop_ObjChild0Copy(pObj), (Abc_Obj_t *)Hop_ObjChild1Copy(pObj) );
assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
Hop_ObjSetMarkA( pObj );
}
@@ -828,8 +836,8 @@ Abc_Obj_t * Abc_ConvertAigToAig( Abc_Ntk_t * pNtkAig, Abc_Obj_t * pObjOld )
Abc_Obj_t * pFanin;
int i;
// get the local AIG
- pHopMan = pObjOld->pNtk->pManFunc;
- pRoot = pObjOld->pData;
+ pHopMan = (Hop_Man_t *)pObjOld->pNtk->pManFunc;
+ pRoot = (Hop_Obj_t *)pObjOld->pData;
// check the case of a constant
if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) )
return Abc_ObjNotCond( Abc_AigConst1(pNtkAig), Hop_IsComplement(pRoot) );
@@ -843,7 +851,7 @@ Abc_Obj_t * Abc_ConvertAigToAig( Abc_Ntk_t * pNtkAig, Abc_Obj_t * pObjOld )
Abc_ConvertAigToAig_rec( pNtkAig, Hop_Regular(pRoot) );
Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
// return the result
- return Abc_ObjNotCond( Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
+ return Abc_ObjNotCond( (Abc_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
}
@@ -873,9 +881,9 @@ int Abc_NtkMapToSop( Abc_Ntk_t * pNtk )
// update the nodes
Abc_NtkForEachNode( pNtk, pNode, i )
{
- pSop = Mio_GateReadSop(pNode->pData);
+ pSop = Mio_GateReadSop((Mio_Gate_t *)pNode->pData);
assert( Abc_SopGetVarNum(pSop) == Abc_ObjFaninNum(pNode) );
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, pSop );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, pSop );
}
return 1;
}
@@ -1000,3 +1008,5 @@ int Abc_NtkToAig( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcHie.c b/src/base/abc/abcHie.c
index 2addf289..1155731e 100644
--- a/src/base/abc/abcHie.c
+++ b/src/base/abc/abcHie.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -143,7 +146,7 @@ void Abc_NtkFlattenLogicHierarchy2_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, i
{
if ( Abc_ObjIsLatch(pObj) )
continue;
- pNtkModel = pObj->pData;
+ pNtkModel = (Abc_Ntk_t *)pObj->pData;
// check the match between the number of actual and formal parameters
assert( Abc_ObjFaninNum(pObj) == Abc_NtkPiNum(pNtkModel) );
assert( Abc_ObjFanoutNum(pObj) == Abc_NtkPoNum(pNtkModel) );
@@ -293,7 +296,7 @@ void Abc_NtkFlattenLogicHierarchy_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, in
{
char Buffer[20];
sprintf( Buffer, "(%d)", *pCounter );
- Vec_StrAppend( vPref, Buffer );
+ Vec_StrPrintStr( vPref, Buffer );
}
Vec_StrPush( vPref, '|' );
Vec_StrPush( vPref, 0 );
@@ -369,7 +372,7 @@ void Abc_NtkFlattenLogicHierarchy_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, in
{
if ( Abc_ObjIsLatch(pObj) )
continue;
- pNtkModel = pObj->pData;
+ pNtkModel = (Abc_Ntk_t *)pObj->pData;
// check the match between the number of actual and formal parameters
assert( Abc_ObjFaninNum(pObj) == Abc_NtkPiNum(pNtkModel) );
assert( Abc_ObjFanoutNum(pObj) == Abc_NtkPoNum(pNtkModel) );
@@ -382,7 +385,7 @@ void Abc_NtkFlattenLogicHierarchy_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, in
Abc_ObjFanin0( Abc_NtkPo(pNtkModel, k) )->pCopy = Abc_ObjFanout0(pTerm)->pCopy;
// create name
Vec_StrShrink( vPref, Length );
- Vec_StrAppend( vPref, Abc_NtkName(pNtkModel) );
+ Vec_StrPrintStr( vPref, Abc_NtkName(pNtkModel) );
// call recursively
Abc_NtkFlattenLogicHierarchy_rec( pNtkNew, pNtkModel, pCounter, vPref );
}
@@ -444,7 +447,7 @@ Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy( Abc_Ntk_t * pNtk )
// recursively flatten hierarchy, create internal logic, add new PI/PO names if there are black boxes
vPref = Vec_StrAlloc( 1000 );
- Vec_StrAppend( vPref, Abc_NtkName(pNtk) );
+ Vec_StrPrintStr( vPref, Abc_NtkName(pNtk) );
Abc_NtkFlattenLogicHierarchy_rec( pNtkNew, pNtk, &Counter, vPref );
printf( "Hierarchy reader flattened %d instances of logic boxes and left %d black boxes.\n",
Counter, Abc_NtkBlackboxNum(pNtkNew) );
@@ -734,3 +737,5 @@ Abc_Ntk_t * Abc_NtkInsertNewLogic( Abc_Ntk_t * pNtkH, Abc_Ntk_t * pNtkL )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcInt.h b/src/base/abc/abcInt.h
index 0e35e774..326ff5a2 100644
--- a/src/base/abc/abcInt.h
+++ b/src/base/abc/abcInt.h
@@ -21,6 +21,10 @@
#ifndef __ABC_INT_H__
#define __ABC_INT_H__
+
+ABC_NAMESPACE_HEADER_START
+
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -43,6 +47,10 @@
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_HEADER_END
+
#endif
////////////////////////////////////////////////////////////////////////
diff --git a/src/base/abc/abcLatch.c b/src/base/abc/abcLatch.c
index baf4e64b..7528f470 100644
--- a/src/base/abc/abcLatch.c
+++ b/src/base/abc/abcLatch.c
@@ -20,6 +20,8 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -39,7 +41,7 @@
SeeAlso []
***********************************************************************/
-bool Abc_NtkLatchIsSelfFeed_rec( Abc_Obj_t * pLatch, Abc_Obj_t * pLatchRoot )
+int Abc_NtkLatchIsSelfFeed_rec( Abc_Obj_t * pLatch, Abc_Obj_t * pLatchRoot )
{
Abc_Obj_t * pFanin;
assert( Abc_ObjIsLatch(pLatch) );
@@ -62,7 +64,7 @@ bool Abc_NtkLatchIsSelfFeed_rec( Abc_Obj_t * pLatch, Abc_Obj_t * pLatchRoot )
SeeAlso []
***********************************************************************/
-bool Abc_NtkLatchIsSelfFeed( Abc_Obj_t * pLatch )
+int Abc_NtkLatchIsSelfFeed( Abc_Obj_t * pLatch )
{
Abc_Obj_t * pFanin;
assert( Abc_ObjIsLatch(pLatch) );
@@ -163,7 +165,7 @@ void Abc_NtkLatchPipe( Abc_Ntk_t * pNtk, int nLatches )
Abc_ObjAssignName( pLatch, Abc_ObjNameDummy("LL", i*nLatches + k, nDigits), NULL );
}
// patch the PI fanouts
- Vec_PtrForEachEntry( vNodes, pFanout, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pFanout, k )
Abc_ObjPatchFanin( pFanout, pObj, pFanin );
}
Vec_PtrFree( vNodes );
@@ -255,11 +257,11 @@ void Abc_NtkNodeConvertToMux( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodeC, Abc_Obj_t *
Abc_ObjAddFanin( pMux, pNode1 );
Abc_ObjAddFanin( pMux, pNode0 );
if ( Abc_NtkHasSop(pNtk) )
- pMux->pData = Abc_SopRegister( pNtk->pManFunc, "11- 1\n0-1 1\n" );
+ pMux->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, "11- 1\n0-1 1\n" );
else if ( Abc_NtkHasBdd(pNtk) )
- pMux->pData = Cudd_bddIte(pNtk->pManFunc,Cudd_bddIthVar(pNtk->pManFunc,0),Cudd_bddIthVar(pNtk->pManFunc,1),Cudd_bddIthVar(pNtk->pManFunc,2)), Cudd_Ref( pMux->pData );
+ pMux->pData = Cudd_bddIte((DdManager *)pNtk->pManFunc,Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0),Cudd_bddIthVar((DdManager *)pNtk->pManFunc,1),Cudd_bddIthVar((DdManager *)pNtk->pManFunc,2)), Cudd_Ref( (DdNode *)pMux->pData );
else if ( Abc_NtkHasAig(pNtk) )
- pMux->pData = Hop_Mux(pNtk->pManFunc,Hop_IthVar(pNtk->pManFunc,0),Hop_IthVar(pNtk->pManFunc,1),Hop_IthVar(pNtk->pManFunc,2));
+ pMux->pData = Hop_Mux((Hop_Man_t *)pNtk->pManFunc,Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0),Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,1),Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,2));
else
assert( 0 );
}
@@ -343,10 +345,10 @@ Vec_Ptr_t * Abc_NtkConverLatchNamesIntoNumbers( Abc_Ntk_t * pNtk )
pObj->pNext = (Abc_Obj_t *)(ABC_PTRINT_T)i;
// add the numbers
vResult = Vec_PtrAlloc( Vec_PtrSize(pNtk->vOnehots) );
- Vec_PtrForEachEntry( pNtk->vOnehots, vNames, i )
+ Vec_PtrForEachEntry( Vec_Ptr_t *, pNtk->vOnehots, vNames, i )
{
vNumbers = Vec_IntAlloc( Vec_PtrSize(vNames) );
- Vec_PtrForEachEntry( vNames, pName, k )
+ Vec_PtrForEachEntry( char *, vNames, pName, k )
{
Num = Nm_ManFindIdByName( pNtk->pManName, pName, ABC_OBJ_BO );
if ( Num < 0 )
@@ -442,14 +444,14 @@ Abc_Ntk_t * Abc_NtkConvertOnehot( Abc_Ntk_t * pNtk )
if ( (k >> i) & 1 )
Abc_ObjAddFanin( pObjNew, Abc_NtkCi(pNtkNew, Abc_NtkPiNum(pNtkNew)+k) );
assert( Abc_ObjFaninNum(pObjNew) == nStates/2 );
- pObjNew->pData = Abc_SopCreateOr( pNtkNew->pManFunc, nStates/2, NULL );
+ pObjNew->pData = Abc_SopCreateOr( (Extra_MmFlex_t *)pNtkNew->pManFunc, nStates/2, NULL );
// save the new flop
pObj = Abc_NtkCi( pNtk, Abc_NtkPiNum(pNtk) + i );
pObj->pCopy = pObjNew;
}
// duplicate the nodes
vNodes = Abc_NtkDfs( pNtk, 0 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
pObj->pCopy = Abc_NtkDupObj( pNtkNew, pObj, 1 );
Abc_ObjForEachFanin( pObj, pFanin, k )
@@ -472,7 +474,7 @@ Abc_Ntk_t * Abc_NtkConvertOnehot( Abc_Ntk_t * pNtk )
Abc_ObjAddFanin( pObjNew, Abc_ObjRegular(pObj->pCopy) );
pfCompl[i] = Abc_ObjIsComplement(pObj->pCopy) ^ !((k >> i) & 1);
}
- pObjNew->pData = Abc_SopCreateAnd( pNtkNew->pManFunc, nFlops, pfCompl );
+ pObjNew->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtkNew->pManFunc, nFlops, pfCompl );
// connect it to the flop input
Abc_ObjAddFanin( Abc_NtkCo(pNtkNew, Abc_NtkPoNum(pNtkNew)+k), pObjNew );
}
@@ -481,8 +483,13 @@ Abc_Ntk_t * Abc_NtkConvertOnehot( Abc_Ntk_t * pNtk )
return pNtkNew;
}
+ABC_NAMESPACE_IMPL_END
+
#include "giaAig.h"
+ABC_NAMESPACE_IMPL_START
+
+
/**Function*************************************************************
Synopsis [Performs retiming with classes.]
@@ -559,7 +566,7 @@ void Abc_NtkTransformBack( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew, Vec_Ptr_t *
Abc_NtkForEachPo( pNtkOld, pObj, i )
pObj->pCopy = Abc_NtkPo( pNtkNew, i );
// remap the flops
- Vec_PtrForEachEntry( vControls, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vControls, pObj, i )
{
assert( Abc_ObjIsPo(pObj) && pObj->pNtk == pNtkOld );
Vec_PtrWriteEntry( vControls, i, pObj->pCopy );
@@ -572,17 +579,17 @@ void Abc_NtkTransformBack( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew, Vec_Ptr_t *
if ( Class == -1 )
continue;
pDriver = Abc_ObjFanin0(Abc_ObjFanin0(pObj));
- pCtrl = Vec_PtrEntry( vControls, Class );
+ pCtrl = (Abc_Obj_t *)Vec_PtrEntry( vControls, Class );
pCtrl = Abc_ObjFanin0( pCtrl );
pNodeNew = Abc_NtkCreateNode( pNtkNew );
Abc_ObjAddFanin( pNodeNew, pCtrl );
Abc_ObjAddFanin( pNodeNew, pDriver );
Abc_ObjAddFanin( pNodeNew, Abc_ObjFanout0(pObj) );
- Abc_ObjSetData( pNodeNew, Abc_SopRegister(pNtkNew->pManFunc, "0-1 1\n11- 1\n") );
+ Abc_ObjSetData( pNodeNew, Abc_SopRegister((Extra_MmFlex_t *)pNtkNew->pManFunc, "0-1 1\n11- 1\n") );
Abc_ObjPatchFanin( Abc_ObjFanin0(pObj), pDriver, pNodeNew );
}
// remove the useless POs
- Vec_PtrForEachEntry( vControls, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vControls, pObj, i )
Abc_NtkDeleteObj( pObj );
}
@@ -649,7 +656,7 @@ Abc_Ntk_t * Abc_NtkCRetime( Abc_Ntk_t * pNtk, int fVerbose )
CountN, Count2, Count1, Count0, Vec_PtrSize(vControls) );
// add the controls to the list of POs
- Vec_PtrForEachEntry( vControls, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vControls, pObj, i )
{
pObjPo = Abc_NtkCreatePo( pNtk );
Abc_ObjAddFanin( pObjPo, pObj );
@@ -676,3 +683,5 @@ Abc_Ntk_t * Abc_NtkCRetime( Abc_Ntk_t * pNtk, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcLib.c b/src/base/abc/abcLib.c
index 4540462d..d3e4d735 100644
--- a/src/base/abc/abcLib.c
+++ b/src/base/abc/abcLib.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -71,12 +74,12 @@ void Abc_LibFree( Abc_Lib_t * pLib, Abc_Ntk_t * pNtkSave )
if ( pLib->pName )
ABC_FREE( pLib->pName );
if ( pLib->pManFunc )
- Hop_ManStop( pLib->pManFunc );
+ Hop_ManStop( (Hop_Man_t *)pLib->pManFunc );
if ( pLib->tModules )
st_free_table( pLib->tModules );
if ( pLib->vModules )
{
- Vec_PtrForEachEntry( pLib->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pLib->vModules, pNtk, i )
{
if ( pNtk == pNtkSave )
continue;
@@ -115,7 +118,7 @@ Abc_Lib_t * Abc_LibDupBlackboxes( Abc_Lib_t * pLib, Abc_Ntk_t * pNtkSave )
// pLibNew->pManFunc = pNtkSave->pManFunc;
Vec_PtrPush( pLibNew->vTops, pNtkSave );
Vec_PtrPush( pLibNew->vModules, pNtkSave );
- Vec_PtrForEachEntry( pLib->vModules, pNtkTemp, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pLib->vModules, pNtkTemp, i )
if ( Abc_NtkHasBlackbox( pNtkTemp ) )
Vec_PtrPush( pLibNew->vModules, Abc_NtkDup(pNtkTemp) );
return pLibNew;
@@ -139,7 +142,7 @@ void Abc_LibPrint( Abc_Lib_t * pLib )
Abc_Obj_t * pObj;
int i, k;
printf( "Models of design %s:\n", pLib->pName );
- Vec_PtrForEachEntry( pLib->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pLib->vModules, pNtk, i )
{
printf( "%2d : %20s ", i+1, pNtk->pName );
printf( "nd = %6d lat = %6d whitebox = %3d blackbox = %3d\n",
@@ -148,9 +151,9 @@ void Abc_LibPrint( Abc_Lib_t * pLib )
if ( Abc_NtkBlackboxNum(pNtk) == 0 )
continue;
Abc_NtkForEachWhitebox( pNtk, pObj, k )
- printf( " %20s (whitebox)\n", Abc_NtkName(pObj->pData) );
+ printf( " %20s (whitebox)\n", Abc_NtkName((Abc_Ntk_t *)pObj->pData) );
Abc_NtkForEachBlackbox( pNtk, pObj, k )
- printf( " %20s (blackbox)\n", Abc_NtkName(pObj->pData) );
+ printf( " %20s (blackbox)\n", Abc_NtkName((Abc_Ntk_t *)pObj->pData) );
}
}
@@ -214,7 +217,7 @@ Abc_Ntk_t * Abc_LibDeriveRoot( Abc_Lib_t * pLib )
printf( "The design includes more than one module and is currently not used.\n" );
return NULL;
}
- pNtk = Vec_PtrEntry( pLib->vModules, 0 ); Vec_PtrClear( pLib->vModules );
+ pNtk = (Abc_Ntk_t *)Vec_PtrEntry( pLib->vModules, 0 ); Vec_PtrClear( pLib->vModules );
pNtk->pManFunc = pLib->pManFunc; pLib->pManFunc = NULL;
return pNtk;
}
@@ -237,10 +240,10 @@ int Abc_LibFindTopLevelModels( Abc_Lib_t * pLib )
int i, k;
assert( Vec_PtrSize( pLib->vModules ) > 0 );
// clear the models
- Vec_PtrForEachEntry( pLib->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pLib->vModules, pNtk, i )
pNtk->fHieVisited = 0;
// mark all the models reachable from other models
- Vec_PtrForEachEntry( pLib->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pLib->vModules, pNtk, i )
{
Abc_NtkForEachBox( pNtk, pObj, k )
{
@@ -248,13 +251,13 @@ int Abc_LibFindTopLevelModels( Abc_Lib_t * pLib )
continue;
if ( pObj->pData == NULL )
continue;
- pNtkBox = pObj->pData;
+ pNtkBox = (Abc_Ntk_t *)pObj->pData;
pNtkBox->fHieVisited = 1;
}
}
// collect the models that are not marked
Vec_PtrClear( pLib->vTops );
- Vec_PtrForEachEntry( pLib->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pLib->vModules, pNtk, i )
{
if ( pNtk->fHieVisited == 0 )
Vec_PtrPush( pLib->vTops, pNtk );
@@ -364,7 +367,7 @@ void Abc_NodeStrashUsingNetwork( Abc_Ntk_t * pNtkAig, Abc_Obj_t * pBox )
unsigned * pPolarity;
int i, fCompl;
assert( Abc_ObjIsBox(pBox) );
- pNtkGate = pBox->pData;
+ pNtkGate = (Abc_Ntk_t *)pBox->pData;
pPolarity = (unsigned *)pBox->pNext;
assert( Abc_NtkIsNetlist(pNtkGate) );
assert( Abc_NtkLatchNum(pNtkGate) == 0 );
@@ -416,7 +419,7 @@ Abc_Ntk_t * Abc_LibDeriveAig( Abc_Ntk_t * pNtk, Abc_Lib_t * pLib )
// build the AIG for the remaining logic in the netlist
vNodes = Abc_NtkDfs( pNtk, 0 );
pProgress = Extra_ProgressBarStart( stdout, Vec_PtrSize(vNodes) );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
if ( Abc_ObjIsNode(pObj) )
@@ -432,14 +435,14 @@ Abc_Ntk_t * Abc_LibDeriveAig( Abc_Ntk_t * pNtk, Abc_Lib_t * pLib )
// deallocate memory manager, which remembers the phase
if ( pNtk->pData )
{
- Extra_MmFlexStop( pNtk->pData );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)pNtk->pData );
pNtk->pData = NULL;
}
// set the COs
// Abc_NtkFinalize( pNtk, pNtkAig );
Abc_NtkForEachCo( pNtk, pObj, i )
Abc_ObjAddFanin( pObj->pCopy, Abc_ObjFanin0(pObj)->pCopy );
- Abc_AigCleanup( pNtkAig->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkAig->pManFunc );
// make sure that everything is okay
if ( !Abc_NtkCheck( pNtkAig ) )
{
@@ -454,3 +457,5 @@ Abc_Ntk_t * Abc_LibDeriveAig( Abc_Ntk_t * pNtk, Abc_Lib_t * pLib )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcMinBase.c b/src/base/abc/abcMinBase.c
index 5186c920..ee0085a2 100644
--- a/src/base/abc/abcMinBase.c
+++ b/src/base/abc/abcMinBase.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -87,12 +90,12 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
Abc_NodeCollectFanins( pNode, vFanins );
for ( i = 0; i < vFanins->nSize; i++ )
if ( vSupport->pArray[i] == 0 )
- Abc_ObjDeleteFanin( pNode, vFanins->pArray[i] );
+ Abc_ObjDeleteFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
assert( nVars == Abc_ObjFaninNum(pNode) );
// update the function of the node
- pNode->pData = Extra_bddRemapUp( pNode->pNtk->pManFunc, bTemp = pNode->pData ); Cudd_Ref( pNode->pData );
- Cudd_RecursiveDeref( pNode->pNtk->pManFunc, bTemp );
+ pNode->pData = Extra_bddRemapUp( (DdManager *)pNode->pNtk->pManFunc, bTemp = (DdNode *)pNode->pData ); Cudd_Ref( (DdNode *)pNode->pData );
+ Cudd_RecursiveDeref( (DdManager *)pNode->pNtk->pManFunc, bTemp );
Vec_PtrFree( vFanins );
Vec_StrFree( vSupport );
return 1;
@@ -146,12 +149,12 @@ int Abc_NodeRemoveDupFanins_int( Abc_Obj_t * pNode )
break;
if ( pFanin1 == pFanin2 )
{
- DdManager * dd = pNode->pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNode->pNtk->pManFunc;
DdNode * bVar1 = Cudd_bddIthVar( dd, i );
DdNode * bVar2 = Cudd_bddIthVar( dd, k );
DdNode * bTrans, * bTemp;
bTrans = Cudd_bddXnor( dd, bVar1, bVar2 ); Cudd_Ref( bTrans );
- pNode->pData = Cudd_bddAndAbstract( dd, bTemp = pNode->pData, bTrans, bVar2 ); Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_bddAndAbstract( dd, bTemp = (DdNode *)pNode->pData, bTrans, bVar2 ); Cudd_Ref( (DdNode *)pNode->pData );
Cudd_RecursiveDeref( dd, bTemp );
Cudd_RecursiveDeref( dd, bTrans );
Abc_NodeMinimumBase( pNode );
@@ -315,7 +318,7 @@ int Abc_ObjFaninNumberNew( Vec_Ptr_t * vFanins, Abc_Obj_t * pFanin )
{
Abc_Obj_t * pObj;
int i;
- Vec_PtrForEachEntry( vFanins, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFanins, pObj, i )
if ( pObj == pFanin )
return i;
return -1;
@@ -363,7 +366,7 @@ int Abc_NodeCollapsePermMap( Abc_Obj_t * pNode, Abc_Obj_t * pSkip, Vec_Ptr_t * v
***********************************************************************/
DdNode * Abc_NodeCollapseFunc( Abc_Obj_t * pFanin, Abc_Obj_t * pFanout, Vec_Ptr_t * vFanins, int * pPermFanin, int * pPermFanout )
{
- DdManager * dd = pFanin->pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pFanin->pNtk->pManFunc;
DdNode * bVar, * bFunc0, * bFunc1, * bTemp, * bFanin, * bFanout;
int RetValue, nSize, iFanin;
// can only eliminate if fanin occurs in the fanin list of the fanout exactly once
@@ -380,14 +383,14 @@ DdNode * Abc_NodeCollapseFunc( Abc_Obj_t * pFanin, Abc_Obj_t * pFanout, Vec_Ptr_
assert( RetValue );
// cofactor the local function of the node
bVar = Cudd_bddIthVar( dd, iFanin );
- bFunc0 = Cudd_Cofactor( dd, pFanout->pData, Cudd_Not(bVar) ); Cudd_Ref( bFunc0 );
- bFunc1 = Cudd_Cofactor( dd, pFanout->pData, bVar ); Cudd_Ref( bFunc1 );
+ bFunc0 = Cudd_Cofactor( dd, (DdNode *)pFanout->pData, Cudd_Not(bVar) ); Cudd_Ref( bFunc0 );
+ bFunc1 = Cudd_Cofactor( dd, (DdNode *)pFanout->pData, bVar ); Cudd_Ref( bFunc1 );
// find the permutation after collapsing
bFunc0 = Cudd_bddPermute( dd, bTemp = bFunc0, pPermFanout ); Cudd_Ref( bFunc0 );
Cudd_RecursiveDeref( dd, bTemp );
bFunc1 = Cudd_bddPermute( dd, bTemp = bFunc1, pPermFanout ); Cudd_Ref( bFunc1 );
Cudd_RecursiveDeref( dd, bTemp );
- bFanin = Cudd_bddPermute( dd, pFanin->pData, pPermFanin ); Cudd_Ref( bFanin );
+ bFanin = Cudd_bddPermute( dd, (DdNode *)pFanin->pData, pPermFanin ); Cudd_Ref( bFanin );
// create the new function
bFanout = Cudd_bddIte( dd, bFanin, bFunc1, bFunc0 ); Cudd_Ref( bFanout );
Cudd_RecursiveDeref( dd, bFanin );
@@ -422,7 +425,7 @@ int Abc_NodeCollapse( Abc_Obj_t * pFanin, Abc_Obj_t * pFanout, Vec_Ptr_t * vFani
Cudd_Ref( bFanoutNew );
// create the new node
pFanoutNew = Abc_NtkCreateNode( pFanin->pNtk );
- Vec_PtrForEachEntry( vFanins, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFanins, pObj, i )
Abc_ObjAddFanin( pFanoutNew, pObj );
pFanoutNew->pData = bFanoutNew;
// minimize the node
@@ -471,7 +474,7 @@ int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose
pPermFanout = ABC_ALLOC( int, nMaxSize + 100 );
vFanins = Vec_PtrAlloc( 100 );
vFanouts = Vec_PtrAlloc( 100 );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_NodeFindCoFanout(pNode) != NULL )
continue;
@@ -484,7 +487,7 @@ int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose
continue;
// perform elimination
Abc_NodeCollectFanouts( pNode, vFanouts );
- Vec_PtrForEachEntry( vFanouts, pFanout, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFanouts, pFanout, k )
{
RetValue = Abc_NodeCollapse( pNode, pFanout, vFanins, pPermFanin, pPermFanout );
assert( RetValue );
@@ -504,3 +507,5 @@ int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcNames.c b/src/base/abc/abcNames.c
index e07b47c1..f8041ec7 100644
--- a/src/base/abc/abcNames.c
+++ b/src/base/abc/abcNames.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -140,7 +143,6 @@ void Abc_NtkTrasferNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkNew) );
assert( Abc_NtkBoxNum(pNtk) == Abc_NtkBoxNum(pNtkNew) );
- assert( Abc_NtkAssertNum(pNtk) == Abc_NtkAssertNum(pNtkNew) );
assert( Nm_ManNumEntries(pNtk->pManName) > 0 );
assert( Nm_ManNumEntries(pNtkNew->pManName) == 0 );
// copy the CI/CO/box names
@@ -169,7 +171,6 @@ void Abc_NtkTrasferNamesNoLatches( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
int i;
assert( Abc_NtkPiNum(pNtk) == Abc_NtkPiNum(pNtkNew) );
assert( Abc_NtkPoNum(pNtk) == Abc_NtkPoNum(pNtkNew) );
- assert( Abc_NtkAssertNum(pNtk) == Abc_NtkAssertNum(pNtkNew) );
assert( Nm_ManNumEntries(pNtk->pManName) > 0 );
assert( Nm_ManNumEntries(pNtkNew->pManName) == 0 );
// copy the CI/CO/box name and skip latches and theirs inputs/outputs
@@ -330,7 +331,6 @@ void Abc_NtkOrderObjsByName( Abc_Ntk_t * pNtk, int fComb )
{
Abc_Obj_t * pObj;
int i;
- assert( Abc_NtkAssertNum(pNtk) == 0 );
assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
// temporarily store the names in the copy field
Abc_NtkForEachPi( pNtk, pObj, i )
@@ -410,37 +410,51 @@ void Abc_NtkAddDummyPoNames( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-void Abc_NtkAddDummyAssertNames( Abc_Ntk_t * pNtk )
-{
- Abc_Obj_t * pObj;
- int nDigits, i;
- nDigits = Extra_Base10Log( Abc_NtkAssertNum(pNtk) );
- Abc_NtkForEachAssert( pNtk, pObj, i )
- Abc_ObjAssignName( pObj, Abc_ObjNameDummy("a", i, nDigits), NULL );
-}
-
-/**Function*************************************************************
-
- Synopsis [Adds dummy names.]
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
void Abc_NtkAddDummyBoxNames( Abc_Ntk_t * pNtk )
{
+ char * pName, PrefLi[100], PrefLo[100];
Abc_Obj_t * pObj;
- int nDigits, i;
+ int nDigits, i, k, CountCur, CountMax = 0;
+ // if PIs/POs already have nodes with what looks like latch names
+ // we need to add different prefix for the new latches
+ Abc_NtkForEachPi( pNtk, pObj, i )
+ {
+ CountCur = 0;
+ pName = Abc_ObjName(pObj);
+ for ( k = 0; pName[k]; k++ )
+ if ( pName[k] == 'l' )
+ CountCur++;
+ else
+ break;
+ CountMax = ABC_MAX( CountMax, CountCur );
+ }
+ Abc_NtkForEachPo( pNtk, pObj, i )
+ {
+ CountCur = 0;
+ pName = Abc_ObjName(pObj);
+ for ( k = 0; pName[k]; k++ )
+ if ( pName[k] == 'l' )
+ CountCur++;
+ else
+ break;
+ CountMax = ABC_MAX( CountMax, CountCur );
+ }
+//printf( "CountMax = %d\n", CountMax );
+ assert( CountMax < 100-2 );
+ for ( i = 0; i <= CountMax; i++ )
+ PrefLi[i] = PrefLo[i] = 'l';
+ PrefLi[i] = 'i';
+ PrefLo[i] = 'o';
+ PrefLi[i+1] = 0;
+ PrefLo[i+1] = 0;
+ // create latch names
assert( !Abc_NtkIsNetlist(pNtk) );
nDigits = Extra_Base10Log( Abc_NtkLatchNum(pNtk) );
Abc_NtkForEachLatch( pNtk, pObj, i )
{
Abc_ObjAssignName( pObj, Abc_ObjNameDummy("l", i, nDigits), NULL );
- Abc_ObjAssignName( Abc_ObjFanin0(pObj), Abc_ObjNameDummy("li", i, nDigits), NULL );
- Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjNameDummy("lo", i, nDigits), NULL );
+ Abc_ObjAssignName( Abc_ObjFanin0(pObj), Abc_ObjNameDummy(PrefLi, i, nDigits), NULL );
+ Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjNameDummy(PrefLo, i, nDigits), NULL );
}
/*
nDigits = Extra_Base10Log( Abc_NtkBlackboxNum(pNtk) );
@@ -474,7 +488,6 @@ void Abc_NtkShortNames( Abc_Ntk_t * pNtk )
pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
Abc_NtkAddDummyPiNames( pNtk );
Abc_NtkAddDummyPoNames( pNtk );
- Abc_NtkAddDummyAssertNames( pNtk );
Abc_NtkAddDummyBoxNames( pNtk );
}
@@ -483,3 +496,5 @@ void Abc_NtkShortNames( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcNetlist.c b/src/base/abc/abcNetlist.c
index 26b88c68..9077e621 100644
--- a/src/base/abc/abcNetlist.c
+++ b/src/base/abc/abcNetlist.c
@@ -21,6 +21,9 @@
#include "abc.h"
//#include "seq.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -252,7 +255,7 @@ Abc_Ntk_t * Abc_NtkAigToLogicSop( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pObj, i )
{
Abc_NtkDupObj(pNtkNew, pObj, 0);
- pObj->pCopy->pData = Abc_SopCreateAnd2( pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
+ pObj->pCopy->pData = Abc_SopCreateAnd2( (Extra_MmFlex_t *)pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
}
// create the choice nodes
Abc_NtkForEachNode( pNtk, pObj, i )
@@ -263,13 +266,13 @@ Abc_Ntk_t * Abc_NtkAigToLogicSop( Abc_Ntk_t * pNtk )
pNodeNew = Abc_NtkCreateNode(pNtkNew);
// add fanins
vInts = Vec_IntAlloc( 10 );
- for ( pFanin = pObj; pFanin; pFanin = pFanin->pData )
+ for ( pFanin = pObj; pFanin; pFanin = (Abc_Obj_t *)pFanin->pData )
{
Vec_IntPush( vInts, (int)(pObj->fPhase != pFanin->fPhase) );
Abc_ObjAddFanin( pNodeNew, pFanin->pCopy );
}
// create the logic function
- pNodeNew->pData = Abc_SopCreateOrMultiCube( pNtkNew->pManFunc, Vec_IntSize(vInts), Vec_IntArray(vInts) );
+ pNodeNew->pData = Abc_SopCreateOrMultiCube( (Extra_MmFlex_t *)pNtkNew->pManFunc, Vec_IntSize(vInts), Vec_IntArray(vInts) );
// set the new node
pObj->pCopy->pCopy = pNodeNew;
Vec_IntFree( vInts );
@@ -332,26 +335,26 @@ Abc_Ntk_t * Abc_NtkAigToLogicSopBench( Abc_Ntk_t * pNtk )
pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_SOP );
// collect the nodes to be used (marks all nodes with current TravId)
vNodes = Abc_NtkDfs( pNtk, 0 );
- // create inverters for the CI and remember them
+ // create inverters for the constant node
pObj = Abc_AigConst1(pNtk);
- if ( Abc_AigNodeHasComplFanoutEdgeTrav(pObj) )
- {
+ if ( Abc_ObjFanoutNum(pObj) > 0 )
pObj->pCopy = Abc_NtkCreateNodeConst1(pNtkNew);
+ if ( Abc_AigNodeHasComplFanoutEdgeTrav(pObj) )
pObj->pCopy->pCopy = Abc_NtkCreateNodeInv( pNtkNew, pObj->pCopy );
- }
+ // create inverters for the CIs
Abc_NtkForEachCi( pNtk, pObj, i )
if ( Abc_AigNodeHasComplFanoutEdgeTrav(pObj) )
pObj->pCopy->pCopy = Abc_NtkCreateNodeInv( pNtkNew, pObj->pCopy );
// duplicate the nodes, create node functions, and inverters
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
Abc_NtkDupObj( pNtkNew, pObj, 0 );
- pObj->pCopy->pData = Abc_SopCreateAnd( pNtkNew->pManFunc, 2, NULL );
+ pObj->pCopy->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtkNew->pManFunc, 2, NULL );
if ( Abc_AigNodeHasComplFanoutEdgeTrav(pObj) )
pObj->pCopy->pCopy = Abc_NtkCreateNodeInv( pNtkNew, pObj->pCopy );
}
// connect the objects
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
Abc_ObjForEachFanin( pObj, pFanin, k )
{
if ( Abc_ObjFaninC( pObj, k ) )
@@ -409,3 +412,5 @@ void Abc_NtkAddPoBuffers( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcNtk.c b/src/base/abc/abcNtk.c
index ae345467..602ad548 100644
--- a/src/base/abc/abcNtk.c
+++ b/src/base/abc/abcNtk.c
@@ -22,6 +22,10 @@
#include "abcInt.h"
#include "main.h"
#include "mio.h"
+#include "gia.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -51,13 +55,13 @@ Abc_Ntk_t * Abc_NtkAlloc( Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan
pNtk->ntkFunc = Func;
// start the object storage
pNtk->vObjs = Vec_PtrAlloc( 100 );
- pNtk->vAsserts = Vec_PtrAlloc( 100 );
pNtk->vPios = Vec_PtrAlloc( 100 );
pNtk->vPis = Vec_PtrAlloc( 100 );
pNtk->vPos = Vec_PtrAlloc( 100 );
pNtk->vCis = Vec_PtrAlloc( 100 );
pNtk->vCos = Vec_PtrAlloc( 100 );
pNtk->vBoxes = Vec_PtrAlloc( 100 );
+ pNtk->vLtlProperties = Vec_PtrAlloc( 100 );
// start the memory managers
pNtk->pMmObj = fUseMemMan? Extra_MmFixedStart( sizeof(Abc_Obj_t) ) : NULL;
pNtk->pMmStep = fUseMemMan? Extra_MmStepStart( ABC_NUM_STEPS ) : NULL;
@@ -105,6 +109,7 @@ Abc_Ntk_t * Abc_NtkStartFrom( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_
fCopyNames = ( Type != ABC_NTK_NETLIST );
// start the network
pNtkNew = Abc_NtkAlloc( Type, Func, 1 );
+ pNtkNew->nConstrs = pNtk->nConstrs;
// duplicate the name and the spec
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
@@ -118,8 +123,6 @@ Abc_Ntk_t * Abc_NtkStartFrom( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_
Abc_NtkDupObj( pNtkNew, pObj, fCopyNames );
Abc_NtkForEachPo( pNtk, pObj, i )
Abc_NtkDupObj( pNtkNew, pObj, fCopyNames );
- Abc_NtkForEachAssert( pNtk, pObj, i )
- Abc_NtkDupObj( pNtkNew, pObj, fCopyNames );
Abc_NtkForEachBox( pNtk, pObj, i )
Abc_NtkDupBox( pNtkNew, pObj, fCopyNames );
// transfer the names
@@ -127,6 +130,10 @@ Abc_Ntk_t * Abc_NtkStartFrom( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc_NtkFunc_
Abc_ManTimeDup( pNtk, pNtkNew );
if ( pNtk->vOnehots )
pNtkNew->vOnehots = (Vec_Ptr_t *)Vec_VecDupInt( (Vec_Vec_t *)pNtk->vOnehots );
+ if ( pNtk->pSeqModel )
+ {
+ pNtkNew->pSeqModel = Gia_ManDupCounterExample( pNtk->pSeqModel, Abc_NtkLatchNum(pNtk) );
+ }
// check that the CI/CO/latches are copied correctly
assert( Abc_NtkCiNum(pNtk) == Abc_NtkCiNum(pNtkNew) );
assert( Abc_NtkCoNum(pNtk) == Abc_NtkCoNum(pNtkNew) );
@@ -155,6 +162,7 @@ Abc_Ntk_t * Abc_NtkStartFromNoLatches( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc
assert( Type != ABC_NTK_NETLIST );
// start the network
pNtkNew = Abc_NtkAlloc( Type, Func, 1 );
+ pNtkNew->nConstrs = pNtk->nConstrs;
// duplicate the name and the spec
pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
@@ -168,8 +176,6 @@ Abc_Ntk_t * Abc_NtkStartFromNoLatches( Abc_Ntk_t * pNtk, Abc_NtkType_t Type, Abc
Abc_NtkDupObj( pNtkNew, pObj, 1 );
Abc_NtkForEachPo( pNtk, pObj, i )
Abc_NtkDupObj( pNtkNew, pObj, 1 );
- Abc_NtkForEachAssert( pNtk, pObj, i )
- Abc_NtkDupObj( pNtkNew, pObj, 1 );
Abc_NtkForEachBox( pNtk, pObj, i )
{
if ( Abc_ObjIsLatch(pObj) )
@@ -320,7 +326,7 @@ Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk )
{
// copy the AND gates
Abc_AigForEachAnd( pNtk, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// relink the choice nodes
Abc_AigForEachAnd( pNtk, pObj, i )
if ( pObj->pData )
@@ -349,7 +355,7 @@ Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk )
if ( pNtk->pExdc )
pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
if ( pNtk->pExcare )
- pNtkNew->pExcare = Abc_NtkDup( pNtk->pExcare );
+ pNtkNew->pExcare = Abc_NtkDup( (Abc_Ntk_t *)pNtk->pExcare );
if ( !Abc_NtkCheck( pNtkNew ) )
fprintf( stdout, "Abc_NtkDup(): Network check has failed.\n" );
pNtk->pCopy = pNtkNew;
@@ -387,8 +393,6 @@ Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk )
Abc_NtkDupObj( pNtkNew, pObj, 0 );
Abc_NtkForEachPo( pNtk, pObj, i )
Abc_NtkDupObj( pNtkNew, pObj, 0 );
- Abc_NtkForEachAssert( pNtk, pObj, i )
- Abc_NtkDupObj( pNtkNew, pObj, 0 );
Abc_NtkForEachBox( pNtk, pObj, i )
Abc_NtkDupBox( pNtkNew, pObj, 0 );
// copy the internal nodes
@@ -409,8 +413,6 @@ Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk )
Abc_NtkDupObj( pNtkNew, pObj, 0 );
Abc_NtkForEachPo( pNtk, pObj, i )
Abc_NtkDupObj( pNtkNew, pObj, 0 );
- Abc_NtkForEachAssert( pNtk, pObj, i )
- Abc_NtkDupObj( pNtkNew, pObj, 0 );
Abc_NtkForEachBox( pNtk, pObj, i )
Abc_NtkDupBox( pNtkNew, pObj, 0 );
// copy the internal nodes
@@ -484,7 +486,7 @@ Abc_Ntk_t * Abc_NtkAttachBottom( Abc_Ntk_t * pNtkTop, Abc_Ntk_t * pNtkBottom )
Abc_NtkPi(pNtkBottom, i)->pCopy = Abc_NtkPi(pNtkTop, i);
// construct all nodes
vNodes = Abc_NtkDfs( pNtkBottom, 0 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
Abc_NtkDupObj(pNtkTop, pObj, 0);
Abc_ObjForEachFanin( pObj, pFanin, k )
@@ -549,12 +551,12 @@ Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNode
pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
Abc_ObjAssignName( pNodeCoNew, pNodeName, NULL );
// copy the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
// if it is an AIG, add to the hash table
if ( Abc_NtkIsStrash(pNtk) )
{
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
}
else
{
@@ -617,12 +619,12 @@ Abc_Ntk_t * Abc_NtkCreateConeArray( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, int fU
}
// copy the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
// if it is an AIG, add to the hash table
if ( Abc_NtkIsStrash(pNtk) )
{
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
}
else
{
@@ -634,7 +636,7 @@ Abc_Ntk_t * Abc_NtkCreateConeArray( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, int fU
Vec_PtrFree( vNodes );
// add the POs corresponding to the root nodes
- Vec_PtrForEachEntry( vRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
{
// create the PO node
pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
@@ -696,8 +698,8 @@ void Abc_NtkAppendToCone( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, Vec_Ptr_t * vRo
}
// copy the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
Vec_PtrFree( vNodes );
// do not add the COs
@@ -744,7 +746,7 @@ Abc_Ntk_t * Abc_NtkCreateMffc( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNode
Abc_NodeMffcConeSupp( pNode, vCone, vSupp );
Abc_NodeRef_rec( pNode );
// create the PIs
- Vec_PtrForEachEntry( vSupp, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pObj, i )
{
pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
@@ -753,12 +755,12 @@ Abc_Ntk_t * Abc_NtkCreateMffc( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNode
pNodeCoNew = Abc_NtkCreatePo( pNtkNew );
Abc_ObjAssignName( pNodeCoNew, pNodeName, NULL );
// copy the nodes
- Vec_PtrForEachEntry( vCone, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vCone, pObj, i )
{
// if it is an AIG, add to the hash table
if ( Abc_NtkIsStrash(pNtk) )
{
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
}
else
{
@@ -811,13 +813,13 @@ Abc_Ntk_t * Abc_NtkCreateTarget( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t
Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), NULL );
}
// copy the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
pObj->pCopy = Abc_NodeStrash( pNtkNew, pObj, 0 );
Vec_PtrFree( vNodes );
// add the PO
pFinal = Abc_AigConst1( pNtkNew );
- Vec_PtrForEachEntry( vRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
{
if ( Abc_ObjIsCo(pObj) )
pOther = Abc_ObjFanin0(pObj)->pCopy;
@@ -825,7 +827,7 @@ Abc_Ntk_t * Abc_NtkCreateTarget( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, Vec_Int_t
pOther = pObj->pCopy;
if ( Vec_IntEntry(vValues, i) == 0 )
pOther = Abc_ObjNot(pOther);
- pFinal = Abc_AigAnd( pNtkNew->pManFunc, pFinal, pOther );
+ pFinal = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pFinal, pOther );
}
// add the PO corresponding to this output
@@ -900,13 +902,13 @@ Abc_Ntk_t * Abc_NtkCreateWithNode( char * pSop )
nVars = Abc_SopGetVarNum( pSop );
vNames = Abc_NodeGetFakeNames( nVars );
for ( i = 0; i < nVars; i++ )
- Abc_ObjAssignName( Abc_NtkCreatePi(pNtkNew), Vec_PtrEntry(vNames, i), NULL );
+ Abc_ObjAssignName( Abc_NtkCreatePi(pNtkNew), (char *)Vec_PtrEntry(vNames, i), NULL );
Abc_NodeFreeNames( vNames );
// create the node, add PIs as fanins, set the function
pNode = Abc_NtkCreateNode( pNtkNew );
Abc_NtkForEachPi( pNtkNew, pFanin, i )
Abc_ObjAddFanin( pNode, pFanin );
- pNode->pData = Abc_SopRegister( pNtkNew->pManFunc, pSop );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtkNew->pManFunc, pSop );
// create the only PO
pNodePo = Abc_NtkCreatePo(pNtkNew);
Abc_ObjAddFanin( pNodePo, pNode );
@@ -942,12 +944,12 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
if ( pNtk->pExdc )
Abc_NtkDelete( pNtk->pExdc );
if ( pNtk->pExcare )
- Abc_NtkDelete( pNtk->pExcare );
+ Abc_NtkDelete( (Abc_Ntk_t *)pNtk->pExcare );
// dereference the BDDs
if ( Abc_NtkHasBdd(pNtk) )
{
Abc_NtkForEachNode( pNtk, pObj, i )
- Cudd_RecursiveDeref( pNtk->pManFunc, pObj->pData );
+ Cudd_RecursiveDeref( (DdManager *)pNtk->pManFunc, (DdNode *)pObj->pData );
}
// make sure all the marks are clean
Abc_NtkForEachObj( pNtk, pObj, i )
@@ -982,12 +984,13 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
Vec_PtrFree( pNtk->vPos );
Vec_PtrFree( pNtk->vCis );
Vec_PtrFree( pNtk->vCos );
- Vec_PtrFree( pNtk->vAsserts );
Vec_PtrFree( pNtk->vObjs );
Vec_PtrFree( pNtk->vBoxes );
if ( pNtk->vLevelsR ) Vec_IntFree( pNtk->vLevelsR );
ABC_FREE( pNtk->pModel );
ABC_FREE( pNtk->pSeqModel );
+ if ( pNtk->pSeqModelVec )
+ Vec_PtrFreeFree( pNtk->pSeqModelVec );
TotalMemory = 0;
TotalMemory += pNtk->pMmObj? Extra_MmFixedReadMemUsage(pNtk->pMmObj) : 0;
TotalMemory += pNtk->pMmStep? Extra_MmStepReadMemUsage(pNtk->pMmStep) : 0;
@@ -1004,13 +1007,13 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
Abc_ManTimeStop( pNtk->pManTime );
// start the functionality manager
if ( Abc_NtkIsStrash(pNtk) )
- Abc_AigFree( pNtk->pManFunc );
+ Abc_AigFree( (Abc_Aig_t *)pNtk->pManFunc );
else if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
- Extra_MmFlexStop( pNtk->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)pNtk->pManFunc );
else if ( Abc_NtkHasBdd(pNtk) )
- Extra_StopManager( pNtk->pManFunc );
+ Extra_StopManager( (DdManager *)pNtk->pManFunc );
else if ( Abc_NtkHasAig(pNtk) )
- { if ( pNtk->pManFunc ) Hop_ManStop( pNtk->pManFunc ); }
+ { if ( pNtk->pManFunc ) Hop_ManStop( (Hop_Man_t *)pNtk->pManFunc ); }
else if ( Abc_NtkHasMapping(pNtk) )
pNtk->pManFunc = NULL;
else if ( !Abc_NtkHasBlackbox(pNtk) )
@@ -1024,11 +1027,11 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
// if ( pNtk->pBlackBoxes )
// Vec_IntFree( pNtk->pBlackBoxes );
// free node attributes
- Vec_PtrForEachEntry( pNtk->vAttrs, pAttrMan, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pNtk->vAttrs, pAttrMan, i )
if ( pAttrMan )
{
//printf( "deleting attr\n" );
- Vec_AttFree( pAttrMan, 1 );
+ Vec_AttFree( (Vec_Att_t *)pAttrMan, 1 );
}
Vec_PtrFree( pNtk->vAttrs );
ABC_FREE( pNtk->pName );
@@ -1059,6 +1062,14 @@ void Abc_NtkFixNonDrivenNets( Abc_Ntk_t * pNtk )
if ( Abc_NtkNodeNum(pNtk) == 0 && Abc_NtkBoxNum(pNtk) == 0 )
return;
+ // special case
+ pNet = Abc_NtkFindNet( pNtk, "[_c1_]" );
+ if ( pNet != NULL )
+ {
+ pNode = Abc_NtkCreateNodeConst1( pNtk );
+ Abc_ObjAddFanin( pNet, pNode );
+ }
+
// check for non-driven nets
vNets = Vec_PtrAlloc( 100 );
Abc_NtkForEachNet( pNtk, pNet, i )
@@ -1077,7 +1088,7 @@ void Abc_NtkFixNonDrivenNets( Abc_Ntk_t * pNtk )
if ( vNets->nSize > 0 )
{
printf( "Warning: Constant-0 drivers added to %d non-driven nets in network \"%s\":\n", Vec_PtrSize(vNets), pNtk->pName );
- Vec_PtrForEachEntry( vNets, pNet, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNets, pNet, i )
{
printf( "%s%s", (i? ", ": ""), Abc_ObjName(pNet) );
if ( i == 3 )
@@ -1117,7 +1128,7 @@ void Abc_NtkMakeComb( Abc_Ntk_t * pNtk, int fRemoveLatches )
// detach the latches
// Abc_NtkForEachLatch( pNtk, pObj, i )
- Vec_PtrForEachEntryReverse( pNtk->vBoxes, pObj, i )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, pNtk->vBoxes, pObj, i )
Abc_NtkDeleteObj( pObj );
assert( Abc_NtkLatchNum(pNtk) == 0 );
assert( Abc_NtkBoxNum(pNtk) == 0 );
@@ -1151,7 +1162,7 @@ void Abc_NtkMakeComb( Abc_Ntk_t * pNtk, int fRemoveLatches )
Vec_PtrFree( pNtk->vCos );
pNtk->vCos = NULL;
// remove the BOs
- Vec_PtrForEachEntry( vBos, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vBos, pObj, i )
Abc_NtkDeleteObj( pObj );
Vec_PtrFree( vBos );
// create COs
@@ -1160,7 +1171,7 @@ void Abc_NtkMakeComb( Abc_Ntk_t * pNtk, int fRemoveLatches )
if ( Abc_NtkIsLogic(pNtk) )
Abc_NtkCleanup( pNtk, 0 );
else if ( Abc_NtkIsStrash(pNtk) )
- Abc_AigCleanup( pNtk->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
else
assert( 0 );
}
@@ -1272,38 +1283,41 @@ void Abc_NtkMakeSeq( Abc_Ntk_t * pNtk, int nLatchesToAdd )
SeeAlso []
***********************************************************************/
-void Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo )
+Abc_Ntk_t * Abc_NtkMakeOnePo( Abc_Ntk_t * pNtkInit, int Output, int nRange )
{
+ Abc_Ntk_t * pNtk;
Vec_Ptr_t * vPosToRemove;
- Abc_Obj_t * pObj;
+ Abc_Obj_t * pNodePo;
int i;
+ assert( !Abc_NtkIsNetlist(pNtkInit) );
+ assert( Abc_NtkHasOnlyLatchBoxes(pNtkInit) );
+ if ( Output < 0 || Output >= Abc_NtkPoNum(pNtkInit) )
+ {
+ printf( "PO index is incorrect.\n" );
+ return NULL;
+ }
- assert( !Abc_NtkIsNetlist(pNtk) );
- assert( Abc_NtkHasOnlyLatchBoxes(pNtk) );
-
+ pNtk = Abc_NtkDup( pNtkInit );
if ( Abc_NtkPoNum(pNtk) == 1 )
- return;
+ return pNtk;
- // make sure the node exists
- Abc_NtkForEachPo( pNtk, pObj, i )
- if ( pObj == pNodePo )
- break;
- assert( i < Abc_NtkPoNum(pNtk) );
+ if ( nRange < 1 )
+ nRange = 1;
// collect POs to remove
vPosToRemove = Vec_PtrAlloc( 100 );
- Abc_NtkForEachPo( pNtk, pObj, i )
- if ( pObj != pNodePo )
- Vec_PtrPush( vPosToRemove, pObj );
+ Abc_NtkForEachPo( pNtk, pNodePo, i )
+ if ( i < Output || i >= Output + nRange )
+ Vec_PtrPush( vPosToRemove, pNodePo );
// remove the POs
- Vec_PtrForEachEntry( vPosToRemove, pObj, i )
- Abc_NtkDeleteObj( pObj );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vPosToRemove, pNodePo, i )
+ Abc_NtkDeleteObj( pNodePo );
Vec_PtrFree( vPosToRemove );
if ( Abc_NtkIsStrash(pNtk) )
{
- Abc_AigCleanup( pNtk->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
printf( "Run sequential cleanup (\"scl\") to get rid of dangling logic.\n" );
}
else
@@ -1313,6 +1327,7 @@ void Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo )
if ( !Abc_NtkCheck( pNtk ) )
fprintf( stdout, "Abc_NtkMakeComb(): Network check has failed.\n" );
+ return pNtk;
}
/**Function*************************************************************
@@ -1398,9 +1413,68 @@ Abc_Ntk_t * Abc_NtkTrim( Abc_Ntk_t * pNtk )
return Abc_NtkDup( pNtk );
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose )
+{
+ Abc_Obj_t * pObj, * pConst0, * pFaninNew;
+ int i, Counter = 0;
+ assert( Vec_PtrSize(vCexes) == Abc_NtkPoNum(pNtk) );
+ pConst0 = Abc_ObjNot( Abc_AigConst1(pNtk) );
+ Abc_NtkForEachPo( pNtk, pObj, i )
+ {
+ if ( Vec_PtrEntry( vCexes, i ) == NULL )
+ continue;
+ Counter++;
+ pFaninNew = Abc_ObjNotCond( pConst0, Abc_ObjFaninC0(pObj) );
+ Abc_ObjPatchFanin( pObj, Abc_ObjFanin0(pObj), pFaninNew );
+ assert( Abc_ObjChild0(pObj) == pConst0 );
+ // if a PO is driven by a latch, they have the same name...
+// if ( Abc_ObjIsBo(pObj) )
+// Nm_ManDeleteIdName( pNtk->pManName, Abc_ObjId(pObj) );
+ }
+ if ( fVerbose )
+ printf( "Logic cones of %d POs have been replaced by constant 0.\n", Counter );
+ Counter = Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
+// printf( "Cleanup removed %d nodes.\n", Counter );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput )
+{
+ Abc_Obj_t * pObj, * pConst0, * pFaninNew;
+ pObj = Abc_NtkPo( pNtk, iOutput );
+ pConst0 = Abc_ObjNot( Abc_AigConst1(pNtk) );
+ pFaninNew = Abc_ObjNotCond( pConst0, Abc_ObjFaninC0(pObj) );
+ Abc_ObjPatchFanin( pObj, Abc_ObjFanin0(pObj), pFaninNew );
+ assert( Abc_ObjChild0(pObj) == pConst0 );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcObj.c b/src/base/abc/abcObj.c
index e4484ec5..40bbc18b 100644
--- a/src/base/abc/abcObj.c
+++ b/src/base/abc/abcObj.c
@@ -23,6 +23,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -134,10 +137,6 @@ Abc_Obj_t * Abc_NtkCreateObj( Abc_Ntk_t * pNtk, Abc_ObjType_t Type )
case ABC_OBJ_BO:
if ( pNtk->vCis ) Vec_PtrPush( pNtk->vCis, pObj );
break;
- case ABC_OBJ_ASSERT:
- Vec_PtrPush( pNtk->vAsserts, pObj );
- Vec_PtrPush( pNtk->vCos, pObj );
- break;
case ABC_OBJ_NET:
case ABC_OBJ_NODE:
break;
@@ -178,10 +177,10 @@ void Abc_NtkDeleteObj( Abc_Obj_t * pObj )
vNodes = Vec_PtrAlloc( 100 );
Abc_NodeCollectFanouts( pObj, vNodes );
for ( i = 0; i < vNodes->nSize; i++ )
- Abc_ObjDeleteFanin( vNodes->pArray[i], pObj );
+ Abc_ObjDeleteFanin( (Abc_Obj_t *)vNodes->pArray[i], pObj );
Abc_NodeCollectFanins( pObj, vNodes );
for ( i = 0; i < vNodes->nSize; i++ )
- Abc_ObjDeleteFanin( pObj, vNodes->pArray[i] );
+ Abc_ObjDeleteFanin( pObj, (Abc_Obj_t *)vNodes->pArray[i] );
Vec_PtrFree( vNodes );
// remove from the list of objects
Vec_PtrWriteEntry( pNtk->vObjs, pObj->Id, NULL );
@@ -214,15 +213,11 @@ void Abc_NtkDeleteObj( Abc_Obj_t * pObj )
case ABC_OBJ_BO:
if ( pNtk->vCis ) Vec_PtrRemove( pNtk->vCis, pObj );
break;
- case ABC_OBJ_ASSERT:
- Vec_PtrRemove( pNtk->vAsserts, pObj );
- Vec_PtrRemove( pNtk->vCos, pObj );
- break;
case ABC_OBJ_NET:
break;
case ABC_OBJ_NODE:
if ( Abc_NtkHasBdd(pNtk) )
- Cudd_RecursiveDeref( pNtk->pManFunc, pObj->pData );
+ Cudd_RecursiveDeref( (DdManager *)pNtk->pManFunc, (DdNode *)pObj->pData );
pObj->pData = NULL;
break;
case ABC_OBJ_LATCH:
@@ -262,13 +257,13 @@ void Abc_NtkDeleteObj_rec( Abc_Obj_t * pObj, int fOnlyNodes )
Abc_NtkDeleteObj( pObj );
if ( fOnlyNodes )
{
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
if ( Abc_ObjIsNode(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
Abc_NtkDeleteObj_rec( pObj, fOnlyNodes );
}
else
{
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
if ( !Abc_ObjIsPi(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
Abc_NtkDeleteObj_rec( pObj, fOnlyNodes );
}
@@ -296,7 +291,7 @@ void Abc_NtkDeleteAll_rec( Abc_Obj_t * pObj )
vNodes = Vec_PtrAlloc( 100 );
Abc_NodeCollectFanins( pObj, vNodes );
Abc_NtkDeleteObj( pObj );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
if ( !Abc_ObjIsNode(pObj) && Abc_ObjFanoutNum(pObj) == 0 )
Abc_NtkDeleteAll_rec( pObj );
Vec_PtrFree( vNodes );
@@ -317,7 +312,7 @@ Abc_Obj_t * Abc_NtkDupObj( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, int fCopyName
{
Abc_Obj_t * pObjNew;
// create the new object
- pObjNew = Abc_NtkCreateObj( pNtkNew, pObj->Type );
+ pObjNew = Abc_NtkCreateObj( pNtkNew, (Abc_ObjType_t)pObj->Type );
// transfer names of the terminal objects
if ( fCopyName )
{
@@ -350,11 +345,11 @@ Abc_Obj_t * Abc_NtkDupObj( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, int fCopyName
if ( Abc_NtkIsStrash(pNtkNew) )
{}
else if ( Abc_NtkHasSop(pNtkNew) || Abc_NtkHasBlifMv(pNtkNew) )
- pObjNew->pData = Abc_SopRegister( pNtkNew->pManFunc, pObj->pData );
+ pObjNew->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtkNew->pManFunc, (char *)pObj->pData );
else if ( Abc_NtkHasBdd(pNtkNew) )
- pObjNew->pData = Cudd_bddTransfer(pObj->pNtk->pManFunc, pNtkNew->pManFunc, pObj->pData), Cudd_Ref(pObjNew->pData);
+ pObjNew->pData = Cudd_bddTransfer((DdManager *)pObj->pNtk->pManFunc, (DdManager *)pNtkNew->pManFunc, (DdNode *)pObj->pData), Cudd_Ref((DdNode *)pObjNew->pData);
else if ( Abc_NtkHasAig(pNtkNew) )
- pObjNew->pData = Hop_Transfer(pObj->pNtk->pManFunc, pNtkNew->pManFunc, pObj->pData, Abc_ObjFaninNum(pObj));
+ pObjNew->pData = Hop_Transfer((Hop_Man_t *)pObj->pNtk->pManFunc, (Hop_Man_t *)pNtkNew->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj));
else if ( Abc_NtkHasMapping(pNtkNew) )
pObjNew->pData = pObj->pData;
else assert( 0 );
@@ -414,7 +409,7 @@ Abc_Obj_t * Abc_NtkCloneObj( Abc_Obj_t * pObj )
{
Abc_Obj_t * pClone, * pFanin;
int i;
- pClone = Abc_NtkCreateObj( pObj->pNtk, pObj->Type );
+ pClone = Abc_NtkCreateObj( pObj->pNtk, (Abc_ObjType_t)pObj->Type );
Abc_ObjForEachFanin( pObj, pFanin, i )
Abc_ObjAddFanin( pClone, pFanin );
return pClone;
@@ -586,13 +581,13 @@ Abc_Obj_t * Abc_NtkCreateNodeConst0( Abc_Ntk_t * pNtk )
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
pNode = Abc_NtkCreateNode( pNtk );
if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, " 0\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, " 0\n" );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Cudd_ReadLogicZero(pNtk->pManFunc), Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc), Cudd_Ref( (DdNode *)pNode->pData );
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_ManConst0(pNtk->pManFunc);
+ pNode->pData = Hop_ManConst0((Hop_Man_t *)pNtk->pManFunc);
else if ( Abc_NtkHasMapping(pNtk) )
- pNode->pData = Mio_LibraryReadConst0(Abc_FrameReadLibGen());
+ pNode->pData = Mio_LibraryReadConst0((Mio_Library_t *)Abc_FrameReadLibGen());
else if ( !Abc_NtkHasBlackbox(pNtk) )
assert( 0 );
return pNode;
@@ -615,13 +610,13 @@ Abc_Obj_t * Abc_NtkCreateNodeConst1( Abc_Ntk_t * pNtk )
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
pNode = Abc_NtkCreateNode( pNtk );
if ( Abc_NtkHasSop(pNtk) || Abc_NtkHasBlifMv(pNtk) )
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, " 1\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, " 1\n" );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Cudd_ReadOne(pNtk->pManFunc), Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_ReadOne((DdManager *)pNtk->pManFunc), Cudd_Ref( (DdNode *)pNode->pData );
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_ManConst1(pNtk->pManFunc);
+ pNode->pData = Hop_ManConst1((Hop_Man_t *)pNtk->pManFunc);
else if ( Abc_NtkHasMapping(pNtk) )
- pNode->pData = Mio_LibraryReadConst1(Abc_FrameReadLibGen());
+ pNode->pData = Mio_LibraryReadConst1((Mio_Library_t *)Abc_FrameReadLibGen());
else if ( !Abc_NtkHasBlackbox(pNtk) )
assert( 0 );
return pNode;
@@ -645,13 +640,13 @@ Abc_Obj_t * Abc_NtkCreateNodeInv( Abc_Ntk_t * pNtk, Abc_Obj_t * pFanin )
pNode = Abc_NtkCreateNode( pNtk );
if ( pFanin ) Abc_ObjAddFanin( pNode, pFanin );
if ( Abc_NtkHasSop(pNtk) )
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, "0 1\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, "0 1\n" );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Cudd_Not(Cudd_bddIthVar(pNtk->pManFunc,0)), Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_Not(Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0)), Cudd_Ref( (DdNode *)pNode->pData );
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_Not(Hop_IthVar(pNtk->pManFunc,0));
+ pNode->pData = Hop_Not(Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0));
else if ( Abc_NtkHasMapping(pNtk) )
- pNode->pData = Mio_LibraryReadInv(Abc_FrameReadLibGen());
+ pNode->pData = Mio_LibraryReadInv((Mio_Library_t *)Abc_FrameReadLibGen());
else
assert( 0 );
return pNode;
@@ -675,13 +670,13 @@ Abc_Obj_t * Abc_NtkCreateNodeBuf( Abc_Ntk_t * pNtk, Abc_Obj_t * pFanin )
pNode = Abc_NtkCreateNode( pNtk );
if ( pFanin ) Abc_ObjAddFanin( pNode, pFanin );
if ( Abc_NtkHasSop(pNtk) )
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, "1 1\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, "1 1\n" );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Cudd_bddIthVar(pNtk->pManFunc,0), Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0), Cudd_Ref( (DdNode *)pNode->pData );
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_IthVar(pNtk->pManFunc,0);
+ pNode->pData = Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0);
else if ( Abc_NtkHasMapping(pNtk) )
- pNode->pData = Mio_LibraryReadBuf(Abc_FrameReadLibGen());
+ pNode->pData = Mio_LibraryReadBuf((Mio_Library_t *)Abc_FrameReadLibGen());
else
assert( 0 );
return pNode;
@@ -705,13 +700,13 @@ Abc_Obj_t * Abc_NtkCreateNodeAnd( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins )
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
pNode = Abc_NtkCreateNode( pNtk );
for ( i = 0; i < vFanins->nSize; i++ )
- Abc_ObjAddFanin( pNode, vFanins->pArray[i] );
+ Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
if ( Abc_NtkHasSop(pNtk) )
- pNode->pData = Abc_SopCreateAnd( pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
+ pNode->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Extra_bddCreateAnd( pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref(pNode->pData);
+ pNode->pData = Extra_bddCreateAnd( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_CreateAnd( pNtk->pManFunc, Vec_PtrSize(vFanins) );
+ pNode->pData = Hop_CreateAnd( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
else
assert( 0 );
return pNode;
@@ -735,13 +730,13 @@ Abc_Obj_t * Abc_NtkCreateNodeOr( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins )
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
pNode = Abc_NtkCreateNode( pNtk );
for ( i = 0; i < vFanins->nSize; i++ )
- Abc_ObjAddFanin( pNode, vFanins->pArray[i] );
+ Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
if ( Abc_NtkHasSop(pNtk) )
- pNode->pData = Abc_SopCreateOr( pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
+ pNode->pData = Abc_SopCreateOr( (Extra_MmFlex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins), NULL );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Extra_bddCreateOr( pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref(pNode->pData);
+ pNode->pData = Extra_bddCreateOr( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_CreateOr( pNtk->pManFunc, Vec_PtrSize(vFanins) );
+ pNode->pData = Hop_CreateOr( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
else
assert( 0 );
return pNode;
@@ -765,13 +760,13 @@ Abc_Obj_t * Abc_NtkCreateNodeExor( Abc_Ntk_t * pNtk, Vec_Ptr_t * vFanins )
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
pNode = Abc_NtkCreateNode( pNtk );
for ( i = 0; i < vFanins->nSize; i++ )
- Abc_ObjAddFanin( pNode, vFanins->pArray[i] );
+ Abc_ObjAddFanin( pNode, (Abc_Obj_t *)vFanins->pArray[i] );
if ( Abc_NtkHasSop(pNtk) )
- pNode->pData = Abc_SopCreateXorSpecial( pNtk->pManFunc, Vec_PtrSize(vFanins) );
+ pNode->pData = Abc_SopCreateXorSpecial( (Extra_MmFlex_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Extra_bddCreateExor( pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref(pNode->pData);
+ pNode->pData = Extra_bddCreateExor( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vFanins) ), Cudd_Ref((DdNode *)pNode->pData);
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_CreateExor( pNtk->pManFunc, Vec_PtrSize(vFanins) );
+ pNode->pData = Hop_CreateExor( (Hop_Man_t *)pNtk->pManFunc, Vec_PtrSize(vFanins) );
else
assert( 0 );
return pNode;
@@ -797,11 +792,11 @@ Abc_Obj_t * Abc_NtkCreateNodeMux( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodeC, Abc_Obj_
Abc_ObjAddFanin( pNode, pNode1 );
Abc_ObjAddFanin( pNode, pNode0 );
if ( Abc_NtkHasSop(pNtk) )
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, "11- 1\n0-1 1\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, "11- 1\n0-1 1\n" );
else if ( Abc_NtkHasBdd(pNtk) )
- pNode->pData = Cudd_bddIte(pNtk->pManFunc,Cudd_bddIthVar(pNtk->pManFunc,0),Cudd_bddIthVar(pNtk->pManFunc,1),Cudd_bddIthVar(pNtk->pManFunc,2)), Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_bddIte((DdManager *)pNtk->pManFunc,Cudd_bddIthVar((DdManager *)pNtk->pManFunc,0),Cudd_bddIthVar((DdManager *)pNtk->pManFunc,1),Cudd_bddIthVar((DdManager *)pNtk->pManFunc,2)), Cudd_Ref( (DdNode *)pNode->pData );
else if ( Abc_NtkHasAig(pNtk) )
- pNode->pData = Hop_Mux(pNtk->pManFunc,Hop_IthVar(pNtk->pManFunc,0),Hop_IthVar(pNtk->pManFunc,1),Hop_IthVar(pNtk->pManFunc,2));
+ pNode->pData = Hop_Mux((Hop_Man_t *)pNtk->pManFunc,Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,0),Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,1),Hop_IthVar((Hop_Man_t *)pNtk->pManFunc,2));
else
assert( 0 );
return pNode;
@@ -819,7 +814,7 @@ Abc_Obj_t * Abc_NtkCreateNodeMux( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodeC, Abc_Obj_
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsConst( Abc_Obj_t * pNode )
+int Abc_NodeIsConst( Abc_Obj_t * pNode )
{
assert( Abc_NtkIsLogic(pNode->pNtk) || Abc_NtkIsNetlist(pNode->pNtk) );
return Abc_ObjIsNode(pNode) && Abc_ObjFaninNum(pNode) == 0;
@@ -836,7 +831,7 @@ bool Abc_NodeIsConst( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsConst0( Abc_Obj_t * pNode )
+int Abc_NodeIsConst0( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
@@ -844,13 +839,13 @@ bool Abc_NodeIsConst0( Abc_Obj_t * pNode )
if ( !Abc_NodeIsConst(pNode) )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return Abc_SopIsConst0(pNode->pData);
+ return Abc_SopIsConst0((char *)pNode->pData);
if ( Abc_NtkHasBdd(pNtk) )
return Cudd_IsComplement(pNode->pData);
if ( Abc_NtkHasAig(pNtk) )
- return Hop_IsComplement(pNode->pData);
+ return Hop_IsComplement((Hop_Obj_t *)pNode->pData)? 1:0;
if ( Abc_NtkHasMapping(pNtk) )
- return pNode->pData == Mio_LibraryReadConst0(Abc_FrameReadLibGen());
+ return pNode->pData == Mio_LibraryReadConst0((Mio_Library_t *)Abc_FrameReadLibGen());
assert( 0 );
return 0;
}
@@ -866,7 +861,7 @@ bool Abc_NodeIsConst0( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsConst1( Abc_Obj_t * pNode )
+int Abc_NodeIsConst1( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
@@ -874,13 +869,13 @@ bool Abc_NodeIsConst1( Abc_Obj_t * pNode )
if ( !Abc_NodeIsConst(pNode) )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return Abc_SopIsConst1(pNode->pData);
+ return Abc_SopIsConst1((char *)pNode->pData);
if ( Abc_NtkHasBdd(pNtk) )
return !Cudd_IsComplement(pNode->pData);
if ( Abc_NtkHasAig(pNtk) )
- return !Hop_IsComplement(pNode->pData);
+ return !Hop_IsComplement((Hop_Obj_t *)pNode->pData);
if ( Abc_NtkHasMapping(pNtk) )
- return pNode->pData == Mio_LibraryReadConst1(Abc_FrameReadLibGen());
+ return pNode->pData == Mio_LibraryReadConst1((Mio_Library_t *)Abc_FrameReadLibGen());
assert( 0 );
return 0;
}
@@ -896,7 +891,7 @@ bool Abc_NodeIsConst1( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsBuf( Abc_Obj_t * pNode )
+int Abc_NodeIsBuf( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
@@ -904,13 +899,13 @@ bool Abc_NodeIsBuf( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 1 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return Abc_SopIsBuf(pNode->pData);
+ return Abc_SopIsBuf((char *)pNode->pData);
if ( Abc_NtkHasBdd(pNtk) )
return !Cudd_IsComplement(pNode->pData);
if ( Abc_NtkHasAig(pNtk) )
- return !Hop_IsComplement(pNode->pData);
+ return !Hop_IsComplement((Hop_Obj_t *)pNode->pData);
if ( Abc_NtkHasMapping(pNtk) )
- return pNode->pData == Mio_LibraryReadBuf(Abc_FrameReadLibGen());
+ return pNode->pData == Mio_LibraryReadBuf((Mio_Library_t *)Abc_FrameReadLibGen());
assert( 0 );
return 0;
}
@@ -926,7 +921,7 @@ bool Abc_NodeIsBuf( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsInv( Abc_Obj_t * pNode )
+int Abc_NodeIsInv( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsLogic(pNtk) || Abc_NtkIsNetlist(pNtk) );
@@ -934,13 +929,13 @@ bool Abc_NodeIsInv( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 1 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return Abc_SopIsInv(pNode->pData);
+ return Abc_SopIsInv((char *)pNode->pData);
if ( Abc_NtkHasBdd(pNtk) )
return Cudd_IsComplement(pNode->pData);
if ( Abc_NtkHasAig(pNtk) )
- return Hop_IsComplement(pNode->pData);
+ return Hop_IsComplement((Hop_Obj_t *)pNode->pData)? 1:0;
if ( Abc_NtkHasMapping(pNtk) )
- return pNode->pData == Mio_LibraryReadInv(Abc_FrameReadLibGen());
+ return pNode->pData == Mio_LibraryReadInv((Mio_Library_t *)Abc_FrameReadLibGen());
assert( 0 );
return 0;
}
@@ -961,11 +956,11 @@ void Abc_NodeComplement( Abc_Obj_t * pNode )
assert( Abc_NtkIsLogic(pNode->pNtk) || Abc_NtkIsNetlist(pNode->pNtk) );
assert( Abc_ObjIsNode(pNode) );
if ( Abc_NtkHasSop(pNode->pNtk) )
- Abc_SopComplement( pNode->pData );
+ Abc_SopComplement( (char *)pNode->pData );
else if ( Abc_NtkHasBdd(pNode->pNtk) )
pNode->pData = Cudd_Not( pNode->pData );
else if ( Abc_NtkHasAig(pNode->pNtk) )
- pNode->pData = Hop_Not( pNode->pData );
+ pNode->pData = Hop_Not( (Hop_Obj_t *)pNode->pData );
else
assert( 0 );
}
@@ -974,3 +969,5 @@ void Abc_NodeComplement( Abc_Obj_t * pNode )
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcRefs.c b/src/base/abc/abcRefs.c
index ec89eaed..26ae55ab 100644
--- a/src/base/abc/abcRefs.c
+++ b/src/base/abc/abcRefs.c
@@ -20,12 +20,15 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel );
-static int Abc_NodeRefDerefStop( Abc_Obj_t * pNode, bool fReference );
+static int Abc_NodeRefDeref( Abc_Obj_t * pNode, int fReference, int fLabel );
+static int Abc_NodeRefDerefStop( Abc_Obj_t * pNode, int fReference );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -120,7 +123,7 @@ int Abc_NodeMffcLabelAig( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel )
+int Abc_NodeRefDeref( Abc_Obj_t * pNode, int fReference, int fLabel )
{
Abc_Obj_t * pNode0, * pNode1;
int Counter;
@@ -165,7 +168,7 @@ int Abc_NodeRefDeref( Abc_Obj_t * pNode, bool fReference, bool fLabel )
SeeAlso []
***********************************************************************/
-int Abc_NodeRefDerefStop( Abc_Obj_t * pNode, bool fReference )
+int Abc_NodeRefDerefStop( Abc_Obj_t * pNode, int fReference )
{
Abc_Obj_t * pNode0, * pNode1;
int Counter;
@@ -327,7 +330,7 @@ void Abc_NodeMffcConeSuppPrint( Abc_Obj_t * pNode )
Abc_NodeRef_rec( pNode );
printf( "Node = %6s : Supp = %3d Cone = %3d (",
Abc_ObjName(pNode), Vec_PtrSize(vSupp), Vec_PtrSize(vCone) );
- Vec_PtrForEachEntry( vCone, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vCone, pObj, i )
printf( " %s", Abc_ObjName(pObj) );
printf( " )\n" );
Vec_PtrFree( vCone );
@@ -350,7 +353,7 @@ int Abc_NodeMffcInside( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vIns
Abc_Obj_t * pObj;
int i, Count1, Count2;
// increment the fanout counters for the leaves
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->vFanouts.nSize++;
// dereference the node
Count1 = Abc_NodeDeref_rec( pNode );
@@ -360,7 +363,7 @@ int Abc_NodeMffcInside( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vIns
Count2 = Abc_NodeRef_rec( pNode );
assert( Count1 == Count2 );
// remove the extra counters
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->vFanouts.nSize--;
return Count1;
}
@@ -450,3 +453,5 @@ int Abc_NodeMffcLabel( Abc_Obj_t * pNode )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcShow.c b/src/base/abc/abcShow.c
index 359f737e..4295726e 100644
--- a/src/base/abc/abcShow.c
+++ b/src/base/abc/abcShow.c
@@ -29,6 +29,9 @@
#include "main.h"
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -71,7 +74,7 @@ void Abc_NodeShowBdd( Abc_Obj_t * pNode )
// set the node names
vNamesIn = Abc_NodeGetFaninNames( pNode );
pNameOut = Abc_ObjName(pNode);
- Cudd_DumpDot( pNode->pNtk->pManFunc, 1, (DdNode **)&pNode->pData, (char **)vNamesIn->pArray, &pNameOut, pFile );
+ Cudd_DumpDot( (DdManager *)pNode->pNtk->pManFunc, 1, (DdNode **)&pNode->pData, (char **)vNamesIn->pArray, &pNameOut, pFile );
Abc_NodeFreeNames( vNamesIn );
Abc_NtkCleanCopy( pNode->pNtk );
fclose( pFile );
@@ -82,6 +85,30 @@ void Abc_NodeShowBdd( Abc_Obj_t * pNode )
/**Function*************************************************************
+ Synopsis [Visualizes BDD of the node.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NodeShowBddOne( DdManager * dd, DdNode * bFunc )
+{
+ char * FileNameDot = "temp.dot";
+ FILE * pFile;
+ if ( (pFile = fopen( FileNameDot, "w" )) == NULL )
+ {
+ fprintf( stdout, "Cannot open the intermediate file \"%s\".\n", FileNameDot );
+ return;
+ }
+ Cudd_DumpDot( dd, 1, (DdNode **)&bFunc, NULL, NULL, pFile );
+ fclose( pFile );
+ Abc_ShowFile( FileNameDot );
+}
+/**Function*************************************************************
+
Synopsis [Visualizes a reconvergence driven cut at the node.]
Description []
@@ -118,7 +145,7 @@ void Abc_NodeShowCut( Abc_Obj_t * pNode, int nNodeSizeMax, int nConeSizeMax )
// add the nodes in the TFO
vNodesTfo = Abc_NodeCollectTfoCands( p, pNode, vCutSmall, ABC_INFINITY );
- Vec_PtrForEachEntry( vNodesTfo, pTemp, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodesTfo, pTemp, i )
Vec_PtrPushUnique( vInside, pTemp );
// create the file name
@@ -314,8 +341,96 @@ void Abc_ShowGetFileName( char * pName, char * pBuffer )
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkWriteFlopDependency( Abc_Ntk_t * pNtk, char * pFileName )
+{
+ FILE * pFile;
+ Vec_Ptr_t * vSupp;
+ Abc_Obj_t * pObj, * pTemp;
+ int i, k, Count;
+ pFile = fopen( pFileName, "w" );
+ if ( pFile == NULL )
+ {
+ printf( "Cannot open input file %s.\n", pFileName );
+ return;
+ }
+ fprintf( pFile, "# Flop dependency for \"%s\" generated by ABC on %s\n", Abc_NtkName(pNtk), Extra_TimeStamp() );
+ fprintf( pFile, "digraph G {\n" );
+ fprintf( pFile, " graph [splines=true overlap=false];\n" );
+ fprintf( pFile, " size = \"7.5,10\";\n" );
+ fprintf( pFile, " center = true;\n" );
+// fprintf( pFile, " edge [len=3,dir=forward];\n" );
+ fprintf( pFile, " edge [dir=forward];\n" );
+ Abc_NtkForEachLatchInput( pNtk, pObj, i )
+ {
+ Abc_ObjFanout0( Abc_ObjFanout0(pObj) )->iTemp = i;
+ vSupp = Abc_NtkNodeSupport( pNtk, &pObj, 1 );
+ Count = 0;
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pTemp, k )
+ Count += Abc_ObjIsPi(pTemp);
+ Vec_PtrFree( vSupp );
+ fprintf( pFile, " { rank = same; %d [label=\"%d(%d)\"]; }\n", i, i, Count );
+ }
+ Abc_NtkForEachLatchInput( pNtk, pObj, i )
+ {
+ vSupp = Abc_NtkNodeSupport( pNtk, &pObj, 1 );
+ Count = 0;
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pTemp, k )
+ if ( !Abc_ObjIsPi(pTemp) )
+ fprintf( pFile, " %4d -> %4d\n", pTemp->iTemp, i );
+ Vec_PtrFree( vSupp );
+ }
+ fprintf( pFile, "}\n" );
+ fclose( pFile );
+}
+
+
+/**Function*************************************************************
+
+ Synopsis [Visualizes AIG with choices.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkShowFlopDependency( Abc_Ntk_t * pNtk )
+{
+ FILE * pFile;
+ char FileNameDot[200];
+ assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) );
+ // create the file name
+ Abc_ShowGetFileName( pNtk->pName, FileNameDot );
+ // check that the file can be opened
+ if ( (pFile = fopen( FileNameDot, "w" )) == NULL )
+ {
+ fprintf( stdout, "Cannot open the intermediate file \"%s\".\n", FileNameDot );
+ return;
+ }
+ fclose( pFile );
+ // write the DOT file
+ Abc_NtkWriteFlopDependency( pNtk, FileNameDot );
+ // visualize the file
+ Abc_ShowFile( FileNameDot );
+}
+
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcSop.c b/src/base/abc/abcSop.c
index c0ace492..5be2f8ef 100644
--- a/src/base/abc/abcSop.c
+++ b/src/base/abc/abcSop.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
The SOPs in this package are represented using char * strings.
For example, the SOP of the node:
@@ -533,7 +536,9 @@ int Abc_SopGetLitNum( char * pSop )
int Abc_SopGetVarNum( char * pSop )
{
char * pCur;
- for ( pCur = pSop; *pCur != '\n'; pCur++ );
+ for ( pCur = pSop; *pCur != '\n'; pCur++ )
+ if ( *pCur == 0 )
+ return -1;
return pCur - pSop - 2;
}
@@ -622,7 +627,7 @@ void Abc_SopComplement( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopIsComplement( char * pSop )
+int Abc_SopIsComplement( char * pSop )
{
char * pCur;
for ( pCur = pSop; *pCur; pCur++ )
@@ -643,7 +648,7 @@ bool Abc_SopIsComplement( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopIsConst0( char * pSop )
+int Abc_SopIsConst0( char * pSop )
{
return pSop[0] == ' ' && pSop[1] == '0';
}
@@ -659,7 +664,7 @@ bool Abc_SopIsConst0( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopIsConst1( char * pSop )
+int Abc_SopIsConst1( char * pSop )
{
return pSop[0] == ' ' && pSop[1] == '1';
}
@@ -675,7 +680,7 @@ bool Abc_SopIsConst1( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopIsBuf( char * pSop )
+int Abc_SopIsBuf( char * pSop )
{
if ( pSop[4] != 0 )
return 0;
@@ -695,7 +700,7 @@ bool Abc_SopIsBuf( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopIsInv( char * pSop )
+int Abc_SopIsInv( char * pSop )
{
if ( pSop[4] != 0 )
return 0;
@@ -715,7 +720,7 @@ bool Abc_SopIsInv( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopIsAndType( char * pSop )
+int Abc_SopIsAndType( char * pSop )
{
char * pCur;
if ( Abc_SopGetCubeNum(pSop) != 1 )
@@ -739,7 +744,7 @@ bool Abc_SopIsAndType( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopIsOrType( char * pSop )
+int Abc_SopIsOrType( char * pSop )
{
char * pCube, * pCur;
int nVars, nLits;
@@ -790,7 +795,7 @@ int Abc_SopIsExorType( char * pSop )
SeeAlso []
***********************************************************************/
-bool Abc_SopCheck( char * pSop, int nFanins )
+int Abc_SopCheck( char * pSop, int nFanins )
{
char * pCubes, * pCubesOld;
int fFound0 = 0, fFound1 = 0;
@@ -1123,3 +1128,5 @@ char * Abc_SopDecoderLog( Extra_MmFlex_t * pMan, int nValues )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index 8ebb00a3..43c53004 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -24,6 +24,9 @@
#include "dec.h"
//#include "seq.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -47,7 +50,7 @@ void * Abc_NtkAttrFree( Abc_Ntk_t * pNtk, int Attr, int fFreeMan )
{
void * pUserMan;
Vec_Att_t * pAttrMan;
- pAttrMan = Vec_PtrEntry( pNtk->vAttrs, Attr );
+ pAttrMan = (Vec_Att_t *)Vec_PtrEntry( pNtk->vAttrs, Attr );
Vec_PtrWriteEntry( pNtk->vAttrs, Attr, NULL );
pUserMan = Vec_AttFree( pAttrMan, fFreeMan );
return pUserMan;
@@ -98,8 +101,6 @@ void Abc_NtkOrderCisCos( Abc_Ntk_t * pNtk )
Vec_PtrPush( pNtk->vCis, pObj );
Abc_NtkForEachPo( pNtk, pObj, i )
Vec_PtrPush( pNtk->vCos, pObj );
- Abc_NtkForEachAssert( pNtk, pObj, i )
- Vec_PtrPush( pNtk->vCos, pObj );
Abc_NtkForEachBox( pNtk, pObj, i )
{
if ( Abc_ObjIsLatch(pObj) )
@@ -141,7 +142,7 @@ int Abc_NtkGetCubeNum( Abc_Ntk_t * pNtk )
if ( Abc_NodeIsConst(pNode) )
continue;
assert( pNode->pData );
- nCubes += Abc_SopGetCubeNum( pNode->pData );
+ nCubes += Abc_SopGetCubeNum( (char *)pNode->pData );
}
return nCubes;
}
@@ -167,7 +168,7 @@ int Abc_NtkGetCubePairNum( Abc_Ntk_t * pNtk )
if ( Abc_NodeIsConst(pNode) )
continue;
assert( pNode->pData );
- nCubes = Abc_SopGetCubeNum( pNode->pData );
+ nCubes = Abc_SopGetCubeNum( (char *)pNode->pData );
nCubePairs += nCubes * (nCubes - 1) / 2;
}
return nCubePairs;
@@ -192,7 +193,7 @@ int Abc_NtkGetLitNum( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pNode, i )
{
assert( pNode->pData );
- nLits += Abc_SopGetLitNum( pNode->pData );
+ nLits += Abc_SopGetLitNum( (char *)pNode->pData );
}
return nLits;
}
@@ -219,7 +220,7 @@ int Abc_NtkGetLitFactNum( Abc_Ntk_t * pNtk )
{
if ( Abc_NodeIsConst(pNode) )
continue;
- pFactor = Dec_Factor( pNode->pData );
+ pFactor = Dec_Factor( (char *)pNode->pData );
nNodes += 1 + Dec_GraphNodeNum(pFactor);
Dec_GraphFree( pFactor );
}
@@ -269,7 +270,7 @@ int Abc_NtkGetBddNodeNum( Abc_Ntk_t * pNtk )
assert( pNode->pData );
if ( Abc_ObjFaninNum(pNode) < 2 )
continue;
- nNodes += pNode->pData? -1 + Cudd_DagSize( pNode->pData ) : 0;
+ nNodes += pNode->pData? -1 + Cudd_DagSize( (DdNode *)pNode->pData ) : 0;
}
return nNodes;
}
@@ -296,7 +297,7 @@ int Abc_NtkGetAigNodeNum( Abc_Ntk_t * pNtk )
if ( Abc_ObjFaninNum(pNode) < 2 )
continue;
//printf( "%d ", Hop_DagSize( pNode->pData ) );
- nNodes += pNode->pData? Hop_DagSize( pNode->pData ) : 0;
+ nNodes += pNode->pData? Hop_DagSize( (Hop_Obj_t *)pNode->pData ) : 0;
}
return nNodes;
}
@@ -316,13 +317,13 @@ int Abc_NtkGetClauseNum( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode;
DdNode * bCover, * zCover, * bFunc;
- DdManager * dd = pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNtk->pManFunc;
int i, nClauses = 0;
assert( Abc_NtkIsBddLogic(pNtk) );
Abc_NtkForEachNode( pNtk, pNode, i )
{
assert( pNode->pData );
- bFunc = pNode->pData;
+ bFunc = (DdNode *)pNode->pData;
bCover = Cudd_zddIsop( dd, bFunc, bFunc, &zCover );
Cudd_Ref( bCover );
@@ -367,7 +368,7 @@ double Abc_NtkGetMappedArea( Abc_Ntk_t * pNtk )
printf( "Node without mapping is encountered.\n" );
continue;
}
- TotalArea += Mio_GateReadArea( pNode->pData );
+ TotalArea += Mio_GateReadArea( (Mio_Gate_t *)pNode->pData );
}
return TotalArea;
}
@@ -598,7 +599,7 @@ void Abc_NtkLoadCopy( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCopies )
Abc_Obj_t * pObj;
int i;
Abc_NtkForEachObj( pNtk, pObj, i )
- pObj->pCopy = Vec_PtrEntry( vCopies, i );
+ pObj->pCopy = (Abc_Obj_t *)Vec_PtrEntry( vCopies, i );
}
/**Function*************************************************************
@@ -780,7 +781,7 @@ void Abc_NtkFixCoDriverProblem( Abc_Obj_t * pDriver, Abc_Obj_t * pNodeCo, int fD
SeeAlso []
***********************************************************************/
-bool Abc_NtkLogicHasSimpleCos( Abc_Ntk_t * pNtk )
+int Abc_NtkLogicHasSimpleCos( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode, * pDriver;
int i;
@@ -825,7 +826,7 @@ bool Abc_NtkLogicHasSimpleCos( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, bool fDuplicate )
+int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, int fDuplicate )
{
Abc_Obj_t * pNode, * pDriver;
int i, nDupGates = 0;
@@ -887,8 +888,8 @@ void Abc_VecObjPushUniqueOrderByLevel( Vec_Ptr_t * p, Abc_Obj_t * pNode )
// find the p of the node
for ( i = p->nSize-1; i > 0; i-- )
{
- pNode1 = p->pArray[i ];
- pNode2 = p->pArray[i-1];
+ pNode1 = (Abc_Obj_t *)p->pArray[i ];
+ pNode2 = (Abc_Obj_t *)p->pArray[i-1];
if ( Abc_ObjRegular(pNode1)->Level <= Abc_ObjRegular(pNode2)->Level )
break;
p->pArray[i ] = pNode2;
@@ -909,7 +910,7 @@ void Abc_VecObjPushUniqueOrderByLevel( Vec_Ptr_t * p, Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsExorType( Abc_Obj_t * pNode )
+int Abc_NodeIsExorType( Abc_Obj_t * pNode )
{
Abc_Obj_t * pNode0, * pNode1;
// check that the node is regular
@@ -942,7 +943,7 @@ bool Abc_NodeIsExorType( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsMuxType( Abc_Obj_t * pNode )
+int Abc_NodeIsMuxType( Abc_Obj_t * pNode )
{
Abc_Obj_t * pNode0, * pNode1;
// check that the node is regular
@@ -998,7 +999,7 @@ int Abc_NtkCountMuxes( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsMuxControlType( Abc_Obj_t * pNode )
+int Abc_NodeIsMuxControlType( Abc_Obj_t * pNode )
{
Abc_Obj_t * pNode0, * pNode1;
// check that the node is regular
@@ -1424,12 +1425,6 @@ void Abc_NtkReassignIds( Abc_Ntk_t * pNtk )
pNode->Id = Vec_PtrSize( vObjsNew );
Vec_PtrPush( vObjsNew, pNode );
}
- // put assert nodes next
- Abc_NtkForEachAssert( pNtk, pNode, i )
- {
- pNode->Id = Vec_PtrSize( vObjsNew );
- Vec_PtrPush( vObjsNew, pNode );
- }
// put latches and their inputs/outputs next
Abc_NtkForEachBox( pNtk, pNode, i )
{
@@ -1448,7 +1443,7 @@ void Abc_NtkReassignIds( Abc_Ntk_t * pNtk )
}
// finally, internal nodes in the DFS order
vNodes = Abc_AigDfs( pNtk, 1, 0 );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( pNode == pConst1 )
continue;
@@ -1472,7 +1467,7 @@ void Abc_NtkReassignIds( Abc_Ntk_t * pNtk )
pNtk->vObjs = vObjsNew;
// rehash the AIG
- Abc_AigRehash( pNtk->pManFunc );
+ Abc_AigRehash( (Abc_Aig_t *)pNtk->pManFunc );
// update the name manager!!!
}
@@ -1582,7 +1577,7 @@ static inline int Abc_ObjCrossCutInc( Abc_Obj_t * pObj )
{
// pObj->pCopy = (void *)(((int)pObj->pCopy)++);
int Value = (int)(ABC_PTRINT_T)pObj->pCopy;
- pObj->pCopy = (void *)(ABC_PTRINT_T)(Value + 1);
+ pObj->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)(Value + 1);
return (int)(ABC_PTRINT_T)pObj->pCopy == Abc_ObjFanoutNum(pObj);
}
@@ -1755,10 +1750,10 @@ void Abc_NtkCompareCones( Abc_Ntk_t * pNtk )
// count the number of nodes in the reverse cone
Counter = 0;
for ( k = 1; k < Vec_PtrSize(vReverse) - 1; k++ )
- for ( pTemp = Vec_PtrEntry(vReverse, k); pTemp; pTemp = pTemp->pCopy )
+ for ( pTemp = (Abc_Obj_t *)Vec_PtrEntry(vReverse, k); pTemp; pTemp = (Abc_Obj_t *)pTemp->pCopy )
Counter++;
CounterCos = CounterCosNew = 0;
- for ( pTemp = Vec_PtrEntryLast(vReverse); pTemp; pTemp = pTemp->pCopy )
+ for ( pTemp = (Abc_Obj_t *)Vec_PtrEntryLast(vReverse); pTemp; pTemp = (Abc_Obj_t *)pTemp->pCopy )
{
assert( Abc_ObjIsCo(pTemp) );
CounterCos++;
@@ -1811,7 +1806,7 @@ void Abc_NtkCompareSupports( Abc_Ntk_t * pNtk )
nNodesOld = Vec_PtrSize(vSupp);
Vec_PtrFree( vSupp );
- for ( pTemp = pObj->pData; pTemp; pTemp = pTemp->pData )
+ for ( pTemp = (Abc_Obj_t *)pObj->pData; pTemp; pTemp = (Abc_Obj_t *)pTemp->pData )
{
vSupp = Abc_NtkNodeSupport( pNtk, &pTemp, 1 );
if ( nNodesOld != Vec_PtrSize(vSupp) )
@@ -1826,3 +1821,5 @@ void Abc_NtkCompareSupports( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abc/abc_.c b/src/base/abc/abc_.c
index 50558bdb..d9302303 100644
--- a/src/base/abc/abc_.c
+++ b/src/base/abc/abc_.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -45,3 +48,5 @@
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index f7caad5d..c9623cf6 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -1,6 +1,6 @@
/**CFile****************************************************************
- FileName [abc.c]
+ FileName [abc.c]
SystemName [ABC: Logic synthesis and verification system.]
@@ -9,7 +9,7 @@
Synopsis [Command file.]
Author [Alan Mishchenko]
-
+
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
@@ -17,14 +17,16 @@
Revision [$Id: abc.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
-
+
#include "abc.h"
+#include "main.h"
#include "mainInt.h"
#include "fraig.h"
#include "fxu.h"
#include "cut.h"
#include "fpga.h"
#include "if.h"
+#include "sim.h"
#include "res.h"
#include "lpk.h"
#include "giaAig.h"
@@ -38,10 +40,32 @@
#include "dch.h"
#include "ssw.h"
#include "cgt.h"
+#include "kit.h"
#include "amap.h"
+#include "retInt.h"
+#include "cnf.h"
#include "cec.h"
#include "giaAbs.h"
+#include "tim.h"
+#include "llb.h"
+#include "ntlnwk.h"
+#include "mfx.h"
+#include "bbr.h"
+#include "cov.h"
+
+#include "cmd.h"
+#include "extra.h"
+//#include "magic.h"
+
+#ifdef _WIN32
+//#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -65,6 +89,7 @@ static int Abc_CommandPrintXCut ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandPrintDsd ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandPrintCone ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandPrintMiter ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandPrintStatus ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandShow ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandShowBdd ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -103,6 +128,7 @@ static int Abc_CommandMiter ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandDemiter ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandOrPos ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAndPos ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandZeroPo ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAppend ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandFrames ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDFrames ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -131,6 +157,7 @@ static int Abc_CommandGen ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandCover ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDouble ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandInter ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBb2Wb ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTest ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandQuaVar ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -143,7 +170,7 @@ static int Abc_CommandICut ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandIRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDRefactor ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDC2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDc2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDChoice ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDch ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDrwsat ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -154,7 +181,7 @@ static int Abc_CommandIFraig ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandDFraig ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandCSweep ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDProve ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDProve2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandDProve2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbSec ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandSimSec ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandMatch ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -207,7 +234,8 @@ static int Abc_CommandSeqFpga ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandSeqMap ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandSeqSweep ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandSeqSweep2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSeqSweepTest ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestSeqSweep ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestScorr ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandLcorr ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandSeqCleanup ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandCycle ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -231,12 +259,16 @@ static int Abc_CommandIProve ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandDebug ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandBmc ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandBmc2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBmc3 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandBmcInter ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandIndcut ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandEnlarge ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandInduction ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandPBAbstraction ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
+static int Abc_CommandCegar ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandConstr ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandUnfold ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFold ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBm ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTraceStart ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTraceCheck ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -255,7 +287,7 @@ static int Abc_CommandAbc8Pfan ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc8If ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc8DChoice ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc8Dch ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc8DC2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc8Dc2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc8Bidec ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc8Strash ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc8Mfs ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -278,6 +310,7 @@ static int Abc_CommandAbc8Zero ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc8Cec ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc8DSec ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
static int Abc_CommandAbc9Get ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Put ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Read ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -296,11 +329,15 @@ static int Abc_CommandAbc9Sim ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Resim ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9SpecI ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Equiv ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Equiv2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Semi ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Times ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Frames ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Retime ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Enable ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Dc2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Bidec ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Shrink ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Miter ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Scl ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Lcorr ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -314,16 +351,26 @@ static int Abc_CommandAbc9Cec ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Force ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Embed ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9If ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Trace ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Speedup ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Era ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Dch ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9AbsStart ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9AbsStartNew ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9AbsDerive ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9AbsRefine ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9PbaStart ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Reparam ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Posplit ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Reach ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Undo ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Test ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbcTestNew ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
extern int Abc_CommandAbcLivenessToSafety ( Abc_Frame_t * pAbc, int argc, char ** argv );
extern int Abc_CommandAbcLivenessToSafetySim ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandAbcTestNew ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-extern Aig_Man_t * Ntl_ManExtract( void * p );
+extern int Abc_CommandAbcLivenessToSafetyWithLTL( Abc_Frame_t * pAbc, int argc, char ** argv );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -340,11 +387,26 @@ extern Aig_Man_t * Ntl_ManExtract( void * p );
SeeAlso []
***********************************************************************/
+void Abc_FrameReplaceCex( Abc_Frame_t * pAbc, Abc_Cex_t ** ppCex )
+{
+ ABC_FREE( pAbc->pCex );
+ pAbc->pCex = *ppCex;
+ *ppCex = NULL;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
void Abc_FrameClearDesign()
{
- extern Abc_Frame_t * Abc_FrameGetGlobalFrame();
- extern void Ntl_ManFree( void * p );
- extern void Nwk_ManFree( void * p );
Abc_Frame_t * pAbc;
pAbc = Abc_FrameGetGlobalFrame();
@@ -376,20 +438,33 @@ void Abc_FrameClearDesign()
SeeAlso []
***********************************************************************/
-void Abc_Init( Abc_Frame_t * pAbc )
+void Abc_CommandUpdate9( Abc_Frame_t * pAbc, Gia_Man_t * pNew )
{
-/*
+ if ( pNew == NULL )
{
- Aig_Man_t * pAig;
- pAig = Ioa_ReadAiger( "i10.aig", 1 );
- Aig_ManStop( pAig );
+ Abc_Print( -1, "Abc_CommandUpdate9(): Tranformation has failed.\n" );
+ return;
}
-*/
+ if ( pAbc->pGia2 )
+ Gia_ManStop( pAbc->pGia2 );
+ pAbc->pGia2 = pAbc->pGia;
+ pAbc->pGia = pNew;
+}
+
-// Amap_LibParseTest( "at\\syn\\libraries\\LIBS\\BRDCM\\tsmc13_5.ff.genlib" );
-// Amap_LibParseTest( "at\\syn\\libraries\\LIBS\\GS60\\GS60_W_30_1.7_CORE.genlib" );
-// Amap_LibParseTest( "at\\syn\\libraries\\LIBS\\TYPICAL\\typical.genlib" );
+/**Function*************************************************************
+
+ Synopsis []
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_Init( Abc_Frame_t * pAbc )
+{
Cmd_CommandAdd( pAbc, "Printing", "print_stats", Abc_CommandPrintStats, 0 );
Cmd_CommandAdd( pAbc, "Printing", "print_exdc", Abc_CommandPrintExdc, 0 );
Cmd_CommandAdd( pAbc, "Printing", "print_io", Abc_CommandPrintIo, 0 );
@@ -409,6 +484,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Printing", "print_dsd", Abc_CommandPrintDsd, 0 );
Cmd_CommandAdd( pAbc, "Printing", "print_cone", Abc_CommandPrintCone, 0 );
Cmd_CommandAdd( pAbc, "Printing", "print_miter", Abc_CommandPrintMiter, 0 );
+ Cmd_CommandAdd( pAbc, "Printing", "print_status", Abc_CommandPrintStatus, 0 );
Cmd_CommandAdd( pAbc, "Printing", "show", Abc_CommandShow, 0 );
Cmd_CommandAdd( pAbc, "Printing", "show_bdd", Abc_CommandShowBdd, 0 );
@@ -438,7 +514,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Synthesis", "refactor", Abc_CommandRefactor, 1 );
// Cmd_CommandAdd( pAbc, "Synthesis", "restructure", Abc_CommandRestructure, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "resub", Abc_CommandResubstitute, 1 );
- Cmd_CommandAdd( pAbc, "Synthesis", "rr", Abc_CommandRr, 1 );
+// Cmd_CommandAdd( pAbc, "Synthesis", "rr", Abc_CommandRr, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "cascade", Abc_CommandCascade, 1 );
Cmd_CommandAdd( pAbc, "Various", "logic", Abc_CommandLogic, 1 );
@@ -447,6 +523,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Various", "demiter", Abc_CommandDemiter, 1 );
Cmd_CommandAdd( pAbc, "Various", "orpos", Abc_CommandOrPos, 1 );
Cmd_CommandAdd( pAbc, "Various", "andpos", Abc_CommandAndPos, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "zeropo", Abc_CommandZeroPo, 1 );
Cmd_CommandAdd( pAbc, "Various", "append", Abc_CommandAppend, 1 );
Cmd_CommandAdd( pAbc, "Various", "frames", Abc_CommandFrames, 1 );
Cmd_CommandAdd( pAbc, "Various", "dframes", Abc_CommandDFrames, 1 );
@@ -475,7 +552,9 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Various", "cover", Abc_CommandCover, 1 );
Cmd_CommandAdd( pAbc, "Various", "double", Abc_CommandDouble, 1 );
Cmd_CommandAdd( pAbc, "Various", "inter", Abc_CommandInter, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "bb2wb", Abc_CommandBb2Wb, 0 );
Cmd_CommandAdd( pAbc, "Various", "test", Abc_CommandTest, 0 );
+// Cmd_CommandAdd( pAbc, "Various", "qbf_solve", Abc_CommandTest, 0 );
Cmd_CommandAdd( pAbc, "Various", "qvar", Abc_CommandQuaVar, 1 );
Cmd_CommandAdd( pAbc, "Various", "qrel", Abc_CommandQuaRel, 1 );
@@ -487,7 +566,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "New AIG", "irw", Abc_CommandIRewrite, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "drw", Abc_CommandDRewrite, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "drf", Abc_CommandDRefactor, 1 );
- Cmd_CommandAdd( pAbc, "New AIG", "dc2", Abc_CommandDC2, 1 );
+ Cmd_CommandAdd( pAbc, "New AIG", "dc2", Abc_CommandDc2, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "dchoice", Abc_CommandDChoice, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "dch", Abc_CommandDch, 1 );
Cmd_CommandAdd( pAbc, "New AIG", "drwsat", Abc_CommandDrwsat, 1 );
@@ -544,7 +623,8 @@ void Abc_Init( Abc_Frame_t * pAbc )
// Cmd_CommandAdd( pAbc, "Sequential", "smap", Abc_CommandSeqMap, 1 );
Cmd_CommandAdd( pAbc, "Sequential", "ssweep", Abc_CommandSeqSweep, 1 );
Cmd_CommandAdd( pAbc, "Sequential", "scorr", Abc_CommandSeqSweep2, 1 );
- Cmd_CommandAdd( pAbc, "Sequential", "testssw", Abc_CommandSeqSweepTest, 0 );
+ Cmd_CommandAdd( pAbc, "Sequential", "testssw", Abc_CommandTestSeqSweep, 0 );
+ Cmd_CommandAdd( pAbc, "Sequential", "testscorr", Abc_CommandTestScorr, 0 );
Cmd_CommandAdd( pAbc, "Sequential", "lcorr", Abc_CommandLcorr, 1 );
Cmd_CommandAdd( pAbc, "Sequential", "scleanup", Abc_CommandSeqCleanup, 1 );
Cmd_CommandAdd( pAbc, "Sequential", "cycle", Abc_CommandCycle, 1 );
@@ -558,10 +638,10 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Verification", "cec", Abc_CommandCec, 0 );
Cmd_CommandAdd( pAbc, "Verification", "dcec", Abc_CommandDCec, 0 );
- Cmd_CommandAdd( pAbc, "Verification", "sec", Abc_CommandSec, 0 );
+// Cmd_CommandAdd( pAbc, "Verification", "sec", Abc_CommandSec, 0 );
Cmd_CommandAdd( pAbc, "Verification", "dsec", Abc_CommandDSec, 0 );
Cmd_CommandAdd( pAbc, "Verification", "dprove", Abc_CommandDProve, 0 );
- Cmd_CommandAdd( pAbc, "Verification", "dprove2", Abc_CommandDProve2, 0 );
+// Cmd_CommandAdd( pAbc, "Verification", "dprove2", Abc_CommandDProve2, 0 );
Cmd_CommandAdd( pAbc, "Verification", "absec", Abc_CommandAbSec, 0 );
Cmd_CommandAdd( pAbc, "Verification", "simsec", Abc_CommandSimSec, 0 );
Cmd_CommandAdd( pAbc, "Verification", "match", Abc_CommandMatch, 0 );
@@ -573,11 +653,16 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Verification", "debug", Abc_CommandDebug, 0 );
Cmd_CommandAdd( pAbc, "Verification", "bmc", Abc_CommandBmc, 0 );
Cmd_CommandAdd( pAbc, "Verification", "bmc2", Abc_CommandBmc2, 0 );
- Cmd_CommandAdd( pAbc, "Verification", "int", Abc_CommandBmcInter, 0 );
+ Cmd_CommandAdd( pAbc, "Verification", "bmc3", Abc_CommandBmc3, 1 );
+ Cmd_CommandAdd( pAbc, "Verification", "int", Abc_CommandBmcInter, 1 );
Cmd_CommandAdd( pAbc, "Verification", "indcut", Abc_CommandIndcut, 0 );
Cmd_CommandAdd( pAbc, "Verification", "enlarge", Abc_CommandEnlarge, 1 );
Cmd_CommandAdd( pAbc, "Verification", "ind", Abc_CommandInduction, 0 );
- Cmd_CommandAdd( pAbc, "Verification", "abs", Abc_CommandPBAbstraction, 0 );
+ Cmd_CommandAdd( pAbc, "Verification", "abs", Abc_CommandCegar, 1 );
+ Cmd_CommandAdd( pAbc, "Verification", "constr", Abc_CommandConstr, 0 );
+ Cmd_CommandAdd( pAbc, "Verification", "unfold", Abc_CommandUnfold, 1 );
+ Cmd_CommandAdd( pAbc, "Verification", "fold", Abc_CommandFold, 1 );
+ Cmd_CommandAdd( pAbc, "Verification", "bm", Abc_CommandBm, 1 );
Cmd_CommandAdd( pAbc, "ABC8", "*r", Abc_CommandAbc8Read, 0 );
@@ -593,7 +678,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC8", "*if", Abc_CommandAbc8If, 0 );
Cmd_CommandAdd( pAbc, "ABC8", "*dchoice", Abc_CommandAbc8DChoice, 0 );
Cmd_CommandAdd( pAbc, "ABC8", "*dch", Abc_CommandAbc8Dch, 0 );
- Cmd_CommandAdd( pAbc, "ABC8", "*dc2", Abc_CommandAbc8DC2, 0 );
+ Cmd_CommandAdd( pAbc, "ABC8", "*dc2", Abc_CommandAbc8Dc2, 0 );
Cmd_CommandAdd( pAbc, "ABC8", "*bidec", Abc_CommandAbc8Bidec, 0 );
Cmd_CommandAdd( pAbc, "ABC8", "*st", Abc_CommandAbc8Strash, 0 );
Cmd_CommandAdd( pAbc, "ABC8", "*mfs", Abc_CommandAbc8Mfs, 0 );
@@ -614,49 +699,65 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC8", "*cec", Abc_CommandAbc8Cec, 0 );
Cmd_CommandAdd( pAbc, "ABC8", "*dsec", Abc_CommandAbc8DSec, 0 );
-
- Cmd_CommandAdd( pAbc, "AIG", "&get", Abc_CommandAbc9Get, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&put", Abc_CommandAbc9Put, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&r", Abc_CommandAbc9Read, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&w", Abc_CommandAbc9Write, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&ps", Abc_CommandAbc9Ps, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&pfan", Abc_CommandAbc9PFan, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&psig", Abc_CommandAbc9PSig, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&status", Abc_CommandAbc9Status, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&show", Abc_CommandAbc9Show, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&st", Abc_CommandAbc9Hash, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&topand", Abc_CommandAbc9Topand, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&cof", Abc_CommandAbc9Cof, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&trim", Abc_CommandAbc9Trim, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&dfs", Abc_CommandAbc9Dfs, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&sim", Abc_CommandAbc9Sim, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&resim", Abc_CommandAbc9Resim, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&speci", Abc_CommandAbc9SpecI, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&equiv", Abc_CommandAbc9Equiv, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&semi", Abc_CommandAbc9Semi, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&times", Abc_CommandAbc9Times, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&frames", Abc_CommandAbc9Frames, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&retime", Abc_CommandAbc9Retime, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&enable", Abc_CommandAbc9Enable, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&miter", Abc_CommandAbc9Miter, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&scl", Abc_CommandAbc9Scl, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&lcorr", Abc_CommandAbc9Lcorr, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&scorr", Abc_CommandAbc9Scorr, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&choice", Abc_CommandAbc9Choice, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&sat", Abc_CommandAbc9Sat, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&fraig", Abc_CommandAbc9Fraig, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&srm", Abc_CommandAbc9Srm, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&reduce", Abc_CommandAbc9Reduce, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&cec", Abc_CommandAbc9Cec, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&force", Abc_CommandAbc9Force, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&embed", Abc_CommandAbc9Embed, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&if", Abc_CommandAbc9If, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&era", Abc_CommandAbc9Era, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&dch", Abc_CommandAbc9Dch, 0 );
- Cmd_CommandAdd( pAbc, "AIG", "&test", Abc_CommandAbc9Test, 0 );
+
+ Cmd_CommandAdd( pAbc, "ABC9", "&get", Abc_CommandAbc9Get, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&put", Abc_CommandAbc9Put, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&r", Abc_CommandAbc9Read, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&w", Abc_CommandAbc9Write, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&ps", Abc_CommandAbc9Ps, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&pfan", Abc_CommandAbc9PFan, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&psig", Abc_CommandAbc9PSig, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&status", Abc_CommandAbc9Status, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&show", Abc_CommandAbc9Show, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&st", Abc_CommandAbc9Hash, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&topand", Abc_CommandAbc9Topand, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&cof", Abc_CommandAbc9Cof, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&trim", Abc_CommandAbc9Trim, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&dfs", Abc_CommandAbc9Dfs, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&sim", Abc_CommandAbc9Sim, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&resim", Abc_CommandAbc9Resim, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&speci", Abc_CommandAbc9SpecI, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&equiv", Abc_CommandAbc9Equiv, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&equiv2", Abc_CommandAbc9Equiv2, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&semi", Abc_CommandAbc9Semi, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&times", Abc_CommandAbc9Times, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&frames", Abc_CommandAbc9Frames, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&retime", Abc_CommandAbc9Retime, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&enable", Abc_CommandAbc9Enable, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&dc2", Abc_CommandAbc9Dc2, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&bidec", Abc_CommandAbc9Bidec, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&shrink", Abc_CommandAbc9Shrink, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&miter", Abc_CommandAbc9Miter, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&scl", Abc_CommandAbc9Scl, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&lcorr", Abc_CommandAbc9Lcorr, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&scorr", Abc_CommandAbc9Scorr, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&choice", Abc_CommandAbc9Choice, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&sat", Abc_CommandAbc9Sat, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&fraig", Abc_CommandAbc9Fraig, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&srm", Abc_CommandAbc9Srm, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&reduce", Abc_CommandAbc9Reduce, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&cec", Abc_CommandAbc9Cec, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&force", Abc_CommandAbc9Force, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&embed", Abc_CommandAbc9Embed, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&if", Abc_CommandAbc9If, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&trace", Abc_CommandAbc9Trace, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&speedup", Abc_CommandAbc9Speedup, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&era", Abc_CommandAbc9Era, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&dch", Abc_CommandAbc9Dch, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&abs_start", Abc_CommandAbc9AbsStart, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&abs_newstart", Abc_CommandAbc9AbsStartNew, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&abs_derive", Abc_CommandAbc9AbsDerive, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&abs_refine", Abc_CommandAbc9AbsRefine, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&pba_start", Abc_CommandAbc9PbaStart, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&reparam", Abc_CommandAbc9Reparam, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&posplit", Abc_CommandAbc9Posplit, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&reach", Abc_CommandAbc9Reach, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&undo", Abc_CommandAbc9Undo, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&test", Abc_CommandAbc9Test, 0 );
Cmd_CommandAdd( pAbc, "Liveness", "l2s", Abc_CommandAbcLivenessToSafety, 0 );
Cmd_CommandAdd( pAbc, "Liveness", "l2ssim", Abc_CommandAbcLivenessToSafetySim, 0 );
+ Cmd_CommandAdd( pAbc, "Liveness", "l3s", Abc_CommandAbcLivenessToSafetyWithLTL, 0 );
Cmd_CommandAdd( pAbc, "Various", "testnew", Abc_CommandAbcTestNew, 0 );
@@ -697,9 +798,24 @@ void Abc_Init( Abc_Frame_t * pAbc )
void For_ManFileExperiment();
// For_ManFileExperiment();
}
+/*
{
+ int i1, i2, i3, i4, i5, i6, N, Counter = 0;
+ for ( N = 20; N < 40; N++ )
+ {
+ Counter = 0;
+ for ( i1 = 0; i1 < N; i1++ )
+ for ( i2 = i1+1; i2 < N; i2++ )
+ for ( i3 = i2; i3 < N; i3++ )
+ for ( i4 = i3; i4 < N; i4++ )
+// for ( i5 = i4+1; i5 < N; i5++ )
+// for ( i6 = i5+1; i6 < N; i6++ )
+ Counter++;
+ printf( "%d=%d ", N, Counter );
+ }
+ printf( "\n" );
}
-
+*/
}
/**Function*************************************************************
@@ -713,13 +829,15 @@ void Abc_Init( Abc_Frame_t * pAbc )
SeeAlso []
***********************************************************************/
-void Abc_End()
+void Abc_End( Abc_Frame_t * pAbc )
{
+ extern Abc_Frame_t * Abc_FrameGetGlobalFrame();
Abc_FrameClearDesign();
+
{
extern void If_LutLibFree( If_Lib_t * pLutLib );
if ( Abc_FrameGetGlobalFrame()->pAbc8Lib )
- If_LutLibFree( Abc_FrameGetGlobalFrame()->pAbc8Lib );
+ If_LutLibFree( (If_Lib_t *)Abc_FrameGetGlobalFrame()->pAbc8Lib );
}
// Dar_LibDumpPriorities();
@@ -729,7 +847,7 @@ void Abc_End()
}
{
- extern void Cnf_ClearMemory();
+// extern void Cnf_ClearMemory();
Cnf_ClearMemory();
}
{
@@ -740,12 +858,11 @@ void Abc_End()
extern void Aig_RManQuit();
Aig_RManQuit();
}
-
Abc_NtkFraigStoreClean();
-// Rwt_Man4ExplorePrint();
-
- if ( Abc_FrameGetGlobalFrame()->pAig )
- Gia_ManStop( Abc_FrameGetGlobalFrame()->pAig );
+ if ( Abc_FrameGetGlobalFrame()->pGia )
+ Gia_ManStop( Abc_FrameGetGlobalFrame()->pGia );
+ if ( Abc_FrameGetGlobalFrame()->pGia2 )
+ Gia_ManStop( Abc_FrameGetGlobalFrame()->pGia2 );
}
/**Function*************************************************************
@@ -761,8 +878,7 @@ void Abc_End()
***********************************************************************/
int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int fFactor;
int fSaveBest;
int fDumpResult;
@@ -774,8 +890,6 @@ int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set the defaults
fFactor = 0;
@@ -824,36 +938,35 @@ int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( Abc_FrameReadErr(pAbc), "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) && fUseLutLib )
{
- fprintf( Abc_FrameReadErr(pAbc), "Cannot print LUT delay for a non-logic network.\n" );
+ Abc_Print( -1, "Cannot print LUT delay for a non-logic network.\n" );
return 1;
}
- Abc_NtkPrintStats( pOut, pNtk, fFactor, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch );
+ Abc_NtkPrintStats( pNtk, fFactor, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch );
if ( fPrintTime )
{
pAbc->TimeTotal += pAbc->TimeCommand;
- fprintf( pAbc->Out, "elapse: %3.2f seconds, total: %3.2f seconds\n",
- pAbc->TimeCommand, pAbc->TimeTotal );
+ Abc_Print( 1, "elapse: %3.2f seconds, total: %3.2f seconds\n", pAbc->TimeCommand, pAbc->TimeTotal );
pAbc->TimeCommand = 0.0;
}
return 0;
usage:
- fprintf( pErr, "usage: print_stats [-fbdltmpgh]\n" );
- fprintf( pErr, "\t prints the network statistics\n" );
- fprintf( pErr, "\t-f : toggles printing the literal count in the factored forms [default = %s]\n", fFactor? "yes": "no" );
- fprintf( pErr, "\t-b : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
- fprintf( pErr, "\t-d : toggles dumping network into file \"<input_file_name>_dump.blif\" [default = %s]\n", fDumpResult? "yes": "no" );
- fprintf( pErr, "\t-l : toggles printing delay of LUT mapping using LUT library [default = %s]\n", fSaveBest? "yes": "no" );
- fprintf( pErr, "\t-t : toggles printing runtime statistics [default = %s]\n", fPrintTime? "yes": "no" );
- fprintf( pErr, "\t-m : toggles printing MUX statistics [default = %s]\n", fPrintMuxes? "yes": "no" );
- fprintf( pErr, "\t-p : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
- fprintf( pErr, "\t-q : toggles printing percentage of increased power due to glitching [default = %s]\n", fGlitch? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_stats [-fbdltmpgh]\n" );
+ Abc_Print( -2, "\t prints the network statistics\n" );
+ Abc_Print( -2, "\t-f : toggles printing the literal count in the factored forms [default = %s]\n", fFactor? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggles dumping network into file \"<input_file_name>_dump.blif\" [default = %s]\n", fDumpResult? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggles printing delay of LUT mapping using LUT library [default = %s]\n", fSaveBest? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggles printing runtime statistics [default = %s]\n", fPrintTime? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggles printing MUX statistics [default = %s]\n", fPrintMuxes? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
+ Abc_Print( -2, "\t-q : toggles printing percentage of increased power due to glitching [default = %s]\n", fGlitch? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -870,18 +983,13 @@ usage:
***********************************************************************/
int Abc_CommandPrintExdc( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkTemp;
double Percentage;
- bool fShort;
+ int fShort;
int c;
int fPrintDc;
-
extern double Abc_NtkSpacePercentage( Abc_Obj_t * pNode );
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set the defaults
fShort = 1;
@@ -906,12 +1014,12 @@ int Abc_CommandPrintExdc( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( Abc_FrameReadErr(pAbc), "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( pNtk->pExdc == NULL )
{
- fprintf( Abc_FrameReadErr(pAbc), "Network has no EXDC.\n" );
+ Abc_Print( -1, "Network has no EXDC.\n" );
return 1;
}
@@ -926,26 +1034,26 @@ int Abc_CommandPrintExdc( Abc_Frame_t * pAbc, int argc, char ** argv )
else
Percentage = Abc_NtkSpacePercentage( Abc_ObjChild0( Abc_NtkPo(pNtk->pExdc, 0) ) );
- printf( "EXDC network statistics: " );
- printf( "(" );
+ Abc_Print( 1, "EXDC network statistics: " );
+ Abc_Print( 1, "(" );
if ( Percentage > 0.05 && Percentage < 99.95 )
- printf( "%.2f", Percentage );
+ Abc_Print( 1, "%.2f", Percentage );
else if ( Percentage > 0.000005 && Percentage < 99.999995 )
- printf( "%.6f", Percentage );
+ Abc_Print( 1, "%.6f", Percentage );
else
- printf( "%f", Percentage );
- printf( " %% don't-cares)\n" );
+ Abc_Print( 1, "%f", Percentage );
+ Abc_Print( 1, " %% don't-cares)\n" );
}
else
- printf( "EXDC network statistics: \n" );
- Abc_NtkPrintStats( pOut, pNtk->pExdc, 0, 0, 0, 0, 0, 0, 0 );
+ Abc_Print( 1, "EXDC network statistics: \n" );
+ Abc_NtkPrintStats( pNtk->pExdc, 0, 0, 0, 0, 0, 0, 0 );
return 0;
usage:
- fprintf( pErr, "usage: print_exdc [-dh]\n" );
- fprintf( pErr, "\t prints the EXDC network statistics\n" );
- fprintf( pErr, "\t-d : toggles printing don't-care percentage [default = %s]\n", fPrintDc? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_exdc [-dh]\n" );
+ Abc_Print( -2, "\t prints the EXDC network statistics\n" );
+ Abc_Print( -2, "\t-d : toggles printing don't-care percentage [default = %s]\n", fPrintDc? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -962,15 +1070,10 @@ usage:
***********************************************************************/
int Abc_CommandPrintIo( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pNode;
int c;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -986,13 +1089,13 @@ int Abc_CommandPrintIo( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( argc > globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
@@ -1001,21 +1104,21 @@ int Abc_CommandPrintIo( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
- Abc_NodePrintFanio( pOut, pNode );
+ Abc_NodePrintFanio( stdout, pNode );
return 0;
}
// print the nodes
- Abc_NtkPrintIo( pOut, pNtk );
+ Abc_NtkPrintIo( stdout, pNtk );
return 0;
usage:
- fprintf( pErr, "usage: print_io [-h] <node>\n" );
- fprintf( pErr, "\t prints the PIs/POs or fanins/fanouts of a node\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tnode : the node to print fanins/fanouts\n");
+ Abc_Print( -2, "usage: print_io [-h] <node>\n" );
+ Abc_Print( -2, "\t prints the PIs/POs or fanins/fanouts of a node\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tnode : the node to print fanins/fanouts\n");
return 1;
}
@@ -1032,16 +1135,11 @@ usage:
***********************************************************************/
int Abc_CommandPrintLatch( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fPrintSccs;
extern void Abc_NtkPrintSccs( Abc_Ntk_t * pNtk, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fPrintSccs = 0;
Extra_UtilGetoptReset();
@@ -1061,20 +1159,20 @@ int Abc_CommandPrintLatch( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// print the nodes
- Abc_NtkPrintLatch( pOut, pNtk );
+ Abc_NtkPrintLatch( stdout, pNtk );
if ( fPrintSccs )
Abc_NtkPrintSccs( pNtk, 0 );
return 0;
usage:
- fprintf( pErr, "usage: print_latch [-sh]\n" );
- fprintf( pErr, "\t prints information about latches\n" );
- fprintf( pErr, "\t-s : toggles printing SCCs of registers [default = %s]\n", fPrintSccs? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_latch [-sh]\n" );
+ Abc_Print( -2, "\t prints information about latches\n" );
+ Abc_Print( -2, "\t-s : toggles printing SCCs of registers [default = %s]\n", fPrintSccs? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1091,15 +1189,10 @@ usage:
***********************************************************************/
int Abc_CommandPrintFanio( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fVerbose;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fVerbose = 0;
Extra_UtilGetoptReset();
@@ -1119,22 +1212,22 @@ int Abc_CommandPrintFanio( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// print the nodes
if ( fVerbose )
- Abc_NtkPrintFanio( pOut, pNtk );
+ Abc_NtkPrintFanio( stdout, pNtk );
else
- Abc_NtkPrintFanioNew( pOut, pNtk );
+ Abc_NtkPrintFanioNew( stdout, pNtk );
return 0;
usage:
- fprintf( pErr, "usage: print_fanio [-vh]\n" );
- fprintf( pErr, "\t prints the statistics about fanins/fanouts of all nodes\n" );
- fprintf( pErr, "\t-v : toggles verbose way of printing the stats [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_fanio [-vh]\n" );
+ Abc_Print( -2, "\t prints the statistics about fanins/fanouts of all nodes\n" );
+ Abc_Print( -2, "\t-v : toggles verbose way of printing the stats [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1151,15 +1244,10 @@ usage:
***********************************************************************/
int Abc_CommandPrintMffc( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
extern void Abc_NtkPrintMffc( FILE * pFile, Abc_Ntk_t * pNtk );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -1175,18 +1263,18 @@ int Abc_CommandPrintMffc( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// print the nodes
- Abc_NtkPrintMffc( pOut, pNtk );
+ Abc_NtkPrintMffc( stdout, pNtk );
return 0;
usage:
- fprintf( pErr, "usage: print_mffc [-h]\n" );
- fprintf( pErr, "\t prints the MFFC of each node in the network\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_mffc [-h]\n" );
+ Abc_Print( -2, "\t prints the MFFC of each node in the network\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1203,16 +1291,11 @@ usage:
***********************************************************************/
int Abc_CommandPrintFactor( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pNode;
int c;
int fUseRealNames;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseRealNames = 1;
Extra_UtilGetoptReset();
@@ -1232,19 +1315,19 @@ int Abc_CommandPrintFactor( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsSopLogic(pNtk) )
{
- fprintf( pErr, "Printing factored forms can be done for SOP networks.\n" );
+ Abc_Print( -1, "Printing factored forms can be done for SOP networks.\n" );
return 1;
}
if ( argc > globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
@@ -1253,22 +1336,22 @@ int Abc_CommandPrintFactor( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
- Abc_NodePrintFactor( pOut, pNode, fUseRealNames );
+ Abc_NodePrintFactor( stdout, pNode, fUseRealNames );
return 0;
}
// print the nodes
- Abc_NtkPrintFactor( pOut, pNtk, fUseRealNames );
+ Abc_NtkPrintFactor( stdout, pNtk, fUseRealNames );
return 0;
usage:
- fprintf( pErr, "usage: print_factor [-nh] <node>\n" );
- fprintf( pErr, "\t prints the factored forms of nodes\n" );
- fprintf( pErr, "\t-n : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tnode : (optional) one node to consider\n");
+ Abc_Print( -2, "usage: print_factor [-nh] <node>\n" );
+ Abc_Print( -2, "\t prints the factored forms of nodes\n" );
+ Abc_Print( -2, "\t-n : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tnode : (optional) one node to consider\n");
return 1;
}
@@ -1285,17 +1368,12 @@ usage:
***********************************************************************/
int Abc_CommandPrintLevel( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pNode;
int c;
int fListNodes;
int fProfile;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fListNodes = 0;
fProfile = 1;
@@ -1319,19 +1397,19 @@ int Abc_CommandPrintLevel( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !fProfile && !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
return 1;
}
if ( argc > globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
@@ -1340,23 +1418,23 @@ int Abc_CommandPrintLevel( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
- Abc_NodePrintLevel( pOut, pNode );
+ Abc_NodePrintLevel( stdout, pNode );
return 0;
}
// process all COs
- Abc_NtkPrintLevel( pOut, pNtk, fProfile, fListNodes );
+ Abc_NtkPrintLevel( stdout, pNtk, fProfile, fListNodes );
return 0;
usage:
- fprintf( pErr, "usage: print_level [-nph] <node>\n" );
- fprintf( pErr, "\t prints information about node level and cone size\n" );
- fprintf( pErr, "\t-n : toggles printing nodes by levels [default = %s]\n", fListNodes? "yes": "no" );
- fprintf( pErr, "\t-p : toggles printing level profile [default = %s]\n", fProfile? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tnode : (optional) one node to consider\n");
+ Abc_Print( -2, "usage: print_level [-nph] <node>\n" );
+ Abc_Print( -2, "\t prints information about node level and cone size\n" );
+ Abc_Print( -2, "\t-n : toggles printing nodes by levels [default = %s]\n", fListNodes? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggles printing level profile [default = %s]\n", fProfile? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tnode : (optional) one node to consider\n");
return 1;
}
@@ -1374,18 +1452,13 @@ usage:
int Abc_CommandPrintSupport( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Vec_Ptr_t * vSuppFun;
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fStruct;
int fVerbose;
extern Vec_Ptr_t * Sim_ComputeFunSupp( Abc_Ntk_t * pNtk, int fVerbose );
extern void Abc_NtkPrintStrSupports( Abc_Ntk_t * pNtk );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fStruct = 1;
fVerbose = 0;
@@ -1409,7 +1482,7 @@ int Abc_CommandPrintSupport( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -1422,12 +1495,12 @@ int Abc_CommandPrintSupport( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( !Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "This command works only for combinational networks (run \"comb\").\n" );
+ Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
return 1;
}
vSuppFun = Sim_ComputeFunSupp( pNtk, fVerbose );
@@ -1436,11 +1509,11 @@ int Abc_CommandPrintSupport( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: print_supp [-svh]\n" );
- fprintf( pErr, "\t prints the supports of the CO nodes\n" );
- fprintf( pErr, "\t-s : toggle printing structural support only [default = %s].\n", fStruct? "yes": "no" );
- fprintf( pErr, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_supp [-svh]\n" );
+ Abc_Print( -2, "\t prints the supports of the CO nodes\n" );
+ Abc_Print( -2, "\t-s : toggle printing structural support only [default = %s].\n", fStruct? "yes": "no" );
+ Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1457,8 +1530,7 @@ usage:
***********************************************************************/
int Abc_CommandPrintSymms( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseBdds;
int fNaive;
@@ -1466,10 +1538,6 @@ int Abc_CommandPrintSymms( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVerbose;
extern void Abc_NtkSymmetries( Abc_Ntk_t * pNtk, int fUseBdds, int fNaive, int fReorder, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseBdds = 0;
fNaive = 0;
@@ -1500,12 +1568,12 @@ int Abc_CommandPrintSymms( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "This command works only for combinational networks (run \"comb\").\n" );
+ Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
@@ -1519,13 +1587,13 @@ int Abc_CommandPrintSymms( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: print_symm [-bnrvh]\n" );
- fprintf( pErr, "\t computes symmetries of the PO functions\n" );
- fprintf( pErr, "\t-b : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
- fprintf( pErr, "\t-n : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
- fprintf( pErr, "\t-r : enable dynamic BDD variable reordering [default = %s].\n", fReorder? "yes": "no" );
- fprintf( pErr, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_symm [-bnrvh]\n" );
+ Abc_Print( -2, "\t computes symmetries of the PO functions\n" );
+ Abc_Print( -2, "\t-b : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
+ Abc_Print( -2, "\t-n : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
+ Abc_Print( -2, "\t-r : enable dynamic BDD variable reordering [default = %s].\n", fReorder? "yes": "no" );
+ Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1542,18 +1610,13 @@ usage:
***********************************************************************/
int Abc_CommandPrintUnate( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseBdds;
int fUseNaive;
int fVerbose;
extern void Abc_NtkPrintUnate( Abc_Ntk_t * pNtk, int fUseBdds, int fUseNaive, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseBdds = 1;
fUseNaive = 0;
@@ -1580,24 +1643,24 @@ int Abc_CommandPrintUnate( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
return 1;
}
Abc_NtkPrintUnate( pNtk, fUseBdds, fUseNaive, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: print_unate [-bnvh]\n" );
- fprintf( pErr, "\t computes unate variables of the PO functions\n" );
- fprintf( pErr, "\t-b : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
- fprintf( pErr, "\t-n : toggle naive BDD-based computation [default = %s].\n", fUseNaive? "yes": "no" );
- fprintf( pErr, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_unate [-bnvh]\n" );
+ Abc_Print( -2, "\t computes unate variables of the PO functions\n" );
+ Abc_Print( -2, "\t-b : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
+ Abc_Print( -2, "\t-n : toggle naive BDD-based computation [default = %s].\n", fUseNaive? "yes": "no" );
+ Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1614,18 +1677,13 @@ usage:
***********************************************************************/
int Abc_CommandPrintAuto( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int Output;
int fNaive;
int fVerbose;
extern void Abc_NtkAutoPrint( Abc_Ntk_t * pNtk, int Output, int fNaive, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Output = -1;
fNaive = 0;
@@ -1638,7 +1696,7 @@ int Abc_CommandPrintAuto( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'O':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-O\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
goto usage;
}
Output = atoi(argv[globalUtilOptind]);
@@ -1660,12 +1718,12 @@ int Abc_CommandPrintAuto( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
return 1;
}
@@ -1674,12 +1732,12 @@ int Abc_CommandPrintAuto( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: print_auto [-O num] [-nvh]\n" );
- fprintf( pErr, "\t computes autosymmetries of the PO functions\n" );
- fprintf( pErr, "\t-O num : (optional) the 0-based number of the output [default = all]\n");
- fprintf( pErr, "\t-n : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
- fprintf( pErr, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_auto [-O num] [-nvh]\n" );
+ Abc_Print( -2, "\t computes autosymmetries of the PO functions\n" );
+ Abc_Print( -2, "\t-O num : (optional) the 0-based number of the output [default = all]\n");
+ Abc_Print( -2, "\t-n : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
+ Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1696,18 +1754,13 @@ usage:
***********************************************************************/
int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pNode;
int c;
int fUseRealNames;
extern void Abc_NodePrintKMap( Abc_Obj_t * pNode, int fUseRealNames );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseRealNames = 1;
Extra_UtilGetoptReset();
@@ -1727,18 +1780,18 @@ int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Visualization of Karnaugh maps works for logic networks.\n" );
+ Abc_Print( -1, "Visualization of Karnaugh maps works for logic networks.\n" );
return 1;
}
if ( argc > globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
if ( argc == globalUtilOptind )
@@ -1746,7 +1799,7 @@ int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
if ( !Abc_ObjIsNode(pNode) )
{
- fprintf( pErr, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
+ Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
return 1;
}
}
@@ -1755,7 +1808,7 @@ int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
}
@@ -1764,11 +1817,11 @@ int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: print_kmap [-nh] <node>\n" );
- fprintf( pErr, " shows the truth table of the node\n" );
- fprintf( pErr, "\t-n : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tnode : the node to consider (default = the driver of the first PO)\n");
+ Abc_Print( -2, "usage: print_kmap [-nh] <node>\n" );
+ Abc_Print( -2, "\t shows the truth table of the node\n" );
+ Abc_Print( -2, "\t-n : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tnode : the node to consider (default = the driver of the first PO)\n");
return 1;
}
@@ -1785,17 +1838,12 @@ usage:
***********************************************************************/
int Abc_CommandPrintGates( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseLibrary;
extern void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseLibrary = 1;
Extra_UtilGetoptReset();
@@ -1815,12 +1863,12 @@ int Abc_CommandPrintGates( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkHasAig(pNtk) )
{
- fprintf( pErr, "Printing gates does not work for AIGs and sequential AIGs.\n" );
+ Abc_Print( -1, "Printing gates does not work for AIGs and sequential AIGs.\n" );
return 1;
}
@@ -1828,10 +1876,10 @@ int Abc_CommandPrintGates( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: print_gates [-lh]\n" );
- fprintf( pErr, "\t prints statistics about gates used in the network\n" );
- fprintf( pErr, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_gates [-lh]\n" );
+ Abc_Print( -2, "\t prints statistics about gates used in the network\n" );
+ Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1848,17 +1896,12 @@ usage:
***********************************************************************/
int Abc_CommandPrintSharing( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseLibrary;
extern void Abc_NtkPrintSharing( Abc_Ntk_t * pNtk );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseLibrary = 1;
Extra_UtilGetoptReset();
@@ -1878,17 +1921,17 @@ int Abc_CommandPrintSharing( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
Abc_NtkPrintSharing( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: print_sharing [-h]\n" );
- fprintf( pErr, "\t prints the number of shared nodes in the TFI cones of the COs\n" );
-// fprintf( pErr, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_sharing [-h]\n" );
+ Abc_Print( -2, "\t prints the number of shared nodes in the TFI cones of the COs\n" );
+// Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1905,17 +1948,12 @@ usage:
***********************************************************************/
int Abc_CommandPrintXCut( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseLibrary;
extern int Abc_NtkCrossCut( Abc_Ntk_t * pNtk );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseLibrary = 1;
Extra_UtilGetoptReset();
@@ -1935,17 +1973,17 @@ int Abc_CommandPrintXCut( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
Abc_NtkCrossCut( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: print_xcut [-h]\n" );
- fprintf( pErr, "\t prints the size of the cross cut of the current network\n" );
-// fprintf( pErr, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_xcut [-h]\n" );
+ Abc_Print( -2, "\t prints the size of the cross cut of the current network\n" );
+// Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1962,31 +2000,28 @@ usage:
***********************************************************************/
int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fCofactor;
int nCofLevel;
+ int fProfile;
extern void Kit_DsdTest( unsigned * pTruth, int nVars );
extern void Kit_DsdPrintCofactors( unsigned * pTruth, int nVars, int nCofLevel, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nCofLevel = 1;
fCofactor = 0;
+ fProfile = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Nch" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Npch" ) ) != EOF )
{
switch ( c )
{
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nCofLevel = atoi(argv[globalUtilOptind]);
@@ -1997,6 +2032,9 @@ int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'c':
fCofactor ^= 1;
break;
+ case 'p':
+ fProfile ^= 1;
+ break;
case 'h':
goto usage;
default:
@@ -2006,13 +2044,13 @@ int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// get the truth table of the first output
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Currently works only for logic networks.\n" );
+ Abc_Print( -1, "Currently works only for logic networks.\n" );
return 1;
}
Abc_NtkToAig( pNtk );
@@ -2023,20 +2061,22 @@ int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
unsigned * pTruth;
if ( !Abc_ObjIsNode(pObj) )
{
- fprintf( pErr, "The fanin of the first PO node does not have a logic function.\n" );
+ Abc_Print( -1, "The fanin of the first PO node does not have a logic function.\n" );
return 1;
}
if ( Abc_ObjFaninNum(pObj) > 16 )
{
- fprintf( pErr, "Currently works only for up to 16 inputs.\n" );
+ Abc_Print( -1, "Currently works only for up to 16 inputs.\n" );
return 1;
}
- pTruth = Hop_ManConvertAigToTruth( pNtk->pManFunc, Hop_Regular(pObj->pData), Abc_ObjFaninNum(pObj), vMemory, 0 );
- if ( Hop_IsComplement(pObj->pData) )
+ pTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNtk->pManFunc, Hop_Regular((Hop_Obj_t *)pObj->pData), Abc_ObjFaninNum(pObj), vMemory, 0 );
+ if ( Hop_IsComplement((Hop_Obj_t *)pObj->pData) )
Extra_TruthNot( pTruth, pTruth, Abc_ObjFaninNum(pObj) );
// Extra_PrintBinary( stdout, pTruth, 1 << Abc_ObjFaninNum(pObj) );
-// printf( "\n" );
- if ( fCofactor )
+// Abc_Print( -1, "\n" );
+ if ( fProfile )
+ Kit_TruthPrintProfile( pTruth, Abc_ObjFaninNum(pObj) );
+ else if ( fCofactor )
Kit_DsdPrintCofactors( pTruth, Abc_ObjFaninNum(pObj), nCofLevel, 1 );
else
Kit_DsdTest( pTruth, Abc_ObjFaninNum(pObj) );
@@ -2045,11 +2085,12 @@ int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: print_dsd [-ch] [-N num]\n" );
- fprintf( pErr, "\t print DSD formula for a single-output function with less than 16 variables\n" );
- fprintf( pErr, "\t-c : toggle recursive cofactoring [default = %s]\n", fCofactor? "yes": "no" );
- fprintf( pErr, "\t-N num : the number of levels to cofactor [default = %d]\n", nCofLevel );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_dsd [-pch] [-N num]\n" );
+ Abc_Print( -2, "\t print DSD formula for a single-output function with less than 16 variables\n" );
+ Abc_Print( -2, "\t-p : toggle printing profile [default = %s]\n", fProfile? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle recursive cofactoring [default = %s]\n", fCofactor? "yes": "no" );
+ Abc_Print( -2, "\t-N num : the number of levels to cofactor [default = %d]\n", nCofLevel );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2066,17 +2107,10 @@ usage:
***********************************************************************/
int Abc_CommandPrintCone( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseLibrary;
- extern int Abc_NtkDarPrintCone( Abc_Ntk_t * pNtk );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseLibrary = 1;
Extra_UtilGetoptReset();
@@ -2095,22 +2129,22 @@ int Abc_CommandPrintCone( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 1;
}
Abc_NtkDarPrintCone( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: print_cone [-h]\n" );
- fprintf( pErr, "\t prints cones of influence info for each primary output\n" );
-// fprintf( pErr, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_cone [-h]\n" );
+ Abc_Print( -2, "\t prints cones of influence info for each primary output\n" );
+// Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2128,17 +2162,12 @@ usage:
***********************************************************************/
int Abc_CommandPrintMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseLibrary;
extern void Abc_NtkPrintMiter( Abc_Ntk_t * pNtk );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseLibrary = 1;
Extra_UtilGetoptReset();
@@ -2157,21 +2186,65 @@ int Abc_CommandPrintMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "The network is should be structurally hashed.\n" );
+ Abc_Print( -1, "The network is should be structurally hashed.\n" );
return 1;
}
Abc_NtkPrintMiter( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: print_miter [-h]\n" );
- fprintf( pErr, "\t prints the status of the miter\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: print_miter [-h]\n" );
+ Abc_Print( -2, "\t prints the status of the miter\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ int c;
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ printf( "Status = %d Frames = %d ", pAbc->Status, pAbc->nFrames );
+ if ( pAbc->pCex == NULL )
+ printf( "Cex is not defined.\n" );
+ else
+ printf( "Cex: PIs = %d Regs = %d PO = %d Frame = %d Bits = %d\n",
+ pAbc->pCex->nPis, pAbc->pCex->nRegs,
+ pAbc->pCex->iPo, pAbc->pCex->iFrame,
+ pAbc->pCex->nBits );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: print_status [-h]\n" );
+ Abc_Print( -2, "\t prints verification status\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2188,24 +2261,22 @@ usage:
***********************************************************************/
int Abc_CommandShow( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fSeq;
int fGateNames;
int fUseReverse;
+ int fFlopDep;
extern void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+ extern void Abc_NtkShowFlopDependency( Abc_Ntk_t * pNtk );
// set defaults
fSeq = 0;
fGateNames = 0;
fUseReverse = 1;
+ fFlopDep = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "rsgh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "rsgfh" ) ) != EOF )
{
switch ( c )
{
@@ -2218,6 +2289,9 @@ int Abc_CommandShow( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'g':
fGateNames ^= 1;
break;
+ case 'f':
+ fFlopDep ^= 1;
+ break;
default:
goto usage;
}
@@ -2225,24 +2299,28 @@ int Abc_CommandShow( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
- Abc_NtkShow( pNtk, fGateNames, fSeq, fUseReverse );
+ if ( fFlopDep )
+ Abc_NtkShowFlopDependency( pNtk );
+ else
+ Abc_NtkShow( pNtk, fGateNames, fSeq, fUseReverse );
return 0;
usage:
- fprintf( pErr, "usage: show [-srgh]\n" );
- fprintf( pErr, " visualizes the network structure using DOT and GSVIEW\n" );
+ Abc_Print( -2, "usage: show [-srgfh]\n" );
+ Abc_Print( -2, " visualizes the network structure using DOT and GSVIEW\n" );
#ifdef WIN32
- fprintf( pErr, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
- fprintf( pErr, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
+ Abc_Print( -2, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
+ Abc_Print( -2, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
#endif
- fprintf( pErr, "\t-s : toggles visualization of sequential networks [default = %s].\n", fSeq? "yes": "no" );
- fprintf( pErr, "\t-r : toggles ordering nodes in reverse order [default = %s].\n", fUseReverse? "yes": "no" );
- fprintf( pErr, "\t-g : toggles printing gate names for mapped network [default = %s].\n", fGateNames? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t-s : toggles visualization of sequential networks [default = %s].\n", fSeq? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggles ordering nodes in reverse order [default = %s].\n", fUseReverse? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggles printing gate names for mapped network [default = %s].\n", fGateNames? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggles visualizing flop dependency graph [default = %s].\n", fFlopDep? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2259,16 +2337,11 @@ usage:
***********************************************************************/
int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pNode;
int c;
extern void Abc_NodeShowBdd( Abc_Obj_t * pNode );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -2284,19 +2357,19 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsBddLogic(pNtk) )
{
- fprintf( pErr, "Visualizing BDDs can only be done for logic BDD networks (run \"bdd\").\n" );
+ Abc_Print( -1, "Visualizing BDDs can only be done for logic BDD networks (run \"bdd\").\n" );
return 1;
}
if ( argc > globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
if ( argc == globalUtilOptind )
@@ -2304,7 +2377,7 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
if ( !Abc_ObjIsNode(pNode) )
{
- fprintf( pErr, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
+ Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
return 1;
}
}
@@ -2313,7 +2386,7 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
}
@@ -2321,14 +2394,14 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: show_bdd [-h] <node>\n" );
- fprintf( pErr, " visualizes the BDD of a node using DOT and GSVIEW\n" );
+ Abc_Print( -2, "usage: show_bdd [-h] <node>\n" );
+ Abc_Print( -2, " visualizes the BDD of a node using DOT and GSVIEW\n" );
#ifdef WIN32
- fprintf( pErr, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
- fprintf( pErr, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
+ Abc_Print( -2, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
+ Abc_Print( -2, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
#endif
- fprintf( pErr, "\tnode : the node to consider [default = the driver of the first PO]\n");
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tnode : the node to consider [default = the driver of the first PO]\n");
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2345,18 +2418,13 @@ usage:
***********************************************************************/
int Abc_CommandShowCut( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pNode;
int c;
int nNodeSizeMax;
int nConeSizeMax;
extern void Abc_NodeShowCut( Abc_Obj_t * pNode, int nNodeSizeMax, int nConeSizeMax );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nNodeSizeMax = 10;
nConeSizeMax = ABC_INFINITY;
@@ -2368,7 +2436,7 @@ int Abc_CommandShowCut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nNodeSizeMax = atoi(argv[globalUtilOptind]);
@@ -2379,7 +2447,7 @@ int Abc_CommandShowCut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConeSizeMax = atoi(argv[globalUtilOptind]);
@@ -2396,41 +2464,41 @@ int Abc_CommandShowCut( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Visualizing cuts only works for AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "Visualizing cuts only works for AIGs (run \"strash\").\n" );
return 1;
}
if ( argc != globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
Abc_NodeShowCut( pNode, nNodeSizeMax, nConeSizeMax );
return 0;
usage:
- fprintf( pErr, "usage: show_cut [-N num] [-C num] [-h] <node>\n" );
- fprintf( pErr, " visualizes the cut of a node using DOT and GSVIEW\n" );
+ Abc_Print( -2, "usage: show_cut [-N num] [-C num] [-h] <node>\n" );
+ Abc_Print( -2, " visualizes the cut of a node using DOT and GSVIEW\n" );
#ifdef WIN32
- fprintf( pErr, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
- fprintf( pErr, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
+ Abc_Print( -2, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
+ Abc_Print( -2, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
#endif
- fprintf( pErr, "\t-N num : the max size of the cut to be computed [default = %d]\n", nNodeSizeMax );
- fprintf( pErr, "\t-C num : the max support of the containing cone [default = %d]\n", nConeSizeMax );
- fprintf( pErr, "\tnode : the node to consider\n");
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t-N num : the max size of the cut to be computed [default = %d]\n", nNodeSizeMax );
+ Abc_Print( -2, "\t-C num : the max support of the containing cone [default = %d]\n", nConeSizeMax );
+ Abc_Print( -2, "\tnode : the node to consider\n");
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2448,17 +2516,13 @@ usage:
***********************************************************************/
int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int fVerbose;
int fBddSizeMax;
int fDualRail;
int fReorder;
int c;
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fVerbose = 1;
@@ -2473,7 +2537,7 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'B':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-B\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
goto usage;
}
fBddSizeMax = atoi(argv[globalUtilOptind]);
@@ -2499,13 +2563,13 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Can only collapse a logic network or an AIG.\n" );
+ Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
return 1;
}
@@ -2520,7 +2584,7 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Collapsing has failed.\n" );
+ Abc_Print( -1, "Collapsing has failed.\n" );
return 1;
}
// replace the current network
@@ -2528,13 +2592,13 @@ int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: collapse [-B num] [-rdvh]\n" );
- fprintf( pErr, "\t collapses the network by constructing global BDDs\n" );
- fprintf( pErr, "\t-B num : limit on live BDD nodes during collapsing [default = %d]\n", fBddSizeMax );
- fprintf( pErr, "\t-r : toggles dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
- fprintf( pErr, "\t-d : toggles dual-rail collapsing mode [default = %s]\n", fDualRail? "yes": "no" );
- fprintf( pErr, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: collapse [-B num] [-rdvh]\n" );
+ Abc_Print( -2, "\t collapses the network by constructing global BDDs\n" );
+ Abc_Print( -2, "\t-B num : limit on live BDD nodes during collapsing [default = %d]\n", fBddSizeMax );
+ Abc_Print( -2, "\t-r : toggles dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggles dual-rail collapsing mode [default = %s]\n", fDualRail? "yes": "no" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2552,7 +2616,6 @@ usage:
***********************************************************************/
int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
Abc_Obj_t * pObj;
int c;
@@ -2560,11 +2623,7 @@ int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
int fRecord;
int fCleanup;
int fComplOuts;
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fAllNodes = 0;
fCleanup = 1;
@@ -2596,7 +2655,7 @@ int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -2604,7 +2663,7 @@ int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkStrash( pNtk, fAllNodes, fCleanup, fRecord );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Strashing has failed.\n" );
+ Abc_Print( -1, "Strashing has failed.\n" );
return 1;
}
if ( fComplOuts )
@@ -2615,13 +2674,13 @@ int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: strash [-acrih]\n" );
- fprintf( pErr, "\t transforms combinational logic into an AIG\n" );
- fprintf( pErr, "\t-a : toggles between using all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "DFS" );
- fprintf( pErr, "\t-c : toggles cleanup to remove the dagling AIG nodes [default = %s]\n", fCleanup? "all": "DFS" );
- fprintf( pErr, "\t-r : toggles using the record of AIG subgraphs [default = %s]\n", fRecord? "yes": "no" );
- fprintf( pErr, "\t-i : toggles complementing the COs of the AIG [default = %s]\n", fComplOuts? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: strash [-acrih]\n" );
+ Abc_Print( -2, "\t transforms combinational logic into an AIG\n" );
+ Abc_Print( -2, "\t-a : toggles between using all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "DFS" );
+ Abc_Print( -2, "\t-c : toggles cleanup to remove the dagling AIG nodes [default = %s]\n", fCleanup? "all": "DFS" );
+ Abc_Print( -2, "\t-r : toggles using the record of AIG subgraphs [default = %s]\n", fRecord? "yes": "no" );
+ Abc_Print( -2, "\t-i : toggles complementing the COs of the AIG [default = %s]\n", fComplOuts? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2638,19 +2697,15 @@ usage:
***********************************************************************/
int Abc_CommandBalance( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
int c;
- bool fDuplicate;
- bool fSelective;
- bool fUpdateLevel;
+ int fDuplicate;
+ int fSelective;
+ int fUpdateLevel;
int fExor;
int fVerbose;
extern Abc_Ntk_t * Abc_NtkBalanceExor( Abc_Ntk_t * pNtk, int fUpdateLevel, int fVerbose );
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fDuplicate = 0;
@@ -2687,7 +2742,7 @@ int Abc_CommandBalance( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// get the new network
@@ -2703,7 +2758,7 @@ int Abc_CommandBalance( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtkTemp == NULL )
{
- fprintf( pErr, "Strashing before balancing has failed.\n" );
+ Abc_Print( -1, "Strashing before balancing has failed.\n" );
return 1;
}
if ( fExor )
@@ -2716,7 +2771,7 @@ int Abc_CommandBalance( Abc_Frame_t * pAbc, int argc, char ** argv )
// check if balancing worked
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Balancing has failed.\n" );
+ Abc_Print( -1, "Balancing has failed.\n" );
return 1;
}
// replace the current network
@@ -2724,14 +2779,14 @@ int Abc_CommandBalance( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: balance [-ldsxvh]\n" );
- fprintf( pErr, "\t transforms the current network into a well-balanced AIG\n" );
- fprintf( pErr, "\t-l : toggle minimizing the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
- fprintf( pErr, "\t-s : toggle duplication on the critical paths [default = %s]\n", fSelective? "yes": "no" );
- fprintf( pErr, "\t-x : toggle balancing multi-input EXORs [default = %s]\n", fExor? "yes": "no" );
- fprintf( pErr, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: balance [-ldsxvh]\n" );
+ Abc_Print( -2, "\t transforms the current network into a well-balanced AIG\n" );
+ Abc_Print( -2, "\t-l : toggle minimizing the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle duplication on the critical paths [default = %s]\n", fSelective? "yes": "no" );
+ Abc_Print( -2, "\t-x : toggle balancing multi-input EXORs [default = %s]\n", fExor? "yes": "no" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2748,16 +2803,12 @@ usage:
***********************************************************************/
int Abc_CommandMuxStruct( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fVerbose;
extern Abc_Ntk_t * Abc_NtkMuxRestructure( Abc_Ntk_t * pNtk, int fVerbose );
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fVerbose = 0;
@@ -2778,13 +2829,13 @@ int Abc_CommandMuxStruct( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// get the new network
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Does not work for a logic network.\n" );
+ Abc_Print( -1, "Does not work for a logic network.\n" );
return 1;
}
// check if balancing worked
@@ -2792,7 +2843,7 @@ int Abc_CommandMuxStruct( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = NULL;
if ( pNtkRes == NULL )
{
- fprintf( pErr, "MUX restructuring has failed.\n" );
+ Abc_Print( -1, "MUX restructuring has failed.\n" );
return 1;
}
// replace the current network
@@ -2800,10 +2851,10 @@ int Abc_CommandMuxStruct( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: mux_struct [-vh]\n" );
- fprintf( pErr, "\t performs MUX restructuring of the current network\n" );
- fprintf( pErr, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: mux_struct [-vh]\n" );
+ Abc_Print( -2, "\t performs MUX restructuring of the current network\n" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2820,7 +2871,6 @@ usage:
***********************************************************************/
int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int nThresh, nFaninMax, c;
int fCnf;
@@ -2830,8 +2880,6 @@ int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
nThresh = 1;
@@ -2848,7 +2896,7 @@ int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
nThresh = atoi(argv[globalUtilOptind]);
@@ -2859,7 +2907,7 @@ int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFaninMax = atoi(argv[globalUtilOptind]);
@@ -2888,12 +2936,12 @@ int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
+ Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
return 1;
}
@@ -2901,7 +2949,7 @@ int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkMulti( pNtk, nThresh, nFaninMax, fCnf, fMulti, fSimple, fFactor );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Renoding has failed.\n" );
+ Abc_Print( -1, "Renoding has failed.\n" );
return 1;
}
// replace the current network
@@ -2909,18 +2957,18 @@ int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: multi [-T num] [-F num] [-msfch]\n" );
- fprintf( pErr, "\t transforms an AIG into a logic network by creating larger nodes\n" );
- fprintf( pErr, "\t-F num : the maximum fanin size after renoding [default = %d]\n", nFaninMax );
- fprintf( pErr, "\t-T num : the threshold for AIG node duplication [default = %d]\n", nThresh );
- fprintf( pErr, "\t (an AIG node is the root of a new node after renoding\n" );
- fprintf( pErr, "\t if this leads to duplication of no more than %d AIG nodes,\n", nThresh );
- fprintf( pErr, "\t that is, if [(numFanouts(Node)-1) * size(MFFC(Node))] <= %d)\n", nThresh );
- fprintf( pErr, "\t-m : creates multi-input AND graph [default = %s]\n", fMulti? "yes": "no" );
- fprintf( pErr, "\t-s : creates a simple AIG (no renoding) [default = %s]\n", fSimple? "yes": "no" );
- fprintf( pErr, "\t-f : creates a factor-cut network [default = %s]\n", fFactor? "yes": "no" );
- fprintf( pErr, "\t-c : performs renoding to derive the CNF [default = %s]\n", fCnf? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: multi [-T num] [-F num] [-msfch]\n" );
+ Abc_Print( -2, "\t transforms an AIG into a logic network by creating larger nodes\n" );
+ Abc_Print( -2, "\t-F num : the maximum fanin size after renoding [default = %d]\n", nFaninMax );
+ Abc_Print( -2, "\t-T num : the threshold for AIG node duplication [default = %d]\n", nThresh );
+ Abc_Print( -2, "\t (an AIG node is the root of a new node after renoding\n" );
+ Abc_Print( -2, "\t if this leads to duplication of no more than %d AIG nodes,\n", nThresh );
+ Abc_Print( -2, "\t that is, if [(numFanouts(Node)-1) * size(MFFC(Node))] <= %d)\n", nThresh );
+ Abc_Print( -2, "\t-m : creates multi-input AND graph [default = %s]\n", fMulti? "yes": "no" );
+ Abc_Print( -2, "\t-s : creates a simple AIG (no renoding) [default = %s]\n", fSimple? "yes": "no" );
+ Abc_Print( -2, "\t-f : creates a factor-cut network [default = %s]\n", fFactor? "yes": "no" );
+ Abc_Print( -2, "\t-c : performs renoding to derive the CNF [default = %s]\n", fCnf? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -2937,7 +2985,6 @@ usage:
***********************************************************************/
int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int nLutSize, nCutsMax, c;
int nFlowIters, nAreaIters;
@@ -2950,8 +2997,6 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkRenode( Abc_Ntk_t * pNtk, int nLutSize, int nCutsMax, int nFlowIters, int nAreaIters, int fArea, int fUseBdds, int fUseSops, int fUseCnfs, int fUseMv, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
nLutSize = 8;
@@ -2972,7 +3017,7 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nLutSize = atoi(argv[globalUtilOptind]);
@@ -2983,7 +3028,7 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nCutsMax = atoi(argv[globalUtilOptind]);
@@ -2994,7 +3039,7 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
goto usage;
}
nFlowIters = atoi(argv[globalUtilOptind]);
@@ -3005,7 +3050,7 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'A':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
goto usage;
}
nAreaIters = atoi(argv[globalUtilOptind]);
@@ -3040,30 +3085,30 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( fUseBdds + fUseSops + fUseCnfs + fUseMv > 1 )
{
- fprintf( pErr, "Cannot optimize two parameters at the same time.\n" );
+ Abc_Print( -1, "Cannot optimize two parameters at the same time.\n" );
return 1;
}
if ( nLutSize < 3 || nLutSize > IF_MAX_FUNC_LUTSIZE )
{
- fprintf( pErr, "Incorrect LUT size (%d).\n", nLutSize );
+ Abc_Print( -1, "Incorrect LUT size (%d).\n", nLutSize );
return 1;
}
if ( nCutsMax < 1 || nCutsMax >= (1<<12) )
{
- fprintf( pErr, "Incorrect number of cuts.\n" );
+ Abc_Print( -1, "Incorrect number of cuts.\n" );
return 1;
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
+ Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
return 1;
}
@@ -3071,7 +3116,7 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkRenode( pNtk, nLutSize, nCutsMax, nFlowIters, nAreaIters, fArea, fUseBdds, fUseSops, fUseCnfs, fUseMv, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Renoding has failed.\n" );
+ Abc_Print( -1, "Renoding has failed.\n" );
return 1;
}
// replace the current network
@@ -3079,20 +3124,20 @@ int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: renode [-K num] [-C num] [-F num] [-A num] [-sbciav]\n" );
- fprintf( pErr, "\t transforms the AIG into a logic network with larger nodes\n" );
- fprintf( pErr, "\t while minimizing the number of FF literals of the node SOPs\n" );
- fprintf( pErr, "\t-K num : the max cut size for renoding (2 < num < %d) [default = %d]\n", IF_MAX_FUNC_LUTSIZE+1, nLutSize );
- fprintf( pErr, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCutsMax );
- fprintf( pErr, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", nFlowIters );
- fprintf( pErr, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", nAreaIters );
- fprintf( pErr, "\t-s : toggles minimizing SOP cubes instead of FF lits [default = %s]\n", fUseSops? "yes": "no" );
- fprintf( pErr, "\t-b : toggles minimizing BDD nodes instead of FF lits [default = %s]\n", fUseBdds? "yes": "no" );
- fprintf( pErr, "\t-c : toggles minimizing CNF clauses instead of FF lits [default = %s]\n", fUseCnfs? "yes": "no" );
- fprintf( pErr, "\t-i : toggles minimizing MV-SOP instead of FF lits [default = %s]\n", fUseMv? "yes": "no" );
- fprintf( pErr, "\t-a : toggles area-oriented mapping [default = %s]\n", fArea? "yes": "no" );
- fprintf( pErr, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: renode [-K num] [-C num] [-F num] [-A num] [-sbciav]\n" );
+ Abc_Print( -2, "\t transforms the AIG into a logic network with larger nodes\n" );
+ Abc_Print( -2, "\t while minimizing the number of FF literals of the node SOPs\n" );
+ Abc_Print( -2, "\t-K num : the max cut size for renoding (2 < num < %d) [default = %d]\n", IF_MAX_FUNC_LUTSIZE+1, nLutSize );
+ Abc_Print( -2, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCutsMax );
+ Abc_Print( -2, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", nFlowIters );
+ Abc_Print( -2, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", nAreaIters );
+ Abc_Print( -2, "\t-s : toggles minimizing SOP cubes instead of FF lits [default = %s]\n", fUseSops? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggles minimizing BDD nodes instead of FF lits [default = %s]\n", fUseBdds? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggles minimizing CNF clauses instead of FF lits [default = %s]\n", fUseCnfs? "yes": "no" );
+ Abc_Print( -2, "\t-i : toggles minimizing MV-SOP instead of FF lits [default = %s]\n", fUseMv? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", fArea? "yes": "no" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3109,7 +3154,6 @@ usage:
***********************************************************************/
int Abc_CommandCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fCleanupPis;
@@ -3119,8 +3163,6 @@ int Abc_CommandCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarCleanupAig( Abc_Ntk_t * pNtk, int fCleanupPis, int fCleanupPos, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fCleanupPis = 1;
@@ -3149,14 +3191,14 @@ int Abc_CommandCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
{
if ( !fCleanupPos && !fCleanupPos )
{
- printf( "Cleanup for PIs and POs is not enabled.\n" );
+ Abc_Print( -1, "Cleanup for PIs and POs is not enabled.\n" );
pNtkRes = Abc_NtkDup( pNtk );
}
else
@@ -3169,7 +3211,7 @@ int Abc_CommandCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Cleanup has failed.\n" );
+ Abc_Print( -1, "Cleanup has failed.\n" );
return 1;
}
// replace the current network
@@ -3177,13 +3219,13 @@ int Abc_CommandCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: cleanup [-iovh]\n" );
- fprintf( pErr, "\t for logic networks, removes dangling combinatinal logic\n" );
- fprintf( pErr, "\t for AIGs, removes PIs w/o fanout and POs driven by const-0\n" );
- fprintf( pErr, "\t-i : toggles removing PIs without fanout [default = %s]\n", fCleanupPis? "yes": "no" );
- fprintf( pErr, "\t-o : toggles removing POs with const-0 drivers [default = %s]\n", fCleanupPos? "yes": "no" );
- fprintf( pErr, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: cleanup [-iovh]\n" );
+ Abc_Print( -2, "\t for logic networks, removes dangling combinatinal logic\n" );
+ Abc_Print( -2, "\t for AIGs, removes PIs w/o fanout and POs driven by const-0\n" );
+ Abc_Print( -2, "\t-i : toggles removing PIs without fanout [default = %s]\n", fCleanupPis? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggles removing POs with const-0 drivers [default = %s]\n", fCleanupPos? "yes": "no" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3200,14 +3242,9 @@ usage:
***********************************************************************/
int Abc_CommandSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -3223,12 +3260,12 @@ int Abc_CommandSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "The classical (SIS-like) sweep can only be performed on a logic network.\n" );
+ Abc_Print( -1, "The classical (SIS-like) sweep can only be performed on a logic network.\n" );
return 1;
}
// modify the current network
@@ -3236,9 +3273,9 @@ int Abc_CommandSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: sweep [-h]\n" );
- fprintf( pErr, "\t removes dangling nodes; propagates constant, buffers, inverters\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: sweep [-h]\n" );
+ Abc_Print( -2, "\t removes dangling nodes; propagates constant, buffers, inverters\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3256,17 +3293,12 @@ usage:
***********************************************************************/
int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- Abc_Ntk_t * pNtk;
- FILE * pOut, * pErr;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Fxu_Data_t * p = NULL;
int c;
- extern bool Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p );
+ extern int Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p );
extern void Abc_NtkFxuFreeInfo( Fxu_Data_t * p );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// allocate the structure
p = ABC_ALLOC( Fxu_Data_t, 1 );
memset( p, 0, sizeof(Fxu_Data_t) );
@@ -3287,7 +3319,7 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
p->nSingleMax = atoi(argv[globalUtilOptind]);
@@ -3298,7 +3330,7 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
p->nPairsMax = atoi(argv[globalUtilOptind]);
@@ -3309,7 +3341,7 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
p->nNodesExt = atoi(argv[globalUtilOptind]);
@@ -3342,21 +3374,21 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
Abc_NtkFxuFreeInfo( p );
return 1;
}
if ( Abc_NtkNodeNum(pNtk) == 0 )
{
- fprintf( pErr, "The network does not have internal nodes.\n" );
+ Abc_Print( -1, "The network does not have internal nodes.\n" );
Abc_NtkFxuFreeInfo( p );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Fast extract can only be applied to a logic network (run \"renode\").\n" );
+ Abc_Print( -1, "Fast extract can only be applied to a logic network (run \"renode\").\n" );
Abc_NtkFxuFreeInfo( p );
return 1;
}
@@ -3368,17 +3400,17 @@ int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: fx [-SDN num] [-sdzcvh]\n");
- fprintf( pErr, "\t performs unate fast extract on the current network\n");
- fprintf( pErr, "\t-S num : max number of single-cube divisors to consider [default = %d]\n", p->nSingleMax );
- fprintf( pErr, "\t-D num : max number of double-cube divisors to consider [default = %d]\n", p->nPairsMax );
- fprintf( pErr, "\t-N num : the maximum number of divisors to extract [default = %d]\n", p->nNodesExt );
- fprintf( pErr, "\t-s : use only single-cube divisors [default = %s]\n", p->fOnlyS? "yes": "no" );
- fprintf( pErr, "\t-d : use only double-cube divisors [default = %s]\n", p->fOnlyD? "yes": "no" );
- fprintf( pErr, "\t-z : use zero-weight divisors [default = %s]\n", p->fUse0? "yes": "no" );
- fprintf( pErr, "\t-c : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" );
- fprintf( pErr, "\t-v : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fx [-SDN num] [-sdzcvh]\n");
+ Abc_Print( -2, "\t performs unate fast extract on the current network\n");
+ Abc_Print( -2, "\t-S num : max number of single-cube divisors to consider [default = %d]\n", p->nSingleMax );
+ Abc_Print( -2, "\t-D num : max number of double-cube divisors to consider [default = %d]\n", p->nPairsMax );
+ Abc_Print( -2, "\t-N num : the maximum number of divisors to extract [default = %d]\n", p->nNodesExt );
+ Abc_Print( -2, "\t-s : use only single-cube divisors [default = %s]\n", p->fOnlyS? "yes": "no" );
+ Abc_Print( -2, "\t-d : use only double-cube divisors [default = %s]\n", p->fOnlyD? "yes": "no" );
+ Abc_Print( -2, "\t-z : use zero-weight divisors [default = %s]\n", p->fUse0? "yes": "no" );
+ Abc_Print( -2, "\t-c : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
Abc_NtkFxuFreeInfo( p );
return 1;
}
@@ -3396,18 +3428,13 @@ usage:
***********************************************************************/
int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- Abc_Ntk_t * pNtk;
- FILE * pOut, * pErr;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int nMaxSize;
int fReverse;
int fVerbose;
int c;
extern int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set the defaults
nMaxSize = 8;
fReverse = 0;
@@ -3420,7 +3447,7 @@ int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
goto usage;
}
nMaxSize = atoi(argv[globalUtilOptind]);
@@ -3444,19 +3471,19 @@ int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkNodeNum(pNtk) == 0 )
{
- fprintf( pErr, "The network does not have internal nodes.\n" );
+ Abc_Print( -1, "The network does not have internal nodes.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command can only be applied to a logic network (run \"renode\" or \"if\").\n" );
+ Abc_Print( -1, "This command can only be applied to a logic network (run \"renode\" or \"if\").\n" );
return 1;
}
@@ -3465,12 +3492,12 @@ int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: eliminate [-N num] [-rvh]\n");
- fprintf( pErr, "\t greedily eliminates nodes by collapsing them into fanouts\n");
- fprintf( pErr, "\t-N num : the maximum support size after collapsing [default = %d]\n", nMaxSize );
- fprintf( pErr, "\t-r : use the reverse topological order [default = %s]\n", fReverse? "yes": "no" );
- fprintf( pErr, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: eliminate [-N num] [-rvh]\n");
+ Abc_Print( -2, "\t greedily eliminates nodes by collapsing them into fanouts\n");
+ Abc_Print( -2, "\t-N num : the maximum support size after collapsing [default = %d]\n", nMaxSize );
+ Abc_Print( -2, "\t-r : use the reverse topological order [default = %s]\n", fReverse? "yes": "no" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3487,17 +3514,13 @@ usage:
***********************************************************************/
int Abc_CommandDisjoint( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes, * pNtkNew;
int fGlobal, fRecursive, fVerbose, fPrint, fShort, c;
- extern Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, bool fVerbose, bool fPrint, bool fShort );
- extern int Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, bool fVerbose, bool fRecursive );
+ extern Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int fShort );
+ extern int Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, int fVerbose, int fRecursive );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fGlobal = 1;
fRecursive = 0;
@@ -3534,13 +3557,13 @@ int Abc_CommandDisjoint( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( fGlobal )
{
-// fprintf( stdout, "Performing DSD of global functions of the network.\n" );
+// Abc_Print( -1, "Performing DSD of global functions of the network.\n" );
// get the new network
if ( !Abc_NtkIsStrash(pNtk) )
{
@@ -3554,7 +3577,7 @@ int Abc_CommandDisjoint( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Global DSD has failed.\n" );
+ Abc_Print( -1, "Global DSD has failed.\n" );
return 1;
}
// replace the current network
@@ -3564,35 +3587,35 @@ int Abc_CommandDisjoint( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( !Abc_NtkIsBddLogic( pNtk ) )
{
- fprintf( pErr, "This command is only applicable to logic BDD networks.\n" );
+ Abc_Print( -1, "This command is only applicable to logic BDD networks.\n" );
return 1;
}
- fprintf( stdout, "Performing recursive DSD and MUX decomposition of local functions.\n" );
+ Abc_Print( -1, "Performing recursive DSD and MUX decomposition of local functions.\n" );
if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
- fprintf( pErr, "Recursive DSD has failed.\n" );
+ Abc_Print( -1, "Recursive DSD has failed.\n" );
}
else
{
if ( !Abc_NtkIsBddLogic( pNtk ) )
{
- fprintf( pErr, "This command is only applicable to logic BDD networks (run \"bdd\").\n" );
+ Abc_Print( -1, "This command is only applicable to logic BDD networks (run \"bdd\").\n" );
return 1;
}
- fprintf( stdout, "Performing simple non-recursive DSD of local functions.\n" );
+ Abc_Print( -1, "Performing simple non-recursive DSD of local functions.\n" );
if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
- fprintf( pErr, "Simple DSD of local functions has failed.\n" );
+ Abc_Print( -1, "Simple DSD of local functions has failed.\n" );
}
return 0;
usage:
- fprintf( pErr, "usage: dsd [-grvpsh]\n" );
- fprintf( pErr, "\t decomposes the network using disjoint-support decomposition\n" );
- fprintf( pErr, "\t-g : toggle DSD of global and local functions [default = %s]\n", fGlobal? "global": "local" );
- fprintf( pErr, "\t-r : toggle recursive DSD/MUX and simple DSD [default = %s]\n", fRecursive? "recursive DSD/MUX": "simple DSD" );
- fprintf( pErr, "\t-v : prints DSD statistics and runtime [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-p : prints DSD structure to the standard output [default = %s]\n", fPrint? "yes": "no" );
- fprintf( pErr, "\t-s : use short PI names when printing DSD structure [default = %s]\n", fShort? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dsd [-grvpsh]\n" );
+ Abc_Print( -2, "\t decomposes the network using disjoint-support decomposition\n" );
+ Abc_Print( -2, "\t-g : toggle DSD of global and local functions [default = %s]\n", fGlobal? "global": "local" );
+ Abc_Print( -2, "\t-r : toggle recursive DSD/MUX and simple DSD [default = %s]\n", fRecursive? "recursive DSD/MUX": "simple DSD" );
+ Abc_Print( -2, "\t-v : prints DSD statistics and runtime [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-p : prints DSD structure to the standard output [default = %s]\n", fPrint? "yes": "no" );
+ Abc_Print( -2, "\t-s : use short PI names when printing DSD structure [default = %s]\n", fShort? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3609,15 +3632,11 @@ usage:
***********************************************************************/
int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Lpk_Par_t Pars, * pPars = &Pars;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
memset( pPars, 0, sizeof(Lpk_Par_t) );
pPars->nLutsMax = 4; // (N) the maximum number of LUTs in the structure
@@ -3638,7 +3657,7 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nLutsMax = atoi(argv[globalUtilOptind]);
@@ -3649,7 +3668,7 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'Q':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-Q\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
goto usage;
}
pPars->nLutsOver = atoi(argv[globalUtilOptind]);
@@ -3660,7 +3679,7 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nVarsShared = atoi(argv[globalUtilOptind]);
@@ -3671,7 +3690,7 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
@@ -3706,45 +3725,45 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command can only be applied to a logic network.\n" );
+ Abc_Print( -1, "This command can only be applied to a logic network.\n" );
return 1;
}
if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 3 )
{
- fprintf( pErr, "The number of shared variables (%d) is not in the range 0 <= S <= 3.\n", pPars->nVarsShared );
+ Abc_Print( -1, "The number of shared variables (%d) is not in the range 0 <= S <= 3.\n", pPars->nVarsShared );
return 1;
}
// modify the current network
if ( !Lpk_Resynthesize( pNtk, pPars ) )
{
- fprintf( pErr, "Resynthesis has failed.\n" );
+ Abc_Print( -1, "Resynthesis has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: lutpack [-N <num>] [-Q <num>] [-S <num>] [-L <num>] [-szfovwh]\n" );
- fprintf( pErr, "\t performs \"rewriting\" for LUT network;\n" );
- fprintf( pErr, "\t determines LUT size as the max fanin count of a node;\n" );
- fprintf( pErr, "\t if the network is not LUT-mapped, packs it into 6-LUTs\n" );
- fprintf( pErr, "\t (there is another command for resynthesis after LUT mapping, \"imfs\")\n" );
- fprintf( pErr, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
- fprintf( pErr, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
- fprintf( pErr, "\t-S <num> : the max number of LUT inputs shared (0 <= num <= 3) [default = %d]\n", pPars->nVarsShared );
- fprintf( pErr, "\t-L <num> : max level increase after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
- fprintf( pErr, "\t-s : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
- fprintf( pErr, "\t-z : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
- fprintf( pErr, "\t-f : toggle using only first node and first cut [default = %s]\n", pPars->fFirst? "yes": "no" );
- fprintf( pErr, "\t-o : toggle using old implementation [default = %s]\n", pPars->fOldAlgo? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle detailed printout of decomposed functions [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: lutpack [-N <num>] [-Q <num>] [-S <num>] [-L <num>] [-szfovwh]\n" );
+ Abc_Print( -2, "\t performs \"rewriting\" for LUT network;\n" );
+ Abc_Print( -2, "\t determines LUT size as the max fanin count of a node;\n" );
+ Abc_Print( -2, "\t if the network is not LUT-mapped, packs it into 6-LUTs\n" );
+ Abc_Print( -2, "\t (there is another command for resynthesis after LUT mapping, \"imfs\")\n" );
+ Abc_Print( -2, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
+ Abc_Print( -2, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
+ Abc_Print( -2, "\t-S <num> : the max number of LUT inputs shared (0 <= num <= 3) [default = %d]\n", pPars->nVarsShared );
+ Abc_Print( -2, "\t-L <num> : max level increase after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+ Abc_Print( -2, "\t-s : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle using only first node and first cut [default = %s]\n", pPars->fFirst? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggle using old implementation [default = %s]\n", pPars->fOldAlgo? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle detailed printout of decomposed functions [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3761,7 +3780,6 @@ usage:
***********************************************************************/
int Abc_CommandLutmin( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int nLutSize;
@@ -3769,9 +3787,6 @@ int Abc_CommandLutmin( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkLutmin( Abc_Ntk_t * pNtk, int nLutSize, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nLutSize = 4;
fVerbose = 0;
@@ -3783,7 +3798,7 @@ int Abc_CommandLutmin( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nLutSize = atoi(argv[globalUtilOptind]);
@@ -3800,14 +3815,14 @@ int Abc_CommandLutmin( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// modify the current network
pNtkRes = Abc_NtkLutmin( pNtk, nLutSize, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "The command has failed.\n" );
+ Abc_Print( -1, "The command has failed.\n" );
return 1;
}
// replace the current network
@@ -3815,13 +3830,13 @@ int Abc_CommandLutmin( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: lutmin [-K <num>] [-vh]\n" );
- fprintf( pErr, "\t perform FPGA mapping while minimizing the LUT count\n" );
- fprintf( pErr, "\t as described in the paper T. Sasao and A. Mishchenko:\n" );
- fprintf( pErr, "\t \"On the number of LUTs to implement logic functions\".\n" );
- fprintf( pErr, "\t-K <num> : the LUT size to use for the mapping (2 <= num) [default = %d]\n", nLutSize );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: lutmin [-K <num>] [-vh]\n" );
+ Abc_Print( -2, "\t perform FPGA mapping while minimizing the LUT count\n" );
+ Abc_Print( -2, "\t as described in the paper T. Sasao and A. Mishchenko:\n" );
+ Abc_Print( -2, "\t \"On the number of LUTs to implement logic functions\".\n" );
+ Abc_Print( -2, "\t-K <num> : the LUT size to use for the mapping (2 <= num) [default = %d]\n", nLutSize );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3838,18 +3853,10 @@ usage:
***********************************************************************/
int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Res_Par_t Pars, * pPars = &Pars;
int c;
-// printf( "Implementation of this command is not finished.\n" );
-// return 1;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
pPars->nWindow = 62;
pPars->nCands = 5;
@@ -3866,7 +3873,7 @@ int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWindow = atoi(argv[globalUtilOptind]);
@@ -3877,7 +3884,7 @@ int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nSimWords = atoi(argv[globalUtilOptind]);
@@ -3888,7 +3895,7 @@ int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nCands = atoi(argv[globalUtilOptind]);
@@ -3899,7 +3906,7 @@ int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
@@ -3925,35 +3932,35 @@ int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command can only be applied to a logic network.\n" );
+ Abc_Print( -1, "This command can only be applied to a logic network.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkResynthesize( pNtk, pPars ) )
{
- fprintf( pErr, "Resynthesis has failed.\n" );
+ Abc_Print( -1, "Resynthesis has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: imfs [-W <NM>] [-L <num>] [-C <num>] [-S <num>] [-avwh]\n" );
- fprintf( pErr, "\t performs resubstitution-based resynthesis with interpolation\n" );
- fprintf( pErr, "\t (there is another command for resynthesis after LUT mapping, \"lutpack\")\n" );
- fprintf( pErr, "\t-W <NM> : fanin/fanout levels (NxM) of the window (00 <= NM <= 99) [default = %d%d]\n", pPars->nWindow/10, pPars->nWindow%10 );
- fprintf( pErr, "\t-C <num> : the max number of resub candidates (1 <= n) [default = %d]\n", pPars->nCands );
- fprintf( pErr, "\t-S <num> : the number of simulation words (1 <= n <= 256) [default = %d]\n", pPars->nSimWords );
- fprintf( pErr, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
- fprintf( pErr, "\t-a : toggle optimization for area only [default = %s]\n", pPars->fArea? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: imfs [-W <NM>] [-L <num>] [-C <num>] [-S <num>] [-avwh]\n" );
+ Abc_Print( -2, "\t performs resubstitution-based resynthesis with interpolation\n" );
+ Abc_Print( -2, "\t (there is another command for resynthesis after LUT mapping, \"lutpack\")\n" );
+ Abc_Print( -2, "\t-W <NM> : fanin/fanout levels (NxM) of the window (00 <= NM <= 99) [default = %d%d]\n", pPars->nWindow/10, pPars->nWindow%10 );
+ Abc_Print( -2, "\t-C <num> : the max number of resub candidates (1 <= n) [default = %d]\n", pPars->nCands );
+ Abc_Print( -2, "\t-S <num> : the number of simulation words (1 <= n <= 256) [default = %d]\n", pPars->nSimWords );
+ Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+ Abc_Print( -2, "\t-a : toggle optimization for area only [default = %s]\n", pPars->fArea? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -3970,18 +3977,9 @@ usage:
***********************************************************************/
int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Mfs_Par_t Pars, * pPars = &Pars;
int c;
-
-// printf( "Implementation of this command is not finished.\n" );
-// return 1;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Abc_NtkMfsParsDefault( pPars );
Extra_UtilGetoptReset();
@@ -3992,7 +3990,7 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWinTfoLevs = atoi(argv[globalUtilOptind]);
@@ -4003,7 +4001,7 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFanoutsMax = atoi(argv[globalUtilOptind]);
@@ -4014,7 +4012,7 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nDepthMax = atoi(argv[globalUtilOptind]);
@@ -4025,7 +4023,7 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-M\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWinSizeMax = atoi(argv[globalUtilOptind]);
@@ -4036,7 +4034,7 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
@@ -4047,7 +4045,7 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -4091,42 +4089,42 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command can only be applied to a logic network.\n" );
+ Abc_Print( -1, "This command can only be applied to a logic network.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkMfs( pNtk, pPars ) )
{
- fprintf( pErr, "Resynthesis has failed.\n" );
+ Abc_Print( -1, "Resynthesis has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: mfs [-WFDMLC <num>] [-raestpgvh]\n" );
- fprintf( pErr, "\t performs don't-care-based optimization of logic networks\n" );
- fprintf( pErr, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
- fprintf( pErr, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
- fprintf( pErr, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
- fprintf( pErr, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax );
- fprintf( pErr, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
- fprintf( pErr, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
- fprintf( pErr, "\t-r : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
- fprintf( pErr, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
- fprintf( pErr, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
- fprintf( pErr, "\t-s : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
- fprintf( pErr, "\t-t : toggle using artificial one-hotness conditions [default = %s]\n", pPars->fOneHotness? "yes": "no" );
- fprintf( pErr, "\t-p : toggle power-aware optimization [default = %s]\n", pPars->fPower? "yes": "no" );
- fprintf( pErr, "\t-g : toggle using new SAT solver [default = %s]\n", pPars->fGiaSat? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: mfs [-WFDMLC <num>] [-raestpgvh]\n" );
+ Abc_Print( -2, "\t performs don't-care-based optimization of logic networks\n" );
+ Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
+ Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
+ Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
+ Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax );
+ Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+ Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-r : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
+ Abc_Print( -2, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
+ Abc_Print( -2, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle using artificial one-hotness conditions [default = %s]\n", pPars->fOneHotness? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle power-aware optimization [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggle using new SAT solver [default = %s]\n", pPars->fGiaSat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4144,17 +4142,12 @@ usage:
***********************************************************************/
int Abc_CommandTrace( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseLutLib;
int fVerbose;
extern void Abc_NtkDelayTracePrint( Abc_Ntk_t * pNtk, int fUseLutLib, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseLutLib = 0;
fVerbose = 0;
@@ -4178,12 +4171,12 @@ int Abc_CommandTrace( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command can only be applied to a logic network.\n" );
+ Abc_Print( -1, "This command can only be applied to a logic network.\n" );
return 1;
}
@@ -4192,11 +4185,11 @@ int Abc_CommandTrace( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: trace [-lvh]\n" );
- fprintf( pErr, "\t performs delay trace of LUT-mapped network\n" );
- fprintf( pErr, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
- fprintf( pErr, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: trace [-lvh]\n" );
+ Abc_Print( -2, "\t performs delay trace of LUT-mapped network\n" );
+ Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4213,7 +4206,6 @@ usage:
***********************************************************************/
int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fUseLutLib;
@@ -4222,10 +4214,7 @@ int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVerbose;
int fVeryVerbose;
extern Abc_Ntk_t * Abc_NtkSpeedup( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fUseLutLib = 0;
@@ -4241,7 +4230,7 @@ int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
Percentage = atoi(argv[globalUtilOptind]);
@@ -4252,7 +4241,7 @@ int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
Degree = atoi(argv[globalUtilOptind]);
@@ -4278,12 +4267,12 @@ int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command can only be applied to a logic network.\n" );
+ Abc_Print( -1, "This command can only be applied to a logic network.\n" );
return 1;
}
@@ -4291,7 +4280,7 @@ int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkSpeedup( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "The command has failed.\n" );
+ Abc_Print( -1, "The command has failed.\n" );
return 1;
}
// replace the current network
@@ -4299,15 +4288,15 @@ int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: speedup [-P num] [-N num] [-lvwh]\n" );
- fprintf( pErr, "\t transforms LUT-mapped network into an AIG with choices;\n" );
- fprintf( pErr, "\t the choices are added to speedup the next round of mapping\n" );
- fprintf( pErr, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
- fprintf( pErr, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
- fprintf( pErr, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
- fprintf( pErr, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: speedup [-P num] [-N num] [-lvwh]\n" );
+ Abc_Print( -2, "\t transforms LUT-mapped network into an AIG with choices;\n" );
+ Abc_Print( -2, "\t the choices are added to speedup the next round of mapping\n" );
+ Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
+ Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
+ Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4324,7 +4313,6 @@ usage:
***********************************************************************/
int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fUseLutLib;
@@ -4335,9 +4323,6 @@ int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseLutLib = 0;
Percentage =10;
@@ -4352,7 +4337,7 @@ int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
Percentage = atoi(argv[globalUtilOptind]);
@@ -4363,7 +4348,7 @@ int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
Degree = atoi(argv[globalUtilOptind]);
@@ -4389,12 +4374,12 @@ int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command can only be applied to a logic network.\n" );
+ Abc_Print( -1, "This command can only be applied to a logic network.\n" );
return 1;
}
@@ -4402,7 +4387,7 @@ int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkPowerdown( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "The command has failed.\n" );
+ Abc_Print( -1, "The command has failed.\n" );
return 1;
}
// replace the current network
@@ -4410,16 +4395,16 @@ int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: powerdown [-P num] [-N num] [-vwh]\n" );
- fprintf( pErr, "\t transforms LUT-mapped network into an AIG with choices;\n" );
- fprintf( pErr, "\t the choices are added to power down the next round of mapping\n" );
- fprintf( pErr, "\t-P <num> : switching propability delta defining power critical edges [default = %d%%]\n", Percentage );
- fprintf( pErr, "\t (e.g. 5% means hot wires switch with probability: 0.45 <= p <= 0.50 (max)\n" );
- fprintf( pErr, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
-// fprintf( pErr, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
- fprintf( pErr, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: powerdown [-P num] [-N num] [-vwh]\n" );
+ Abc_Print( -2, "\t transforms LUT-mapped network into an AIG with choices;\n" );
+ Abc_Print( -2, "\t the choices are added to power down the next round of mapping\n" );
+ Abc_Print( -2, "\t-P <num> : switching propability delta defining power critical edges [default = %d%%]\n", Percentage );
+ Abc_Print( -2, "\t (e.g. 5% means hot wires switch with probability: 0.45 <= p <= 0.50 (max)\n" );
+ Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
+// Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4436,13 +4421,11 @@ usage:
***********************************************************************/
int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Nwk_LMPars_t Pars, * pPars = &Pars;
Vec_Int_t * vResult;
int c;
extern Vec_Int_t * Abc_NtkLutMerge( Abc_Ntk_t * pNtk, Nwk_LMPars_t * pPars );
- pNtk = Abc_FrameReadNtk(pAbc);
-
// set defaults
memset( pPars, 0, sizeof(Nwk_LMPars_t) );
pPars->nMaxLutSize = 5; // the max LUT size for merging (N=5)
@@ -4462,7 +4445,7 @@ int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLutSize = atoi(argv[globalUtilOptind]);
@@ -4473,7 +4456,7 @@ int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxSuppSize = atoi(argv[globalUtilOptind]);
@@ -4484,7 +4467,7 @@ int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxDistance = atoi(argv[globalUtilOptind]);
@@ -4495,7 +4478,7 @@ int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLevelDiff = atoi(argv[globalUtilOptind]);
@@ -4506,7 +4489,7 @@ int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxFanout = atoi(argv[globalUtilOptind]);
@@ -4534,7 +4517,7 @@ int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL || !Abc_NtkIsLogic(pNtk) )
{
- printf( "Abc_CommandSpeedup(): There is no mapped network to merge LUTs.\n" );
+ Abc_Print( -1, "Abc_CommandMerge(): There is no mapped network to merge LUTs.\n" );
return 1;
}
@@ -4543,18 +4526,18 @@ int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: merge [-NSDLF num] [-scwvh]\n" );
- fprintf( stdout, "\t creates pairs of topologically-related LUTs\n" );
- fprintf( stdout, "\t-N <num> : the max LUT size for merging (1 < num) [default = %d]\n", pPars->nMaxLutSize );
- fprintf( stdout, "\t-S <num> : the max total support size after merging (1 < num) [default = %d]\n", pPars->nMaxSuppSize );
- fprintf( stdout, "\t-D <num> : the max distance in terms of LUTs (0 < num) [default = %d]\n", pPars->nMaxDistance );
- fprintf( stdout, "\t-L <num> : the max difference in levels (0 <= num) [default = %d]\n", pPars->nMaxLevelDiff );
- fprintf( stdout, "\t-F <num> : the max number of fanouts to stop traversal (0 < num) [default = %d]\n", pPars->nMaxFanout );
- fprintf( stdout, "\t-s : toggle the use of nodes without support overlap [default = %s]\n", pPars->fUseDiffSupp? "yes" : "no" );
- fprintf( stdout, "\t-c : toggle the use of TFI/TFO nodes as candidates [default = %s]\n", pPars->fUseTfiTfo? "yes" : "no" );
- fprintf( stdout, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: merge [-NSDLF num] [-scwvh]\n" );
+ Abc_Print( -2, "\t creates pairs of topologically-related LUTs\n" );
+ Abc_Print( -2, "\t-N <num> : the max LUT size for merging (1 < num) [default = %d]\n", pPars->nMaxLutSize );
+ Abc_Print( -2, "\t-S <num> : the max total support size after merging (1 < num) [default = %d]\n", pPars->nMaxSuppSize );
+ Abc_Print( -2, "\t-D <num> : the max distance in terms of LUTs (0 < num) [default = %d]\n", pPars->nMaxDistance );
+ Abc_Print( -2, "\t-L <num> : the max difference in levels (0 <= num) [default = %d]\n", pPars->nMaxLevelDiff );
+ Abc_Print( -2, "\t-F <num> : the max number of fanouts to stop traversal (0 < num) [default = %d]\n", pPars->nMaxFanout );
+ Abc_Print( -2, "\t-s : toggle the use of nodes without support overlap [default = %s]\n", pPars->fUseDiffSupp? "yes" : "no" );
+ Abc_Print( -2, "\t-c : toggle the use of TFI/TFO nodes as candidates [default = %s]\n", pPars->fUseTfiTfo? "yes" : "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4571,22 +4554,17 @@ usage:
***********************************************************************/
int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
- bool fUpdateLevel;
- bool fPrecompute;
- bool fUseZeros;
- bool fVerbose;
- bool fVeryVerbose;
- bool fPlaceEnable;
+ int fUpdateLevel;
+ int fPrecompute;
+ int fUseZeros;
+ int fVerbose;
+ int fVeryVerbose;
+ int fPlaceEnable;
// external functions
extern void Rwr_Precompute();
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUpdateLevel = 1;
fPrecompute = 0;
@@ -4632,37 +4610,37 @@ int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command can only be applied to an AIG (run \"strash\").\n" );
+ Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+ Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkRewrite( pNtk, fUpdateLevel, fUseZeros, fVerbose, fVeryVerbose, fPlaceEnable ) )
{
- fprintf( pErr, "Rewriting has failed.\n" );
+ Abc_Print( -1, "Rewriting has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: rewrite [-lzvwh]\n" );
- fprintf( pErr, "\t performs technology-independent rewriting of the AIG\n" );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle printout subgraph statistics [default = %s]\n", fVeryVerbose? "yes": "no" );
-// fprintf( pErr, "\t-p : toggle placement-aware rewriting [default = %s]\n", fPlaceEnable? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: rewrite [-lzvwh]\n" );
+ Abc_Print( -2, "\t performs technology-independent rewriting of the AIG\n" );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printout subgraph statistics [default = %s]\n", fVeryVerbose? "yes": "no" );
+// Abc_Print( -2, "\t-p : toggle placement-aware rewriting [default = %s]\n", fPlaceEnable? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4679,20 +4657,15 @@ usage:
***********************************************************************/
int Abc_CommandRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nNodeSizeMax;
int nConeSizeMax;
- bool fUpdateLevel;
- bool fUseZeros;
- bool fUseDcs;
- bool fVerbose;
- extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+ int fUpdateLevel;
+ int fUseZeros;
+ int fUseDcs;
+ int fVerbose;
+ extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose );
// set defaults
nNodeSizeMax = 10;
@@ -4709,7 +4682,7 @@ int Abc_CommandRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nNodeSizeMax = atoi(argv[globalUtilOptind]);
@@ -4720,7 +4693,7 @@ int Abc_CommandRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConeSizeMax = atoi(argv[globalUtilOptind]);
@@ -4749,44 +4722,44 @@ int Abc_CommandRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command can only be applied to an AIG (run \"strash\").\n" );
+ Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+ Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
return 1;
}
if ( fUseDcs && nNodeSizeMax >= nConeSizeMax )
{
- fprintf( pErr, "For don't-care to work, containing cone should be larger than collapsed node.\n" );
+ Abc_Print( -1, "For don't-care to work, containing cone should be larger than collapsed node.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkRefactor( pNtk, nNodeSizeMax, nConeSizeMax, fUpdateLevel, fUseZeros, fUseDcs, fVerbose ) )
{
- fprintf( pErr, "Refactoring has failed.\n" );
+ Abc_Print( -1, "Refactoring has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: refactor [-N num] [-C num] [-lzdvh]\n" );
- fprintf( pErr, "\t performs technology-independent refactoring of the AIG\n" );
- fprintf( pErr, "\t-N num : the max support of the collapsed node [default = %d]\n", nNodeSizeMax );
- fprintf( pErr, "\t-C num : the max support of the containing cone [default = %d]\n", nConeSizeMax );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
- fprintf( pErr, "\t-d : toggle using don't-cares [default = %s]\n", fUseDcs? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: refactor [-N num] [-C num] [-lzdvh]\n" );
+ Abc_Print( -2, "\t performs technology-independent refactoring of the AIG\n" );
+ Abc_Print( -2, "\t-N num : the max support of the collapsed node [default = %d]\n", nNodeSizeMax );
+ Abc_Print( -2, "\t-C num : the max support of the containing cone [default = %d]\n", nConeSizeMax );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggle using don't-cares [default = %s]\n", fUseDcs? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4803,18 +4776,13 @@ usage:
***********************************************************************/
int Abc_CommandRestructure( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nCutsMax;
- bool fUpdateLevel;
- bool fUseZeros;
- bool fVerbose;
- extern int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutsMax, bool fUpdateLevel, bool fUseZeros, bool fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+ int fUpdateLevel;
+ int fUseZeros;
+ int fVerbose;
+ extern int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutsMax, int fUpdateLevel, int fUseZeros, int fVerbose );
// set defaults
nCutsMax = 5;
@@ -4829,7 +4797,7 @@ int Abc_CommandRestructure( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nCutsMax = atoi(argv[globalUtilOptind]);
@@ -4855,41 +4823,41 @@ int Abc_CommandRestructure( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( nCutsMax < 4 || nCutsMax > CUT_SIZE_MAX )
{
- fprintf( pErr, "Can only compute the cuts for %d <= K <= %d.\n", 4, CUT_SIZE_MAX );
+ Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", 4, CUT_SIZE_MAX );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command can only be applied to an AIG (run \"strash\").\n" );
+ Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+ Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkRestructure( pNtk, nCutsMax, fUpdateLevel, fUseZeros, fVerbose ) )
{
- fprintf( pErr, "Refactoring has failed.\n" );
+ Abc_Print( -1, "Refactoring has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: restructure [-K num] [-lzvh]\n" );
- fprintf( pErr, "\t performs technology-independent restructuring of the AIG\n" );
- fprintf( pErr, "\t-K num : the max cut size (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, nCutsMax );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: restructure [-K num] [-lzvh]\n" );
+ Abc_Print( -2, "\t performs technology-independent restructuring of the AIG\n" );
+ Abc_Print( -2, "\t-K num : the max cut size (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, nCutsMax );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -4906,23 +4874,18 @@ usage:
***********************************************************************/
int Abc_CommandResubstitute( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int RS_CUT_MIN = 4;
int RS_CUT_MAX = 16;
int c;
int nCutsMax;
int nNodesMax;
int nLevelsOdc;
- bool fUpdateLevel;
- bool fUseZeros;
- bool fVerbose;
- bool fVeryVerbose;
- extern int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutsMax, int nNodesMax, int nLevelsOdc, bool fUpdateLevel, bool fVerbose, bool fVeryVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+ int fUpdateLevel;
+ int fUseZeros;
+ int fVerbose;
+ int fVeryVerbose;
+ extern int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutsMax, int nNodesMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose );
// set defaults
nCutsMax = 8;
@@ -4940,7 +4903,7 @@ int Abc_CommandResubstitute( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nCutsMax = atoi(argv[globalUtilOptind]);
@@ -4951,7 +4914,7 @@ int Abc_CommandResubstitute( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nNodesMax = atoi(argv[globalUtilOptind]);
@@ -4962,7 +4925,7 @@ int Abc_CommandResubstitute( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nLevelsOdc = atoi(argv[globalUtilOptind]);
@@ -4991,49 +4954,49 @@ int Abc_CommandResubstitute( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( nCutsMax < RS_CUT_MIN || nCutsMax > RS_CUT_MAX )
{
- fprintf( pErr, "Can only compute cuts for %d <= K <= %d.\n", RS_CUT_MIN, RS_CUT_MAX );
+ Abc_Print( -1, "Can only compute cuts for %d <= K <= %d.\n", RS_CUT_MIN, RS_CUT_MAX );
return 1;
}
if ( nNodesMax < 0 || nNodesMax > 3 )
{
- fprintf( pErr, "Can only resubstitute at most 3 nodes.\n" );
+ Abc_Print( -1, "Can only resubstitute at most 3 nodes.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command can only be applied to an AIG (run \"strash\").\n" );
+ Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+ Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkResubstitute( pNtk, nCutsMax, nNodesMax, nLevelsOdc, fUpdateLevel, fVerbose, fVeryVerbose ) )
{
- fprintf( pErr, "Refactoring has failed.\n" );
+ Abc_Print( -1, "Refactoring has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: resub [-K num] [-N num] [-F num] [-lzvwh]\n" );
- fprintf( pErr, "\t performs technology-independent restructuring of the AIG\n" );
- fprintf( pErr, "\t-K num : the max cut size (%d <= num <= %d) [default = %d]\n", RS_CUT_MIN, RS_CUT_MAX, nCutsMax );
- fprintf( pErr, "\t-N num : the max number of nodes to add (0 <= num <= 3) [default = %d]\n", nNodesMax );
- fprintf( pErr, "\t-F num : the number of fanout levels for ODC computation [default = %d]\n", nLevelsOdc );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle verbose printout of ODC computation [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: resub [-K num] [-N num] [-F num] [-lzvwh]\n" );
+ Abc_Print( -2, "\t performs technology-independent restructuring of the AIG\n" );
+ Abc_Print( -2, "\t-K num : the max cut size (%d <= num <= %d) [default = %d]\n", RS_CUT_MIN, RS_CUT_MAX, nCutsMax );
+ Abc_Print( -2, "\t-N num : the max number of nodes to add (0 <= num <= 3) [default = %d]\n", nNodesMax );
+ Abc_Print( -2, "\t-F num : the number of fanout levels for ODC computation [default = %d]\n", nLevelsOdc );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle verbose printout of ODC computation [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5050,8 +5013,7 @@ usage:
***********************************************************************/
int Abc_CommandRr( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c, Window;
int nFaninLevels;
int nFanoutLevels;
@@ -5059,10 +5021,6 @@ int Abc_CommandRr( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVerbose;
extern int Abc_NtkRR( Abc_Ntk_t * pNtk, int nFaninLevels, int nFanoutLevels, int fUseFanouts, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nFaninLevels = 3;
nFanoutLevels = 3;
@@ -5076,7 +5034,7 @@ int Abc_CommandRr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
Window = atoi(argv[globalUtilOptind]);
@@ -5101,35 +5059,35 @@ int Abc_CommandRr( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command can only be applied to an AIG (run \"strash\").\n" );
+ Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+ Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkRR( pNtk, nFaninLevels, nFanoutLevels, fUseFanouts, fVerbose ) )
{
- fprintf( pErr, "Redundancy removal has failed.\n" );
+ Abc_Print( -1, "Redundancy removal has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: rr [-W NM] [-fvh]\n" );
- fprintf( pErr, "\t removes combinational redundancies in the current network\n" );
- fprintf( pErr, "\t-W NM : window size: TFI (N) and TFO (M) logic levels [default = %d%d]\n", nFaninLevels, nFanoutLevels );
- fprintf( pErr, "\t-f : toggle RR w.r.t. fanouts [default = %s]\n", fUseFanouts? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: rr [-W NM] [-fvh]\n" );
+ Abc_Print( -2, "\t removes combinational redundancies in the current network\n" );
+ Abc_Print( -2, "\t-W NM : window size: TFI (N) and TFO (M) logic levels [default = %d%d]\n", nFaninLevels, nFanoutLevels );
+ Abc_Print( -2, "\t-f : toggle RR w.r.t. fanouts [default = %s]\n", fUseFanouts? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5146,16 +5104,12 @@ usage:
***********************************************************************/
int Abc_CommandCascade( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nLutSize;
int fCheck;
int fVerbose;
extern Abc_Ntk_t * Abc_NtkCascade( Abc_Ntk_t * pNtk, int nLutSize, int fCheck, int fVerbose );
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
nLutSize = 12;
@@ -5169,7 +5123,7 @@ int Abc_CommandCascade( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nLutSize = atoi(argv[globalUtilOptind]);
@@ -5192,13 +5146,13 @@ int Abc_CommandCascade( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Can only collapse a logic network or an AIG.\n" );
+ Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
return 1;
}
@@ -5213,7 +5167,7 @@ int Abc_CommandCascade( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Cascade synthesis has failed.\n" );
+ Abc_Print( -1, "Cascade synthesis has failed.\n" );
return 1;
}
// replace the current network
@@ -5221,18 +5175,18 @@ int Abc_CommandCascade( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: cascade [-K <num>] [-cvh]\n" );
- fprintf( pErr, "\t performs LUT cascade synthesis for the current network\n" );
- fprintf( pErr, "\t-K num : the number of LUT inputs [default = %d]\n", nLutSize );
- fprintf( pErr, "\t-c : check equivalence after synthesis [default = %s]\n", fCheck? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t \n");
- fprintf( pErr, " A lookup-table cascade is a programmable architecture developed by\n");
- fprintf( pErr, " Professor Tsutomu Sasao (sasao@cse.kyutech.ac.jp) at Kyushu Institute\n");
- fprintf( pErr, " of Technology. This work received Takeda Techno-Entrepreneurship Award:\n");
- fprintf( pErr, " http://www.lsi-cad.com/sasao/photo/takeda.html\n");
- fprintf( pErr, "\t \n");
+ Abc_Print( -2, "usage: cascade [-K <num>] [-cvh]\n" );
+ Abc_Print( -2, "\t performs LUT cascade synthesis for the current network\n" );
+ Abc_Print( -2, "\t-K num : the number of LUT inputs [default = %d]\n", nLutSize );
+ Abc_Print( -2, "\t-c : check equivalence after synthesis [default = %s]\n", fCheck? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t \n");
+ Abc_Print( -2, " A lookup-table cascade is a programmable architecture developed by\n");
+ Abc_Print( -2, " Professor Tsutomu Sasao (sasao@cse.kyutech.ac.jp) at Kyushu Institute\n");
+ Abc_Print( -2, " of Technology. This work received Takeda Techno-Entrepreneurship Award:\n");
+ Abc_Print( -2, " http://www.lsi-cad.com/sasao/photo/takeda.html\n");
+ Abc_Print( -2, "\t \n");
return 1;
}
@@ -5250,14 +5204,10 @@ usage:
***********************************************************************/
int Abc_CommandLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -5273,13 +5223,13 @@ int Abc_CommandLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash( pNtk ) )
{
- fprintf( pErr, "This command is only applicable to strashed networks.\n" );
+ Abc_Print( -1, "This command is only applicable to strashed networks.\n" );
return 1;
}
@@ -5287,7 +5237,7 @@ int Abc_CommandLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkToLogic( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Converting to a logic network has failed.\n" );
+ Abc_Print( -1, "Converting to a logic network has failed.\n" );
return 1;
}
// replace the current network
@@ -5295,9 +5245,9 @@ int Abc_CommandLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: logic [-h]\n" );
- fprintf( pErr, "\t transforms an AIG into a logic network with SOPs\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: logic [-h]\n" );
+ Abc_Print( -2, "\t transforms an AIG into a logic network with SOPs\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5314,7 +5264,6 @@ usage:
***********************************************************************/
int Abc_CommandComb( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fRemoveLatches;
@@ -5322,9 +5271,6 @@ int Abc_CommandComb( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Abc_NtkMakeSeq( Abc_Ntk_t * pNtk, int nLatchesToAdd );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fRemoveLatches = 0;
nLatchesToAdd = 0;
@@ -5336,7 +5282,7 @@ int Abc_CommandComb( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nLatchesToAdd = atoi(argv[globalUtilOptind]);
@@ -5356,17 +5302,17 @@ int Abc_CommandComb( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) && nLatchesToAdd == 0 )
{
- fprintf( pErr, "The network is already combinational.\n" );
+ Abc_Print( -1, "The network is already combinational.\n" );
return 0;
}
if ( !Abc_NtkIsComb(pNtk) && nLatchesToAdd != 0 )
{
- fprintf( pErr, "The network is already combinational.\n" );
+ Abc_Print( -1, "The network is already combinational.\n" );
return 0;
}
@@ -5381,11 +5327,11 @@ int Abc_CommandComb( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: comb [-L num] [-lh]\n" );
- fprintf( pErr, "\t converts comb network into seq, and vice versa\n" );
- fprintf( pErr, "\t-L : number of latches to add to comb network (0 = do not add) [default = %d]\n", nLatchesToAdd );
- fprintf( pErr, "\t-l : toggle converting latches to PIs/POs or removing them [default = %s]\n", fRemoveLatches? "remove": "convert" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: comb [-L num] [-lh]\n" );
+ Abc_Print( -2, "\t converts comb network into seq, and vice versa\n" );
+ Abc_Print( -2, "\t-L : number of latches to add to comb network (0 = do not add) [default = %d]\n", nLatchesToAdd );
+ Abc_Print( -2, "\t-l : toggle converting latches to PIs/POs or removing them [default = %s]\n", fRemoveLatches? "remove": "convert" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5403,7 +5349,6 @@ usage:
int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char Buffer[32];
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -5416,8 +5361,6 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
int nPartSize;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fComb = 1;
@@ -5433,7 +5376,7 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPartSize = atoi(argv[globalUtilOptind]);
@@ -5457,7 +5400,7 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
// compute the miter
pNtkRes = Abc_NtkMiter( pNtk1, pNtk2, fComb, nPartSize, fImplic, fMulti );
@@ -5467,7 +5410,7 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
// get the new network
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Miter computation has failed.\n" );
+ Abc_Print( -1, "Miter computation has failed.\n" );
return 0;
}
// replace the current network
@@ -5479,17 +5422,17 @@ usage:
strcpy( Buffer, "unused" );
else
sprintf( Buffer, "%d", nPartSize );
- fprintf( pErr, "usage: miter [-P num] [-cimh] <file1> <file2>\n" );
- fprintf( pErr, "\t computes the miter of the two circuits\n" );
- fprintf( pErr, "\t-P num : output partition size [default = %s]\n", Buffer );
- fprintf( pErr, "\t-c : toggles deriving combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
- fprintf( pErr, "\t-i : toggles deriving implication miter (file1 => file2) [default = %s]\n", fImplic? "yes": "no" );
- fprintf( pErr, "\t-m : toggles creating multi-output miter [default = %s]\n", fMulti? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: miter [-P num] [-cimh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t computes the miter of the two circuits\n" );
+ Abc_Print( -2, "\t-P num : output partition size [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-c : toggles deriving combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
+ Abc_Print( -2, "\t-i : toggles deriving implication miter (file1 => file2) [default = %s]\n", fImplic? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggles creating multi-output miter [default = %s]\n", fMulti? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -5506,17 +5449,12 @@ usage:
***********************************************************************/
int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;//, * pNtkRes;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
int fSeq;
int c;
extern int Abc_NtkDemiter( Abc_Ntk_t * pNtk );
extern int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fSeq = 1;
Extra_UtilGetoptReset();
@@ -5534,7 +5472,7 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "The network is not strashed.\n" );
+ Abc_Print( -1, "The network is not strashed.\n" );
return 1;
}
@@ -5543,7 +5481,7 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( !Abc_NtkDarDemiter( pNtk ) )
{
- fprintf( pErr, "Demitering has failed.\n" );
+ Abc_Print( -1, "Demitering has failed.\n" );
return 1;
}
}
@@ -5551,17 +5489,17 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( Abc_NtkPoNum(pNtk) != 1 )
{
- fprintf( pErr, "The network is not a single-output miter.\n" );
+ Abc_Print( -1, "The network is not a single-output miter.\n" );
return 1;
}
if ( !Abc_NodeIsExorType(Abc_ObjFanin0(Abc_NtkPo(pNtk,0))) )
{
- fprintf( pErr, "The miter's PO is not an EXOR.\n" );
+ Abc_Print( -1, "The miter's PO is not an EXOR.\n" );
return 1;
}
if ( !Abc_NtkDemiter( pNtk ) )
{
- fprintf( pErr, "Demitering has failed.\n" );
+ Abc_Print( -1, "Demitering has failed.\n" );
return 1;
}
}
@@ -5570,10 +5508,10 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: demiter [-sh]\n" );
- fprintf( pErr, "\t removes topmost EXOR from the miter to create two POs\n" );
- fprintf( pErr, "\t-s : applied multi-output algorithm [default = %s]\n", fSeq? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: demiter [-sh]\n" );
+ Abc_Print( -2, "\t removes topmost EXOR from the miter to create two POs\n" );
+ Abc_Print( -2, "\t-s : applied multi-output algorithm [default = %s]\n", fSeq? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5590,16 +5528,11 @@ usage:
***********************************************************************/
int Abc_CommandOrPos( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;//, * pNtkRes;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
int fComb;
int c;
extern int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
@@ -5616,27 +5549,27 @@ int Abc_CommandOrPos( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "The network is not strashed.\n" );
+ Abc_Print( -1, "The network is not strashed.\n" );
return 1;
}
/*
if ( Abc_NtkPoNum(pNtk) == 1 )
{
- fprintf( pErr, "The network already has one PO.\n" );
+ Abc_Print( -1, "The network already has one PO.\n" );
return 1;
}
*/
/*
if ( Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The miter has latches. ORing is not performed.\n" );
+ Abc_Print( -1, "The miter has latches. ORing is not performed.\n" );
return 1;
}
*/
// get the new network
if ( !Abc_NtkCombinePos( pNtk, 0 ) )
{
- fprintf( pErr, "ORing the POs has failed.\n" );
+ Abc_Print( -1, "ORing the POs has failed.\n" );
return 1;
}
// replace the current network
@@ -5644,10 +5577,10 @@ int Abc_CommandOrPos( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: orpos [-h]\n" );
- fprintf( pErr, "\t creates single-output miter by ORing the POs of the current network\n" );
-// fprintf( pErr, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: orpos [-h]\n" );
+ Abc_Print( -2, "\t creates single-output miter by ORing the POs of the current network\n" );
+// Abc_Print( -2, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5664,15 +5597,9 @@ usage:
***********************************************************************/
int Abc_CommandAndPos( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;//, * pNtkRes;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
int fComb;
int c;
- extern int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
Extra_UtilGetoptReset();
@@ -5690,26 +5617,26 @@ int Abc_CommandAndPos( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "The network is not strashed.\n" );
+ Abc_Print( -1, "The network is not strashed.\n" );
return 1;
}
if ( Abc_NtkPoNum(pNtk) == 1 )
{
- fprintf( pErr, "The network already has one PO.\n" );
+ Abc_Print( -1, "The network already has one PO.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The miter has latches. ORing is not performed.\n" );
+ Abc_Print( -1, "The miter has latches. ORing is not performed.\n" );
return 1;
}
// get the new network
if ( !Abc_NtkCombinePos( pNtk, 1 ) )
{
- fprintf( pErr, "ANDing the POs has failed.\n" );
+ Abc_Print( -1, "ANDing the POs has failed.\n" );
return 1;
}
// replace the current network
@@ -5717,10 +5644,79 @@ int Abc_CommandAndPos( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: andpos [-h]\n" );
- fprintf( pErr, "\t creates single-output miter by ANDing the POs of the current network\n" );
-// fprintf( pErr, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: andpos [-h]\n" );
+ Abc_Print( -2, "\t creates single-output miter by ANDing the POs of the current network\n" );
+// Abc_Print( -2, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes;
+ int c, iOutput = -1;
+ extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput );
+
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'N':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ iOutput = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( iOutput < 0 )
+ goto usage;
+ break;
+ default:
+ goto usage;
+ }
+ }
+
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ Abc_Print( -1, "The network is not strashed.\n" );
+ return 1;
+ }
+ if ( iOutput < 0 )
+ {
+ Abc_Print( -1, "The output index is not specified.\n" );
+ return 1;
+ }
+ if ( iOutput >= Abc_NtkPoNum(pNtk) )
+ {
+ Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
+ return 1;
+ }
+
+ // get the new network
+ pNtkRes = Abc_NtkDup( pNtk );
+ Abc_NtkDropOneOutput( pNtkRes, iOutput );
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: zeropo [-N num] [-h]\n" );
+ Abc_Print( -2, "\t replaces the PO driver by constant 0\n" );
+ Abc_Print( -2, "\t-F num : the zero-based index of the PO to replace [default = %d]\n", iOutput );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5737,15 +5733,11 @@ usage:
***********************************************************************/
int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk2;
char * FileName;
int fComb;
int c;
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
Extra_UtilGetoptReset();
@@ -5764,13 +5756,13 @@ int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv )
// get the second network
if ( argc != globalUtilOptind + 1 )
{
- fprintf( pErr, "The network to append is not given.\n" );
+ Abc_Print( -1, "The network to append is not given.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "The base network should be strashed for the appending to work.\n" );
+ Abc_Print( -1, "The base network should be strashed for the appending to work.\n" );
return 1;
}
@@ -5783,7 +5775,7 @@ int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv )
// check if the second network is combinational
if ( Abc_NtkLatchNum(pNtk2) )
{
- fprintf( pErr, "The second network has latches. Appending does not work for such networks.\n" );
+ Abc_Print( -1, "The second network has latches. Appending does not work for such networks.\n" );
return 0;
}
@@ -5791,22 +5783,22 @@ int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( !Abc_NtkAppend( pNtk, pNtk2, 1 ) )
{
Abc_NtkDelete( pNtk2 );
- fprintf( pErr, "Appending the networks failed.\n" );
+ Abc_Print( -1, "Appending the networks failed.\n" );
return 1;
}
Abc_NtkDelete( pNtk2 );
// sweep dangling logic
- Abc_AigCleanup( pNtk->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
// replace the current network
// Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
return 0;
usage:
- fprintf( pErr, "usage: append [-h] <file>\n" );
- fprintf( pErr, "\t appends a combinational network on top of the current network\n" );
-// fprintf( pErr, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t<file> : file name with the second network\n");
+ Abc_Print( -2, "usage: append [-h] <file>\n" );
+ Abc_Print( -2, "\t appends a combinational network on top of the current network\n" );
+// Abc_Print( -2, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : file name with the second network\n");
return 1;
}
@@ -5823,16 +5815,12 @@ usage:
***********************************************************************/
int Abc_CommandFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
int nFrames;
int fInitial;
int fVerbose;
int c;
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
nFrames = 5;
@@ -5846,7 +5834,7 @@ int Abc_CommandFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -5869,7 +5857,7 @@ int Abc_CommandFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -5884,7 +5872,7 @@ int Abc_CommandFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkFrames( pNtk, nFrames, fInitial, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Unrolling the network has failed.\n" );
+ Abc_Print( -1, "Unrolling the network has failed.\n" );
return 1;
}
// replace the current network
@@ -5892,12 +5880,12 @@ int Abc_CommandFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: frames [-F num] [-ivh]\n" );
- fprintf( pErr, "\t unrolls the network for a number of time frames\n" );
- fprintf( pErr, "\t-F num : the number of frames to unroll [default = %d]\n", nFrames );
- fprintf( pErr, "\t-i : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
- fprintf( pErr, "\t-v : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: frames [-F num] [-ivh]\n" );
+ Abc_Print( -2, "\t unrolls the network for a number of time frames\n" );
+ Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-i : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -5914,7 +5902,6 @@ usage:
***********************************************************************/
int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
int nPrefix;
int nFrames;
@@ -5923,10 +5910,7 @@ int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
int c;
extern Abc_Ntk_t * Abc_NtkDarFrames( Abc_Ntk_t * pNtk, int nPrefix, int nFrames, int fInitial, int fVerbose );
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
nPrefix = 5;
@@ -5941,7 +5925,7 @@ int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nPrefix = atoi(argv[globalUtilOptind]);
@@ -5952,7 +5936,7 @@ int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -5975,12 +5959,12 @@ int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( nPrefix > nFrames )
{
- fprintf( pErr, "Prefix (%d) cannot be more than the number of frames (%d).\n", nPrefix, nFrames );
+ Abc_Print( -1, "Prefix (%d) cannot be more than the number of frames (%d).\n", nPrefix, nFrames );
return 1;
}
@@ -5995,7 +5979,7 @@ int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarFrames( pNtk, nPrefix, nFrames, fInitial, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Unrolling the network has failed.\n" );
+ Abc_Print( -1, "Unrolling the network has failed.\n" );
return 1;
}
// replace the current network
@@ -6003,13 +5987,13 @@ int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dframes [-NF num] [-ivh]\n" );
- fprintf( pErr, "\t unrolls the network with simplification\n" );
- fprintf( pErr, "\t-N num : the number of frames to use as prefix [default = %d]\n", nPrefix );
- fprintf( pErr, "\t-F num : the number of frames to unroll [default = %d]\n", nFrames );
- fprintf( pErr, "\t-i : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
- fprintf( pErr, "\t-v : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dframes [-NF num] [-ivh]\n" );
+ Abc_Print( -2, "\t unrolls the network with simplification\n" );
+ Abc_Print( -2, "\t-N num : the number of frames to use as prefix [default = %d]\n", nPrefix );
+ Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-i : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6028,15 +6012,10 @@ usage:
***********************************************************************/
int Abc_CommandSop( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int fDirect;
int c;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fDirect = 0;
Extra_UtilGetoptReset();
@@ -6055,26 +6034,26 @@ int Abc_CommandSop( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Converting to SOP is possible only for logic networks.\n" );
+ Abc_Print( -1, "Converting to SOP is possible only for logic networks.\n" );
return 1;
}
if ( !Abc_NtkToSop(pNtk, fDirect) )
{
- fprintf( pErr, "Converting to SOP has failed.\n" );
+ Abc_Print( -1, "Converting to SOP has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: sop [-dh]\n" );
- fprintf( pErr, "\t converts node functions to SOP\n" );
- fprintf( pErr, "\t-d : toggles using both phases or only positive [default = %s]\n", fDirect? "direct": "both" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: sop [-dh]\n" );
+ Abc_Print( -2, "\t converts node functions to SOP\n" );
+ Abc_Print( -2, "\t-d : toggles using both phases or only positive [default = %s]\n", fDirect? "direct": "both" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6091,14 +6070,9 @@ usage:
***********************************************************************/
int Abc_CommandBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -6113,30 +6087,30 @@ int Abc_CommandBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Converting to BDD is possible only for logic networks.\n" );
+ Abc_Print( -1, "Converting to BDD is possible only for logic networks.\n" );
return 1;
}
if ( Abc_NtkIsBddLogic(pNtk) )
{
- fprintf( pOut, "The logic network is already in the BDD form.\n" );
+ Abc_Print( -1, "The logic network is already in the BDD form.\n" );
return 0;
}
if ( !Abc_NtkToBdd(pNtk) )
{
- fprintf( pErr, "Converting to BDD has failed.\n" );
+ Abc_Print( -1, "Converting to BDD has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: bdd [-h]\n" );
- fprintf( pErr, "\t converts node functions to BDD\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: bdd [-h]\n" );
+ Abc_Print( -2, "\t converts node functions to BDD\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6153,14 +6127,9 @@ usage:
***********************************************************************/
int Abc_CommandAig( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -6175,30 +6144,30 @@ int Abc_CommandAig( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Converting to AIG is possible only for logic networks.\n" );
+ Abc_Print( -1, "Converting to AIG is possible only for logic networks.\n" );
return 1;
}
if ( Abc_NtkIsAigLogic(pNtk) )
{
- fprintf( pOut, "The logic network is already in the AIG form.\n" );
+ Abc_Print( -1, "The logic network is already in the AIG form.\n" );
return 0;
}
if ( !Abc_NtkToAig(pNtk) )
{
- fprintf( pErr, "Converting to AIG has failed.\n" );
+ Abc_Print( -1, "Converting to AIG has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: aig [-h]\n" );
- fprintf( pErr, "\t converts node functions to AIG\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: aig [-h]\n" );
+ Abc_Print( -2, "\t converts node functions to AIG\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6215,16 +6184,11 @@ usage:
***********************************************************************/
int Abc_CommandReorder( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fVerbose;
extern void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fVerbose = 0;
Extra_UtilGetoptReset();
@@ -6244,24 +6208,24 @@ int Abc_CommandReorder( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// get the new network
if ( !Abc_NtkIsBddLogic(pNtk) )
{
- fprintf( pErr, "Variable reordering is possible when node functions are BDDs (run \"bdd\").\n" );
+ Abc_Print( -1, "Variable reordering is possible when node functions are BDDs (run \"bdd\").\n" );
return 1;
}
Abc_NtkBddReorder( pNtk, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: reorder [-vh]\n" );
- fprintf( pErr, "\t reorders local functions of the nodes using sifting\n" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: reorder [-vh]\n" );
+ Abc_Print( -2, "\t reorders local functions of the nodes using sifting\n" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6278,16 +6242,11 @@ usage:
***********************************************************************/
int Abc_CommandBidec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fVerbose;
extern void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fVerbose = 0;
Extra_UtilGetoptReset();
@@ -6307,24 +6266,24 @@ int Abc_CommandBidec( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// get the new network
if ( !Abc_NtkIsAigLogic(pNtk) )
{
- fprintf( pErr, "Bi-decomposition only works when node functions are AIGs (run \"aig\").\n" );
+ Abc_Print( -1, "Bi-decomposition only works when node functions are AIGs (run \"aig\").\n" );
return 1;
}
Abc_NtkBidecResyn( pNtk, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: bidec [-vh]\n" );
- fprintf( pErr, "\t applies bi-decomposition to local functions of the nodes\n" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: bidec [-vh]\n" );
+ Abc_Print( -2, "\t applies bi-decomposition to local functions of the nodes\n" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6341,8 +6300,8 @@ usage:
***********************************************************************/
int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr, * pFile;
- Abc_Ntk_t * pNtk;
+ FILE * pFile;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
char * pFileName;
int c;
int fReverse;
@@ -6350,10 +6309,6 @@ int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Abc_NtkImplementCiOrder( Abc_Ntk_t * pNtk, char * pFileName, int fReverse, int fVerbose );
extern void Abc_NtkFindCiOrder( Abc_Ntk_t * pNtk, int fReverse, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fReverse = 0;
fVerbose = 0;
@@ -6377,12 +6332,12 @@ int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// if ( Abc_NtkLatchNum(pNtk) > 0 )
// {
-// printf( "Currently this procedure does not work for sequential networks.\n" );
+// Abc_Print( -1, "Currently this procedure does not work for sequential networks.\n" );
// return 1;
// }
@@ -6394,7 +6349,7 @@ int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
pFile = fopen( pFileName, "r" );
if ( pFile == NULL )
{
- fprintf( pErr, "Cannot open file \"%s\" with the BDD variable order.\n", pFileName );
+ Abc_Print( -1, "Cannot open file \"%s\" with the BDD variable order.\n", pFileName );
return 1;
}
fclose( pFile );
@@ -6406,12 +6361,12 @@ int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: order [-rvh] <file>\n" );
- fprintf( pErr, "\t computes a good static CI variable order\n" );
- fprintf( pErr, "\t-r : toggle reverse ordering [default = %s]\n", fReverse? "yes": "no" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t<file> : (optional) file with the given variable order\n" );
+ Abc_Print( -2, "usage: order [-rvh] <file>\n" );
+ Abc_Print( -2, "\t computes a good static CI variable order\n" );
+ Abc_Print( -2, "\t-r : toggle reverse ordering [default = %s]\n", fReverse? "yes": "no" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : (optional) file with the given variable order\n" );
return 1;
}
@@ -6428,14 +6383,10 @@ usage:
***********************************************************************/
int Abc_CommandMuxes( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -6451,13 +6402,13 @@ int Abc_CommandMuxes( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsBddLogic(pNtk) )
{
- fprintf( pErr, "Only a BDD logic network can be converted to MUXes.\n" );
+ Abc_Print( -1, "Only a BDD logic network can be converted to MUXes.\n" );
return 1;
}
@@ -6465,7 +6416,7 @@ int Abc_CommandMuxes( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkBddToMuxes( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Converting to MUXes has failed.\n" );
+ Abc_Print( -1, "Converting to MUXes has failed.\n" );
return 1;
}
// replace the current network
@@ -6473,10 +6424,10 @@ int Abc_CommandMuxes( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: muxes [-h]\n" );
- fprintf( pErr, "\t converts the current network into a network derived by\n" );
- fprintf( pErr, "\t replacing all nodes by DAGs isomorphic to the local BDDs\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: muxes [-h]\n" );
+ Abc_Print( -2, "\t converts the current network into a network derived by\n" );
+ Abc_Print( -2, "\t replacing all nodes by DAGs isomorphic to the local BDDs\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6494,16 +6445,12 @@ usage:
***********************************************************************/
int Abc_CommandExtSeqDcs( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fVerbose;
- extern int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNet, bool fVerbose );
+ extern int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNet, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fVerbose = 0;
Extra_UtilGetoptReset();
@@ -6523,31 +6470,31 @@ int Abc_CommandExtSeqDcs( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- fprintf( stdout, "The current network has no latches.\n" );
+ Abc_Print( -1, "The current network has no latches.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Extracting sequential don't-cares works only for AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "Extracting sequential don't-cares works only for AIGs (run \"strash\").\n" );
return 0;
}
if ( !Abc_NtkExtractSequentialDcs( pNtk, fVerbose ) )
{
- fprintf( stdout, "Extracting sequential don't-cares has failed.\n" );
+ Abc_Print( -1, "Extracting sequential don't-cares has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: ext_seq_dcs [-vh]\n" );
- fprintf( pErr, "\t create EXDC network using unreachable states\n" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: ext_seq_dcs [-vh]\n" );
+ Abc_Print( -2, "\t create EXDC network using unreachable states\n" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6564,66 +6511,76 @@ usage:
***********************************************************************/
int Abc_CommandReach( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
- int nBddMax;
- int nIterMax;
- int fPartition;
- int fReorder;
- int fReorderImage;
- int fVerbose;
+ Saig_ParBbr_t Pars, * pPars = &Pars;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
- extern void Abc_NtkDarReach( Abc_Ntk_t * pNtk, int nBddMax, int nIterMax, int fPartition, int fReorder, int fReorderImage, int fVerbose );
+ char * pLogFileName = NULL;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+ extern int Abc_NtkDarReach( Abc_Ntk_t * pNtk, Saig_ParBbr_t * pPars );
// set defaults
- nBddMax = 50000;
- nIterMax = 1000;
- fPartition = 1;
- fReorder = 1;
- fReorderImage = 0;
- fVerbose = 0;
+ Bbr_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "BFprovh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "TBFLproyvh" ) ) != EOF )
{
switch ( c )
{
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->TimeLimit < 0 )
+ goto usage;
+ break;
case 'B':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-B\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
goto usage;
}
- nBddMax = atoi(argv[globalUtilOptind]);
+ pPars->nBddMax = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
- if ( nBddMax < 0 )
+ if ( pPars->nBddMax < 0 )
goto usage;
break;
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
- nIterMax = atoi(argv[globalUtilOptind]);
+ pPars->nIterMax = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
- if ( nIterMax < 0 )
+ if ( pPars->nIterMax < 0 )
goto usage;
break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
case 'p':
- fPartition ^= 1;
+ pPars->fPartition ^= 1;
break;
case 'r':
- fReorder ^= 1;
+ pPars->fReorder ^= 1;
break;
case 'o':
- fReorderImage ^= 1;
+ pPars->fReorderImage ^= 1;
+ break;
+ case 'y':
+ pPars->fSkipOutCheck ^= 1;
break;
case 'v':
- fVerbose ^= 1;
+ pPars->fVerbose ^= 1;
break;
case 'h':
goto usage;
@@ -6633,48 +6590,39 @@ int Abc_CommandReach( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- fprintf( stdout, "The current network has no latches.\n" );
+ Abc_Print( -1, "The current network has no latches.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Reachability analysis works only for AIGs (run \"strash\").\n" );
- return 1;
- }
-/*
- if ( Abc_NtkLatchNum(pNtk) > 60 || Abc_NtkNodeNum(pNtk) > 3000 )
- {
- fprintf( stdout, "The number of latches %d and nodes %d. Skippping...\n", Abc_NtkLatchNum(pNtk), Abc_NtkNodeNum(pNtk) );
- return 0;
- }
-*/
-/*
- if ( Abc_NtkPoNum(pNtk) != 1 )
- {
- fprintf( stdout, "The sequential miter has more than one output (run \"orpos\").\n" );
+ Abc_Print( -1, "Reachability analysis works only for AIGs (run \"strash\").\n" );
return 1;
}
-*/
-// Abc_NtkVerifyUsingBdds( pNtk, nBddMax, nIterMax, fPartition, fReorder, fVerbose );
- Abc_NtkDarReach( pNtk, nBddMax, nIterMax, fPartition, fReorder, fReorderImage, fVerbose );
- pAbc->pCex = pNtk->pSeqModel; // temporary ???
+ pAbc->Status = Abc_NtkDarReach( pNtk, pPars );
+ pAbc->nFrames = pPars->iFrame;
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, "reach" );
return 0;
usage:
- fprintf( pErr, "usage: reach [-BF num] [-provh]\n" );
- fprintf( pErr, "\t verifies sequential miter using BDD-based reachability\n" );
- fprintf( pErr, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", nBddMax );
- fprintf( pErr, "\t-F num : max number of reachability iterations [default = %d]\n", nIterMax );
- fprintf( pErr, "\t-p : enable partitioned image computation [default = %s]\n", fPartition? "yes": "no" );
- fprintf( pErr, "\t-r : enable dynamic BDD variable reordering [default = %s]\n", fReorder? "yes": "no" );
- fprintf( pErr, "\t-o : toggles BDD variable reordering during image computation [default = %s]\n", fReorderImage? "yes": "no" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: reach [-TBF num] [-L file] [-proyvh]\n" );
+ Abc_Print( -2, "\t verifies sequential miter using BDD-based reachability\n" );
+ Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
+ Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
+ Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+ Abc_Print( -2, "\t-p : enable partitioned image computation [default = %s]\n", pPars->fPartition? "yes": "no" );
+ Abc_Print( -2, "\t-r : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggles BDD variable reordering during image computation [default = %s]\n", pPars->fReorderImage? "yes": "no" );
+ Abc_Print( -2, "\t-y : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -6691,7 +6639,6 @@ usage:
***********************************************************************/
int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
Abc_Obj_t * pNode, * pNodeCo;
int c;
@@ -6699,27 +6646,26 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
int fUseMffc;
int fSeq;
int Output;
+ int nRange;
- extern void Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo );
+ extern Abc_Ntk_t * Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, int Output, int nRange );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUseAllCis = 0;
fUseMffc = 0;
fSeq = 0;
Output = -1;
+ nRange = -1;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Omash" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "ORmash" ) ) != EOF )
{
switch ( c )
{
case 'O':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-O\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
goto usage;
}
Output = atoi(argv[globalUtilOptind]);
@@ -6727,6 +6673,17 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( Output < 0 )
goto usage;
break;
+ case 'R':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nRange = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nRange < 0 )
+ goto usage;
+ break;
case 'm':
fUseMffc ^= 1;
break;
@@ -6745,19 +6702,19 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Currently can only be applied to the logic network or an AIG.\n" );
+ Abc_Print( -1, "Currently can only be applied to the logic network or an AIG.\n" );
return 1;
}
if ( argc > globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
@@ -6767,7 +6724,7 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
if ( fUseMffc )
@@ -6779,31 +6736,30 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( Output == -1 )
{
- fprintf( pErr, "The node is not specified.\n" );
+ Abc_Print( -1, "The node is not specified.\n" );
return 1;
}
if ( Output >= Abc_NtkCoNum(pNtk) )
{
- fprintf( pErr, "The 0-based output number (%d) is larger than the number of outputs (%d).\n", Output, Abc_NtkCoNum(pNtk) );
+ Abc_Print( -1, "The 0-based output number (%d) is larger than the number of outputs (%d).\n", Output, Abc_NtkCoNum(pNtk) );
return 1;
}
pNodeCo = Abc_NtkCo( pNtk, Output );
if ( fSeq )
- {
- pNtkRes = Abc_NtkDup( pNtk );
- pNodeCo = Abc_NtkPo( pNtkRes, Output );
- Abc_NtkMakeOnePo( pNtkRes, pNodeCo );
- }
+ pNtkRes = Abc_NtkMakeOnePo( pNtk, Output, nRange );
else if ( fUseMffc )
pNtkRes = Abc_NtkCreateMffc( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo) );
else
pNtkRes = Abc_NtkCreateCone( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo), fUseAllCis );
}
if ( pNodeCo && Abc_ObjFaninC0(pNodeCo) && !fSeq )
- printf( "The extracted cone represents the complement function of the CO.\n" );
+ {
+ Abc_NtkPo(pNtkRes, 0)->fCompl0 ^= 1;
+// Abc_Print( -1, "The extracted cone represents the complement function of the CO.\n" );
+ }
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Writing the logic cone of one node has failed.\n" );
+ Abc_Print( -1, "Writing the logic cone of one node has failed.\n" );
return 1;
}
// replace the current network
@@ -6811,14 +6767,15 @@ int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: cone [-O num] [-amsh] <name>\n" );
- fprintf( pErr, "\t replaces the current network by one logic cone\n" );
- fprintf( pErr, "\t-a : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
- fprintf( pErr, "\t-m : toggle keeping only MFFC or complete TFI cone [default = %s]\n", fUseMffc? "MFFC": "TFI cone" );
- fprintf( pErr, "\t-s : toggle comb or sequential cone (works with \"-O num\") [default = %s]\n", fSeq? "seq": "comb" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t-O num : (optional) the 0-based number of the CO to extract\n");
- fprintf( pErr, "\tname : (optional) the name of the node to extract\n");
+ Abc_Print( -2, "usage: cone [-OR num] [-amsh] <name>\n" );
+ Abc_Print( -2, "\t replaces the current network by one logic cone\n" );
+ Abc_Print( -2, "\t-a : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
+ Abc_Print( -2, "\t-m : toggle keeping only MFFC or complete TFI cone [default = %s]\n", fUseMffc? "MFFC": "TFI cone" );
+ Abc_Print( -2, "\t-s : toggle comb or sequential cone (works with \"-O num\") [default = %s]\n", fSeq? "seq": "comb" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t-O num : (optional) the 0-based number of the CO to extract\n");
+ Abc_Print( -2, "\t-R num : (optional) the number of outputs to extract\n");
+ Abc_Print( -2, "\tname : (optional) the name of the node to extract\n");
return 1;
}
@@ -6835,15 +6792,11 @@ usage:
***********************************************************************/
int Abc_CommandNode( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
Abc_Obj_t * pNode;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -6859,26 +6812,26 @@ int Abc_CommandNode( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Currently can only be applied to a logic network.\n" );
+ Abc_Print( -1, "Currently can only be applied to a logic network.\n" );
return 1;
}
if ( argc != globalUtilOptind + 1 )
{
- fprintf( pErr, "Wrong number of auguments.\n" );
+ Abc_Print( -1, "Wrong number of auguments.\n" );
goto usage;
}
pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
if ( pNode == NULL )
{
- fprintf( pErr, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
return 1;
}
@@ -6886,7 +6839,7 @@ int Abc_CommandNode( Abc_Frame_t * pAbc, int argc, char ** argv )
// pNtkRes = Abc_NtkDeriveFromBdd( pNtk->pManFunc, pNode->pData, NULL, NULL );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Splitting one node has failed.\n" );
+ Abc_Print( -1, "Splitting one node has failed.\n" );
return 1;
}
// replace the current network
@@ -6894,10 +6847,10 @@ int Abc_CommandNode( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: node [-h] <name>\n" );
- fprintf( pErr, "\t replaces the current network by the network composed of one node\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tname : the node name\n");
+ Abc_Print( -2, "usage: node [-h] <name>\n" );
+ Abc_Print( -2, "\t replaces the current network by the network composed of one node\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tname : the node name\n");
return 1;
}
@@ -6915,15 +6868,11 @@ usage:
***********************************************************************/
int Abc_CommandTopmost( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nLevels;
extern Abc_Ntk_t * Abc_NtkTopmost( Abc_Ntk_t * pNtk, int nLevels );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nLevels = 10;
Extra_UtilGetoptReset();
@@ -6934,7 +6883,7 @@ int Abc_CommandTopmost( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nLevels = atoi(argv[globalUtilOptind]);
@@ -6951,31 +6900,31 @@ int Abc_CommandTopmost( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
if ( Abc_NtkLatchNum(pNtk) > 0 )
{
- fprintf( stdout, "Currently can only works for combinational circuits.\n" );
+ Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
return 0;
}
if ( Abc_NtkPoNum(pNtk) != 1 )
{
- fprintf( stdout, "Currently expects a single-output miter.\n" );
+ Abc_Print( -1, "Currently expects a single-output miter.\n" );
return 0;
}
pNtkRes = Abc_NtkTopmost( pNtk, nLevels );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "The command has failed.\n" );
+ Abc_Print( -1, "The command has failed.\n" );
return 1;
}
// replace the current network
@@ -6983,11 +6932,11 @@ int Abc_CommandTopmost( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: topmost [-N num] [-h]\n" );
- fprintf( pErr, "\t replaces the current network by several of its topmost levels\n" );
- fprintf( pErr, "\t-N num : max number of levels [default = %d]\n", nLevels );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tname : the node name\n");
+ Abc_Print( -2, "usage: topmost [-N num] [-h]\n" );
+ Abc_Print( -2, "\t replaces the current network by several of its topmost levels\n" );
+ Abc_Print( -2, "\t-N num : max number of levels [default = %d]\n", nLevels );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tname : the node name\n");
return 1;
}
@@ -7004,15 +6953,11 @@ usage:
***********************************************************************/
int Abc_CommandTopAnd( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
extern Abc_Ntk_t * Abc_NtkTopAnd( Abc_Ntk_t * pNtk );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -7028,40 +6973,40 @@ int Abc_CommandTopAnd( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
if ( Abc_NtkLatchNum(pNtk) > 0 )
{
- fprintf( stdout, "Currently can only works for combinational circuits.\n" );
+ Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
return 0;
}
if ( Abc_NtkPoNum(pNtk) != 1 )
{
- fprintf( stdout, "Currently expects a single-output miter.\n" );
+ Abc_Print( -1, "Currently expects a single-output miter.\n" );
return 0;
}
if ( Abc_ObjFaninC0(Abc_NtkPo(pNtk, 0)) )
{
- fprintf( stdout, "The PO driver is complemented. AND-decomposition is impossible.\n" );
+ Abc_Print( -1, "The PO driver is complemented. AND-decomposition is impossible.\n" );
return 0;
}
if ( !Abc_ObjIsNode(Abc_ObjChild0(Abc_NtkPo(pNtk, 0))) )
{
- fprintf( stdout, "The PO driver is not a node. AND-decomposition is impossible.\n" );
+ Abc_Print( -1, "The PO driver is not a node. AND-decomposition is impossible.\n" );
return 0;
}
pNtkRes = Abc_NtkTopAnd( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "The command has failed.\n" );
+ Abc_Print( -1, "The command has failed.\n" );
return 1;
}
// replace the current network
@@ -7069,10 +7014,10 @@ int Abc_CommandTopAnd( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: topand [-h]\n" );
- fprintf( pErr, "\t performs AND-decomposition of single-output combinational miter\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tname : the node name\n");
+ Abc_Print( -2, "usage: topand [-h]\n" );
+ Abc_Print( -2, "\t performs AND-decomposition of single-output combinational miter\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tname : the node name\n");
return 1;
}
@@ -7089,15 +7034,11 @@ usage:
***********************************************************************/
int Abc_CommandTrim( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nLevels;
extern Abc_Ntk_t * Abc_NtkTrim( Abc_Ntk_t * pNtk );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nLevels = 10;
Extra_UtilGetoptReset();
@@ -7109,7 +7050,7 @@ int Abc_CommandTrim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nLevels = atoi(argv[globalUtilOptind]);
@@ -7127,19 +7068,19 @@ int Abc_CommandTrim( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for logic circuits.\n" );
+ Abc_Print( -1, "Currently only works for logic circuits.\n" );
return 0;
}
pNtkRes = Abc_NtkTrim( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "The command has failed.\n" );
+ Abc_Print( -1, "The command has failed.\n" );
return 1;
}
// replace the current network
@@ -7147,10 +7088,10 @@ int Abc_CommandTrim( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: trim [-h]\n" );
- fprintf( pErr, "\t removes POs fed by PIs and constants, and PIs w/o fanout\n" );
-// fprintf( pErr, "\t-N num : max number of levels [default = %d]\n", nLevels );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: trim [-h]\n" );
+ Abc_Print( -2, "\t removes POs fed by PIs and constants, and PIs w/o fanout\n" );
+// Abc_Print( -2, "\t-N num : max number of levels [default = %d]\n", nLevels );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -7168,14 +7109,8 @@ usage:
***********************************************************************/
int Abc_CommandShortNames( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -7191,16 +7126,16 @@ int Abc_CommandShortNames( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
Abc_NtkShortNames( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: short_names [-h]\n" );
- fprintf( pErr, "\t replaces PI/PO/latch names by short char strings\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: short_names [-h]\n" );
+ Abc_Print( -2, "\t replaces PI/PO/latch names by short char strings\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -7217,14 +7152,10 @@ usage:
***********************************************************************/
int Abc_CommandExdcFree( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -7240,12 +7171,12 @@ int Abc_CommandExdcFree( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( pNtk->pExdc == NULL )
{
- fprintf( pErr, "The network has no EXDC.\n" );
+ Abc_Print( -1, "The network has no EXDC.\n" );
return 1;
}
@@ -7258,9 +7189,9 @@ int Abc_CommandExdcFree( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: exdc_free [-h]\n" );
- fprintf( pErr, "\t frees the EXDC network of the current network\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: exdc_free [-h]\n" );
+ Abc_Print( -2, "\t frees the EXDC network of the current network\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -7277,14 +7208,10 @@ usage:
***********************************************************************/
int Abc_CommandExdcGet( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -7300,12 +7227,12 @@ int Abc_CommandExdcGet( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( pNtk->pExdc == NULL )
{
- fprintf( pErr, "The network has no EXDC.\n" );
+ Abc_Print( -1, "The network has no EXDC.\n" );
return 1;
}
@@ -7315,9 +7242,9 @@ int Abc_CommandExdcGet( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: exdc_get [-h]\n" );
- fprintf( pErr, "\t replaces the current network by the EXDC of the current network\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: exdc_get [-h]\n" );
+ Abc_Print( -2, "\t replaces the current network by the EXDC of the current network\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -7334,15 +7261,12 @@ usage:
***********************************************************************/
int Abc_CommandExdcSet( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr, * pFile;
+ FILE * pFile;
Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
char * FileName;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -7358,7 +7282,7 @@ int Abc_CommandExdcSet( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -7371,10 +7295,10 @@ int Abc_CommandExdcSet( Abc_Frame_t * pAbc, int argc, char ** argv )
FileName = argv[globalUtilOptind];
if ( (pFile = fopen( FileName, "r" )) == NULL )
{
- fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
- fprintf( pAbc->Err, "Did you mean \"%s\"?", FileName );
- fprintf( pAbc->Err, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
@@ -7383,7 +7307,7 @@ int Abc_CommandExdcSet( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1 );
if ( pNtkNew == NULL )
{
- fprintf( pAbc->Err, "Reading network from file has failed.\n" );
+ Abc_Print( -1, "Reading network from file has failed.\n" );
return 1;
}
@@ -7401,10 +7325,10 @@ int Abc_CommandExdcSet( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: exdc_set [-h] <file>\n" );
- fprintf( pErr, "\t sets the network from file as EXDC for the current network\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t<file> : file with the new EXDC network\n");
+ Abc_Print( -2, "usage: exdc_set [-h] <file>\n" );
+ Abc_Print( -2, "\t sets the network from file as EXDC for the current network\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : file with the new EXDC network\n");
return 1;
}
@@ -7421,15 +7345,12 @@ usage:
***********************************************************************/
int Abc_CommandCareSet( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr, * pFile;
+ FILE * pFile;
Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
char * FileName;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -7445,7 +7366,7 @@ int Abc_CommandCareSet( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -7458,10 +7379,10 @@ int Abc_CommandCareSet( Abc_Frame_t * pAbc, int argc, char ** argv )
FileName = argv[globalUtilOptind];
if ( (pFile = fopen( FileName, "r" )) == NULL )
{
- fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
- fprintf( pAbc->Err, "Did you mean \"%s\"?", FileName );
- fprintf( pAbc->Err, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
@@ -7470,14 +7391,14 @@ int Abc_CommandCareSet( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1 );
if ( pNtkNew == NULL )
{
- fprintf( pAbc->Err, "Reading network from file has failed.\n" );
+ Abc_Print( -1, "Reading network from file has failed.\n" );
return 1;
}
// replace the EXDC
if ( pNtk->pExcare )
{
- Abc_NtkDelete( pNtk->pExcare );
+ Abc_NtkDelete( (Abc_Ntk_t *)pNtk->pExcare );
pNtk->pExcare = NULL;
}
pNtkRes = Abc_NtkDup( pNtk );
@@ -7488,10 +7409,10 @@ int Abc_CommandCareSet( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: care_set [-h] <file>\n" );
- fprintf( pErr, "\t sets the network from file as a care for the current network\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t<file> : file with the new care network\n");
+ Abc_Print( -2, "usage: care_set [-h] <file>\n" );
+ Abc_Print( -2, "\t sets the network from file as a care for the current network\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : file with the new care network\n");
return 1;
}
@@ -7511,17 +7432,12 @@ int Abc_CommandCut( Abc_Frame_t * pAbc, int argc, char ** argv )
Cut_Params_t Params, * pParams = &Params;
Cut_Man_t * pCutMan;
Cut_Oracle_t * pCutOracle = NULL;
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fOracle;
extern Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
extern void Abc_NtkCutsOracle( Abc_Ntk_t * pNtk, Cut_Oracle_t * pCutOracle );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fOracle = 0;
memset( pParams, 0, sizeof(Cut_Params_t) );
@@ -7547,7 +7463,7 @@ int Abc_CommandCut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
pParams->nVarsMax = atoi(argv[globalUtilOptind]);
@@ -7558,7 +7474,7 @@ int Abc_CommandCut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-M\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pParams->nKeepMax = atoi(argv[globalUtilOptind]);
@@ -7614,22 +7530,22 @@ int Abc_CommandCut( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Cut computation is available only for AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "Cut computation is available only for AIGs (run \"strash\").\n" );
return 1;
}
if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
{
- fprintf( pErr, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
+ Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
return 1;
}
if ( pParams->fDag && pParams->fTree )
{
- fprintf( pErr, "Cannot compute both DAG cuts and tree cuts at the same time.\n" );
+ Abc_Print( -1, "Cannot compute both DAG cuts and tree cuts at the same time.\n" );
return 1;
}
@@ -7648,23 +7564,23 @@ int Abc_CommandCut( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: cut [-K num] [-M num] [-tfdcovamjvh]\n" );
- fprintf( pErr, "\t computes k-feasible cuts for the AIG\n" );
- fprintf( pErr, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
- fprintf( pErr, "\t-M num : max number of cuts stored at a node [default = %d]\n", pParams->nKeepMax );
- fprintf( pErr, "\t-t : toggle truth table computation [default = %s]\n", pParams->fTruth? "yes": "no" );
- fprintf( pErr, "\t-f : toggle filtering of duplicated/dominated [default = %s]\n", pParams->fFilter? "yes": "no" );
- fprintf( pErr, "\t-d : toggle dropping when fanouts are done [default = %s]\n", pParams->fDrop? "yes": "no" );
- fprintf( pErr, "\t-x : toggle computing only DAG cuts [default = %s]\n", pParams->fDag? "yes": "no" );
- fprintf( pErr, "\t-y : toggle computing only tree cuts [default = %s]\n", pParams->fTree? "yes": "no" );
- fprintf( pErr, "\t-g : toggle computing only global cuts [default = %s]\n", pParams->fGlobal? "yes": "no" );
- fprintf( pErr, "\t-l : toggle computing only local cuts [default = %s]\n", pParams->fLocal? "yes": "no" );
- fprintf( pErr, "\t-z : toggle fancy computations [default = %s]\n", pParams->fFancy? "yes": "no" );
- fprintf( pErr, "\t-a : toggle recording cut functions [default = %s]\n", pParams->fRecordAig?"yes": "no" );
- fprintf( pErr, "\t-m : toggle delay-oriented FPGA mapping [default = %s]\n", pParams->fMap? "yes": "no" );
- fprintf( pErr, "\t-j : toggle removing fanouts due to XOR/MUX [default = %s]\n", pParams->fAdjust? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: cut [-K num] [-M num] [-tfdcovamjvh]\n" );
+ Abc_Print( -2, "\t computes k-feasible cuts for the AIG\n" );
+ Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
+ Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n", pParams->nKeepMax );
+ Abc_Print( -2, "\t-t : toggle truth table computation [default = %s]\n", pParams->fTruth? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle filtering of duplicated/dominated [default = %s]\n", pParams->fFilter? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggle dropping when fanouts are done [default = %s]\n", pParams->fDrop? "yes": "no" );
+ Abc_Print( -2, "\t-x : toggle computing only DAG cuts [default = %s]\n", pParams->fDag? "yes": "no" );
+ Abc_Print( -2, "\t-y : toggle computing only tree cuts [default = %s]\n", pParams->fTree? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggle computing only global cuts [default = %s]\n", pParams->fGlobal? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle computing only local cuts [default = %s]\n", pParams->fLocal? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle fancy computations [default = %s]\n", pParams->fFancy? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggle recording cut functions [default = %s]\n", pParams->fRecordAig?"yes": "no" );
+ Abc_Print( -2, "\t-m : toggle delay-oriented FPGA mapping [default = %s]\n", pParams->fMap? "yes": "no" );
+ Abc_Print( -2, "\t-j : toggle removing fanouts due to XOR/MUX [default = %s]\n", pParams->fAdjust? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -7683,15 +7599,10 @@ int Abc_CommandScut( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Cut_Params_t Params, * pParams = &Params;
Cut_Man_t * pCutMan;
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
extern Cut_Man_t * Abc_NtkSeqCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
memset( pParams, 0, sizeof(Cut_Params_t) );
pParams->nVarsMax = 5; // the max cut size ("k" of the k-feasible cuts)
@@ -7708,7 +7619,7 @@ int Abc_CommandScut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
pParams->nVarsMax = atoi(argv[globalUtilOptind]);
@@ -7719,7 +7630,7 @@ int Abc_CommandScut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-M\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pParams->nKeepMax = atoi(argv[globalUtilOptind]);
@@ -7742,19 +7653,19 @@ int Abc_CommandScut( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
/*
if ( !Abc_NtkIsSeq(pNtk) )
{
- fprintf( pErr, "Sequential cuts can be computed for sequential AIGs (run \"seq\").\n" );
+ Abc_Print( -1, "Sequential cuts can be computed for sequential AIGs (run \"seq\").\n" );
return 1;
}
*/
if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
{
- fprintf( pErr, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
+ Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
return 1;
}
@@ -7763,13 +7674,13 @@ int Abc_CommandScut( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: scut [-K num] [-M num] [-tvh]\n" );
- fprintf( pErr, "\t computes k-feasible cuts for the sequential AIG\n" );
- fprintf( pErr, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
- fprintf( pErr, "\t-M num : max number of cuts stored at a node [default = %d]\n", pParams->nKeepMax );
- fprintf( pErr, "\t-t : toggle truth table computation [default = %s]\n", pParams->fTruth? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: scut [-K num] [-M num] [-tvh]\n" );
+ Abc_Print( -2, "\t computes k-feasible cuts for the sequential AIG\n" );
+ Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
+ Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n", pParams->nKeepMax );
+ Abc_Print( -2, "\t-t : toggle truth table computation [default = %s]\n", pParams->fTruth? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -7786,17 +7697,12 @@ usage:
***********************************************************************/
int Abc_CommandEspresso( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fVerbose;
extern void Abc_NtkEspresso( Abc_Ntk_t * pNtk, int fVerbose );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
- printf( "This command is currently disabled.\n" );
+ Abc_Print( -1, "This command is currently disabled.\n" );
return 0;
// set defaults
@@ -7817,22 +7723,22 @@ int Abc_CommandEspresso( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "SOP minimization is possible for logic networks (run \"renode\").\n" );
+ Abc_Print( -1, "SOP minimization is possible for logic networks (run \"renode\").\n" );
return 1;
}
// Abc_NtkEspresso( pNtk, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: espresso [-vh]\n" );
- fprintf( pErr, "\t minimizes SOPs of the local functions using Espresso\n" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: espresso [-vh]\n" );
+ Abc_Print( -2, "\t minimizes SOPs of the local functions using Espresso\n" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -7849,8 +7755,7 @@ usage:
***********************************************************************/
int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nVars;
int fAdder;
@@ -7868,10 +7773,6 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Abc_GenOneHot( char * pFileName, int nVars );
extern void Abc_GenRandom( char * pFileName, int nPis );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nVars = 8;
fAdder = 0;
@@ -7889,7 +7790,7 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nVars = atoi(argv[globalUtilOptind]);
@@ -7947,22 +7848,22 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
else if ( fRandom )
Abc_GenRandom( FileName, nVars );
else
- printf( "Type of circuit is not specified.\n" );
+ Abc_Print( -1, "Type of circuit is not specified.\n" );
return 0;
usage:
- fprintf( pErr, "usage: gen [-N num] [-asmftrvh] <file>\n" );
- fprintf( pErr, "\t generates simple circuits\n" );
- fprintf( pErr, "\t-N num : the number of variables [default = %d]\n", nVars );
- fprintf( pErr, "\t-a : generate ripple-carry adder [default = %s]\n", fAdder? "yes": "no" );
- fprintf( pErr, "\t-s : generate a sorter [default = %s]\n", fSorter? "yes": "no" );
- fprintf( pErr, "\t-m : generate a mesh [default = %s]\n", fMesh? "yes": "no" );
- fprintf( pErr, "\t-f : generate a LUT FPGA structure [default = %s]\n", fFpga? "yes": "no" );
- fprintf( pErr, "\t-t : generate one-hotness conditions [default = %s]\n", fOneHot? "yes": "no" );
- fprintf( pErr, "\t-r : generate random single-output function [default = %s]\n", fRandom? "yes": "no" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t<file> : output file name\n");
+ Abc_Print( -2, "usage: gen [-N num] [-asmftrvh] <file>\n" );
+ Abc_Print( -2, "\t generates simple circuits\n" );
+ Abc_Print( -2, "\t-N num : the number of variables [default = %d]\n", nVars );
+ Abc_Print( -2, "\t-a : generate ripple-carry adder [default = %s]\n", fAdder? "yes": "no" );
+ Abc_Print( -2, "\t-s : generate a sorter [default = %s]\n", fSorter? "yes": "no" );
+ Abc_Print( -2, "\t-m : generate a mesh [default = %s]\n", fMesh? "yes": "no" );
+ Abc_Print( -2, "\t-f : generate a LUT FPGA structure [default = %s]\n", fFpga? "yes": "no" );
+ Abc_Print( -2, "\t-t : generate one-hotness conditions [default = %s]\n", fOneHot? "yes": "no" );
+ Abc_Print( -2, "\t-r : generate random single-output function [default = %s]\n", fRandom? "yes": "no" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : output file name\n");
return 1;
}
@@ -7979,7 +7880,6 @@ usage:
***********************************************************************/
int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fVerbose;
@@ -7987,11 +7887,7 @@ int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
int fUseEsop;
int fUseInvs;
int nFaninMax;
- extern Abc_Ntk_t * Abc_NtkSopEsopCover( Abc_Ntk_t * pNtk, int nFaninMax, bool fUseEsop, bool fUseSop, bool fUseInvs, bool fVerbose );
-
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fUseSop = 1;
@@ -8007,7 +7903,7 @@ int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nFaninMax = atoi(argv[globalUtilOptind]);
@@ -8035,13 +7931,13 @@ int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for strashed networks.\n" );
+ Abc_Print( -1, "Only works for strashed networks.\n" );
return 1;
}
@@ -8049,7 +7945,7 @@ int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkSopEsopCover( pNtk, nFaninMax, fUseEsop, fUseSop, fUseInvs, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -8057,14 +7953,14 @@ int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: cover [-N num] [-sxvh]\n" );
- fprintf( pErr, "\t decomposition into a network of SOP/ESOP PLAs\n" );
- fprintf( pErr, "\t-N num : maximum number of inputs [default = %d]\n", nFaninMax );
- fprintf( pErr, "\t-s : toggle the use of SOPs [default = %s]\n", fUseSop? "yes": "no" );
- fprintf( pErr, "\t-x : toggle the use of ESOPs [default = %s]\n", fUseEsop? "yes": "no" );
-// fprintf( pErr, "\t-i : toggle the use of interters [default = %s]\n", fUseInvs? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: cover [-N num] [-sxvh]\n" );
+ Abc_Print( -2, "\t decomposition into a network of SOP/ESOP PLAs\n" );
+ Abc_Print( -2, "\t-N num : maximum number of inputs [default = %d]\n", nFaninMax );
+ Abc_Print( -2, "\t-s : toggle the use of SOPs [default = %s]\n", fUseSop? "yes": "no" );
+ Abc_Print( -2, "\t-x : toggle the use of ESOPs [default = %s]\n", fUseEsop? "yes": "no" );
+// Abc_Print( -2, "\t-i : toggle the use of interters [default = %s]\n", fUseInvs? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -8081,7 +7977,6 @@ usage:
***********************************************************************/
int Abc_CommandInter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes = NULL;
char ** pArgvNew;
int nArgcNew;
@@ -8091,9 +7986,6 @@ int Abc_CommandInter( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkInter( Abc_Ntk_t * pNtkOn, Abc_Ntk_t * pNtkOff, int fRelation, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fRelation = 0;
fVerbose = 0;
@@ -8117,20 +8009,20 @@ int Abc_CommandInter( Abc_Frame_t * pAbc, int argc, char ** argv )
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( nArgcNew == 0 )
{
Abc_Obj_t * pObj;
int i;
- printf( "Deriving new circuit structure for the current network.\n" );
+ Abc_Print( -1, "Deriving new circuit structure for the current network.\n" );
Abc_NtkForEachPo( pNtk2, pObj, i )
Abc_ObjXorFaninC( pObj, 0 );
}
if ( fRelation && Abc_NtkCoNum(pNtk1) != 1 )
{
- printf( "Computation of interplants as a relation only works for single-output functions.\n" );
- printf( "Use command \"cone\" to extract one output cone from the multi-output network.\n" );
+ Abc_Print( -1, "Computation of interplants as a relation only works for single-output functions.\n" );
+ Abc_Print( -1, "Use command \"cone\" to extract one output cone from the multi-output network.\n" );
}
else
pNtkRes = Abc_NtkInter( pNtk1, pNtk2, fRelation, fVerbose );
@@ -8139,33 +8031,33 @@ int Abc_CommandInter( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
return 0;
usage:
- fprintf( pErr, "usage: inter [-rvh] <onset.blif> <offset.blif>\n" );
- fprintf( pErr, "\t derives interpolant of two networks representing onset and offset;\n" );
- fprintf( pErr, "\t-r : toggle computing interpolant as a relation [default = %s]\n", fRelation? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t \n" );
- fprintf( pErr, "\t Comments:\n" );
- fprintf( pErr, "\t \n" );
- fprintf( pErr, "\t The networks given on the command line should have the same CIs/COs.\n" );
- fprintf( pErr, "\t If only one network is given on the command line, this network\n" );
- fprintf( pErr, "\t is assumed to be the offset, while the current network is the onset.\n" );
- fprintf( pErr, "\t If no network is given on the command line, the current network is\n" );
- fprintf( pErr, "\t assumed to be the onset and its complement is taken to be the offset.\n" );
- fprintf( pErr, "\t The resulting interpolant is stored as the current network.\n" );
- fprintf( pErr, "\t To verify that the interpolant agrees with the onset and the offset,\n" );
- fprintf( pErr, "\t save it in file \"inter.blif\" and run the following:\n" );
- fprintf( pErr, "\t (a) \"miter -i <onset.blif> <inter.blif>; iprove\"\n" );
- fprintf( pErr, "\t (b) \"miter -i <inter.blif> <offset_inv.blif>; iprove\"\n" );
- fprintf( pErr, "\t where <offset_inv.blif> is the network derived by complementing the\n" );
- fprintf( pErr, "\t outputs of <offset.blif>: \"r <onset.blif>; st -i; w <offset_inv.blif>\"\n" );
+ Abc_Print( -2, "usage: inter [-rvh] <onset.blif> <offset.blif>\n" );
+ Abc_Print( -2, "\t derives interpolant of two networks representing onset and offset;\n" );
+ Abc_Print( -2, "\t-r : toggle computing interpolant as a relation [default = %s]\n", fRelation? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t \n" );
+ Abc_Print( -2, "\t Comments:\n" );
+ Abc_Print( -2, "\t \n" );
+ Abc_Print( -2, "\t The networks given on the command line should have the same CIs/COs.\n" );
+ Abc_Print( -2, "\t If only one network is given on the command line, this network\n" );
+ Abc_Print( -2, "\t is assumed to be the offset, while the current network is the onset.\n" );
+ Abc_Print( -2, "\t If no network is given on the command line, the current network is\n" );
+ Abc_Print( -2, "\t assumed to be the onset and its complement is taken to be the offset.\n" );
+ Abc_Print( -2, "\t The resulting interpolant is stored as the current network.\n" );
+ Abc_Print( -2, "\t To verify that the interpolant agrees with the onset and the offset,\n" );
+ Abc_Print( -2, "\t save it in file \"inter.blif\" and run the following:\n" );
+ Abc_Print( -2, "\t (a) \"miter -i <onset.blif> <inter.blif>; iprove\"\n" );
+ Abc_Print( -2, "\t (b) \"miter -i <inter.blif> <offset_inv.blif>; iprove\"\n" );
+ Abc_Print( -2, "\t where <offset_inv.blif> is the network derived by complementing the\n" );
+ Abc_Print( -2, "\t outputs of <offset.blif>: \"r <onset.blif>; st -i; w <offset_inv.blif>\"\n" );
return 1;
}
@@ -8182,7 +8074,6 @@ usage:
***********************************************************************/
int Abc_CommandDouble( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int nFrames;
@@ -8190,9 +8081,6 @@ int Abc_CommandDouble( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nFrames = 50;
fVerbose = 0;
@@ -8204,7 +8092,7 @@ int Abc_CommandDouble( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -8223,31 +8111,86 @@ int Abc_CommandDouble( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsSopLogic(pNtk) )
{
- fprintf( pErr, "Only works for logic SOP networks.\n" );
+ Abc_Print( -1, "Only works for logic SOP networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDouble( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
return 0;
usage:
- fprintf( pErr, "usage: double [-vh]\n" );
- fprintf( pErr, "\t puts together two parallel copies of the current network\n" );
-// fprintf( pErr, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: double [-vh]\n" );
+ Abc_Print( -2, "\t puts together two parallel copies of the current network\n" );
+// Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandBb2Wb( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern void Abc_NtkConvertBb2Wb( char * pFileNameIn, char * pFileNameOut, int fSeq, int fVerbose );
+ int c;
+ int fSeq;
+ int fVerbose;
+ // set defaults
+ fSeq = 0;
+ fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 's':
+ fSeq ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ default:
+ goto usage;
+ }
+ }
+ if ( argc != globalUtilOptind + 2 )
+ {
+ Abc_Print( -1, "Expecting two files names on the command line.\n" );
+ goto usage;
+ }
+ Abc_NtkConvertBb2Wb( argv[globalUtilOptind], argv[globalUtilOptind+1], fSeq, fVerbose );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: bb2wb [-svh] <file_in> <file_out>\n" );
+ Abc_Print( -2, "\t replaces black boxes by white boxes with AND functions\n" );
+ Abc_Print( -2, "\t (file names should have standard extensions, e.g. \"blif\")\n" );
+ Abc_Print( -2, "\t-s : toggle using sequential white boxes [default = %s]\n", fSeq? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file_in> : input file with design containing black boxes\n");
+ Abc_Print( -2, "\t<file_out> : output file with design containing white boxes\n");
return 1;
}
@@ -8264,8 +8207,7 @@ usage:
***********************************************************************/
int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Ntk_t * pNtkRes = NULL;
int c;
int fBmc;
@@ -8302,10 +8244,10 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkCRetime( Abc_Ntk_t * pNtk, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-// printf( "This command is temporarily disabled.\n" );
+
+
+// Abc_Print( -1, "This command is temporarily disabled.\n" );
// return 0;
// set defaults
@@ -8322,7 +8264,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -8333,7 +8275,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nLevels = atoi(argv[globalUtilOptind]);
@@ -8359,19 +8301,19 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
/*
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsSeq(pNtk) )
{
- fprintf( pErr, "Only works for non-sequential networks.\n" );
+ Abc_Print( -1, "Only works for non-sequential networks.\n" );
return 1;
}
*/
// Abc_NtkTestEsop( pNtk );
// Abc_NtkTestSop( pNtk );
-// printf( "This command is currently not used.\n" );
+// Abc_Print( -1, "This command is currently not used.\n" );
// run the command
// pNtkRes = Abc_NtkMiterForCofactors( pNtk, 0, 0, -1 );
// pNtkRes = Abc_NtkNewAig( pNtk );
@@ -8380,7 +8322,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = NULL;
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 1;
}
// replace the current network
@@ -8414,7 +8356,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// pNtkRes = NULL;
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 1;
}
// replace the current network
@@ -8439,21 +8381,21 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
/*
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Network should be strashed. Command has failed.\n" );
+ Abc_Print( -1, "Network should be strashed. Command has failed.\n" );
return 1;
}
*/
/*
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
*/
/*
if ( Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for logic circuits.\n" );
+ Abc_Print( -1, "Currently only works for logic circuits.\n" );
return 0;
}
*/
@@ -8467,7 +8409,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// pNtkRes = NULL;
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 1;
}
// replace the current network
@@ -8480,7 +8422,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
/*
if ( globalUtilOptind != 1 )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 1;
}
Abc_NtkDarTestBlif( argv[globalUtilOptind] );
@@ -8488,13 +8430,15 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// Abc_NtkDarPartition( pNtk );
//Abc_NtkDarTest( pNtk );
+//Abc_NtkWriteAig( pNtk, NULL );
+
/*
// pNtkRes = Abc_NtkDarRetimeStep( pNtk, 0 );
pNtkRes = Abc_NtkDarHaigRecord( pNtk, 3, 3000, 0, 0, 0, 0 );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 1;
}
// replace the current network
@@ -8505,7 +8449,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarTestNtk( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 1;
}
// replace the current network
@@ -8527,23 +8471,29 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
Aig_ManStop( pAig );
}
*/
+
+/*
// Bbl_ManSimpleDemo();
// pNtkRes = Abc_NtkCRetime( pNtk );
pNtkRes = NULL;
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 1;
}
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+*/
+
+// Abc_NtkHelloWorld( pNtk );
+
return 0;
usage:
- fprintf( pErr, "usage: test [-h] <file_name>\n" );
- fprintf( pErr, "\t testbench for new procedures\n" );
-// fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-// fprintf( pErr, "\t-w : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: test [-h] <file_name>\n" );
+ Abc_Print( -2, "\t testbench for new procedures\n" );
+// Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+// Abc_Print( -2, "\t-w : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -8560,15 +8510,11 @@ usage:
***********************************************************************/
int Abc_CommandQuaVar( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, iVar, fUniv, fVerbose, RetValue;
extern int Abc_NtkQuantify( Abc_Ntk_t * pNtk, int fUniv, int iVar, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
iVar = 0;
fUniv = 0;
@@ -8581,7 +8527,7 @@ int Abc_CommandQuaVar( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
iVar = atoi(argv[globalUtilOptind]);
@@ -8603,12 +8549,12 @@ int Abc_CommandQuaVar( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum( pNtk ) )
{
- fprintf( pErr, "This command cannot be applied to an AIG with choice nodes.\n" );
+ Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
return 1;
}
@@ -8617,11 +8563,11 @@ int Abc_CommandQuaVar( Abc_Frame_t * pAbc, int argc, char ** argv )
RetValue = Abc_NtkQuantify( pNtkRes, fUniv, iVar, fVerbose );
// clean temporary storage for the cofactors
Abc_NtkCleanData( pNtkRes );
- Abc_AigCleanup( pNtkRes->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkRes->pManFunc );
// check the result
if ( !RetValue )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -8629,12 +8575,12 @@ int Abc_CommandQuaVar( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: qvar [-I num] [-uvh]\n" );
- fprintf( pErr, "\t quantifies one variable using the AIG\n" );
- fprintf( pErr, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
- fprintf( pErr, "\t-u : toggle universal quantification [default = %s]\n", fUniv? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: qvar [-I num] [-uvh]\n" );
+ Abc_Print( -2, "\t quantifies one variable using the AIG\n" );
+ Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
+ Abc_Print( -2, "\t-u : toggle universal quantification [default = %s]\n", fUniv? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -8651,15 +8597,11 @@ usage:
***********************************************************************/
int Abc_CommandQuaRel( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, iVar, fInputs, fVerbose;
extern Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
iVar = 0;
fInputs = 1;
@@ -8672,7 +8614,7 @@ int Abc_CommandQuaRel( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
iVar = atoi(argv[globalUtilOptind]);
@@ -8694,17 +8636,17 @@ int Abc_CommandQuaRel( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum( pNtk ) )
{
- fprintf( pErr, "This command cannot be applied to an AIG with choice nodes.\n" );
+ Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "This command works only for sequential circuits.\n" );
+ Abc_Print( -1, "This command works only for sequential circuits.\n" );
return 1;
}
@@ -8720,7 +8662,7 @@ int Abc_CommandQuaRel( Abc_Frame_t * pAbc, int argc, char ** argv )
// check if the result is available
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -8728,12 +8670,12 @@ int Abc_CommandQuaRel( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: qrel [-qvh]\n" );
- fprintf( pErr, "\t computes transition relation of the sequential network\n" );
-// fprintf( pErr, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
- fprintf( pErr, "\t-q : perform quantification of inputs [default = %s]\n", fInputs? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: qrel [-qvh]\n" );
+ Abc_Print( -2, "\t computes transition relation of the sequential network\n" );
+// Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
+ Abc_Print( -2, "\t-q : perform quantification of inputs [default = %s]\n", fInputs? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -8750,15 +8692,11 @@ usage:
***********************************************************************/
int Abc_CommandQuaReach( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nIters, fVerbose;
extern Abc_Ntk_t * Abc_NtkReachability( Abc_Ntk_t * pNtk, int nIters, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nIters = 256;
fVerbose = 0;
@@ -8770,7 +8708,7 @@ int Abc_CommandQuaReach( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
nIters = atoi(argv[globalUtilOptind]);
@@ -8789,39 +8727,39 @@ int Abc_CommandQuaReach( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum( pNtk ) )
{
- fprintf( pErr, "This command cannot be applied to an AIG with choice nodes.\n" );
+ Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
return 1;
}
if ( !Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "This command works only for combinational transition relations.\n" );
+ Abc_Print( -1, "This command works only for combinational transition relations.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
if ( Abc_NtkPoNum(pNtk) > 1 )
{
- fprintf( pErr, "The transition relation should have one output.\n" );
+ Abc_Print( -1, "The transition relation should have one output.\n" );
return 1;
}
if ( Abc_NtkPiNum(pNtk) % 2 != 0 )
{
- fprintf( pErr, "The transition relation should have an even number of inputs.\n" );
+ Abc_Print( -1, "The transition relation should have an even number of inputs.\n" );
return 1;
}
pNtkRes = Abc_NtkReachability( pNtk, nIters, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -8829,13 +8767,13 @@ int Abc_CommandQuaReach( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: qreach [-I num] [-vh]\n" );
- fprintf( pErr, "\t computes unreachable states using AIG-based quantification\n" );
- fprintf( pErr, "\t assumes that the current network is a transition relation\n" );
- fprintf( pErr, "\t assumes that the initial state is composed of all zeros\n" );
- fprintf( pErr, "\t-I num : the number of image computations to perform [default = %d]\n", nIters );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: qreach [-I num] [-vh]\n" );
+ Abc_Print( -2, "\t computes unreachable states using AIG-based quantification\n" );
+ Abc_Print( -2, "\t assumes that the current network is a transition relation\n" );
+ Abc_Print( -2, "\t assumes that the initial state is composed of all zeros\n" );
+ Abc_Print( -2, "\t-I num : the number of image computations to perform [default = %d]\n", nIters );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -8852,17 +8790,11 @@ usage:
***********************************************************************/
int Abc_CommandSenseInput( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Vec_Int_t * vResult;
int c, nConfLim, fVerbose;
extern Vec_Int_t * Abc_NtkSensitivity( Abc_Ntk_t * pNtk, int nConfLim, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nConfLim = 1000;
fVerbose = 1;
@@ -8874,7 +8806,7 @@ int Abc_CommandSenseInput( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLim = atoi(argv[globalUtilOptind]);
@@ -8893,27 +8825,27 @@ int Abc_CommandSenseInput( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkGetChoiceNum( pNtk ) )
{
- fprintf( pErr, "This command cannot be applied to an AIG with choice nodes.\n" );
+ Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
return 1;
}
if ( !Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "This command works only for combinational transition relations.\n" );
+ Abc_Print( -1, "This command works only for combinational transition relations.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
if ( Abc_NtkPoNum(pNtk) < 2 )
{
- fprintf( pErr, "The network should have at least two outputs.\n" );
+ Abc_Print( -1, "The network should have at least two outputs.\n" );
return 1;
}
@@ -8922,12 +8854,12 @@ int Abc_CommandSenseInput( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: senseinput [-C num] [-vh]\n" );
- fprintf( pErr, "\t computes sensitivity of POs to PIs under constraint\n" );
- fprintf( pErr, "\t constraint should be represented as the last PO" );
- fprintf( pErr, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfLim );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: senseinput [-C num] [-vh]\n" );
+ Abc_Print( -2, "\t computes sensitivity of POs to PIs under constraint\n" );
+ Abc_Print( -2, "\t constraint should be represented as the last PO" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfLim );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -8945,15 +8877,11 @@ usage:
***********************************************************************/
int Abc_CommandIStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
int c;
extern Abc_Ntk_t * Abc_NtkIvyStrash( Abc_Ntk_t * pNtk );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -8968,7 +8896,7 @@ int Abc_CommandIStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
@@ -8981,7 +8909,7 @@ int Abc_CommandIStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkIvyStrash( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -8989,9 +8917,9 @@ int Abc_CommandIStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: istrash [-h]\n" );
- fprintf( pErr, "\t perform sequential structural hashing\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: istrash [-h]\n" );
+ Abc_Print( -2, "\t perform sequential structural hashing\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9008,15 +8936,10 @@ usage:
***********************************************************************/
int Abc_CommandICut( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c, nInputs;
extern void Abc_NtkIvyCuts( Abc_Ntk_t * pNtk, int nInputs );
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nInputs = 5;
Extra_UtilGetoptReset();
@@ -9027,7 +8950,7 @@ int Abc_CommandICut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nInputs = atoi(argv[globalUtilOptind]);
@@ -9043,12 +8966,12 @@ int Abc_CommandICut( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
@@ -9056,10 +8979,10 @@ int Abc_CommandICut( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: icut [-K num] [-h]\n" );
- fprintf( pErr, "\t computes sequential cuts of the given size\n" );
- fprintf( pErr, "\t-K num : the number of cut inputs (2 <= num <= 6) [default = %d]\n", nInputs );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: icut [-K num] [-h]\n" );
+ Abc_Print( -2, "\t computes sequential cuts of the given size\n" );
+ Abc_Print( -2, "\t-K num : the number of cut inputs (2 <= num <= 6) [default = %d]\n", nInputs );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9076,15 +8999,11 @@ usage:
***********************************************************************/
int Abc_CommandIRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, fUpdateLevel, fUseZeroCost, fVerbose;
extern Abc_Ntk_t * Abc_NtkIvyRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeroCost, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUpdateLevel = 1;
fUseZeroCost = 0;
@@ -9111,19 +9030,19 @@ int Abc_CommandIRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkIvyRewrite( pNtk, fUpdateLevel, fUseZeroCost, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9131,12 +9050,12 @@ int Abc_CommandIRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: irw [-lzvh]\n" );
- fprintf( pErr, "\t perform combinational AIG rewriting\n" );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: irw [-lzvh]\n" );
+ Abc_Print( -2, "\t perform combinational AIG rewriting\n" );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9153,7 +9072,6 @@ usage:
***********************************************************************/
int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
Dar_RwrPar_t Pars, * pPars = &Pars;
int c;
@@ -9161,9 +9079,6 @@ int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Dar_ManDefaultRwrParams( pPars );
Extra_UtilGetoptReset();
@@ -9174,7 +9089,7 @@ int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nCutsMax = atoi(argv[globalUtilOptind]);
@@ -9185,7 +9100,7 @@ int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nSubgMax = atoi(argv[globalUtilOptind]);
@@ -9219,18 +9134,18 @@ int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDRewrite( pNtk, pPars );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9238,17 +9153,17 @@ int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: drw [-C num] [-N num] [-lfzrvwh]\n" );
- fprintf( pErr, "\t performs combinational AIG rewriting\n" );
- fprintf( pErr, "\t-C num : the max number of cuts at a node [default = %d]\n", pPars->nCutsMax );
- fprintf( pErr, "\t-N num : the max number of subgraphs tried [default = %d]\n", pPars->nSubgMax );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-f : toggle representing fanouts [default = %s]\n", pPars->fFanout? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
- fprintf( pErr, "\t-r : toggle using cut recycling [default = %s]\n", pPars->fRecycle? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: drw [-C num] [-N num] [-lfzrvwh]\n" );
+ Abc_Print( -2, "\t performs combinational AIG rewriting\n" );
+ Abc_Print( -2, "\t-C num : the max number of cuts at a node [default = %d]\n", pPars->nCutsMax );
+ Abc_Print( -2, "\t-N num : the max number of subgraphs tried [default = %d]\n", pPars->nSubgMax );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle representing fanouts [default = %s]\n", pPars->fFanout? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle using cut recycling [default = %s]\n", pPars->fRecycle? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9265,7 +9180,6 @@ usage:
***********************************************************************/
int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
Dar_RefPar_t Pars, * pPars = &Pars;
int c;
@@ -9273,9 +9187,6 @@ int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDRefactor( Abc_Ntk_t * pNtk, Dar_RefPar_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Dar_ManDefaultRefParams( pPars );
Extra_UtilGetoptReset();
@@ -9286,7 +9197,7 @@ int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMffcMin = atoi(argv[globalUtilOptind]);
@@ -9297,7 +9208,7 @@ int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nLeafMax = atoi(argv[globalUtilOptind]);
@@ -9308,7 +9219,7 @@ int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nCutsMax = atoi(argv[globalUtilOptind]);
@@ -9339,23 +9250,23 @@ int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
if ( pPars->nLeafMax < 4 || pPars->nLeafMax > 15 )
{
- fprintf( pErr, "This command only works for cut sizes 4 <= K <= 15.\n" );
+ Abc_Print( -1, "This command only works for cut sizes 4 <= K <= 15.\n" );
return 1;
}
pNtkRes = Abc_NtkDRefactor( pNtk, pPars );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9363,17 +9274,17 @@ int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: drf [-M num] [-K num] [-C num] [-elzvwh]\n" );
- fprintf( pErr, "\t performs combinational AIG refactoring\n" );
- fprintf( pErr, "\t-M num : the min MFFC size to attempt refactoring [default = %d]\n", pPars->nMffcMin );
- fprintf( pErr, "\t-K num : the max number of cuts leaves [default = %d]\n", pPars->nLeafMax );
- fprintf( pErr, "\t-C num : the max number of cuts to try at a node [default = %d]\n", pPars->nCutsMax );
- fprintf( pErr, "\t-e : toggle extending tbe cut below MFFC [default = %s]\n", pPars->fExtend? "yes": "no" );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: drf [-M num] [-K num] [-C num] [-elzvwh]\n" );
+ Abc_Print( -2, "\t performs combinational AIG refactoring\n" );
+ Abc_Print( -2, "\t-M num : the min MFFC size to attempt refactoring [default = %d]\n", pPars->nMffcMin );
+ Abc_Print( -2, "\t-K num : the max number of cuts leaves [default = %d]\n", pPars->nLeafMax );
+ Abc_Print( -2, "\t-C num : the max number of cuts to try at a node [default = %d]\n", pPars->nCutsMax );
+ Abc_Print( -2, "\t-e : toggle extending tbe cut below MFFC [default = %s]\n", pPars->fExtend? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9388,18 +9299,14 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandDC2( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandDc2( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int fBalance, fVerbose, fUpdateLevel, fFanout, fPower, c;
extern Abc_Ntk_t * Abc_NtkDC2( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fBalance = 0;
fVerbose = 0;
@@ -9434,18 +9341,18 @@ int Abc_CommandDC2( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDC2( pNtk, fBalance, fUpdateLevel, fFanout, fPower, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9453,14 +9360,14 @@ int Abc_CommandDC2( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dc2 [-blfpvh]\n" );
- fprintf( pErr, "\t performs combinational AIG optimization\n" );
- fprintf( pErr, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
- fprintf( pErr, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-f : toggle representing fanouts [default = %s]\n", fFanout? "yes": "no" );
- fprintf( pErr, "\t-p : toggle power-aware rewriting [default = %s]\n", fPower? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dc2 [-blfpvh]\n" );
+ Abc_Print( -2, "\t performs combinational AIG optimization\n" );
+ Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle representing fanouts [default = %s]\n", fFanout? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", fPower? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9478,7 +9385,6 @@ usage:
***********************************************************************/
int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int fBalance, fVerbose, fUpdateLevel, fConstruct, c;
int nConfMax, nLevelMax;
@@ -9486,9 +9392,6 @@ int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDChoice( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fConstruct, int nConfMax, int nLevelMax, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fBalance = 1;
fUpdateLevel = 1;
@@ -9504,7 +9407,7 @@ int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfMax = atoi(argv[globalUtilOptind]);
@@ -9515,7 +9418,7 @@ int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nLevelMax = atoi(argv[globalUtilOptind]);
@@ -9543,18 +9446,18 @@ int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDChoice( pNtk, fBalance, fUpdateLevel, fConstruct, nConfMax, nLevelMax, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9562,15 +9465,15 @@ int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dchoice [-C num] [-L num] [-blcvh]\n" );
- fprintf( pErr, "\t performs partitioned choicing using new AIG package\n" );
- fprintf( pErr, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
- fprintf( pErr, "\t-L num : the max level of nodes to consider (0 = not used) [default = %d]\n", nLevelMax );
- fprintf( pErr, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
- fprintf( pErr, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-c : toggle constructive computation of choices [default = %s]\n", fConstruct? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dchoice [-C num] [-L num] [-blcvh]\n" );
+ Abc_Print( -2, "\t performs partitioned choicing using new AIG package\n" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
+ Abc_Print( -2, "\t-L num : the max level of nodes to consider (0 = not used) [default = %d]\n", nLevelMax );
+ Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle constructive computation of choices [default = %s]\n", fConstruct? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9588,15 +9491,11 @@ usage:
int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Dch_Pars_t Pars, * pPars = &Pars;
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
extern Abc_Ntk_t * Abc_NtkDch( Abc_Ntk_t * pNtk, Dch_Pars_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Dch_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset();
@@ -9607,7 +9506,7 @@ int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWords = atoi(argv[globalUtilOptind]);
@@ -9618,7 +9517,7 @@ int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -9629,7 +9528,7 @@ int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
@@ -9666,18 +9565,18 @@ int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDch( pNtk, pPars );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9685,19 +9584,19 @@ int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dch [-WCS num] [-sptgcfvh]\n" );
- fprintf( pErr, "\t computes structural choices using a new approach\n" );
- fprintf( pErr, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
- fprintf( pErr, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( pErr, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
- fprintf( pErr, "\t-s : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
- fprintf( pErr, "\t-p : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
- fprintf( pErr, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
- fprintf( pErr, "\t-g : toggle using GIA to prove equivalences [default = %s]\n", pPars->fUseGia? "yes": "no" );
- fprintf( pErr, "\t-c : toggle using circuit-based SAT vs. MiniSat [default = %s]\n", pPars->fUseCSat? "yes": "no" );
- fprintf( pErr, "\t-f : toggle using faster logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dch [-WCS num] [-sptgcfvh]\n" );
+ Abc_Print( -2, "\t computes structural choices using a new approach\n" );
+ Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
+ Abc_Print( -2, "\t-s : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggle using GIA to prove equivalences [default = %s]\n", pPars->fUseGia? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle using circuit-based SAT vs. MiniSat [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle using faster logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9714,16 +9613,12 @@ usage:
***********************************************************************/
int Abc_CommandDrwsat( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int fBalance, fVerbose, c;
extern Abc_Ntk_t * Abc_NtkDrwsat( Abc_Ntk_t * pNtk, int fBalance, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fBalance = 0;
fVerbose = 0;
@@ -9746,18 +9641,18 @@ int Abc_CommandDrwsat( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDrwsat( pNtk, fBalance, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9765,11 +9660,11 @@ int Abc_CommandDrwsat( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: drwsat [-bvh]\n" );
- fprintf( pErr, "\t performs combinational AIG optimization for SAT\n" );
- fprintf( pErr, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: drwsat [-bvh]\n" );
+ Abc_Print( -2, "\t performs combinational AIG optimization for SAT\n" );
+ Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9786,15 +9681,11 @@ usage:
***********************************************************************/
int Abc_CommandIRewriteSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, fUpdateLevel, fUseZeroCost, fVerbose;
extern Abc_Ntk_t * Abc_NtkIvyRewriteSeq( Abc_Ntk_t * pNtk, int fUseZeroCost, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUpdateLevel = 0;
fUseZeroCost = 0;
@@ -9821,19 +9712,19 @@ int Abc_CommandIRewriteSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkIvyRewriteSeq( pNtk, fUseZeroCost, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9841,12 +9732,12 @@ int Abc_CommandIRewriteSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: irws [-zvh]\n" );
- fprintf( pErr, "\t perform sequential AIG rewriting\n" );
-// fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: irws [-zvh]\n" );
+ Abc_Print( -2, "\t perform sequential AIG rewriting\n" );
+// Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9863,15 +9754,11 @@ usage:
***********************************************************************/
int Abc_CommandIResyn( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, fUpdateLevel, fVerbose;
extern Abc_Ntk_t * Abc_NtkIvyResyn( Abc_Ntk_t * pNtk, int fUpdateLevel, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fUpdateLevel = 1;
fVerbose = 0;
@@ -9894,19 +9781,19 @@ int Abc_CommandIResyn( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkIvyResyn( pNtk, fUpdateLevel, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -9914,11 +9801,11 @@ int Abc_CommandIResyn( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: iresyn [-lvh]\n" );
- fprintf( pErr, "\t performs combinational resynthesis\n" );
- fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: iresyn [-lvh]\n" );
+ Abc_Print( -2, "\t performs combinational resynthesis\n" );
+ Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -9935,7 +9822,6 @@ usage:
***********************************************************************/
int Abc_CommandISat( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, fUpdateLevel, fVerbose;
int nConfLimit;
@@ -9943,9 +9829,6 @@ int Abc_CommandISat( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkIvySat( Abc_Ntk_t * pNtk, int nConfLimit, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nConfLimit = 100000;
fUpdateLevel = 1;
@@ -9958,7 +9841,7 @@ int Abc_CommandISat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -9980,19 +9863,19 @@ int Abc_CommandISat( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkIvySat( pNtk, nConfLimit, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -10000,12 +9883,12 @@ int Abc_CommandISat( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: isat [-C num] [-vh]\n" );
- fprintf( pErr, "\t tries to prove the miter constant 0\n" );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
-// fprintf( pErr, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: isat [-C num] [-vh]\n" );
+ Abc_Print( -2, "\t tries to prove the miter constant 0\n" );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+// Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10022,7 +9905,6 @@ usage:
***********************************************************************/
int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, fProve, fVerbose, fDoSparse;
int nConfLimit;
@@ -10033,9 +9915,6 @@ int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarFraigPart( Abc_Ntk_t * pNtk, int nPartSize, int nConfLimit, int nLevelMax, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nPartSize = 0;
nLevelMax = 0;
@@ -10051,7 +9930,7 @@ int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPartSize = atoi(argv[globalUtilOptind]);
@@ -10062,7 +9941,7 @@ int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -10073,7 +9952,7 @@ int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nLevelMax = atoi(argv[globalUtilOptind]);
@@ -10098,12 +9977,12 @@ int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
@@ -10113,7 +9992,7 @@ int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkIvyFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -10121,15 +10000,15 @@ int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: ifraig [-P num] [-C num] [-L num] [-spvh]\n" );
- fprintf( pErr, "\t performs fraiging using a new method\n" );
- fprintf( pErr, "\t-P num : partition size (0 = partitioning is not used) [default = %d]\n", nPartSize );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( pErr, "\t-L num : limit on node level to fraig (0 = fraig all nodes) [default = %d]\n", nLevelMax );
- fprintf( pErr, "\t-s : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
- fprintf( pErr, "\t-p : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: ifraig [-P num] [-C num] [-L num] [-spvh]\n" );
+ Abc_Print( -2, "\t performs fraiging using a new method\n" );
+ Abc_Print( -2, "\t-P num : partition size (0 = partitioning is not used) [default = %d]\n", nPartSize );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-L num : limit on node level to fraig (0 = fraig all nodes) [default = %d]\n", nLevelMax );
+ Abc_Print( -2, "\t-s : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10146,16 +10025,12 @@ usage:
***********************************************************************/
int Abc_CommandDFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nConfLimit, fDoSparse, fProve, fSpeculate, fChoicing, fVerbose;
extern Abc_Ntk_t * Abc_NtkDarFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fSpeculate, int fChoicing, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nConfLimit = 100;
fDoSparse = 1;
@@ -10171,7 +10046,7 @@ int Abc_CommandDFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -10202,19 +10077,19 @@ int Abc_CommandDFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDarFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fSpeculate, fChoicing, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -10222,15 +10097,15 @@ int Abc_CommandDFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dfraig [-C num] [-sprcvh]\n" );
- fprintf( pErr, "\t performs fraiging using a new method\n" );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( pErr, "\t-s : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
- fprintf( pErr, "\t-p : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
- fprintf( pErr, "\t-r : toggle speculative reduction [default = %s]\n", fSpeculate? "yes": "no" );
- fprintf( pErr, "\t-c : toggle accumulation of choices [default = %s]\n", fChoicing? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dfraig [-C num] [-sprcvh]\n" );
+ Abc_Print( -2, "\t performs fraiging using a new method\n" );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-s : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle speculative reduction [default = %s]\n", fSpeculate? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle accumulation of choices [default = %s]\n", fChoicing? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10247,16 +10122,12 @@ usage:
***********************************************************************/
int Abc_CommandCSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nCutsMax, nLeafMax, fVerbose;
extern Abc_Ntk_t * Abc_NtkCSweep( Abc_Ntk_t * pNtk, int nCutsMax, int nLeafMax, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nCutsMax = 8;
nLeafMax = 6;
@@ -10269,7 +10140,7 @@ int Abc_CommandCSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nCutsMax = atoi(argv[globalUtilOptind]);
@@ -10280,7 +10151,7 @@ int Abc_CommandCSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nLeafMax = atoi(argv[globalUtilOptind]);
@@ -10299,31 +10170,31 @@ int Abc_CommandCSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( nCutsMax < 2 )
{
- fprintf( pErr, "The number of cuts cannot be less than 2.\n" );
+ Abc_Print( -1, "The number of cuts cannot be less than 2.\n" );
return 1;
}
if ( nLeafMax < 3 || nLeafMax > 16 )
{
- fprintf( pErr, "The number of leaves is infeasible.\n" );
+ Abc_Print( -1, "The number of leaves is infeasible.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkCSweep( pNtk, nCutsMax, nLeafMax, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -10331,12 +10202,12 @@ int Abc_CommandCSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: csweep [-C num] [-K num] [-vh]\n" );
- fprintf( pErr, "\t performs cut sweeping using a new method\n" );
- fprintf( pErr, "\t-C num : limit on the number of cuts (C >= 2) [default = %d]\n", nCutsMax );
- fprintf( pErr, "\t-K num : limit on the cut size (3 <= K <= 16) [default = %d]\n", nLeafMax );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: csweep [-C num] [-K num] [-vh]\n" );
+ Abc_Print( -2, "\t performs cut sweeping using a new method\n" );
+ Abc_Print( -2, "\t-C num : limit on the number of cuts (C >= 2) [default = %d]\n", nCutsMax );
+ Abc_Print( -2, "\t-K num : limit on the cut size (3 <= K <= 16) [default = %d]\n", nLeafMax );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10354,16 +10225,12 @@ usage:
int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Prove_Params_t Params, * pParams = &Params;
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkTemp;
int c, clk, RetValue, iOut = -1;
extern int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Prove_ParamsSetDefault( pParams );
pParams->fUseRewriting = 1;
@@ -10387,13 +10254,13 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) > 0 )
{
- fprintf( pErr, "The network has registers. Use \"dprove\".\n" );
+ Abc_Print( -1, "The network has registers. Use \"dprove\".\n" );
return 1;
}
@@ -10419,29 +10286,29 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
break;
}
if ( i == Abc_NtkCoNum(pNtk) )
- printf( "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
+ Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
ABC_FREE( pSimInfo );
}
-
+ pAbc->Status = RetValue;
if ( RetValue == -1 )
- printf( "UNDECIDED " );
+ Abc_Print( 1, "UNDECIDED " );
else if ( RetValue == 0 )
- printf( "SATISFIABLE (output = %d) ", iOut );
+ Abc_Print( 1, "SATISFIABLE (output = %d) ", iOut );
else
- printf( "UNSATISFIABLE " );
- //printf( "\n" );
+ Abc_Print( 1, "UNSATISFIABLE " );
+ //Abc_Print( -1, "\n" );
- ABC_PRT( "Time", clock() - clk );
+ Abc_PrintTime( 1, "Time", clock() - clk );
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
return 0;
usage:
- fprintf( pErr, "usage: iprove [-rvh]\n" );
- fprintf( pErr, "\t performs CEC using a new method\n" );
- fprintf( pErr, "\t-r : toggle AIG rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pParams->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: iprove [-rvh]\n" );
+ Abc_Print( -2, "\t performs CEC using a new method\n" );
+ Abc_Print( -2, "\t-r : toggle AIG rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pParams->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10459,7 +10326,7 @@ usage:
/*
int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
+ FILE * stdout, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int nIters;
@@ -10472,8 +10339,8 @@ int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarHaigRecord( Abc_Ntk_t * pNtk, int nIters, int nSteps, int fRetimingOnly, int fAddBugs, int fUseCnf, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+
+
// set defaults
nIters = 3;
@@ -10490,7 +10357,7 @@ int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
goto usage;
}
nIters = atoi(argv[globalUtilOptind]);
@@ -10501,7 +10368,7 @@ int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
goto usage;
}
nSteps = atoi(argv[globalUtilOptind]);
@@ -10529,19 +10396,19 @@ int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for strashed networks.\n" );
+ Abc_Print( -1, "This command works only for strashed networks.\n" );
return 1;
}
pNtkRes = Abc_NtkDarHaigRecord( pNtk, nIters, nSteps, fRetimingOnly, fAddBugs, fUseCnf, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -10549,19 +10416,19 @@ int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: haig [-IS num] [-rbcvh]\n" );
- fprintf( pErr, "\t run a few rounds of comb+seq synthesis to test HAIG recording\n" );
- fprintf( pErr, "\t the current network is set to be the result of synthesis performed\n" );
- fprintf( pErr, "\t (this network can be verified using command \"dsec\")\n" );
- fprintf( pErr, "\t HAIG is written out into the file \"haig.blif\"\n" );
- fprintf( pErr, "\t (this HAIG can be proved using \"r haig.blif; st; dprove -abc -F 16\")\n" );
- fprintf( pErr, "\t-I num : the number of rounds of comb+seq synthesis [default = %d]\n", nIters );
- fprintf( pErr, "\t-S num : the number of forward retiming moves performed [default = %d]\n", nSteps );
- fprintf( pErr, "\t-r : toggle the use of retiming only [default = %s]\n", fRetimingOnly? "yes": "no" );
- fprintf( pErr, "\t-b : toggle bug insertion [default = %s]\n", fAddBugs? "yes": "no" );
- fprintf( pErr, "\t-c : enable CNF-based proof (no speculative reduction) [default = %s]\n", fUseCnf? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: haig [-IS num] [-rbcvh]\n" );
+ Abc_Print( -2, "\t run a few rounds of comb+seq synthesis to test HAIG recording\n" );
+ Abc_Print( -2, "\t the current network is set to be the result of synthesis performed\n" );
+ Abc_Print( -2, "\t (this network can be verified using command \"dsec\")\n" );
+ Abc_Print( -2, "\t HAIG is written out into the file \"haig.blif\"\n" );
+ Abc_Print( -2, "\t (this HAIG can be proved using \"r haig.blif; st; dprove -abc -F 16\")\n" );
+ Abc_Print( -2, "\t-I num : the number of rounds of comb+seq synthesis [default = %d]\n", nIters );
+ Abc_Print( -2, "\t-S num : the number of forward retiming moves performed [default = %d]\n", nSteps );
+ Abc_Print( -2, "\t-r : toggle the use of retiming only [default = %s]\n", fRetimingOnly? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggle bug insertion [default = %s]\n", fAddBugs? "yes": "no" );
+ Abc_Print( -2, "\t-c : enable CNF-based proof (no speculative reduction) [default = %s]\n", fUseCnf? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
*/
@@ -10579,14 +10446,11 @@ usage:
***********************************************************************/
int Abc_CommandMini( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
extern Abc_Ntk_t * Abc_NtkMiniBalance( Abc_Ntk_t * pNtk );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
Extra_UtilGetoptReset();
@@ -10602,19 +10466,19 @@ int Abc_CommandMini( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for combinatinally strashed AIG networks.\n" );
+ Abc_Print( -1, "Only works for combinatinally strashed AIG networks.\n" );
return 1;
}
pNtkRes = Abc_NtkMiniBalance( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Command has failed.\n" );
+ Abc_Print( -1, "Command has failed.\n" );
return 0;
}
// replace the current network
@@ -10622,9 +10486,9 @@ int Abc_CommandMini( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: mini [-h]\n" );
- fprintf( pErr, "\t perform balancing using new package\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: mini [-h]\n" );
+ Abc_Print( -2, "\t perform balancing using new package\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10641,18 +10505,12 @@ usage:
***********************************************************************/
int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nPars;
int fVerbose;
extern void Abc_NtkQbf( Abc_Ntk_t * pNtk, int nPars, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nPars = -1;
fVerbose = 1;
@@ -10664,7 +10522,7 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPars = atoi(argv[globalUtilOptind]);
@@ -10683,22 +10541,22 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "Works only for combinational networks.\n" );
+ Abc_Print( -1, "Works only for combinational networks.\n" );
return 1;
}
if ( Abc_NtkPoNum(pNtk) != 1 )
{
- fprintf( pErr, "The miter should have one primary output.\n" );
+ Abc_Print( -1, "The miter should have one primary output.\n" );
return 1;
}
if ( !(nPars > 0 && nPars < Abc_NtkPiNum(pNtk)) )
{
- fprintf( pErr, "The number of paramter variables is invalid (should be > 0 and < PI num).\n" );
+ Abc_Print( -1, "The number of paramter variables is invalid (should be > 0 and < PI num).\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
@@ -10712,11 +10570,11 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: qbf [-P num] [-vh]\n" );
- fprintf( pErr, "\t solves a quantified boolean formula problem EpVxM(p,x)\n" );
- fprintf( pErr, "\t-P num : number of paramters (should be the first PIs) [default = %d]\n", nPars );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: qbf [-P num] [-vh]\n" );
+ Abc_Print( -2, "\t solves a quantified intean formula problem EpVxM(p,x)\n" );
+ Abc_Print( -2, "\t-P num : number of paramters (should be the first PIs) [default = %d]\n", nPars );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10736,7 +10594,6 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char Buffer[100];
Fraig_Params_t Params, * pParams = &Params;
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int fAllNodes;
int fExdc;
@@ -10745,9 +10602,6 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fExdc = 0;
fAllNodes = 0;
@@ -10771,7 +10625,7 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'R':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-R\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
goto usage;
}
pParams->nPatsRand = atoi(argv[globalUtilOptind]);
@@ -10782,7 +10636,7 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pParams->nPatsDyna = atoi(argv[globalUtilOptind]);
@@ -10793,7 +10647,7 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pParams->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -10835,12 +10689,12 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Can only fraig a logic network or an AIG.\n" );
+ Abc_Print( -1, "Can only fraig a logic network or an AIG.\n" );
return 1;
}
@@ -10873,7 +10727,7 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Fraiging has failed.\n" );
+ Abc_Print( -1, "Fraiging has failed.\n" );
return 1;
}
@@ -10886,21 +10740,21 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
usage:
sprintf( Buffer, "%d", pParams->nBTLimit );
- fprintf( pErr, "usage: fraig [-R num] [-D num] [-C num] [-rscpvtah]\n" );
- fprintf( pErr, "\t transforms a logic network into a functionally reduced AIG\n" );
- fprintf( pErr, "\t (there are also newer fraiging commands, \"ifraig\" and \"dfraig\")\n" );
- fprintf( pErr, "\t-R num : number of random patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsRand );
- fprintf( pErr, "\t-D num : number of systematic patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsDyna );
- fprintf( pErr, "\t-C num : number of backtracks for one SAT problem [default = %s]\n", pParams->nBTLimit==-1? "infinity" : Buffer );
- fprintf( pErr, "\t-r : toggle functional reduction [default = %s]\n", pParams->fFuncRed? "yes": "no" );
- fprintf( pErr, "\t-s : toggle considering sparse functions [default = %s]\n", pParams->fDoSparse? "yes": "no" );
- fprintf( pErr, "\t-c : toggle accumulation of choices [default = %s]\n", pParams->fChoicing? "yes": "no" );
- fprintf( pErr, "\t-p : toggle proving the miter outputs [default = %s]\n", pParams->fTryProve? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", pParams->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-e : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
- fprintf( pErr, "\t-a : toggle between all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "dfs" );
- fprintf( pErr, "\t-t : toggle using partitioned representation [default = %s]\n", fPartition? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fraig [-R num] [-D num] [-C num] [-rscpvtah]\n" );
+ Abc_Print( -2, "\t transforms a logic network into a functionally reduced AIG\n" );
+ Abc_Print( -2, "\t (there are also newer fraiging commands, \"ifraig\" and \"dfraig\")\n" );
+ Abc_Print( -2, "\t-R num : number of random patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsRand );
+ Abc_Print( -2, "\t-D num : number of systematic patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsDyna );
+ Abc_Print( -2, "\t-C num : number of backtracks for one SAT problem [default = %s]\n", pParams->nBTLimit==-1? "infinity" : Buffer );
+ Abc_Print( -2, "\t-r : toggle functional reduction [default = %s]\n", pParams->fFuncRed? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle considering sparse functions [default = %s]\n", pParams->fDoSparse? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle accumulation of choices [default = %s]\n", pParams->fChoicing? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle proving the miter outputs [default = %s]\n", pParams->fTryProve? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pParams->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-e : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggle between all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "dfs" );
+ Abc_Print( -2, "\t-t : toggle using partitioned representation [default = %s]\n", fPartition? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10917,15 +10771,11 @@ usage:
***********************************************************************/
int Abc_CommandFraigTrust( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fDuplicate;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fDuplicate = 0;
Extra_UtilGetoptReset();
@@ -10945,7 +10795,7 @@ int Abc_CommandFraigTrust( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -10953,7 +10803,7 @@ int Abc_CommandFraigTrust( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkFraigTrust( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Fraiging in the trust mode has failed.\n" );
+ Abc_Print( -1, "Fraiging in the trust mode has failed.\n" );
return 1;
}
// replace the current network
@@ -10961,10 +10811,10 @@ int Abc_CommandFraigTrust( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: fraig_trust [-h]\n" );
- fprintf( pErr, "\t transforms the current network into an AIG assuming it is FRAIG with choices\n" );
-// fprintf( pErr, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fraig_trust [-h]\n" );
+ Abc_Print( -2, "\t transforms the current network into an AIG assuming it is FRAIG with choices\n" );
+// Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -10981,15 +10831,10 @@ usage:
***********************************************************************/
int Abc_CommandFraigStore( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fDuplicate;
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fDuplicate = 0;
Extra_UtilGetoptReset();
@@ -11009,23 +10854,23 @@ int Abc_CommandFraigStore( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
// get the new network
if ( !Abc_NtkFraigStore( pNtk ) )
{
- fprintf( pErr, "Fraig storing has failed.\n" );
+ Abc_Print( -1, "Fraig storing has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: fraig_store [-h]\n" );
- fprintf( pErr, "\t saves the current network in the AIG database\n" );
-// fprintf( pErr, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fraig_store [-h]\n" );
+ Abc_Print( -2, "\t saves the current network in the AIG database\n" );
+// Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11042,15 +10887,11 @@ usage:
***********************************************************************/
int Abc_CommandFraigRestore( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fDuplicate;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fDuplicate = 0;
Extra_UtilGetoptReset();
@@ -11070,7 +10911,7 @@ int Abc_CommandFraigRestore( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -11078,7 +10919,7 @@ int Abc_CommandFraigRestore( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkFraigRestore();
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Fraig restoring has failed.\n" );
+ Abc_Print( -1, "Fraig restoring has failed.\n" );
return 1;
}
// replace the current network
@@ -11086,10 +10927,10 @@ int Abc_CommandFraigRestore( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: fraig_restore [-h]\n" );
- fprintf( pErr, "\t makes the current network by fraiging the AIG database\n" );
-// fprintf( pErr, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fraig_restore [-h]\n" );
+ Abc_Print( -2, "\t makes the current network by fraiging the AIG database\n" );
+// Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11106,15 +10947,9 @@ usage:
***********************************************************************/
int Abc_CommandFraigClean( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fDuplicate;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fDuplicate = 0;
Extra_UtilGetoptReset();
@@ -11135,10 +10970,10 @@ int Abc_CommandFraigClean( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: fraig_clean [-h]\n" );
- fprintf( pErr, "\t cleans the internal FRAIG storage\n" );
-// fprintf( pErr, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fraig_clean [-h]\n" );
+ Abc_Print( -2, "\t cleans the internal FRAIG storage\n" );
+// Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11155,19 +10990,13 @@ usage:
***********************************************************************/
int Abc_CommandFraigSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fUseInv;
int fExdc;
int fVerbose;
int fVeryVerbose;
- extern bool Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
+ extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
// set defaults
fUseInv = 1;
fExdc = 0;
@@ -11199,34 +11028,34 @@ int Abc_CommandFraigSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Cannot sweep AIGs (use \"fraig\").\n" );
+ Abc_Print( -1, "Cannot sweep AIGs (use \"fraig\").\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "Transform the current network into a logic network.\n" );
+ Abc_Print( -1, "Transform the current network into a logic network.\n" );
return 1;
}
// modify the current network
if ( !Abc_NtkFraigSweep( pNtk, fUseInv, fExdc, fVerbose, fVeryVerbose ) )
{
- fprintf( pErr, "Sweeping has failed.\n" );
+ Abc_Print( -1, "Sweeping has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: fraig_sweep [-evwh]\n" );
- fprintf( pErr, "\t performs technology-dependent sweep\n" );
- fprintf( pErr, "\t-e : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : prints equivalence class information [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fraig_sweep [-evwh]\n" );
+ Abc_Print( -2, "\t performs technology-dependent sweep\n" );
+ Abc_Print( -2, "\t-e : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : prints equivalence class information [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11243,24 +11072,32 @@ usage:
***********************************************************************/
int Abc_CommandFraigDress( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ extern void Abc_NtkDress( Abc_Ntk_t * pNtk, char * pFileName, int fVerbose );
+ extern void Abc_NtkDress2( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConflictLimit, int fVerbose );
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtk2;
char * pFileName;
int c;
+ int nConfs;
int fVerbose;
- extern void Abc_NtkDress( Abc_Ntk_t * pNtk, char * pFileName, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
- fVerbose = 0;
+ nConfs = 1000;
+ fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Cvh" ) ) != EOF )
{
switch ( c )
{
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConfs = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConfs < 0 )
+ goto usage;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -11272,33 +11109,37 @@ int Abc_CommandFraigDress( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for logic networks.\n" );
+ Abc_Print( -1, "This command works only for logic networks.\n" );
return 1;
}
if ( argc != globalUtilOptind && argc != globalUtilOptind + 1 )
goto usage;
if ( argc == globalUtilOptind && Abc_NtkSpec(pNtk) == NULL )
{
- fprintf( pErr, "The current network has no spec.\n" );
+ Abc_Print( -1, "The current network has no spec.\n" );
return 1;
}
// get the input file name
pFileName = (argc == globalUtilOptind + 1) ? argv[globalUtilOptind] : Abc_NtkSpec(pNtk);
// modify the current network
- Abc_NtkDress( pNtk, pFileName, fVerbose );
+// Abc_NtkDress( pNtk, pFileName, fVerbose );
+ pNtk2 = Io_Read( pFileName, Io_ReadFileType(pFileName), 1 );
+ Abc_NtkDress2( pNtk, pNtk2, nConfs, fVerbose );
+ Abc_NtkDelete( pNtk2 );
return 0;
usage:
- fprintf( pErr, "usage: dress [-vh] <file>\n" );
- fprintf( pErr, "\t transfers internal node names from file to the current network\n" );
- fprintf( pErr, "\t<file> : network with names (if not given, the current network spec is used)\n" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dress [-C num] [-vh] <file>\n" );
+ Abc_Print( -2, "\t transfers internal node names from file to the current network\n" );
+ Abc_Print( -2, "\t<file> : network with names (if not given, the current network spec is used)\n" );
+ Abc_Print( -2, "\t-C num : the maximum number of conflicts at each node [default = %d]\n", nConfs );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11317,14 +11158,8 @@ usage:
***********************************************************************/
int Abc_CommandHaigStart( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
@@ -11339,16 +11174,16 @@ int Abc_CommandHaigStart( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs; run strashing (\"st\").\n" );
+ Abc_Print( -1, "This command works only for AIGs; run strashing (\"st\").\n" );
return 0;
}
Abc_NtkHaigStart( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: haig_start [-h]\n" );
- fprintf( pErr, "\t starts constructive accumulation of combinational choices\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: haig_start [-h]\n" );
+ Abc_Print( -2, "\t starts constructive accumulation of combinational choices\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11365,14 +11200,8 @@ usage:
***********************************************************************/
int Abc_CommandHaigStop( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
@@ -11387,16 +11216,16 @@ int Abc_CommandHaigStop( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs; run strashing (\"st\").\n" );
+ Abc_Print( -1, "This command works only for AIGs; run strashing (\"st\").\n" );
return 0;
}
Abc_NtkHaigStop( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: haig_stop [-h]\n" );
- fprintf( pErr, "\t cleans the internal storage for combinational choices\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: haig_stop [-h]\n" );
+ Abc_Print( -2, "\t cleans the internal storage for combinational choices\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11413,14 +11242,10 @@ usage:
***********************************************************************/
int Abc_CommandHaigUse( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
@@ -11435,14 +11260,14 @@ int Abc_CommandHaigUse( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs; run strashing (\"st\").\n" );
+ Abc_Print( -1, "This command works only for AIGs; run strashing (\"st\").\n" );
return 0;
}
// get the new network
pNtkRes = Abc_NtkHaigUse( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Transforming internal storage into AIG with choices has failed.\n" );
+ Abc_Print( -1, "Transforming internal storage into AIG with choices has failed.\n" );
return 1;
}
// replace the current network
@@ -11450,9 +11275,9 @@ int Abc_CommandHaigUse( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: haig_use [-h]\n" );
- fprintf( pErr, "\t transforms internal storage into an AIG with choices\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: haig_use [-h]\n" );
+ Abc_Print( -2, "\t transforms internal storage into an AIG with choices\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11471,16 +11296,12 @@ usage:
***********************************************************************/
int Abc_CommandRecStart( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nVars;
int nCuts;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nVars = 4;
nCuts = 8;
@@ -11492,7 +11313,7 @@ int Abc_CommandRecStart( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nVars = atoi(argv[globalUtilOptind]);
@@ -11503,7 +11324,7 @@ int Abc_CommandRecStart( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nCuts = atoi(argv[globalUtilOptind]);
@@ -11519,29 +11340,29 @@ int Abc_CommandRecStart( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !(nVars >= 3 && nVars <= 16) )
{
- fprintf( pErr, "The range of allowed values is 3 <= K <= 16.\n" );
+ Abc_Print( -1, "The range of allowed values is 3 <= K <= 16.\n" );
return 0;
}
if ( Abc_NtkRecIsRunning() )
{
- fprintf( pErr, "The AIG subgraph recording is already started.\n" );
+ Abc_Print( -1, "The AIG subgraph recording is already started.\n" );
return 0;
}
if ( pNtk && !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs; run strashing (\"st\").\n" );
+ Abc_Print( -1, "This command works only for AIGs; run strashing (\"st\").\n" );
return 0;
}
Abc_NtkRecStart( pNtk, nVars, nCuts );
return 0;
usage:
- fprintf( pErr, "usage: rec_start [-K num] [-C num] [-h]\n" );
- fprintf( pErr, "\t starts recording AIG subgraphs (should be called for\n" );
- fprintf( pErr, "\t an empty network or after reading in a previous record)\n" );
- fprintf( pErr, "\t-K num : the largest number of inputs [default = %d]\n", nVars );
- fprintf( pErr, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCuts );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: rec_start [-K num] [-C num] [-h]\n" );
+ Abc_Print( -2, "\t starts recording AIG subgraphs (should be called for\n" );
+ Abc_Print( -2, "\t an empty network or after reading in a previous record)\n" );
+ Abc_Print( -2, "\t-K num : the largest number of inputs [default = %d]\n", nVars );
+ Abc_Print( -2, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCuts );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11558,14 +11379,8 @@ usage:
***********************************************************************/
int Abc_CommandRecStop( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
@@ -11580,16 +11395,16 @@ int Abc_CommandRecStop( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !Abc_NtkRecIsRunning() )
{
- fprintf( pErr, "This command works only after calling \"rec_start\".\n" );
+ Abc_Print( -1, "This command works only after calling \"rec_start\".\n" );
return 0;
}
Abc_NtkRecStop();
return 0;
usage:
- fprintf( pErr, "usage: rec_stop [-h]\n" );
- fprintf( pErr, "\t cleans the internal storage for AIG subgraphs\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: rec_stop [-h]\n" );
+ Abc_Print( -2, "\t cleans the internal storage for AIG subgraphs\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11606,14 +11421,8 @@ usage:
***********************************************************************/
int Abc_CommandRecAdd( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
@@ -11628,21 +11437,21 @@ int Abc_CommandRecAdd( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works for AIGs.\n" );
+ Abc_Print( -1, "This command works for AIGs.\n" );
return 0;
}
if ( !Abc_NtkRecIsRunning() )
{
- fprintf( pErr, "This command works for AIGs after calling \"rec_start\".\n" );
+ Abc_Print( -1, "This command works for AIGs after calling \"rec_start\".\n" );
return 0;
}
Abc_NtkRecAdd( pNtk );
return 0;
usage:
- fprintf( pErr, "usage: rec_add [-h]\n" );
- fprintf( pErr, "\t adds subgraphs from the current network to the set\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: rec_add [-h]\n" );
+ Abc_Print( -2, "\t adds subgraphs from the current network to the set\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11659,14 +11468,8 @@ usage:
***********************************************************************/
int Abc_CommandRecPs( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
@@ -11681,16 +11484,16 @@ int Abc_CommandRecPs( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !Abc_NtkRecIsRunning() )
{
- fprintf( pErr, "This command works for AIGs only after calling \"rec_start\".\n" );
+ Abc_Print( -1, "This command works for AIGs only after calling \"rec_start\".\n" );
return 0;
}
Abc_NtkRecPs();
return 0;
usage:
- fprintf( pErr, "usage: rec_ps [-h]\n" );
- fprintf( pErr, "\t prints statistics about the recorded AIG subgraphs\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: rec_ps [-h]\n" );
+ Abc_Print( -2, "\t prints statistics about the recorded AIG subgraphs\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11707,14 +11510,10 @@ usage:
***********************************************************************/
int Abc_CommandRecUse( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
@@ -11729,14 +11528,14 @@ int Abc_CommandRecUse( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( !Abc_NtkRecIsRunning() )
{
- fprintf( pErr, "This command works for AIGs only after calling \"rec_start\".\n" );
+ Abc_Print( -1, "This command works for AIGs only after calling \"rec_start\".\n" );
return 0;
}
// get the new network
pNtkRes = Abc_NtkRecUse();
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Transforming internal AIG subgraphs into an AIG with choices has failed.\n" );
+ Abc_Print( -1, "Transforming internal AIG subgraphs into an AIG with choices has failed.\n" );
return 1;
}
// replace the current network
@@ -11744,9 +11543,9 @@ int Abc_CommandRecUse( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: rec_use [-h]\n" );
- fprintf( pErr, "\t transforms internal storage into an AIG with choices\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: rec_use [-h]\n" );
+ Abc_Print( -2, "\t transforms internal storage into an AIG with choices\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11765,7 +11564,6 @@ usage:
***********************************************************************/
int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
char Buffer[100];
double DelayTarget;
@@ -11776,12 +11574,9 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVerbose;
int c;
extern Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, int fSwitching, int fVerbose );
- extern bool Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
+ extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
DelayTarget =-1;
fAreaOnly = 0;
@@ -11797,7 +11592,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
goto usage;
}
DelayTarget = (float)atof(argv[globalUtilOptind]);
@@ -11829,7 +11624,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -11841,23 +11636,23 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtk == NULL )
{
- fprintf( pErr, "Strashing before mapping has failed.\n" );
+ Abc_Print( -1, "Strashing before mapping has failed.\n" );
return 1;
}
pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
Abc_NtkDelete( pNtkRes );
if ( pNtk == NULL )
{
- fprintf( pErr, "Balancing before mapping has failed.\n" );
+ Abc_Print( -1, "Balancing before mapping has failed.\n" );
return 1;
}
- fprintf( pOut, "The network was strashed and balanced before mapping.\n" );
+ Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
// get the new network
pNtkRes = Abc_NtkMap( pNtk, DelayTarget, fRecovery, fSwitching, fVerbose );
if ( pNtkRes == NULL )
{
Abc_NtkDelete( pNtk );
- fprintf( pErr, "Mapping has failed.\n" );
+ Abc_Print( -1, "Mapping has failed.\n" );
return 1;
}
Abc_NtkDelete( pNtk );
@@ -11868,7 +11663,7 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkMap( pNtk, DelayTarget, fRecovery, fSwitching, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Mapping has failed.\n" );
+ Abc_Print( -1, "Mapping has failed.\n" );
return 1;
}
}
@@ -11885,15 +11680,15 @@ usage:
sprintf( Buffer, "not used" );
else
sprintf( Buffer, "%.3f", DelayTarget );
- fprintf( pErr, "usage: map [-D float] [-arspvh]\n" );
- fprintf( pErr, "\t performs standard cell mapping of the current network\n" );
- fprintf( pErr, "\t-D float : sets the global required times [default = %s]\n", Buffer );
- fprintf( pErr, "\t-a : toggles area-only mapping [default = %s]\n", fAreaOnly? "yes": "no" );
- fprintf( pErr, "\t-r : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
- fprintf( pErr, "\t-s : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
- fprintf( pErr, "\t-p : optimizes power by minimizing switching [default = %s]\n", fSwitching? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: map [-D float] [-arspvh]\n" );
+ Abc_Print( -2, "\t performs standard cell mapping of the current network\n" );
+ Abc_Print( -2, "\t-D float : sets the global required times [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-a : toggles area-only mapping [default = %s]\n", fAreaOnly? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
+ Abc_Print( -2, "\t-p : optimizes power by minimizing switching [default = %s]\n", fSwitching? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -11911,17 +11706,13 @@ usage:
int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Amap_Par_t Pars, * pPars = &Pars;
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int fSweep;
int c;
extern Abc_Ntk_t * Abc_NtkDarAmap( Abc_Ntk_t * pNtk, Amap_Par_t * pPars );
- extern bool Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
+ extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fSweep = 0;
Amap_ManSetDefaultParams( pPars );
@@ -11933,7 +11724,7 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->nIterFlow = atoi(argv[globalUtilOptind]);
@@ -11944,7 +11735,7 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'A':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-A\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-A\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->nIterArea = atoi(argv[globalUtilOptind]);
@@ -11955,7 +11746,7 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'E':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->fEpsilon = (float)atof(argv[globalUtilOptind]);
@@ -11987,7 +11778,7 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -11996,23 +11787,23 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtk == NULL )
{
- fprintf( pErr, "Strashing before mapping has failed.\n" );
+ Abc_Print( -1, "Strashing before mapping has failed.\n" );
return 1;
}
pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
Abc_NtkDelete( pNtkRes );
if ( pNtk == NULL )
{
- fprintf( pErr, "Balancing before mapping has failed.\n" );
+ Abc_Print( -1, "Balancing before mapping has failed.\n" );
return 1;
}
- fprintf( pOut, "The network was strashed and balanced before mapping.\n" );
+ Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
// get the new network
pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
if ( pNtkRes == NULL )
{
Abc_NtkDelete( pNtk );
- fprintf( pErr, "Mapping has failed.\n" );
+ Abc_Print( -1, "Mapping has failed.\n" );
return 1;
}
Abc_NtkDelete( pNtk );
@@ -12023,7 +11814,7 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Mapping has failed.\n" );
+ Abc_Print( -1, "Mapping has failed.\n" );
return 1;
}
}
@@ -12036,17 +11827,17 @@ int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: amap [-FA <num>] [-E <float>] [-mxisvh]\n" );
- fprintf( pErr, "\t performs standard cell mapping of the current network\n" );
- fprintf( pErr, "\t-F num : the number of iterations of area flow [default = %d]\n", pPars->nIterFlow );
- fprintf( pErr, "\t-A num : the number of iterations of exact area [default = %d]\n", pPars->nIterArea );
- fprintf( pErr, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->fEpsilon );
- fprintf( pErr, "\t-m : toggles using MUX matching [default = %s]\n", pPars->fUseMuxes? "yes": "no" );
- fprintf( pErr, "\t-x : toggles using XOR matching [default = %s]\n", pPars->fUseXors? "yes": "no" );
- fprintf( pErr, "\t-i : toggles assuming inverters are free [default = %s]\n", pPars->fFreeInvs? "yes": "no" );
- fprintf( pErr, "\t-s : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: amap [-FA <num>] [-E <float>] [-mxisvh]\n" );
+ Abc_Print( -2, "\t performs standard cell mapping of the current network\n" );
+ Abc_Print( -2, "\t-F num : the number of iterations of area flow [default = %d]\n", pPars->nIterFlow );
+ Abc_Print( -2, "\t-A num : the number of iterations of exact area [default = %d]\n", pPars->nIterArea );
+ Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->fEpsilon );
+ Abc_Print( -2, "\t-m : toggles using MUX matching [default = %s]\n", pPars->fUseMuxes? "yes": "no" );
+ Abc_Print( -2, "\t-x : toggles using XOR matching [default = %s]\n", pPars->fUseXors? "yes": "no" );
+ Abc_Print( -2, "\t-i : toggles assuming inverters are free [default = %s]\n", pPars->fFreeInvs? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -12064,14 +11855,8 @@ usage:
***********************************************************************/
int Abc_CommandUnmap( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -12087,27 +11872,27 @@ int Abc_CommandUnmap( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkHasMapping(pNtk) )
{
- fprintf( pErr, "Cannot unmap the network that is not mapped.\n" );
+ Abc_Print( -1, "Cannot unmap the network that is not mapped.\n" );
return 1;
}
// get the new network
if ( !Abc_NtkMapToSop( pNtk ) )
{
- fprintf( pErr, "Unmapping has failed.\n" );
+ Abc_Print( -1, "Unmapping has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: unmap [-h]\n" );
- fprintf( pErr, "\t replaces the library gates by the logic nodes represented using SOPs\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: unmap [-h]\n" );
+ Abc_Print( -2, "\t replaces the library gates by the logic nodes represented using SOPs\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -12124,14 +11909,8 @@ usage:
***********************************************************************/
int Abc_CommandAttach( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -12147,28 +11926,28 @@ int Abc_CommandAttach( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsSopLogic(pNtk) )
{
- fprintf( pErr, "Can only attach gates if the nodes have SOP representations.\n" );
+ Abc_Print( -1, "Can only attach gates if the nodes have SOP representations.\n" );
return 1;
}
// get the new network
if ( !Abc_NtkAttach( pNtk ) )
{
- fprintf( pErr, "Attaching gates has failed.\n" );
+ Abc_Print( -1, "Attaching gates has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( pErr, "usage: attach [-h]\n" );
- fprintf( pErr, "\t replaces the SOP functions by the gates from the library\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: attach [-h]\n" );
+ Abc_Print( -2, "\t replaces the SOP functions by the gates from the library\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -12186,15 +11965,11 @@ usage:
***********************************************************************/
int Abc_CommandSuperChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
extern Abc_Ntk_t * Abc_NtkSuperChoice( Abc_Ntk_t * pNtk );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -12210,13 +11985,13 @@ int Abc_CommandSuperChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
+ Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
return 1;
}
@@ -12224,7 +11999,7 @@ int Abc_CommandSuperChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkSuperChoice( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Superchoicing has failed.\n" );
+ Abc_Print( -1, "Superchoicing has failed.\n" );
return 1;
}
// replace the current network
@@ -12232,11 +12007,11 @@ int Abc_CommandSuperChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: sc [-h]\n" );
- fprintf( pErr, "\t performs superchoicing\n" );
- fprintf( pErr, "\t (accumulate: \"r file.blif; rsup; b; sc; f -ac; wb file_sc.blif\")\n" );
- fprintf( pErr, "\t (map without supergate library: \"r file_sc.blif; ft; map\")\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: sc [-h]\n" );
+ Abc_Print( -2, "\t performs superchoicing\n" );
+ Abc_Print( -2, "\t (accumulate: \"r file.blif; rsup; b; sc; f -ac; wb file_sc.blif\")\n" );
+ Abc_Print( -2, "\t (map without supergate library: \"r file_sc.blif; ft; map\")\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -12253,7 +12028,6 @@ usage:
***********************************************************************/
int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int nLutSize;
@@ -12262,9 +12036,6 @@ int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
extern int Abc_NtkSuperChoiceLut( Abc_Ntk_t * pNtk, int nLutSize, int nCutSizeMax, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fVerbose = 1;
nLutSize = 4;
@@ -12277,7 +12048,7 @@ int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
goto usage;
}
nLutSize = atoi(argv[globalUtilOptind]);
@@ -12288,7 +12059,7 @@ int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
goto usage;
}
nCutSizeMax = atoi(argv[globalUtilOptind]);
@@ -12308,13 +12079,13 @@ int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
+ Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
return 1;
}
@@ -12325,7 +12096,7 @@ int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( !Abc_NtkSuperChoiceLut( pNtkRes, nLutSize, nCutSizeMax, fVerbose ) )
{
Abc_NtkDelete( pNtkRes );
- fprintf( pErr, "Superchoicing has failed.\n" );
+ Abc_Print( -1, "Superchoicing has failed.\n" );
return 1;
}
// replace the current network
@@ -12333,14 +12104,14 @@ int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: scl [-K num] [-N num] [-vh]\n" );
- fprintf( pErr, "\t performs superchoicing for K-LUTs\n" );
- fprintf( pErr, "\t (accumulate: \"r file.blif; b; scl; f -ac; wb file_sc.blif\")\n" );
- fprintf( pErr, "\t (FPGA map: \"r file_sc.blif; ft; read_lut lutlibK; fpga\")\n" );
- fprintf( pErr, "\t-K num : the number of LUT inputs [default = %d]\n", nLutSize );
- fprintf( pErr, "\t-N num : the max size of the cut [default = %d]\n", nCutSizeMax );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: scl [-K num] [-N num] [-vh]\n" );
+ Abc_Print( -2, "\t performs superchoicing for K-LUTs\n" );
+ Abc_Print( -2, "\t (accumulate: \"r file.blif; b; scl; f -ac; wb file_sc.blif\")\n" );
+ Abc_Print( -2, "\t (FPGA map: \"r file_sc.blif; ft; read_lut lutlibK; fpga\")\n" );
+ Abc_Print( -2, "\t-K num : the number of LUT inputs [default = %d]\n", nLutSize );
+ Abc_Print( -2, "\t-N num : the max size of the cut [default = %d]\n", nCutSizeMax );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -12359,7 +12130,6 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char Buffer[100];
char LutSize[100];
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fRecovery;
@@ -12372,9 +12142,6 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkFpga( Abc_Ntk_t * pNtk, float DelayTarget, int fRecovery, int fSwitching, int fLatchPaths, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fRecovery = 1;
fSwitching = 0;
@@ -12404,7 +12171,7 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
goto usage;
}
DelayTarget = (float)atof(argv[globalUtilOptind]);
@@ -12415,7 +12182,7 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
goto usage;
}
nLutSize = atoi(argv[globalUtilOptind]);
@@ -12430,7 +12197,7 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -12440,7 +12207,7 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
/*
else
{
- fprintf( pErr, "Cannot perform FPGA mapping with LUT size %d.\n", nLutSize );
+ Abc_Print( -1, "Cannot perform FPGA mapping with LUT size %d.\n", nLutSize );
return 1;
}
*/
@@ -12450,23 +12217,23 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtk == NULL )
{
- fprintf( pErr, "Strashing before FPGA mapping has failed.\n" );
+ Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
return 1;
}
pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
Abc_NtkDelete( pNtkRes );
if ( pNtk == NULL )
{
- fprintf( pErr, "Balancing before FPGA mapping has failed.\n" );
+ Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
return 1;
}
- fprintf( pOut, "The network was strashed and balanced before FPGA mapping.\n" );
+ Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
// get the new network
pNtkRes = Abc_NtkFpga( pNtk, DelayTarget, fRecovery, fSwitching, fLatchPaths, fVerbose );
if ( pNtkRes == NULL )
{
Abc_NtkDelete( pNtk );
- fprintf( pErr, "FPGA mapping has failed.\n" );
+ Abc_Print( -1, "FPGA mapping has failed.\n" );
return 1;
}
Abc_NtkDelete( pNtk );
@@ -12477,7 +12244,7 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkFpga( pNtk, DelayTarget, fRecovery, fSwitching, fLatchPaths, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "FPGA mapping has failed.\n" );
+ Abc_Print( -1, "FPGA mapping has failed.\n" );
return 1;
}
}
@@ -12494,15 +12261,15 @@ usage:
sprintf( LutSize, "library" );
else
sprintf( LutSize, "%d", nLutSize );
- fprintf( pErr, "usage: fpga [-D float] [-K num] [-aplvh]\n" );
- fprintf( pErr, "\t performs FPGA mapping of the current network\n" );
- fprintf( pErr, "\t-a : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
- fprintf( pErr, "\t-p : optimizes power by minimizing switching activity [default = %s]\n", fSwitching? "yes": "no" );
- fprintf( pErr, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", fLatchPaths? "yes": "no" );
- fprintf( pErr, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
- fprintf( pErr, "\t-K num : the number of LUT inputs (2 < num < 11) [default = %s]%s\n", LutSize, (nLutSize == -1 ? " (type \"print_lut\")" : "") );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : prints the command usage\n");
+ Abc_Print( -2, "usage: fpga [-D float] [-K num] [-aplvh]\n" );
+ Abc_Print( -2, "\t performs FPGA mapping of the current network\n" );
+ Abc_Print( -2, "\t-a : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
+ Abc_Print( -2, "\t-p : optimizes power by minimizing switching activity [default = %s]\n", fSwitching? "yes": "no" );
+ Abc_Print( -2, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", fLatchPaths? "yes": "no" );
+ Abc_Print( -2, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < 11) [default = %s]%s\n", LutSize, (nLutSize == -1 ? " (type \"print_lut\")" : "") );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : prints the command usage\n");
return 1;
}
@@ -12520,7 +12287,6 @@ usage:
int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char Buffer[100];
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fRecovery;
@@ -12531,9 +12297,6 @@ int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkFpgaFast( Abc_Ntk_t * pNtk, int nLutSize, int fRecovery, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fRecovery = 1;
fVerbose = 0;
@@ -12555,7 +12318,7 @@ int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
goto usage;
}
DelayTarget = (float)atof(argv[globalUtilOptind]);
@@ -12566,7 +12329,7 @@ int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
goto usage;
}
nLutSize = atoi(argv[globalUtilOptind]);
@@ -12581,7 +12344,7 @@ int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -12591,23 +12354,23 @@ int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtk == NULL )
{
- fprintf( pErr, "Strashing before FPGA mapping has failed.\n" );
+ Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
return 1;
}
pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
Abc_NtkDelete( pNtkRes );
if ( pNtk == NULL )
{
- fprintf( pErr, "Balancing before FPGA mapping has failed.\n" );
+ Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
return 1;
}
- fprintf( pOut, "The network was strashed and balanced before FPGA mapping.\n" );
+ Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
// get the new network
pNtkRes = Abc_NtkFpgaFast( pNtk, nLutSize, fRecovery, fVerbose );
if ( pNtkRes == NULL )
{
Abc_NtkDelete( pNtk );
- fprintf( pErr, "FPGA mapping has failed.\n" );
+ Abc_Print( -1, "FPGA mapping has failed.\n" );
return 1;
}
Abc_NtkDelete( pNtk );
@@ -12618,7 +12381,7 @@ int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkFpgaFast( pNtk, nLutSize, fRecovery, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "FPGA mapping has failed.\n" );
+ Abc_Print( -1, "FPGA mapping has failed.\n" );
return 1;
}
}
@@ -12631,13 +12394,13 @@ usage:
sprintf( Buffer, "not used" );
else
sprintf( Buffer, "%.2f", DelayTarget );
- fprintf( pErr, "usage: ffpga [-K num] [-avh]\n" );
- fprintf( pErr, "\t performs fast FPGA mapping of the current network\n" );
- fprintf( pErr, "\t-a : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
-// fprintf( pErr, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
- fprintf( pErr, "\t-K num : the number of LUT inputs (2 < num < 32) [default = %d]\n", nLutSize );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : prints the command usage\n");
+ Abc_Print( -2, "usage: ffpga [-K num] [-avh]\n" );
+ Abc_Print( -2, "\t performs fast FPGA mapping of the current network\n" );
+ Abc_Print( -2, "\t-a : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
+// Abc_Print( -2, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < 32) [default = %d]\n", nLutSize );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : prints the command usage\n");
return 1;
}
@@ -12656,16 +12419,12 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char Buffer[100];
char LutSize[100];
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
If_Par_t Pars, * pPars = &Pars;
- int c;
+ int c, fLutMux;
extern Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
memset( pPars, 0, sizeof(If_Par_t) );
// user-controlable paramters
@@ -12690,20 +12449,21 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->fTruth = 0;
pPars->nLatches = pNtk? Abc_NtkLatchNum(pNtk) : 0;
pPars->fLiftLeaves = 0;
- pPars->pLutLib = Abc_FrameReadLibLut();
+ pPars->pLutLib = (If_Lib_t *)Abc_FrameReadLibLut();
pPars->pTimesArr = NULL;
pPars->pTimesArr = NULL;
pPars->pFuncCost = NULL;
+ fLutMux = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrstbvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbugvh" ) ) != EOF )
{
switch ( c )
{
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nLutSize = atoi(argv[globalUtilOptind]);
@@ -12716,7 +12476,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nCutsMax = atoi(argv[globalUtilOptind]);
@@ -12727,7 +12487,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nFlowIters = atoi(argv[globalUtilOptind]);
@@ -12738,7 +12498,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'A':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nAreaIters = atoi(argv[globalUtilOptind]);
@@ -12749,7 +12509,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
@@ -12760,7 +12520,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'E':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
@@ -12795,11 +12555,17 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 's':
pPars->fSeqMap ^= 1;
break;
- case 't':
- pPars->fLiftLeaves ^= 1;
+ case 'd':
+ pPars->fBidec ^= 1;
break;
case 'b':
- pPars->fBidec ^= 1;
+ pPars->fUseBat ^= 1;
+ break;
+ case 'u':
+ fLutMux ^= 1;
+ break;
+ case 'g':
+ pPars->fDelayOpt ^= 1;
break;
case 'v':
pPars->fVerbose ^= 1;
@@ -12812,20 +12578,20 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
/*
if ( pPars->fSeqMap )
{
- fprintf( pErr, "Sequential mapping is currently disabled.\n" );
+ Abc_Print( -1, "Sequential mapping is currently disabled.\n" );
return 1;
}
*/
if ( pPars->fSeqMap && pPars->nLatches == 0 )
{
- fprintf( pErr, "The network has no latches. Use combinational mapping instead of sequential.\n" );
+ Abc_Print( -1, "The network has no latches. Use combinational mapping instead of sequential.\n" );
return 1;
}
@@ -12833,7 +12599,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( pPars->pLutLib == NULL )
{
- fprintf( pErr, "The LUT library is not given.\n" );
+ Abc_Print( -1, "The LUT library is not given.\n" );
return 1;
}
// get LUT size from the library
@@ -12845,23 +12611,41 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nLutSize < 3 || pPars->nLutSize > IF_MAX_LUTSIZE )
{
- fprintf( pErr, "Incorrect LUT size (%d).\n", pPars->nLutSize );
+ Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
return 1;
}
if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
{
- fprintf( pErr, "Incorrect number of cuts.\n" );
+ Abc_Print( -1, "Incorrect number of cuts.\n" );
return 1;
}
+ if ( fLutMux )
+ {
+ extern int Abc_NtkCutCostMux( If_Cut_t * pCut );
+ pPars->fCutMin = 1;
+ pPars->fTruth = 1;
+ pPars->pFuncCost = Abc_NtkCutCostMux;
+ }
+
// enable truth table computation if choices are selected
if ( (c = Abc_NtkGetChoiceNum( pNtk )) )
{
- printf( "Performing LUT mapping with %d choices.\n", c );
-// pPars->fTruth = 1;
+ Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c );
pPars->fExpRed = 0;
}
+
+ if ( pPars->fUseBat )
+ {
+ if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
+ {
+ Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
+ return 1;
+ }
+ pPars->fCutMin = 1;
+ }
+
// enable truth table computation if cut minimization is selected
if ( pPars->fCutMin )
{
@@ -12869,10 +12653,19 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->fExpRed = 0;
}
+ // modify for global delay optimization
+ if ( pPars->fDelayOpt )
+ {
+ pPars->fTruth = 1;
+ pPars->fExpRed = 0;
+ pPars->fUsePerm = 1;
+ pPars->pLutLib = NULL;
+ }
+
// complain if truth tables are requested but the cut size is too large
if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
{
- fprintf( pErr, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
+ Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
return 1;
}
@@ -12886,23 +12679,23 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtk == NULL )
{
- fprintf( pErr, "Strashing before FPGA mapping has failed.\n" );
+ Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
return 1;
}
pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
Abc_NtkDelete( pNtkRes );
if ( pNtk == NULL )
{
- fprintf( pErr, "Balancing before FPGA mapping has failed.\n" );
+ Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
return 1;
}
- fprintf( pOut, "The network was strashed and balanced before FPGA mapping.\n" );
+ Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
// get the new network
pNtkRes = Abc_NtkIf( pNtk, pPars );
if ( pNtkRes == NULL )
{
Abc_NtkDelete( pNtk );
- fprintf( pErr, "FPGA mapping has failed.\n" );
+ Abc_Print( -1, "FPGA mapping has failed.\n" );
return 0;
}
Abc_NtkDelete( pNtk );
@@ -12913,7 +12706,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkIf( pNtk, pPars );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "FPGA mapping has failed.\n" );
+ Abc_Print( -1, "FPGA mapping has failed.\n" );
return 0;
}
}
@@ -12930,27 +12723,29 @@ usage:
sprintf( LutSize, "library" );
else
sprintf( LutSize, "%d", pPars->nLutSize );
- fprintf( pErr, "usage: if [-KCFA num] [-DE float] [-qarlepmsbvh]\n" );
- fprintf( pErr, "\t performs FPGA technology mapping of the network\n" );
- fprintf( pErr, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
- fprintf( pErr, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
- fprintf( pErr, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
- fprintf( pErr, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
- fprintf( pErr, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
- fprintf( pErr, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
- fprintf( pErr, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
- fprintf( pErr, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
-// fprintf( pErr, "\t-f : toggles one fancy feature [default = %s]\n", pPars->fFancy? "yes": "no" );
- fprintf( pErr, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
- fprintf( pErr, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
- fprintf( pErr, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
- fprintf( pErr, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
- fprintf( pErr, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
- fprintf( pErr, "\t-s : toggles sequential mapping [default = %s]\n", pPars->fSeqMap? "yes": "no" );
-// fprintf( pErr, "\t-t : toggles the use of true sequential cuts [default = %s]\n", pPars->fLiftLeaves? "yes": "no" );
- fprintf( pErr, "\t-b : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : prints the command usage\n");
+ Abc_Print( -2, "usage: if [-KCFA num] [-DE float] [-qarlepmsdbugvh]\n" );
+ Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
+ Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
+ Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
+ Abc_Print( -2, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
+ Abc_Print( -2, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
+ Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
+ Abc_Print( -2, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
+// Abc_Print( -2, "\t-f : toggles one fancy feature [default = %s]\n", pPars->fFancy? "yes": "no" );
+ Abc_Print( -2, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
+ Abc_Print( -2, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
+ Abc_Print( -2, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
+ Abc_Print( -2, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggles sequential mapping [default = %s]\n", pPars->fSeqMap? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
+ Abc_Print( -2, "\t-u : toggles the use of MUXes along with LUTs [default = %s]\n", fLutMux? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggles global delay optimization [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : prints the command usage\n");
return 1;
}
@@ -12969,19 +12764,13 @@ usage:
***********************************************************************/
int Abc_CommandInit( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pObj;
int c, i;
int fZeros;
int fOnes;
int fRandom;
int fDontCare;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fZeros = 0;
fOnes = 0;
@@ -13013,13 +12802,13 @@ int Abc_CommandInit( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The current network is combinational.\n" );
+ Abc_Print( -1, "The current network is combinational.\n" );
return 0;
}
@@ -13048,17 +12837,17 @@ int Abc_CommandInit( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_LatchSetInitDc( pObj );
}
else
- printf( "The initial states remain unchanged.\n" );
+ Abc_Print( -1, "The initial states remain unchanged.\n" );
return 0;
usage:
- fprintf( pErr, "usage: init [-zordh]\n" );
- fprintf( pErr, "\t resets initial states of all latches\n" );
- fprintf( pErr, "\t-z : set zeros initial states [default = %s]\n", fZeros? "yes": "no" );
- fprintf( pErr, "\t-o : set ones initial states [default = %s]\n", fOnes? "yes": "no" );
- fprintf( pErr, "\t-d : set don't-care initial states [default = %s]\n", fDontCare? "yes": "no" );
- fprintf( pErr, "\t-r : set random initial states [default = %s]\n", fRandom? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: init [-zordh]\n" );
+ Abc_Print( -2, "\t resets initial states of all latches\n" );
+ Abc_Print( -2, "\t-z : set zeros initial states [default = %s]\n", fZeros? "yes": "no" );
+ Abc_Print( -2, "\t-o : set ones initial states [default = %s]\n", fOnes? "yes": "no" );
+ Abc_Print( -2, "\t-d : set don't-care initial states [default = %s]\n", fDontCare? "yes": "no" );
+ Abc_Print( -2, "\t-r : set random initial states [default = %s]\n", fRandom? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13075,16 +12864,12 @@ usage:
***********************************************************************/
int Abc_CommandZero( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
- extern Abc_Ntk_t * Abc_NtkRestrashZero( Abc_Ntk_t * pNtk, bool fCleanup );
+ extern Abc_Ntk_t * Abc_NtkRestrashZero( Abc_Ntk_t * pNtk, int fCleanup );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -13100,19 +12885,19 @@ int Abc_CommandZero( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The current network is combinational.\n" );
+ Abc_Print( -1, "The current network is combinational.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command works only for AIGs.\n" );
+ Abc_Print( -1, "This command works only for AIGs.\n" );
return 0;
}
@@ -13120,7 +12905,7 @@ int Abc_CommandZero( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkRestrashZero( pNtk, 0 );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Converting to sequential AIG has failed.\n" );
+ Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
return 1;
}
// replace the current network
@@ -13128,9 +12913,9 @@ int Abc_CommandZero( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: zero [-h]\n" );
- fprintf( pErr, "\t converts latches to have const-0 initial value\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: zero [-h]\n" );
+ Abc_Print( -2, "\t converts latches to have const-0 initial value\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13147,14 +12932,8 @@ usage:
***********************************************************************/
int Abc_CommandUndc( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -13170,19 +12949,19 @@ int Abc_CommandUndc( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The current network is combinational.\n" );
+ Abc_Print( -1, "The current network is combinational.\n" );
return 0;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command works only for logic networks.\n" );
+ Abc_Print( -1, "This command works only for logic networks.\n" );
return 0;
}
@@ -13191,9 +12970,9 @@ int Abc_CommandUndc( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: undc [-h]\n" );
- fprintf( pErr, "\t converts latches with DC init values into free PIs\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: undc [-h]\n" );
+ Abc_Print( -2, "\t converts latches with DC init values into free PIs\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13210,15 +12989,11 @@ usage:
***********************************************************************/
int Abc_CommandOneHot( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
extern Abc_Ntk_t * Abc_NtkConvertOnehot( Abc_Ntk_t * pNtk );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -13233,24 +13008,24 @@ int Abc_CommandOneHot( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The current network is combinational.\n" );
+ Abc_Print( -1, "The current network is combinational.\n" );
return 0;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command works only for logic networks.\n" );
+ Abc_Print( -1, "This command works only for logic networks.\n" );
return 0;
}
// get the new network
pNtkRes = Abc_NtkConvertOnehot( pNtk );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Converting to one-hot encoding has failed.\n" );
+ Abc_Print( -1, "Converting to one-hot encoding has failed.\n" );
return 1;
}
// replace the current network
@@ -13258,9 +13033,9 @@ int Abc_CommandOneHot( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: onehot [-h]\n" );
- fprintf( pErr, "\t converts natural encoding into one-hot encoding\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: onehot [-h]\n" );
+ Abc_Print( -2, "\t converts natural encoding into one-hot encoding\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13277,16 +13052,10 @@ usage:
***********************************************************************/
int Abc_CommandPipe( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nLatches;
extern void Abc_NtkLatchPipe( Abc_Ntk_t * pNtk, int nLatches );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nLatches = 5;
Extra_UtilGetoptReset();
@@ -13297,7 +13066,7 @@ int Abc_CommandPipe( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a positive integer.\n" );
goto usage;
}
nLatches = atoi(argv[globalUtilOptind]);
@@ -13314,13 +13083,13 @@ int Abc_CommandPipe( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The current network is combinational.\n" );
+ Abc_Print( -1, "The current network is combinational.\n" );
return 0;
}
@@ -13329,10 +13098,10 @@ int Abc_CommandPipe( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: pipe [-L num] [-h]\n" );
- fprintf( pErr, "\t inserts the given number of latches at each PI for pipelining\n" );
- fprintf( pErr, "\t-L num : the number of latches to insert [default = %d]\n", nLatches );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: pipe [-L num] [-h]\n" );
+ Abc_Print( -2, "\t inserts the given number of latches at each PI for pipelining\n" );
+ Abc_Print( -2, "\t-L num : the number of latches to insert [default = %d]\n", nLatches );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13349,14 +13118,10 @@ usage:
***********************************************************************/
int Abc_CommandSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -13372,19 +13137,19 @@ int Abc_CommandSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- fprintf( pErr, "The network has no latches.\n" );
+ Abc_Print( -1, "The network has no latches.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Conversion to sequential AIG works only for combinational AIGs (run \"strash\").\n" );
+ Abc_Print( -1, "Conversion to sequential AIG works only for combinational AIGs (run \"strash\").\n" );
return 1;
}
@@ -13393,7 +13158,7 @@ int Abc_CommandSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = NULL;
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Converting to sequential AIG has failed.\n" );
+ Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
return 1;
}
// replace the current network
@@ -13401,9 +13166,9 @@ int Abc_CommandSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: seq [-h]\n" );
- fprintf( pErr, "\t converts AIG into sequential AIG\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: seq [-h]\n" );
+ Abc_Print( -2, "\t converts AIG into sequential AIG\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13420,15 +13185,11 @@ usage:
***********************************************************************/
int Abc_CommandUnseq( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fShare;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fShare = 1;
Extra_UtilGetoptReset();
@@ -13448,13 +13209,13 @@ int Abc_CommandUnseq( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
/*
if ( !Abc_NtkIsSeq(pNtk) )
{
- fprintf( pErr, "Conversion to combinational AIG works only for sequential AIG (run \"seq\").\n" );
+ Abc_Print( -1, "Conversion to combinational AIG works only for sequential AIG (run \"seq\").\n" );
return 1;
}
*/
@@ -13467,7 +13228,7 @@ int Abc_CommandUnseq( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = NULL;
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Converting sequential AIG into an SOP logic network has failed.\n" );
+ Abc_Print( -1, "Converting sequential AIG into an SOP logic network has failed.\n" );
return 1;
}
// replace the current network
@@ -13475,10 +13236,10 @@ int Abc_CommandUnseq( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: unseq [-sh]\n" );
- fprintf( pErr, "\t converts sequential AIG into an SOP logic network\n" );
- fprintf( pErr, "\t-s : toggle sharing latches [default = %s]\n", fShare? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: unseq [-sh]\n" );
+ Abc_Print( -2, "\t converts sequential AIG into an SOP logic network\n" );
+ Abc_Print( -2, "\t-s : toggle sharing latches [default = %s]\n", fShare? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13495,7 +13256,6 @@ usage:
***********************************************************************/
int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nMaxIters;
int fForward;
@@ -13503,28 +13263,26 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
int fOneStep;
int fVerbose;
int Mode;
- extern int Abc_NtkRetime( Abc_Ntk_t * pNtk, int Mode, int fForwardOnly, int fBackwardOnly, int fOneStep, int fVerbose );
+ int nDelayLim;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Mode = 5;
+ nDelayLim = 0;
fForward = 0;
fBackward = 0;
fOneStep = 0;
fVerbose = 0;
nMaxIters = 15;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Mfbsvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "MDfbsvh" ) ) != EOF )
{
switch ( c )
{
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-M\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
goto usage;
}
Mode = atoi(argv[globalUtilOptind]);
@@ -13532,6 +13290,17 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( Mode < 0 )
goto usage;
break;
+ case 'D':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
+ goto usage;
+ }
+ nDelayLim = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nDelayLim < 0 )
+ goto usage;
+ break;
case 'f':
fForward ^= 1;
break;
@@ -13553,25 +13322,25 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( fForward && fBackward )
{
- fprintf( pErr, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
+ Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network has no latches. Retiming is not performed.\n" );
+ Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
return 0;
}
if ( Mode < 0 || Mode > 6 )
{
- fprintf( pErr, "The mode (%d) is incorrect. Retiming is not performed.\n", Mode );
+ Abc_Print( -1, "The mode (%d) is incorrect. Retiming is not performed.\n", Mode );
return 0;
}
@@ -13579,13 +13348,13 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "Retiming with choice nodes is not implemented.\n" );
+ Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
return 0;
}
// convert the network into an SOP network
pNtkRes = Abc_NtkToLogic( pNtk );
// perform the retiming
- Abc_NtkRetime( pNtkRes, Mode, fForward, fBackward, fOneStep, fVerbose );
+ Abc_NtkRetime( pNtkRes, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
return 0;
@@ -13594,40 +13363,41 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
// get the network in the SOP form
if ( !Abc_NtkToSop(pNtk, 0) )
{
- printf( "Converting to SOPs has failed.\n" );
+ Abc_Print( -1, "Converting to SOPs has failed.\n" );
return 0;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "The network is not a logic network. Retiming is not performed.\n" );
+ Abc_Print( -1, "The network is not a logic network. Retiming is not performed.\n" );
return 0;
}
// perform the retiming
- Abc_NtkRetime( pNtk, Mode, fForward, fBackward, fOneStep, fVerbose );
+ Abc_NtkRetime( pNtk, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: retime [-M num] [-fbvh]\n" );
- fprintf( pErr, "\t retimes the current network using one of the algorithms:\n" );
- fprintf( pErr, "\t 1: most forward retiming\n" );
- fprintf( pErr, "\t 2: most backward retiming\n" );
- fprintf( pErr, "\t 3: forward and backward min-area retiming\n" );
- fprintf( pErr, "\t 4: forward and backward min-delay retiming\n" );
- fprintf( pErr, "\t 5: mode 3 followed by mode 4\n" );
- fprintf( pErr, "\t 6: Pan's optimum-delay retiming using binary search\n" );
- fprintf( pErr, "\t-M num : the retiming algorithm to use [default = %d]\n", Mode );
- fprintf( pErr, "\t-f : enables forward-only retiming in modes 3,4,5 [default = %s]\n", fForward? "yes": "no" );
- fprintf( pErr, "\t-b : enables backward-only retiming in modes 3,4,5 [default = %s]\n", fBackward? "yes": "no" );
- fprintf( pErr, "\t-s : enables retiming one step only in mode 4 [default = %s]\n", fOneStep? "yes": "no" );
- fprintf( pErr, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: retime [-MD num] [-fbvh]\n" );
+ Abc_Print( -2, "\t retimes the current network using one of the algorithms:\n" );
+ Abc_Print( -2, "\t 1: most forward retiming\n" );
+ Abc_Print( -2, "\t 2: most backward retiming\n" );
+ Abc_Print( -2, "\t 3: forward and backward min-area retiming\n" );
+ Abc_Print( -2, "\t 4: forward and backward min-delay retiming\n" );
+ Abc_Print( -2, "\t 5: mode 3 followed by mode 4\n" );
+ Abc_Print( -2, "\t 6: Pan's optimum-delay retiming using binary search\n" );
+ Abc_Print( -2, "\t-M num : the retiming algorithm to use [default = %d]\n", Mode );
+ Abc_Print( -2, "\t-D num : the minimum delay target (0=unused) [default = %d]\n", nDelayLim );
+ Abc_Print( -2, "\t-f : enables forward-only retiming in modes 3,4,5 [default = %s]\n", fForward? "yes": "no" );
+ Abc_Print( -2, "\t-b : enables backward-only retiming in modes 3,4,5 [default = %s]\n", fBackward? "yes": "no" );
+ Abc_Print( -2, "\t-s : enables retiming one step only in mode 4 [default = %s]\n", fOneStep? "yes": "no" );
+ Abc_Print( -2, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
-// fprintf( pErr, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
-// fprintf( pErr, "\t-f : toggle forward retiming (for AIGs) [default = %s]\n", fForward? "yes": "no" );
-// fprintf( pErr, "\t-b : toggle backward retiming (for AIGs) [default = %s]\n", fBackward? "yes": "no" );
-// fprintf( pErr, "\t-i : toggle computation of initial state [default = %s]\n", fInitial? "yes": "no" );
+// Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
+// Abc_Print( -2, "\t-f : toggle forward retiming (for AIGs) [default = %s]\n", fForward? "yes": "no" );
+// Abc_Print( -2, "\t-b : toggle backward retiming (for AIGs) [default = %s]\n", fBackward? "yes": "no" );
+// Abc_Print( -2, "\t-i : toggle computation of initial state [default = %s]\n", fInitial? "yes": "no" );
}
/**Function*************************************************************
@@ -13643,7 +13413,6 @@ usage:
***********************************************************************/
int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int fMinArea;
int fForwardOnly;
@@ -13659,9 +13428,6 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarRetimeMostFwd( Abc_Ntk_t * pNtk, int nMaxIters, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fMinArea = 1;
fForwardOnly = 0;
@@ -13679,7 +13445,7 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
goto usage;
}
nMaxIters = atoi(argv[globalUtilOptind]);
@@ -13690,7 +13456,7 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
goto usage;
}
nStepsMax = atoi(argv[globalUtilOptind]);
@@ -13725,19 +13491,19 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network has no latches. Retiming is not performed.\n" );
+ Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
@@ -13751,7 +13517,7 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarRetimeMostFwd( pNtk, nMaxIters, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Retiming has failed.\n" );
+ Abc_Print( -1, "Retiming has failed.\n" );
return 1;
}
// replace the current network
@@ -13759,17 +13525,17 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dretime [-NS num] [-mfbiavh]\n" );
- fprintf( pErr, "\t new implementation of min-area (or most-forward) retiming\n" );
- fprintf( pErr, "\t-m : toggle min-area retiming and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" );
- fprintf( pErr, "\t-f : enables forward-only retiming [default = %s]\n", fForwardOnly? "yes": "no" );
- fprintf( pErr, "\t-b : enables backward-only retiming [default = %s]\n", fBackwardOnly? "yes": "no" );
- fprintf( pErr, "\t-i : enables init state computation [default = %s]\n", fInitial? "yes": "no" );
- fprintf( pErr, "\t-N num : the max number of one-frame iterations to perform [default = %d]\n", nMaxIters );
- fprintf( pErr, "\t-S num : the max number of forward retiming steps to perform [default = %d]\n", nStepsMax );
- fprintf( pErr, "\t-a : enables a fast most-forward algorithm [default = %s]\n", fFastAlgo? "yes": "no" );
- fprintf( pErr, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dretime [-NS num] [-mfbiavh]\n" );
+ Abc_Print( -2, "\t new implementation of min-area (or most-forward) retiming\n" );
+ Abc_Print( -2, "\t-m : toggle min-area retiming and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" );
+ Abc_Print( -2, "\t-f : enables forward-only retiming [default = %s]\n", fForwardOnly? "yes": "no" );
+ Abc_Print( -2, "\t-b : enables backward-only retiming [default = %s]\n", fBackwardOnly? "yes": "no" );
+ Abc_Print( -2, "\t-i : enables init state computation [default = %s]\n", fInitial? "yes": "no" );
+ Abc_Print( -2, "\t-N num : the max number of one-frame iterations to perform [default = %d]\n", nMaxIters );
+ Abc_Print( -2, "\t-S num : the max number of forward retiming steps to perform [default = %d]\n", nStepsMax );
+ Abc_Print( -2, "\t-a : enables a fast most-forward algorithm [default = %s]\n", fFastAlgo? "yes": "no" );
+ Abc_Print( -2, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13786,7 +13552,6 @@ usage:
***********************************************************************/
int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c, nMaxIters;
int fForward;
@@ -13796,7 +13561,7 @@ int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
int fFastButConservative;
int maxDelay;
- printf( "This command is temporarily disabled.\n" );
+ Abc_Print( -1, "This command is temporarily disabled.\n" );
return 0;
// extern Abc_Ntk_t* Abc_FlowRetime_MinReg( Abc_Ntk_t * pNtk, int fVerbose,
// int fComputeInit, int fGuaranteeInit, int fBlockConst,
@@ -13804,9 +13569,6 @@ int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
// int maxDelay, int fFastButConservative);
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fForward = 0;
fFastButConservative = 0;
@@ -13825,7 +13587,7 @@ int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-M\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
goto usage;
}
nMaxIters = atoi(argv[globalUtilOptind]);
@@ -13836,7 +13598,7 @@ int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
goto usage;
}
maxDelay = atoi(argv[globalUtilOptind]);
@@ -13874,31 +13636,31 @@ int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( fForward && fBackward )
{
- fprintf( pErr, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
+ Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
return 1;
}
if ( fGuaranteeInit && !fComputeInit )
{
- fprintf( pErr, "Initial state guarantee (-g) requires initial state computation (-i).\n" );
+ Abc_Print( -1, "Initial state guarantee (-g) requires initial state computation (-i).\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network has no latches. Retiming is not performed.\n" );
+ Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
return 0;
}
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "Retiming with choice nodes is not implemented.\n" );
+ Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
return 0;
}
@@ -13914,18 +13676,18 @@ int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: fretime [-M num] [-D num] [-fbvih]\n" );
- fprintf( pErr, "\t retimes the current network using flow-based algorithm\n" );
- fprintf( pErr, "\t-M num : the maximum number of iterations [default = %d]\n", nMaxIters );
- fprintf( pErr, "\t-D num : the maximum delay [default = none]\n" );
- fprintf( pErr, "\t-i : enables init state computation [default = %s]\n", fComputeInit? "yes": "no" );
- fprintf( pErr, "\t-k : blocks retiming over const nodes [default = %s]\n", fBlockConst? "yes": "no" );
- fprintf( pErr, "\t-g : guarantees init state computation [default = %s]\n", fGuaranteeInit? "yes": "no" );
- fprintf( pErr, "\t-c : very fast (but conserv.) delay constraints [default = %s]\n", fFastButConservative? "yes": "no" );
- fprintf( pErr, "\t-f : enables forward-only retiming [default = %s]\n", fForward? "yes": "no" );
- fprintf( pErr, "\t-b : enables backward-only retiming [default = %s]\n", fBackward? "yes": "no" );
- fprintf( pErr, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: fretime [-M num] [-D num] [-fbvih]\n" );
+ Abc_Print( -2, "\t retimes the current network using flow-based algorithm\n" );
+ Abc_Print( -2, "\t-M num : the maximum number of iterations [default = %d]\n", nMaxIters );
+ Abc_Print( -2, "\t-D num : the maximum delay [default = none]\n" );
+ Abc_Print( -2, "\t-i : enables init state computation [default = %s]\n", fComputeInit? "yes": "no" );
+ Abc_Print( -2, "\t-k : blocks retiming over const nodes [default = %s]\n", fBlockConst? "yes": "no" );
+ Abc_Print( -2, "\t-g : guarantees init state computation [default = %s]\n", fGuaranteeInit? "yes": "no" );
+ Abc_Print( -2, "\t-c : very fast (but conserv.) delay constraints [default = %s]\n", fFastButConservative? "yes": "no" );
+ Abc_Print( -2, "\t-f : enables forward-only retiming [default = %s]\n", fForward? "yes": "no" );
+ Abc_Print( -2, "\t-b : enables backward-only retiming [default = %s]\n", fBackward? "yes": "no" );
+ Abc_Print( -2, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -13942,16 +13704,12 @@ usage:
***********************************************************************/
int Abc_CommandCRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fVerbose;
extern Abc_Ntk_t * Abc_NtkCRetime( Abc_Ntk_t * pNtk, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fVerbose = 0;
Extra_UtilGetoptReset();
@@ -13970,24 +13728,24 @@ int Abc_CommandCRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for logic networks.\n" );
+ Abc_Print( -1, "Only works for logic networks.\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
// modify the current network
pNtkRes = Abc_NtkCRetime( pNtk, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Sequential cleanup has failed.\n" );
+ Abc_Print( -1, "Sequential cleanup has failed.\n" );
return 1;
}
// replace the current network
@@ -13995,10 +13753,10 @@ int Abc_CommandCRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: cretime [-vh]\n" );
- fprintf( pErr, "\t performs most-forward retiming with equiv classes\n" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: cretime [-vh]\n" );
+ Abc_Print( -2, "\t performs most-forward retiming with equiv classes\n" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -14015,15 +13773,11 @@ usage:
***********************************************************************/
int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
int c, nMaxIters;
int fVerbose;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nMaxIters = 15;
fVerbose = 0;
@@ -14035,7 +13789,7 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
goto usage;
}
nMaxIters = atoi(argv[globalUtilOptind]);
@@ -14055,7 +13809,7 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -14065,7 +13819,7 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
// quit if there are choice nodes
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "Currently cannot map/retime networks with choice nodes.\n" );
+ Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
return 0;
}
*/
@@ -14081,7 +13835,7 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtkNew == NULL )
{
- fprintf( pErr, "Strashing before FPGA mapping/retiming has failed.\n" );
+ Abc_Print( -1, "Strashing before FPGA mapping/retiming has failed.\n" );
return 1;
}
@@ -14089,7 +13843,7 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_NtkDelete( pNtkRes );
if ( pNtkNew == NULL )
{
- fprintf( pErr, "Balancing before FPGA mapping has failed.\n" );
+ Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
return 1;
}
@@ -14099,11 +13853,11 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_NtkDelete( pNtkRes );
if ( pNtkNew == NULL )
{
- fprintf( pErr, "Converting into a seq AIG before FPGA mapping/retiming has failed.\n" );
+ Abc_Print( -1, "Converting into a seq AIG before FPGA mapping/retiming has failed.\n" );
return 1;
}
- fprintf( pOut, "The network was strashed and balanced before FPGA mapping/retiming.\n" );
+ Abc_Print( 1, "The network was strashed and balanced before FPGA mapping/retiming.\n" );
}
// get the new network
@@ -14111,7 +13865,7 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = NULL;
if ( pNtkRes == NULL )
{
-// fprintf( pErr, "Sequential FPGA mapping has failed.\n" );
+// Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
Abc_NtkDelete( pNtkNew );
return 0;
}
@@ -14121,11 +13875,11 @@ int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: sfpga [-I num] [-vh]\n" );
- fprintf( pErr, "\t performs integrated sequential FPGA mapping/retiming\n" );
- fprintf( pErr, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: sfpga [-I num] [-vh]\n" );
+ Abc_Print( -2, "\t performs integrated sequential FPGA mapping/retiming\n" );
+ Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -14142,15 +13896,11 @@ usage:
***********************************************************************/
int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
int c, nMaxIters;
int fVerbose;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nMaxIters = 15;
fVerbose = 0;
@@ -14162,7 +13912,7 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
goto usage;
}
nMaxIters = atoi(argv[globalUtilOptind]);
@@ -14182,7 +13932,7 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -14192,7 +13942,7 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
// quit if there are choice nodes
if ( Abc_NtkGetChoiceNum(pNtk) )
{
- fprintf( pErr, "Currently cannot map/retime networks with choice nodes.\n" );
+ Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
return 0;
}
*/
@@ -14208,7 +13958,7 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
if ( pNtkNew == NULL )
{
- fprintf( pErr, "Strashing before SC mapping/retiming has failed.\n" );
+ Abc_Print( -1, "Strashing before SC mapping/retiming has failed.\n" );
return 1;
}
@@ -14216,7 +13966,7 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_NtkDelete( pNtkRes );
if ( pNtkNew == NULL )
{
- fprintf( pErr, "Balancing before SC mapping/retiming has failed.\n" );
+ Abc_Print( -1, "Balancing before SC mapping/retiming has failed.\n" );
return 1;
}
@@ -14226,11 +13976,11 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_NtkDelete( pNtkRes );
if ( pNtkNew == NULL )
{
- fprintf( pErr, "Converting into a seq AIG before SC mapping/retiming has failed.\n" );
+ Abc_Print( -1, "Converting into a seq AIG before SC mapping/retiming has failed.\n" );
return 1;
}
- fprintf( pOut, "The network was strashed and balanced before SC mapping/retiming.\n" );
+ Abc_Print( -1, "The network was strashed and balanced before SC mapping/retiming.\n" );
}
// get the new network
@@ -14238,7 +13988,7 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = NULL;
if ( pNtkRes == NULL )
{
-// fprintf( pErr, "Sequential FPGA mapping has failed.\n" );
+// Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
Abc_NtkDelete( pNtkNew );
return 0;
}
@@ -14249,11 +13999,11 @@ int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: smap [-I num] [-vh]\n" );
- fprintf( pErr, "\t performs integrated sequential standard-cell mapping/retiming\n" );
- fprintf( pErr, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: smap [-I num] [-vh]\n" );
+ Abc_Print( -2, "\t performs integrated sequential standard-cell mapping/retiming\n" );
+ Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -14270,16 +14020,12 @@ usage:
***********************************************************************/
int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
Fra_Ssw_t Pars, * pPars = &Pars;
int c;
extern Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
pPars->nPartSize = 0;
pPars->nOverSize = 0;
@@ -14303,7 +14049,7 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
pPars->nPartSize = atoi(argv[globalUtilOptind]);
@@ -14314,7 +14060,7 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'Q':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-Q\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
goto usage;
}
pPars->nOverSize = atoi(argv[globalUtilOptind]);
@@ -14325,7 +14071,7 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesP = atoi(argv[globalUtilOptind]);
@@ -14336,7 +14082,7 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesK = atoi(argv[globalUtilOptind]);
@@ -14347,7 +14093,7 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxImps = atoi(argv[globalUtilOptind]);
@@ -14358,7 +14104,7 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
@@ -14396,31 +14142,31 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
+ Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
if ( pPars->nFramesK > 1 && pPars->fUse1Hot )
{
- printf( "Currrently can only use one-hotness for simple induction (K=1).\n" );
+ Abc_Print( -1, "Currrently can only use one-hotness for simple induction (K=1).\n" );
return 0;
}
if ( pPars->nFramesP && pPars->fUse1Hot )
{
- printf( "Currrently can only use one-hotness without prefix.\n" );
+ Abc_Print( -1, "Currrently can only use one-hotness without prefix.\n" );
return 0;
}
@@ -14428,7 +14174,7 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarSeqSweep( pNtk, pPars );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Sequential sweeping has failed.\n" );
+ Abc_Print( -1, "Sequential sweeping has failed.\n" );
return 1;
}
// replace the current network
@@ -14436,22 +14182,22 @@ int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: ssweep [-PQNFL <num>] [-lrfetvh]\n" );
- fprintf( pErr, "\t performs sequential sweep using K-step induction\n" );
- fprintf( pErr, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
- fprintf( pErr, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
- fprintf( pErr, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
- fprintf( pErr, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
- fprintf( pErr, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
-// fprintf( pErr, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
-// fprintf( pErr, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
- fprintf( pErr, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
- fprintf( pErr, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
- fprintf( pErr, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
- fprintf( pErr, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
- fprintf( pErr, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: ssweep [-PQNFL <num>] [-lrfetvh]\n" );
+ Abc_Print( -2, "\t performs sequential sweep using K-step induction\n" );
+ Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+ Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+ Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
+ Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+ Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+// Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
+// Abc_Print( -2, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
+ Abc_Print( -2, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -14468,27 +14214,24 @@ usage:
***********************************************************************/
int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
Ssw_Pars_t Pars, * pPars = &Pars;
+ int nConstrs = 0;
int c;
extern Abc_Ntk_t * Abc_NtkDarSeqSweep2( Abc_Ntk_t * pNtk, Ssw_Pars_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Ssw_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "PQFCLNSIVMplfudsvwh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "PQFCLSIVMNcmplofdsvwh" ) ) != EOF )
{
switch ( c )
{
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
pPars->nPartSize = atoi(argv[globalUtilOptind]);
@@ -14499,7 +14242,7 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'Q':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-Q\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
goto usage;
}
pPars->nOverSize = atoi(argv[globalUtilOptind]);
@@ -14510,7 +14253,7 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesK = atoi(argv[globalUtilOptind]);
@@ -14521,7 +14264,7 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -14532,7 +14275,7 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
@@ -14540,21 +14283,10 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nMaxLevs <= 0 )
goto usage;
break;
- case 'N':
- if ( globalUtilOptind >= argc )
- {
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
- goto usage;
- }
- pPars->nConstrs = atoi(argv[globalUtilOptind]);
- globalUtilOptind++;
- if ( pPars->nConstrs < 0 )
- goto usage;
- break;
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesAddSim = atoi(argv[globalUtilOptind]);
@@ -14565,7 +14297,7 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
pPars->nItersStop = atoi(argv[globalUtilOptind]);
@@ -14576,7 +14308,7 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'V':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-V\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
goto usage;
}
pPars->nSatVarMax2 = atoi(argv[globalUtilOptind]);
@@ -14587,7 +14319,7 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-M\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pPars->nRecycleCalls2 = atoi(argv[globalUtilOptind]);
@@ -14595,18 +14327,35 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nRecycleCalls2 < 0 )
goto usage;
break;
+ case 'N':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConstrs = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConstrs < 0 )
+ goto usage;
+ break;
+ case 'c':
+ pPars->fConstrs ^= 1;
+ break;
+ case 'm':
+ pPars->fMergeFull ^= 1;
+ break;
case 'p':
pPars->fPolarFlip ^= 1;
break;
case 'l':
pPars->fLatchCorr ^= 1;
break;
+ case 'o':
+ pPars->fOutputCorr ^= 1;
+ break;
case 'f':
pPars->fSemiFormal ^= 1;
break;
- case 'u':
- pPars->fUniqueness ^= 1;
- break;
case 'd':
pPars->fDynamic ^= 1;
break;
@@ -14628,27 +14377,50 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
+ Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
+ // if constraints are to be used, network should have no constraints
+ if ( nConstrs > 0 )
+ {
+ if ( Abc_NtkConstrNum(pNtk) > 0 )
+ {
+ Abc_Print( -1, "The network already has %d constraints.\n", Abc_NtkConstrNum(pNtk) );
+ return 0;
+ }
+ else
+ {
+ Abc_Print( 0, "Setting the number of constraints to be %d.\n", nConstrs );
+ pNtk->nConstrs = nConstrs;
+ }
+ }
+
+ if ( pPars->fConstrs )
+ {
+ if ( Abc_NtkConstrNum(pNtk) > 0 )
+ Abc_Print( 0, "Performing scorr with %d constraints.\n", Abc_NtkConstrNum(pNtk) );
+ else
+ Abc_Print( 0, "Performing constraint-based scorr without constraints.\n" );
+ }
+
// get the new network
pNtkRes = Abc_NtkDarSeqSweep2( pNtk, pPars );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Sequential sweeping has failed.\n" );
+ Abc_Print( -1, "Sequential sweeping has failed.\n" );
return 1;
}
// replace the current network
@@ -14656,27 +14428,30 @@ int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: scorr [-PQFCLNSIVM <num>] [-pludsvwh]\n" );
- fprintf( pErr, "\t performs sequential sweep using K-step induction\n" );
- fprintf( pErr, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
- fprintf( pErr, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
- fprintf( pErr, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
- fprintf( pErr, "\t-C num : max number of conflicts at a node (0=inifinite) [default = %d]\n", pPars->nBTLimit );
- fprintf( pErr, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
- fprintf( pErr, "\t-N num : number of last POs treated as constraints (0=none) [default = %d]\n", pPars->nConstrs );
- fprintf( pErr, "\t-S num : additional simulation frames for c-examples (0=none) [default = %d]\n", pPars->nFramesAddSim );
- fprintf( pErr, "\t-I num : iteration number to stop and output SR-model (-1=none) [default = %d]\n", pPars->nItersStop );
- fprintf( pErr, "\t-V num : min var num needed to recycle the SAT solver [default = %d]\n", pPars->nSatVarMax2 );
- fprintf( pErr, "\t-M num : min call num needed to recycle the SAT solver [default = %d]\n", pPars->nRecycleCalls2 );
- fprintf( pErr, "\t-p : toggle alighning polarity of SAT variables [default = %s]\n", pPars->fPolarFlip? "yes": "no" );
- fprintf( pErr, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
-// fprintf( pErr, "\t-f : toggle filtering using iterative BMC [default = %s]\n", pPars->fSemiFormal? "yes": "no" );
- fprintf( pErr, "\t-u : toggle using uniqueness constraints [default = %s]\n", pPars->fUniqueness? "yes": "no" );
- fprintf( pErr, "\t-d : toggle dynamic addition of constraints [default = %s]\n", pPars->fDynamic? "yes": "no" );
- fprintf( pErr, "\t-s : toggle local simulation in the cone of influence [default = %s]\n", pPars->fLocalSim? "yes": "no" );
- fprintf( pErr, "\t-w : toggle printout of flop equivalences [default = %s]\n", pPars->fFlopVerbose? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: scorr [-PQFCLSIVMN <num>] [-cmplodsvwh]\n" );
+ Abc_Print( -2, "\t performs sequential sweep using K-step induction\n" );
+ Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+ Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+ Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+ Abc_Print( -2, "\t-C num : max number of conflicts at a node (0=inifinite) [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+ Abc_Print( -2, "\t-N num : number of last POs treated as constraints (0=none) [default = %d]\n", pPars->fConstrs );
+ Abc_Print( -2, "\t-S num : additional simulation frames for c-examples (0=none) [default = %d]\n", pPars->nFramesAddSim );
+ Abc_Print( -2, "\t-I num : iteration number to stop and output SR-model (-1=none) [default = %d]\n", pPars->nItersStop );
+ Abc_Print( -2, "\t-V num : min var num needed to recycle the SAT solver [default = %d]\n", pPars->nSatVarMax2 );
+ Abc_Print( -2, "\t-M num : min call num needed to recycle the SAT solver [default = %d]\n", pPars->nRecycleCalls2 );
+ Abc_Print( -2, "\t-N num : set last <num> POs to be constraints (use with -c) [default = %d]\n", nConstrs );
+ Abc_Print( -2, "\t-c : toggle using explicit constraints [default = %s]\n", pPars->fConstrs? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggle full merge if constraints are present [default = %s]\n", pPars->fMergeFull? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle alighning polarity of SAT variables [default = %s]\n", pPars->fPolarFlip? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle doing latch correspondence [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggle doing \'PO correspondence\' [default = %s]\n", pPars->fOutputCorr? "yes": "no" );
+// Abc_Print( -2, "\t-f : toggle filtering using iterative BMC [default = %s]\n", pPars->fSemiFormal? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggle dynamic addition of constraints [default = %s]\n", pPars->fDynamic? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle local simulation in the cone of influence [default = %s]\n", pPars->fLocalSim? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printout of flop equivalences [default = %s]\n", pPars->fFlopVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -14691,7 +14466,7 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandTestSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char * pFileName;
Fra_Ssw_t Pars, * pPars = &Pars;
@@ -14722,7 +14497,7 @@ int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
pPars->nPartSize = atoi(argv[globalUtilOptind]);
@@ -14733,7 +14508,7 @@ int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'Q':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-Q\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
goto usage;
}
pPars->nOverSize = atoi(argv[globalUtilOptind]);
@@ -14744,7 +14519,7 @@ int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesP = atoi(argv[globalUtilOptind]);
@@ -14755,7 +14530,7 @@ int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesK = atoi(argv[globalUtilOptind]);
@@ -14766,7 +14541,7 @@ int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxImps = atoi(argv[globalUtilOptind]);
@@ -14777,7 +14552,7 @@ int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
@@ -14817,30 +14592,140 @@ int Abc_CommandSeqSweepTest( Abc_Frame_t * pAbc, int argc, char ** argv )
pFileName = argv[globalUtilOptind];
else
{
- printf( "File name should be given on the command line.\n" );
+ Abc_Print( -1, "File name should be given on the command line.\n" );
return 1;
}
Fra_FraigInductionTest( pFileName, pPars );
return 0;
usage:
- fprintf( stdout, "usage: testssw [-PQNFL num] [-lrfetvh] <file>\n" );
- fprintf( stdout, "\t performs sequential sweep using K-step induction\n" );
- fprintf( stdout, "\t (outputs a file with a set of pairs of equivalent nodes)\n" );
- fprintf( stdout, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
- fprintf( stdout, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
- fprintf( stdout, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
- fprintf( stdout, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
- fprintf( stdout, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
-// fprintf( stdout, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
-// fprintf( stdout, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
- fprintf( stdout, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
- fprintf( stdout, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
- fprintf( stdout, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
- fprintf( stdout, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
- fprintf( stdout, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: testssw [-PQNFL num] [-lrfetvh] <file>\n" );
+ Abc_Print( -2, "\t performs sequential sweep using K-step induction\n" );
+ Abc_Print( -2, "\t (outputs a file with a set of pairs of equivalent nodes)\n" );
+ Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+ Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+ Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
+ Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+ Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+// Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
+// Abc_Print( -2, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
+ Abc_Print( -2, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandTestScorr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern Abc_Ntk_t * Abc_NtkTestScorr( char * pFileNameIn, char * pFileNameOut, int nStepsMax, int nBTLimit, int fNewAlgo, int fFlopOnly, int fFfNdOnly, int fVerbose );
+
+ Abc_Ntk_t * pNtkRes;
+ int c;
+ int nConfMax;
+ int nStepsMax;
+ int fNewAlgo;
+ int fFlopOnly;
+ int fFfNdOnly;
+ int fVerbose;
+ // set defaults
+ nConfMax = 100;
+ nStepsMax = -1;
+ fNewAlgo = 0;
+ fFlopOnly = 0;
+ fFfNdOnly = 0;
+ fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "CSnfsvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConfMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConfMax < 0 )
+ goto usage;
+ break;
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nStepsMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nStepsMax < 0 )
+ goto usage;
+ break;
+ case 'n':
+ fNewAlgo ^= 1;
+ break;
+ case 'f':
+ fFlopOnly ^= 1;
+ break;
+ case 's':
+ fFfNdOnly ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ default:
+ goto usage;
+ }
+ }
+ if ( argc != globalUtilOptind + 2 )
+ {
+ Abc_Print( -1, "Expecting two files names on the command line.\n" );
+ goto usage;
+ }
+ if ( fFlopOnly && fFfNdOnly )
+ {
+ Abc_Print( -1, "These two options (-f and -s) are incompatible.\n" );
+ goto usage;
+ }
+ // get the new network
+ pNtkRes = Abc_NtkTestScorr( argv[globalUtilOptind], argv[globalUtilOptind+1], nStepsMax, nConfMax, fNewAlgo, fFlopOnly, fFfNdOnly, fVerbose );
+ if ( pNtkRes == NULL )
+ {
+ Abc_Print( -1, "Sequential sweeping has failed.\n" );
+ return 1;
+ }
+ // replace the current network
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: testscorr [-CS num] [-nfsvh] <file_in> <file_out>\n" );
+ Abc_Print( -2, "\t outputs the list of sequential equivalences into a file\n" );
+ Abc_Print( -2, "\t (if <file_in> is in BENCH, init state file should be the same directory)\n" );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfMax );
+ Abc_Print( -2, "\t-S num : limit on refinement iterations (-1=no limit, 0=after BMC, etc) [default = %d]\n", nStepsMax );
+ Abc_Print( -2, "\t-n : toggle between \"scorr\" and \"&scorr\" [default = %s]\n", fNewAlgo? "&scorr": "scorr" );
+ Abc_Print( -2, "\t-f : toggle reporting only flop/flop equivs [default = %s]\n", fFlopOnly? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle reporting only flop/flop and flop/node equivs [default = %s]\n", fFfNdOnly? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file_in> : input file with design for sequential equivalence computation\n");
+ Abc_Print( -2, "\t<file_out> : output file with the list of pairs of equivalent signals\n");
return 1;
}
@@ -14857,7 +14742,6 @@ usage:
***********************************************************************/
int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int nFramesP;
@@ -14869,8 +14753,8 @@ int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarLcorrNew( Abc_Ntk_t * pNtk, int nVarsMax, int nConfMax, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+
+
// set defaults
nFramesP = 0;
@@ -14886,7 +14770,7 @@ int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nFramesP = atoi(argv[globalUtilOptind]);
@@ -14897,7 +14781,7 @@ int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfMax = atoi(argv[globalUtilOptind]);
@@ -14908,7 +14792,7 @@ int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
nVarsMax = atoi(argv[globalUtilOptind]);
@@ -14931,19 +14815,19 @@ int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
+ Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
@@ -14954,7 +14838,7 @@ int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarLcorr( pNtk, nFramesP, nConfMax, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Sequential sweeping has failed.\n" );
+ Abc_Print( -1, "Sequential sweeping has failed.\n" );
return 1;
}
// replace the current network
@@ -14962,14 +14846,14 @@ int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: lcorr [-PCS num] [-nvh]\n" );
- fprintf( pErr, "\t computes latch correspondence using 1-step induction\n" );
- fprintf( pErr, "\t-P num : number of time frames to use as the prefix [default = %d]\n", nFramesP );
- fprintf( pErr, "\t-C num : max conflict number when proving latch equivalence [default = %d]\n", nConfMax );
- fprintf( pErr, "\t-S num : the max number of SAT variables [default = %d]\n", nVarsMax );
- fprintf( pErr, "\t-n : toggle using new algorithm [default = %s]\n", fNewAlgor? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: lcorr [-PCS num] [-nvh]\n" );
+ Abc_Print( -2, "\t computes latch correspondence using 1-step induction\n" );
+ Abc_Print( -2, "\t-P num : number of time frames to use as the prefix [default = %d]\n", nFramesP );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfMax );
+ Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", nVarsMax );
+ Abc_Print( -2, "\t-n : toggle using new algorithm [default = %s]\n", fNewAlgor? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -14986,24 +14870,23 @@ usage:
***********************************************************************/
int Abc_CommandSeqCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int fLatchConst;
int fLatchEqual;
+ int fSaveNames;
int fVerbose;
- extern Abc_Ntk_t * Abc_NtkDarLatchSweep( Abc_Ntk_t * pNtk, int fLatchConst, int fLatchEqual, int fVerbose );
+ extern Abc_Ntk_t * Abc_NtkDarLatchSweep( Abc_Ntk_t * pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
// set defaults
fLatchConst = 1;
fLatchEqual = 1;
+ fSaveNames = 0;
fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "cevh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "cenvh" ) ) != EOF )
{
switch ( c )
{
@@ -15013,6 +14896,9 @@ int Abc_CommandSeqCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'e':
fLatchEqual ^= 1;
break;
+ case 'n':
+ fSaveNames ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -15024,24 +14910,24 @@ int Abc_CommandSeqCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for structrally hashed networks.\n" );
+ Abc_Print( -1, "Only works for structrally hashed networks.\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
// modify the current network
- pNtkRes = Abc_NtkDarLatchSweep( pNtk, fLatchConst, fLatchEqual, fVerbose );
+ pNtkRes = Abc_NtkDarLatchSweep( pNtk, fLatchConst, fLatchEqual, fSaveNames, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Sequential cleanup has failed.\n" );
+ Abc_Print( -1, "Sequential cleanup has failed.\n" );
return 1;
}
// replace the current network
@@ -15049,13 +14935,14 @@ int Abc_CommandSeqCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: scleanup [-cevh]\n" );
- fprintf( pErr, "\t performs sequential cleanup of the current network\n" );
- fprintf( pErr, "\t by removing nodes and latches that do not feed into POs\n" );
- fprintf( pErr, "\t-c : sweep stuck-at latches detected by ternary simulation [default = %s]\n", fLatchConst? "yes": "no" );
- fprintf( pErr, "\t-e : merge equal latches (same data inputs and init states) [default = %s]\n", fLatchEqual? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: scleanup [-cenvh]\n" );
+ Abc_Print( -2, "\t performs sequential cleanup of the current network\n" );
+ Abc_Print( -2, "\t by removing nodes and latches that do not feed into POs\n" );
+ Abc_Print( -2, "\t-c : sweep stuck-at latches detected by ternary simulation [default = %s]\n", fLatchConst? "yes": "no" );
+ Abc_Print( -2, "\t-e : merge equal latches (same data inputs and init states) [default = %s]\n", fLatchEqual? "yes": "no" );
+ Abc_Print( -2, "\t-n : toggle preserving latch names [default = %s]\n", fSaveNames? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -15072,19 +14959,13 @@ usage:
***********************************************************************/
int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nFrames;
int fUseXval;
int fVerbose;
extern void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVerbose );
extern void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nFrames = 100;
fUseXval = 0;
@@ -15097,7 +14978,7 @@ int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -15119,23 +15000,23 @@ int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) && !Abc_NtkIsSopLogic(pNtk) )
{
- fprintf( pErr, "Only works for strashed networks or logic SOP networks.\n" );
+ Abc_Print( -1, "Only works for strashed networks or logic SOP networks.\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
if ( fUseXval && !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "X-valued simulation only works for AIGs. Run \"strash\".\n" );
+ Abc_Print( -1, "X-valued simulation only works for AIGs. Run \"strash\".\n" );
return 0;
}
if ( fUseXval )
@@ -15147,13 +15028,13 @@ int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: cycle [-F num] [-xvh]\n" );
- fprintf( pErr, "\t cycles sequential circuit for the given number of timeframes\n" );
- fprintf( pErr, "\t to derive a new initial state (which may be on the envelope)\n" );
- fprintf( pErr, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
- fprintf( pErr, "\t-x : use x-valued primary inputs [default = %s]\n", fUseXval? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: cycle [-F num] [-xvh]\n" );
+ Abc_Print( -2, "\t cycles sequential circuit for the given number of timeframes\n" );
+ Abc_Print( -2, "\t to derive a new initial state (which may be on the envelope)\n" );
+ Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-x : use x-valued primary inputs [default = %s]\n", fUseXval? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -15170,19 +15051,13 @@ usage:
***********************************************************************/
int Abc_CommandXsim( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nFrames;
int fXInputs;
int fXState;
int fVerbose;
extern void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXState, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nFrames = 10;
fXInputs = 0;
@@ -15196,7 +15071,7 @@ int Abc_CommandXsim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -15221,31 +15096,31 @@ int Abc_CommandXsim( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for strashed networks.\n" );
+ Abc_Print( -1, "Only works for strashed networks.\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
Abc_NtkXValueSimulate( pNtk, nFrames, fXInputs, fXState, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: xsim [-F num] [-isvh]\n" );
- fprintf( pErr, "\t performs X-valued simulation of the AIG\n" );
- fprintf( pErr, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
- fprintf( pErr, "\t-i : toggle X-valued representation of inputs [default = %s]\n", fXInputs? "yes": "no" );
- fprintf( pErr, "\t-s : toggle X-valued representation of state [default = %s]\n", fXState? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: xsim [-F num] [-isvh]\n" );
+ Abc_Print( -2, "\t performs X-valued simulation of the AIG\n" );
+ Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-i : toggle X-valued representation of inputs [default = %s]\n", fXInputs? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle X-valued representation of state [default = %s]\n", fXState? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -15263,8 +15138,7 @@ usage:
***********************************************************************/
int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fNew;
int fComb;
@@ -15274,11 +15148,6 @@ int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
int fMiter;
int fVerbose;
extern int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, int fNew, int fComb, int fMiter, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fNew = 0;
fComb = 0;
@@ -15295,7 +15164,7 @@ int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -15306,7 +15175,7 @@ int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
nWords = atoi(argv[globalUtilOptind]);
@@ -15317,7 +15186,7 @@ int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
TimeOut = atoi(argv[globalUtilOptind]);
@@ -15345,29 +15214,30 @@ int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for strashed networks.\n" );
+ Abc_Print( -1, "Only works for strashed networks.\n" );
return 1;
}
ABC_FREE( pNtk->pSeqModel );
- Abc_NtkDarSeqSim( pNtk, nFrames, nWords, TimeOut, fNew, fComb, fMiter, fVerbose );
+ pAbc->Status = Abc_NtkDarSeqSim( pNtk, nFrames, nWords, TimeOut, fNew, fComb, fMiter, fVerbose );
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
return 0;
usage:
- fprintf( pErr, "usage: sim [-FWT num] [-ncmvh]\n" );
- fprintf( pErr, "\t performs random simulation of the sequential miter\n" );
- fprintf( pErr, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
- fprintf( pErr, "\t-W num : the number of words to simulate [default = %d]\n", nWords );
- fprintf( pErr, "\t-T num : approximate runtime limit in seconds [default = %d]\n", TimeOut );
- fprintf( pErr, "\t-n : toggle new vs. old implementation [default = %s]\n", fNew? "new": "old" );
- fprintf( pErr, "\t-c : toggle comb vs. seq simulaton [default = %s]\n", fComb? "comb": "seq" );
- fprintf( pErr, "\t-m : toggle miter vs. any circuit [default = %s]\n", fMiter? "miter": "circuit" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: sim [-FWT num] [-ncmvh]\n" );
+ Abc_Print( -2, "\t performs random simulation of the sequential miter\n" );
+ Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", nWords );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", TimeOut );
+ Abc_Print( -2, "\t-n : toggle new vs. old implementation [default = %s]\n", fNew? "new": "old" );
+ Abc_Print( -2, "\t-c : toggle comb vs. seq simulaton [default = %s]\n", fComb? "comb": "seq" );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", fMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -15384,7 +15254,6 @@ usage:
***********************************************************************/
int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
int nFrames, nPref;
@@ -15394,9 +15263,6 @@ int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkPhaseAbstract( Abc_Ntk_t * pNtk, int nFrames, int nPref, int fIgnore, int fPrint, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nFrames = 0;
nPref = 0;
@@ -15411,7 +15277,7 @@ int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -15422,7 +15288,7 @@ int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPref = atoi(argv[globalUtilOptind]);
@@ -15447,17 +15313,17 @@ int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for structrally hashed networks.\n" );
+ Abc_Print( -1, "Only works for structrally hashed networks.\n" );
return 1;
}
if ( !Abc_NtkLatchNum(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
if ( fPrint )
@@ -15469,7 +15335,7 @@ int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkPhaseAbstract( pNtk, nFrames, nPref, fIgnore, 0, fVerbose );
if ( pNtkRes == NULL )
{
-// fprintf( pErr, "Phase abstraction has failed.\n" );
+// Abc_Print( -1, "Phase abstraction has failed.\n" );
return 0;
}
// replace the current network
@@ -15477,15 +15343,15 @@ int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: phase [-FP <num>] [-ipvh]\n" );
- fprintf( pErr, "\t performs sequential cleanup of the current network\n" );
- fprintf( pErr, "\t by removing nodes and latches that do not feed into POs\n" );
- fprintf( pErr, "\t-F num : the number of frames to abstract [default = %d]\n", nFrames );
- fprintf( pErr, "\t-P num : the number of prefix frames to skip [default = %d]\n", nPref );
- fprintf( pErr, "\t-i : toggle ignoring the initial state [default = %s]\n", fIgnore? "yes": "no" );
- fprintf( pErr, "\t-p : toggle printing statistics about generators [default = %s]\n", fPrint? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: phase [-FP <num>] [-ipvh]\n" );
+ Abc_Print( -2, "\t performs sequential cleanup of the current network\n" );
+ Abc_Print( -2, "\t by removing nodes and latches that do not feed into POs\n" );
+ Abc_Print( -2, "\t-F num : the number of frames to abstract [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-P num : the number of prefix frames to skip [default = %d]\n", nPref );
+ Abc_Print( -2, "\t-i : toggle ignoring the initial state [default = %s]\n", fIgnore? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle printing statistics about generators [default = %s]\n", fPrint? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -15502,7 +15368,6 @@ usage:
***********************************************************************/
int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtkRes, * pNtk1, * pNtk2, * pNtk;
char ** pArgvNew;
int nArgcNew;
@@ -15515,9 +15380,6 @@ int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarSynchOne( Abc_Ntk_t * pNtk, int nWords, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nWords = 32;
fVerbose = 1;
@@ -15529,7 +15391,7 @@ int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
nWords = atoi(argv[globalUtilOptind]);
@@ -15553,20 +15415,20 @@ int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
pNtkRes = Abc_NtkDarSynchOne( pNtk, nWords, fVerbose );
}
else
{
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
{
if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
- printf( "The network has no latches..\n" );
+ Abc_Print( -1, "The network has no latches..\n" );
return 0;
}
@@ -15577,7 +15439,7 @@ int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Synchronization has failed.\n" );
+ Abc_Print( -1, "Synchronization has failed.\n" );
return 0;
}
// replace the current network
@@ -15585,23 +15447,23 @@ int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: synch [-W <num>] [-vh] <file1> <file2>\n" );
- fprintf( pErr, "\t derives and applies synchronization sequence\n" );
- fprintf( pErr, "\t-W num : the number of simulation words [default = %d]\n", nWords );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tfile1 : (optional) the file with the first design\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second design\n\n");
- fprintf( pErr, "\t If no designs are given on the command line,\n" );
- fprintf( pErr, "\t assumes the current network has no initial state,\n" );
- fprintf( pErr, "\t derives synchronization sequence and applies it.\n\n" );
- fprintf( pErr, "\t If two designs are given on the command line\n" );
- fprintf( pErr, "\t assumes both of them have no initial state,\n" );
- fprintf( pErr, "\t derives sequences for both designs, synchorinizes\n" );
- fprintf( pErr, "\t them, and creates SEC miter comparing two designs.\n\n" );
- fprintf( pErr, "\t If only one design is given on the command line,\n" );
- fprintf( pErr, "\t considers the second design to be the current network,\n" );
- fprintf( pErr, "\t and derives SEC miter for them, as described above.\n" );
+ Abc_Print( -2, "usage: synch [-W <num>] [-vh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t derives and applies synchronization sequence\n" );
+ Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", nWords );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first design\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second design\n\n");
+ Abc_Print( -2, "\t If no designs are given on the command line,\n" );
+ Abc_Print( -2, "\t assumes the current network has no initial state,\n" );
+ Abc_Print( -2, "\t derives synchronization sequence and applies it.\n\n" );
+ Abc_Print( -2, "\t If two designs are given on the command line\n" );
+ Abc_Print( -2, "\t assumes both of them have no initial state,\n" );
+ Abc_Print( -2, "\t derives sequences for both designs, synchorinizes\n" );
+ Abc_Print( -2, "\t them, and creates SEC miter comparing two designs.\n\n" );
+ Abc_Print( -2, "\t If only one design is given on the command line,\n" );
+ Abc_Print( -2, "\t considers the second design to be the current network,\n" );
+ Abc_Print( -2, "\t and derives SEC miter for them, as described above.\n" );
return 1;
}
@@ -15618,7 +15480,6 @@ usage:
***********************************************************************/
int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Cgt_Par_t Pars, * pPars = &Pars;
Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
int c;
@@ -15626,9 +15487,6 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarClockGate( Abc_Ntk_t * pNtk, Abc_Ntk_t * pCare, Cgt_Par_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Cgt_SetDefaultParams( pPars );
Extra_UtilGetoptReset();
@@ -15639,7 +15497,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nLevelMax = atoi(argv[globalUtilOptind]);
@@ -15650,7 +15508,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nCandMax = atoi(argv[globalUtilOptind]);
@@ -15661,7 +15519,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nOdcMax = atoi(argv[globalUtilOptind]);
@@ -15672,7 +15530,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nConfMax = atoi(argv[globalUtilOptind]);
@@ -15683,7 +15541,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'V':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-V\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
goto usage;
}
pPars->nVarsMin = atoi(argv[globalUtilOptind]);
@@ -15694,7 +15552,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFlopsMin = atoi(argv[globalUtilOptind]);
@@ -15719,7 +15577,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
@@ -15728,7 +15586,7 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1 );
if ( pNtkCare == NULL )
{
- printf( "Reading care network has failed.\n" );
+ Abc_Print( -1, "Reading care network has failed.\n" );
return 1;
}
// modify the current network
@@ -15741,12 +15599,12 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
}
else
{
- fprintf( pErr, "Wrong number of arguments.\n" );
+ Abc_Print( -1, "Wrong number of arguments.\n" );
return 0;
}
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Clock gating has failed.\n" );
+ Abc_Print( -1, "Clock gating has failed.\n" );
return 0;
}
// replace the current network
@@ -15754,19 +15612,19 @@ int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: clockgate [-LNDCVK <num>] [-avwh] <file>\n" );
- fprintf( pErr, "\t sequential clock gating with observability don't-cares\n" );
- fprintf( pErr, "\t-L num : max level number of a clock gate [default = %d]\n", pPars->nLevelMax );
- fprintf( pErr, "\t-N num : max number of candidates for a flop [default = %d]\n", pPars->nCandMax );
- fprintf( pErr, "\t-D num : max number of ODC levels to consider [default = %d]\n", pPars->nOdcMax );
- fprintf( pErr, "\t-C num : max number of conflicts at a node [default = %d]\n", pPars->nConfMax );
- fprintf( pErr, "\t-V num : min number of vars to recycle SAT solver [default = %d]\n", pPars->nVarsMin );
- fprintf( pErr, "\t-K num : min number of flops to recycle SAT solver [default = %d]\n", pPars->nFlopsMin );
- fprintf( pErr, "\t-a : toggle minimizing area-only [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggle even more detailed output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tfile : (optional) constraints for primary inputs and register outputs\n");
+ Abc_Print( -2, "usage: clockgate [-LNDCVK <num>] [-avwh] <file>\n" );
+ Abc_Print( -2, "\t sequential clock gating with observability don't-cares\n" );
+ Abc_Print( -2, "\t-L num : max level number of a clock gate [default = %d]\n", pPars->nLevelMax );
+ Abc_Print( -2, "\t-N num : max number of candidates for a flop [default = %d]\n", pPars->nCandMax );
+ Abc_Print( -2, "\t-D num : max number of ODC levels to consider [default = %d]\n", pPars->nOdcMax );
+ Abc_Print( -2, "\t-C num : max number of conflicts at a node [default = %d]\n", pPars->nConfMax );
+ Abc_Print( -2, "\t-V num : min number of vars to recycle SAT solver [default = %d]\n", pPars->nVarsMin );
+ Abc_Print( -2, "\t-K num : min number of flops to recycle SAT solver [default = %d]\n", pPars->nFlopsMin );
+ Abc_Print( -2, "\t-a : toggle minimizing area-only [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle even more detailed output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile : (optional) constraints for primary inputs and register outputs\n");
return 1;
}
@@ -15783,7 +15641,6 @@ usage:
***********************************************************************/
int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtkRes, * pNtk;
int c;
int nObjId;
@@ -15793,9 +15650,6 @@ int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarExtWin( Abc_Ntk_t * pNtk, int nObjId, int nDist, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nObjId = -1;
nDist = 5;
@@ -15808,7 +15662,7 @@ int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nObjId = atoi(argv[globalUtilOptind]);
@@ -15819,7 +15673,7 @@ int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
nDist = atoi(argv[globalUtilOptind]);
@@ -15838,25 +15692,25 @@ int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for structrally hashed networks.\n" );
+ Abc_Print( -1, "Only works for structrally hashed networks.\n" );
return 1;
}
if ( argc != globalUtilOptind )
{
- fprintf( pErr, "Not enough command-line arguments.\n" );
+ Abc_Print( -1, "Not enough command-line arguments.\n" );
return 1;
}
// modify the current network
pNtkRes = Abc_NtkDarExtWin( pNtk, nObjId, nDist, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Extracting sequential window has failed.\n" );
+ Abc_Print( -1, "Extracting sequential window has failed.\n" );
return 0;
}
// replace the current network
@@ -15864,12 +15718,12 @@ int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: extwin [-ND <num>] [-vh]\n" );
- fprintf( pErr, "\t extracts sequential window from the AIG\n" );
- fprintf( pErr, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
- fprintf( pErr, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: extwin [-ND <num>] [-vh]\n" );
+ Abc_Print( -2, "\t extracts sequential window from the AIG\n" );
+ Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
+ Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -15886,7 +15740,6 @@ usage:
***********************************************************************/
int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
int c;
int nObjId;
@@ -15896,9 +15749,6 @@ int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarInsWin( Abc_Ntk_t * pNtk, Abc_Ntk_t * pWnd, int nObjId, int nDist, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nObjId = -1;
nDist = 5;
@@ -15911,7 +15761,7 @@ int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nObjId = atoi(argv[globalUtilOptind]);
@@ -15922,7 +15772,7 @@ int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
nDist = atoi(argv[globalUtilOptind]);
@@ -15941,24 +15791,24 @@ int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "Only works for structrally hashed networks.\n" );
+ Abc_Print( -1, "Only works for structrally hashed networks.\n" );
return 1;
}
if ( argc != globalUtilOptind + 1 )
{
- fprintf( pErr, "Not enough command-line arguments.\n" );
+ Abc_Print( -1, "Not enough command-line arguments.\n" );
return 1;
}
pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1 );
if ( pNtkCare == NULL )
{
- printf( "Reading care network has failed.\n" );
+ Abc_Print( -1, "Reading care network has failed.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtkCare) )
@@ -15972,7 +15822,7 @@ int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_NtkDelete( pNtkCare );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Inserting sequential window has failed.\n" );
+ Abc_Print( -1, "Inserting sequential window has failed.\n" );
return 0;
}
// replace the current network
@@ -15980,13 +15830,13 @@ int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: inswin [-ND <num>] [-vh] <file>\n" );
- fprintf( pErr, "\t inserts sequential window into the AIG\n" );
- fprintf( pErr, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
- fprintf( pErr, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tfile : file with the AIG to be inserted\n");
+ Abc_Print( -2, "usage: inswin [-ND <num>] [-vh] <file>\n" );
+ Abc_Print( -2, "\t inserts sequential window into the AIG\n" );
+ Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
+ Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile : file with the AIG to be inserted\n");
return 1;
}
@@ -16004,7 +15854,6 @@ usage:
int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char Buffer[16];
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -16025,9 +15874,6 @@ int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fSat = 0;
fVerbose = 0;
@@ -16045,7 +15891,7 @@ int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
nSeconds = atoi(argv[globalUtilOptind]);
@@ -16056,7 +15902,7 @@ int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -16067,7 +15913,7 @@ int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
nInsLimit = atoi(argv[globalUtilOptind]);
@@ -16078,7 +15924,7 @@ int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPartSize = atoi(argv[globalUtilOptind]);
@@ -16105,7 +15951,7 @@ int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( fIgnoreNames )
@@ -16133,21 +15979,21 @@ usage:
strcpy( Buffer, "unused" );
else
sprintf( Buffer, "%d", nPartSize );
- fprintf( pErr, "usage: cec [-T num] [-C num] [-I num] [-P num] [-psnvh] <file1> <file2>\n" );
- fprintf( pErr, "\t performs combinational equivalence checking\n" );
- fprintf( pErr, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( pErr, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
- fprintf( pErr, "\t-P num : partition size for multi-output networks [default = %s]\n", Buffer );
- fprintf( pErr, "\t-p : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
- fprintf( pErr, "\t-s : toggle \"SAT only\" and \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
- fprintf( pErr, "\t-n : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: cec [-T num] [-C num] [-I num] [-P num] [-psnvh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs combinational equivalence checking\n" );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
+ Abc_Print( -2, "\t-P num : partition size for multi-output networks [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-p : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle \"SAT only\" and \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
+ Abc_Print( -2, "\t-n : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -16165,7 +16011,6 @@ usage:
***********************************************************************/
int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -16183,9 +16028,6 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
extern int Abc_NtkDarCec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int fPartition, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fSat = 0;
fVerbose = 0;
@@ -16202,7 +16044,7 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
nSeconds = atoi(argv[globalUtilOptind]);
@@ -16213,7 +16055,7 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -16224,7 +16066,7 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
nInsLimit = atoi(argv[globalUtilOptind]);
@@ -16255,7 +16097,7 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsStrash(pNtk) )
@@ -16273,7 +16115,7 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
}
else
{
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
}
@@ -16281,7 +16123,7 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
- printf( "Currently this command only works for networks without latches. Run \"comb\".\n" );
+ Abc_Print( -1, "Currently this command only works for networks without latches. Run \"comb\".\n" );
return 1;
}
@@ -16296,20 +16138,20 @@ int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dcec [-T num] [-C num] [-I num] [-mpsvh] <file1> <file2>\n" );
- fprintf( pErr, "\t performs combinational equivalence checking\n" );
- fprintf( pErr, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( pErr, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
- fprintf( pErr, "\t-m : toggle working on two networks or a miter [default = %s]\n", fMiter? "miter": "two networks" );
- fprintf( pErr, "\t-p : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
- fprintf( pErr, "\t-s : toggle \"SAT only\" (miter) or \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: dcec [-T num] [-C num] [-I num] [-mpsvh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs combinational equivalence checking\n" );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
+ Abc_Print( -2, "\t-m : toggle working on two networks or a miter [default = %s]\n", fMiter? "miter": "two networks" );
+ Abc_Print( -2, "\t-p : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle \"SAT only\" (miter) or \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -16326,7 +16168,6 @@ usage:
***********************************************************************/
int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -16343,11 +16184,10 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Abc_NtkSecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nInsLimit, int nFrames );
extern int Abc_NtkSecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nFrames, int fVerbose );
+ Abc_Print( 0, "This command is no longer used.\n" );
+ return 0;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fRetime = 0; // verification after retiming
fSat = 0;
@@ -16364,7 +16204,7 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -16375,7 +16215,7 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
nSeconds = atoi(argv[globalUtilOptind]);
@@ -16386,7 +16226,7 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -16397,7 +16237,7 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
nInsLimit = atoi(argv[globalUtilOptind]);
@@ -16421,14 +16261,14 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
{
if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
- printf( "The network has no latches. Used combinational command \"cec\".\n" );
+ Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
return 0;
}
@@ -16443,21 +16283,21 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: sec [-F num] [-T num] [-C num] [-I num] [-srvh] <file1> <file2>\n" );
- fprintf( pErr, "\t performs bounded sequential equivalence checking\n" );
- fprintf( pErr, "\t (there is also an unbounded SEC commands, \"dsec\" and \"dprove\")\n" );
- fprintf( pErr, "\t-s : toggle \"SAT only\" and \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
- fprintf( pErr, "\t-r : toggles retiming verification [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t-F num : the number of time frames to use [default = %d]\n", nFrames );
- fprintf( pErr, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( pErr, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: sec [-F num] [-T num] [-C num] [-I num] [-srvh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs bounded sequential equivalence checking\n" );
+ Abc_Print( -2, "\t (there is also an unbounded SEC commands, \"dsec\" and \"dprove\")\n" );
+ Abc_Print( -2, "\t-s : toggle \"SAT only\" and \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
+ Abc_Print( -2, "\t-r : toggles retiming verification [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t-F num : the number of time frames to use [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -16475,7 +16315,6 @@ usage:
int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Fra_Sec_t SecPar, * pSecPar = &SecPar;
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -16487,9 +16326,6 @@ int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
extern int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Fra_Sec_t * p );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Fra_SecSetDefaultParams( pSecPar );
pSecPar->TimeLimit = 0;
@@ -16502,7 +16338,7 @@ int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
@@ -16513,7 +16349,7 @@ int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->TimeLimit = atoi(argv[globalUtilOptind]);
@@ -16549,13 +16385,13 @@ int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
{
if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
- printf( "The network has no latches. Used combinational command \"cec\".\n" );
+ Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
return 0;
}
@@ -16573,22 +16409,22 @@ int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: dsec [-F num] [-T num] [-armfnwvh] <file1> <file2>\n" );
- fprintf( pErr, "\t performs inductive sequential equivalence checking\n" );
- fprintf( pErr, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
- fprintf( pErr, "\t-T num : the approximate runtime limit (in seconds) [default = %d]\n", pSecPar->TimeLimit );
- fprintf( pErr, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
- fprintf( pErr, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
- fprintf( pErr, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
- fprintf( pErr, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
- fprintf( pErr, "\t-n : toggle ignoring names when matching PIs/POs [default = %s]\n", fIgnoreNames? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: dsec [-F num] [-T num] [-armfnwvh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs inductive sequential equivalence checking\n" );
+ Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
+ Abc_Print( -2, "\t-T num : the approximate runtime limit (in seconds) [default = %d]\n", pSecPar->TimeLimit );
+ Abc_Print( -2, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
+ Abc_Print( -2, "\t-n : toggle ignoring names when matching PIs/POs [default = %s]\n", fIgnoreNames? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -16606,22 +16442,17 @@ usage:
int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Fra_Sec_t SecPar, * pSecPar = &SecPar;
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
+ char * pLogFileName = NULL;
extern void Fra_SecSetDefaultParams( Fra_Sec_t * p );
extern int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Fra_SecSetDefaultParams( pSecPar );
// pSecPar->TimeLimit = 300;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "cbFCGDVBRarmfijkouwvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "cbFCGDVBRLarmfijkouwvh" ) ) != EOF )
{
switch ( c )
{
@@ -16634,7 +16465,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
@@ -16645,7 +16476,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -16656,7 +16487,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'G':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-G\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nBTLimitGlobal = atoi(argv[globalUtilOptind]);
@@ -16667,7 +16498,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nBTLimitInter = atoi(argv[globalUtilOptind]);
@@ -16678,7 +16509,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'V':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-V\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nBddVarsMax = atoi(argv[globalUtilOptind]);
@@ -16689,7 +16520,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'B':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-B\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nBddMax = atoi(argv[globalUtilOptind]);
@@ -16700,7 +16531,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'R':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-R\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nBddIterMax = atoi(argv[globalUtilOptind]);
@@ -16708,6 +16539,15 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pSecPar->nBddIterMax < 0 )
goto usage;
break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
case 'a':
pSecPar->fPhaseAbstract ^= 1;
break;
@@ -16747,19 +16587,21 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
// perform verification
- Abc_NtkDarProve( pNtk, pSecPar );
- pAbc->pCex = pNtk->pSeqModel; // temporary ???
+ pAbc->Status = Abc_NtkDarProve( pNtk, pSecPar );
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, "dprove" );
// read back the resulting unsolved reduced sequential miter
if ( pSecPar->fReadUnsolved && pSecPar->nSMnumber >= 0 )
@@ -16768,36 +16610,37 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
sprintf( FileName, "sm%02d.aig", pSecPar->nSMnumber );
pNtk = Io_Read( FileName, Io_ReadFileType(FileName), 1 );
if ( pNtk == NULL )
- printf( "Cannot read back unsolved reduced sequential miter \"%s\",\n", FileName );
+ Abc_Print( -1, "Cannot read back unsolved reduced sequential miter \"%s\",\n", FileName );
else
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
}
return 0;
usage:
- fprintf( pErr, "usage: dprove [-FCGDVBR num] [-cbarmfijouwvh]\n" );
- fprintf( pErr, "\t performs SEC on the sequential miter\n" );
- fprintf( pErr, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
- fprintf( pErr, "\t-C num : the conflict limit at a node during induction [default = %d]\n", pSecPar->nBTLimit );
- fprintf( pErr, "\t-G num : the global conflict limit during induction [default = %d]\n", pSecPar->nBTLimitGlobal );
- fprintf( pErr, "\t-D num : the conflict limit during interpolation [default = %d]\n", pSecPar->nBTLimitInter );
- fprintf( pErr, "\t-V num : the flop count limit for BDD-based reachablity [default = %d]\n", pSecPar->nBddVarsMax );
- fprintf( pErr, "\t-B num : the BDD size limit in BDD-based reachablity [default = %d]\n", pSecPar->nBddMax );
- fprintf( pErr, "\t-R num : the max number of reachability iterations [default = %d]\n", pSecPar->nBddIterMax );
- fprintf( pErr, "\t-c : toggles using CEC before attempting SEC [default = %s]\n", pSecPar->fTryComb? "yes": "no" );
- fprintf( pErr, "\t-b : toggles using BMC before attempting SEC [default = %s]\n", pSecPar->fTryBmc? "yes": "no" );
- fprintf( pErr, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
- fprintf( pErr, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
- fprintf( pErr, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
- fprintf( pErr, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
- fprintf( pErr, "\t-i : toggles the use of induction [default = %s]\n", pSecPar->fInduction? "yes": "no" );
- fprintf( pErr, "\t-j : toggles the use of interpolation [default = %s]\n", pSecPar->fInterpolation? "yes": "no" );
- fprintf( pErr, "\t-k : toggles applying interpolation to each output [default = %s]\n", pSecPar->fInterSeparate? "yes": "no" );
- fprintf( pErr, "\t-o : toggles using BDD variable reordering during image computation [default = %s]\n", pSecPar->fReorderImage? "yes": "no" );
- fprintf( pErr, "\t-u : toggles reading back unsolved reduced sequential miter [default = %s]\n", pSecPar->fReadUnsolved? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dprove [-FCGDVBR num] [-L file] [-cbarmfijouwvh]\n" );
+ Abc_Print( -2, "\t performs SEC on the sequential miter\n" );
+ Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
+ Abc_Print( -2, "\t-C num : the conflict limit at a node during induction [default = %d]\n", pSecPar->nBTLimit );
+ Abc_Print( -2, "\t-G num : the global conflict limit during induction [default = %d]\n", pSecPar->nBTLimitGlobal );
+ Abc_Print( -2, "\t-D num : the conflict limit during interpolation [default = %d]\n", pSecPar->nBTLimitInter );
+ Abc_Print( -2, "\t-V num : the flop count limit for BDD-based reachablity [default = %d]\n", pSecPar->nBddVarsMax );
+ Abc_Print( -2, "\t-B num : the BDD size limit in BDD-based reachablity [default = %d]\n", pSecPar->nBddMax );
+ Abc_Print( -2, "\t-R num : the max number of reachability iterations [default = %d]\n", pSecPar->nBddIterMax );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+ Abc_Print( -2, "\t-c : toggles using CEC before attempting SEC [default = %s]\n", pSecPar->fTryComb? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggles using BMC before attempting SEC [default = %s]\n", pSecPar->fTryBmc? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
+ Abc_Print( -2, "\t-i : toggles the use of induction [default = %s]\n", pSecPar->fInduction? "yes": "no" );
+ Abc_Print( -2, "\t-j : toggles the use of interpolation [default = %s]\n", pSecPar->fInterpolation? "yes": "no" );
+ Abc_Print( -2, "\t-k : toggles applying interpolation to each output [default = %s]\n", pSecPar->fInterSeparate? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggles using BDD variable reordering during image computation [default = %s]\n", pSecPar->fReorderImage? "yes": "no" );
+ Abc_Print( -2, "\t-u : toggles reading back unsolved reduced sequential miter [default = %s]\n", pSecPar->fReadUnsolved? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -16815,20 +16658,14 @@ usage:
***********************************************************************/
int Abc_CommandDProve2( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int nConfLast;
int fSeparate;
int fVeryVerbose;
int fVerbose;
int c;
- extern int Abc_NtkDProve2( Abc_Ntk_t * pNtk, int nConfLast, int fSeparate, int fVeryVerbose, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
+// extern int Abc_NtkDProve2( Abc_Ntk_t * pNtk, int nConfLast, int fSeparate, int fVeryVerbose, int fVerbose );
// set defaults
nConfLast = 75000;
fSeparate = 0;
@@ -16842,7 +16679,7 @@ int Abc_CommandDProve2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLast = atoi(argv[globalUtilOptind]);
@@ -16865,31 +16702,31 @@ int Abc_CommandDProve2( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- printf( "This command works only for sequential networks.\n" );
+ Abc_Print( -1, "This command works only for sequential networks.\n" );
return 0;
}
// perform verification
- Abc_NtkDProve2( pNtk, nConfLast, fSeparate, fVeryVerbose, fVerbose );
+// Abc_NtkDProve2( pNtk, nConfLast, fSeparate, fVeryVerbose, fVerbose );
return 0;
usage:
- fprintf( pErr, "usage: dprove2 [-C num] [-kwvh]\n" );
- fprintf( pErr, "\t improved integrated solver of sequential miters\n" );
- fprintf( pErr, "\t-C num : the conflict limit during final BMC [default = %d]\n", nConfLast );
- fprintf( pErr, "\t-k : toggles solving each output separately [default = %s]\n", fSeparate? "yes": "no" );
- fprintf( pErr, "\t-w : toggles very verbose output [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dprove2 [-C num] [-kwvh]\n" );
+ Abc_Print( -2, "\t improved integrated solver of sequential miters\n" );
+ Abc_Print( -2, "\t-C num : the conflict limit during final BMC [default = %d]\n", nConfLast );
+ Abc_Print( -2, "\t-k : toggles solving each output separately [default = %s]\n", fSeparate? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -16906,7 +16743,6 @@ usage:
***********************************************************************/
int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -16916,9 +16752,6 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
extern int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fMiter = 1;
nFrames = 2;
@@ -16931,7 +16764,7 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -16954,7 +16787,7 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
Abc_NtkDarAbSec( pNtk, NULL, nFrames, fVerbose );
@@ -16963,13 +16796,13 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
{
if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
- printf( "The network has no latches. Used combinational command \"cec\".\n" );
+ Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
return 0;
}
// perform verification
@@ -16980,15 +16813,15 @@ int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: absec [-F num] [-mv] <file1> <file2>\n" );
- fprintf( pErr, "\t performs SEC by applying CEC to several timeframes\n" );
- fprintf( pErr, "\t-F num : the total number of timeframes to use [default = %d]\n", nFrames );
- fprintf( pErr, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: absec [-F num] [-mv] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs SEC by applying CEC to several timeframes\n" );
+ Abc_Print( -2, "\t-F num : the total number of timeframes to use [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -17006,7 +16839,6 @@ usage:
int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Ssw_Pars_t Pars, * pPars = &Pars;
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -17016,9 +16848,6 @@ int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
extern int Abc_NtkDarSimSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Ssw_Pars_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fMiter = 1;
Ssw_ManSetDefaultParams( pPars );
@@ -17032,7 +16861,7 @@ int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesK = atoi(argv[globalUtilOptind]);
@@ -17043,7 +16872,7 @@ int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nIsleDist = atoi(argv[globalUtilOptind]);
@@ -17073,7 +16902,7 @@ int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
// Abc_Ntk_t * pNtkA, * pNtkB;
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
Abc_NtkDarSimSec( pNtk, NULL, pPars );
@@ -17089,13 +16918,13 @@ int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
{
if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
- printf( "The network has no latches. Used combinational command \"cec\".\n" );
+ Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
return 0;
}
// perform verification
@@ -17106,18 +16935,18 @@ int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: simsec [-FD num] [-mcyv] <file1> <file2>\n" );
- fprintf( pErr, "\t performs SEC using structural similarity\n" );
- fprintf( pErr, "\t-F num : the limit on the depth of induction [default = %d]\n", pPars->nFramesK );
- fprintf( pErr, "\t-D num : the distance for extending islands [default = %d]\n", pPars->nIsleDist );
- fprintf( pErr, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
- fprintf( pErr, "\t-c : uses partial vs. full signal correspondence [default = %s]\n", pPars->fPartSigCorr? "partial": "full" );
- fprintf( pErr, "\t-y : dumps speculatively reduced miter of the classes [default = %s]\n", pPars->fDumpSRInit? "yes": "no" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: simsec [-FD num] [-mcyv] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs SEC using structural similarity\n" );
+ Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pPars->nFramesK );
+ Abc_Print( -2, "\t-D num : the distance for extending islands [default = %d]\n", pPars->nIsleDist );
+ Abc_Print( -2, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
+ Abc_Print( -2, "\t-c : uses partial vs. full signal correspondence [default = %s]\n", pPars->fPartSigCorr? "partial": "full" );
+ Abc_Print( -2, "\t-y : dumps speculatively reduced miter of the classes [default = %s]\n", pPars->fDumpSRInit? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -17134,7 +16963,6 @@ usage:
***********************************************************************/
int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
int fDelete1, fDelete2;
char ** pArgvNew;
@@ -17146,9 +16974,6 @@ int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarMatch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nDist, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fMiter = 0;
nDist = 0;
@@ -17161,7 +16986,7 @@ int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
nDist = atoi(argv[globalUtilOptind]);
@@ -17185,7 +17010,7 @@ int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
// Abc_Ntk_t * pNtkA, * pNtkB;
if ( !Abc_NtkIsStrash(pNtk) )
{
- printf( "This command works only for structrally hashed networks. Run \"st\".\n" );
+ Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
pNtkRes = Abc_NtkDarMatch( pNtk, NULL, nDist, fVerbose );
@@ -17201,13 +17026,13 @@ int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
{
pArgvNew = argv + globalUtilOptind;
nArgcNew = argc - globalUtilOptind;
- if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
return 1;
if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
{
if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
- printf( "The network has no latches. Used combinational command \"cec\".\n" );
+ Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
return 0;
}
// perform verification
@@ -17217,7 +17042,7 @@ int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtkRes == NULL )
{
- printf( "Matching has failed.\n" );
+ Abc_Print( -1, "Matching has failed.\n" );
return 1;
}
// replace the current network
@@ -17225,16 +17050,16 @@ int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: match [-D num] [-mv] <file1> <file2>\n" );
- fprintf( pErr, "\t detects structural similarity using simulation\n" );
- fprintf( pErr, "\t replaces the current network by the miter of differences\n" );
- fprintf( pErr, "\t-D num : the distance for extending differences [default = %d]\n", nDist );
- fprintf( pErr, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
- fprintf( pErr, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\tfile1 : (optional) the file with the first network\n");
- fprintf( pErr, "\tfile2 : (optional) the file with the second network\n");
- fprintf( pErr, "\t if no files are given, uses the current network and its spec\n");
- fprintf( pErr, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: match [-D num] [-mv] <file1> <file2>\n" );
+ Abc_Print( -2, "\t detects structural similarity using simulation\n" );
+ Abc_Print( -2, "\t replaces the current network by the miter of differences\n" );
+ Abc_Print( -2, "\t-D num : the distance for extending differences [default = %d]\n", nDist );
+ Abc_Print( -2, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
return 1;
}
@@ -17251,19 +17076,13 @@ usage:
***********************************************************************/
int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int RetValue;
int fVerbose;
int nConfLimit;
int nInsLimit;
int clk;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fVerbose = 0;
nConfLimit = 100000;
@@ -17276,7 +17095,7 @@ int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -17287,7 +17106,7 @@ int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
nInsLimit = atoi(argv[globalUtilOptind]);
@@ -17307,12 +17126,12 @@ int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) > 0 )
{
- fprintf( stdout, "Currently can only solve the miter for combinational circuits.\n" );
+ Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
return 0;
}
@@ -17335,39 +17154,39 @@ int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv )
//Abc_Obj_t * pObj;
int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
if ( pSimInfo[0] != 1 )
- printf( "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
+ Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
ABC_FREE( pSimInfo );
/*
// print model
Abc_NtkForEachPi( pNtk, pObj, i )
{
- printf( "%d", (int)(pNtk->pModel[i] > 0) );
+ Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
if ( i == 70 )
break;
}
- printf( "\n" );
+ Abc_Print( -1, "\n" );
*/
}
-
+ pAbc->Status = RetValue;
if ( RetValue == -1 )
- printf( "UNDECIDED " );
+ Abc_Print( 1, "UNDECIDED " );
else if ( RetValue == 0 )
- printf( "SATISFIABLE " );
+ Abc_Print( 1, "SATISFIABLE " );
else
- printf( "UNSATISFIABLE " );
- //printf( "\n" );
- ABC_PRT( "Time", clock() - clk );
+ Abc_Print( 1, "UNSATISFIABLE " );
+ //Abc_Print( -1, "\n" );
+ Abc_PrintTime( 1, "Time", clock() - clk );
return 0;
usage:
- fprintf( pErr, "usage: sat [-C num] [-I num] [-vh]\n" );
- fprintf( pErr, "\t solves the combinational miter using SAT solver MiniSat-1.14\n" );
- fprintf( pErr, "\t derives CNF from the current network and leave it unchanged\n" );
- fprintf( pErr, "\t (there is also a newer SAT solving command \"dsat\")\n" );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( pErr, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: sat [-C num] [-I num] [-vh]\n" );
+ Abc_Print( -2, "\t solves the combinational miter using SAT solver MiniSat-1.14\n" );
+ Abc_Print( -2, "\t derives CNF from the current network and leave it unchanged\n" );
+ Abc_Print( -2, "\t (there is also a newer SAT solving command \"dsat\")\n" );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -17384,8 +17203,7 @@ usage:
***********************************************************************/
int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int RetValue;
int fAlignPol;
@@ -17396,12 +17214,6 @@ int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
int clk;
extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fAlignPol, int fAndOuts, int fVerbose );
-
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
fAlignPol = 0;
fAndOuts = 0;
@@ -17416,7 +17228,7 @@ int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -17427,7 +17239,7 @@ int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
nInsLimit = atoi(argv[globalUtilOptind]);
@@ -17453,24 +17265,24 @@ int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) > 0 )
{
- fprintf( stdout, "Currently can only solve the miter for combinational circuits.\n" );
+ Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
return 0;
}
/*
if ( Abc_NtkPoNum(pNtk) != 1 )
{
- fprintf( stdout, "Currently expects a single-output miter.\n" );
+ Abc_Print( -1, "Currently expects a single-output miter.\n" );
return 0;
}
*/
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
@@ -17479,44 +17291,33 @@ int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
// verify that the pattern is correct
if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
{
- //int i;
- //Abc_Obj_t * pObj;
int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
if ( pSimInfo[0] != 1 )
- printf( "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
+ Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
ABC_FREE( pSimInfo );
- /*
- // print model
- Abc_NtkForEachPi( pNtk, pObj, i )
- {
- printf( "%d", (int)(pNtk->pModel[i] > 0) );
- if ( i == 70 )
- break;
- }
- printf( "\n" );
- */
+ pAbc->pCex = Gia_ManCreateFromComb( 0, Abc_NtkPiNum(pNtk), 0, pNtk->pModel );
}
-
+ pAbc->Status = RetValue;
if ( RetValue == -1 )
- printf( "UNDECIDED " );
+ Abc_Print( 1, "UNDECIDED " );
else if ( RetValue == 0 )
- printf( "SATISFIABLE " );
+ Abc_Print( 1, "SATISFIABLE " );
else
- printf( "UNSATISFIABLE " );
- //printf( "\n" );
- ABC_PRT( "Time", clock() - clk );
+ Abc_Print( 1, "UNSATISFIABLE " );
+ //Abc_Print( -1, "\n" );
+ Abc_PrintTime( 1, "Time", clock() - clk );
return 0;
usage:
- fprintf( pErr, "usage: dsat [-C num] [-I num] [-pavh]\n" );
- fprintf( pErr, "\t solves the combinational miter using SAT solver MiniSat-1.14\n" );
- fprintf( pErr, "\t derives CNF from the current network and leave it unchanged\n" );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( pErr, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
- fprintf( pErr, "\t-p : alighn polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
- fprintf( pErr, "\t-a : toggle ANDing/ORing of miter outputs [default = %s]\n", fAndOuts? "ANDing": "ORing" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: dsat [-C num] [-I num] [-pavh]\n" );
+ Abc_Print( -2, "\t solves the combinational miter using SAT solver MiniSat-1.14\n" );
+ Abc_Print( -2, "\t derives CNF from the current network and leave it unchanged\n" );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
+ Abc_Print( -2, "\t-p : alighn polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggle ANDing/ORing of miter outputs [default = %s]\n", fAndOuts? "ANDing": "ORing" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -17533,8 +17334,7 @@ usage:
***********************************************************************/
int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int RetValue;
int c, clk;
int nAlgo;
@@ -17546,11 +17346,6 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVerbose;
extern int Abc_NtkPartitionedSat( Abc_Ntk_t * pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nAlgo = 0;
nPartSize = 10000;
@@ -17567,7 +17362,7 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'A':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-A\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
goto usage;
}
nAlgo = atoi(argv[globalUtilOptind]);
@@ -17578,7 +17373,7 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPartSize = atoi(argv[globalUtilOptind]);
@@ -17589,7 +17384,7 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfTotal = atoi(argv[globalUtilOptind]);
@@ -17615,17 +17410,17 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) > 0 )
{
- fprintf( stdout, "Currently can only solve the miter for combinational circuits.\n" );
+ Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
@@ -17638,49 +17433,49 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
//Abc_Obj_t * pObj;
int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
if ( pSimInfo[0] != 1 )
- printf( "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
+ Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
ABC_FREE( pSimInfo );
/*
// print model
Abc_NtkForEachPi( pNtk, pObj, i )
{
- printf( "%d", (int)(pNtk->pModel[i] > 0) );
+ Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
if ( i == 70 )
break;
}
- printf( "\n" );
+ Abc_Print( -1, "\n" );
*/
}
if ( RetValue == -1 )
- printf( "UNDECIDED " );
+ Abc_Print( 1, "UNDECIDED " );
else if ( RetValue == 0 )
- printf( "SATISFIABLE " );
+ Abc_Print( 1, "SATISFIABLE " );
else
- printf( "UNSATISFIABLE " );
- //printf( "\n" );
- ABC_PRT( "Time", clock() - clk );
+ Abc_Print( 1, "UNSATISFIABLE " );
+ //Abc_Print( -1, "\n" );
+ Abc_PrintTime( 1, "Time", clock() - clk );
return 0;
usage:
- fprintf( pErr, "usage: psat [-APC num] [-psvh]\n" );
- fprintf( pErr, "\t solves the combinational miter using partitioning\n" );
- fprintf( pErr, "\t (derives CNF from the current network and leave it unchanged)\n" );
- fprintf( pErr, "\t for multi-output miters, tries to prove that the AND of POs is always 0\n" );
- fprintf( pErr, "\t (if POs should be ORed instead of ANDed, use command \"orpos\")\n" );
- fprintf( pErr, "\t-A num : partitioning algorithm [default = %d]\n", nAlgo );
- fprintf( pErr, "\t 0 : no partitioning\n" );
- fprintf( pErr, "\t 1 : partitioning by level\n" );
- fprintf( pErr, "\t 2 : DFS post-order\n" );
- fprintf( pErr, "\t 3 : DFS pre-order\n" );
- fprintf( pErr, "\t 4 : bit-slicing\n" );
- fprintf( pErr, "\t partitions are ordered by level (high level first)\n" );
- fprintf( pErr, "\t-P num : limit on the partition size [default = %d]\n", nPartSize );
- fprintf( pErr, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfTotal );
- fprintf( pErr, "\t-p : align polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
- fprintf( pErr, "\t-s : apply logic synthesis to each partition [default = %s]\n", fSynthesize? "yes": "no" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: psat [-APC num] [-psvh]\n" );
+ Abc_Print( -2, "\t solves the combinational miter using partitioning\n" );
+ Abc_Print( -2, "\t (derives CNF from the current network and leave it unchanged)\n" );
+ Abc_Print( -2, "\t for multi-output miters, tries to prove that the AND of POs is always 0\n" );
+ Abc_Print( -2, "\t (if POs should be ORed instead of ANDed, use command \"orpos\")\n" );
+ Abc_Print( -2, "\t-A num : partitioning algorithm [default = %d]\n", nAlgo );
+ Abc_Print( -2, "\t 0 : no partitioning\n" );
+ Abc_Print( -2, "\t 1 : partitioning by level\n" );
+ Abc_Print( -2, "\t 2 : DFS post-order\n" );
+ Abc_Print( -2, "\t 3 : DFS pre-order\n" );
+ Abc_Print( -2, "\t 4 : bit-slicing\n" );
+ Abc_Print( -2, "\t partitions are ordered by level (high level first)\n" );
+ Abc_Print( -2, "\t-P num : limit on the partition size [default = %d]\n", nPartSize );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfTotal );
+ Abc_Print( -2, "\t-p : align polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
+ Abc_Print( -2, "\t-s : apply logic synthesis to each partition [default = %s]\n", fSynthesize? "yes": "no" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -17697,15 +17492,11 @@ usage:
***********************************************************************/
int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkTemp;
Prove_Params_t Params, * pParams = &Params;
int c, clk, RetValue;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Prove_ParamsSetDefault( pParams );
Extra_UtilGetoptReset();
@@ -17716,7 +17507,7 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pParams->nItersMax = atoi(argv[globalUtilOptind]);
@@ -17727,7 +17518,7 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pParams->nMiteringLimitStart = atoi(argv[globalUtilOptind]);
@@ -17738,7 +17529,7 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pParams->nFraigingLimitStart = atoi(argv[globalUtilOptind]);
@@ -17749,7 +17540,7 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
@@ -17760,7 +17551,7 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
pParams->nTotalInspectLimit = atoi(argv[globalUtilOptind]);
@@ -17789,17 +17580,17 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkLatchNum(pNtk) > 0 )
{
- fprintf( stdout, "Currently can only solve the miter for combinational circuits.\n" );
+ Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
return 0;
}
if ( Abc_NtkCoNum(pNtk) != 1 )
{
- fprintf( stdout, "Currently can only solve the miter with one output.\n" );
+ Abc_Print( -1, "Currently can only solve the miter with one output.\n" );
return 0;
}
clk = clock();
@@ -17816,38 +17607,38 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
{
int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtkTemp->pModel );
if ( pSimInfo[0] != 1 )
- printf( "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
+ Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
ABC_FREE( pSimInfo );
}
-
+ pAbc->Status = RetValue;
if ( RetValue == -1 )
- printf( "UNDECIDED " );
+ Abc_Print( 1, "UNDECIDED " );
else if ( RetValue == 0 )
- printf( "SATISFIABLE " );
+ Abc_Print( 1, "SATISFIABLE " );
else
- printf( "UNSATISFIABLE " );
- //printf( "\n" );
+ Abc_Print( 1, "UNSATISFIABLE " );
+ //Abc_Print( -1, "\n" );
- ABC_PRT( "Time", clock() - clk );
+ Abc_PrintTime( 1, "Time", clock() - clk );
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
return 0;
usage:
- fprintf( pErr, "usage: prove [-N num] [-C num] [-F num] [-L num] [-I num] [-rfbvh]\n" );
- fprintf( pErr, "\t solves combinational miter by rewriting, FRAIGing, and SAT\n" );
- fprintf( pErr, "\t replaces the current network by the cone modified by rewriting\n" );
- fprintf( pErr, "\t (there are also newer CEC commands, \"iprove\" and \"dprove\")\n" );
- fprintf( pErr, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
- fprintf( pErr, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
- fprintf( pErr, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
- fprintf( pErr, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
- fprintf( pErr, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
- fprintf( pErr, "\t-r : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
- fprintf( pErr, "\t-f : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
- fprintf( pErr, "\t-b : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: prove [-N num] [-C num] [-F num] [-L num] [-I num] [-rfbvh]\n" );
+ Abc_Print( -2, "\t solves combinational miter by rewriting, FRAIGing, and SAT\n" );
+ Abc_Print( -2, "\t replaces the current network by the cone modified by rewriting\n" );
+ Abc_Print( -2, "\t (there are also newer CEC commands, \"iprove\" and \"dprove\")\n" );
+ Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
+ Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
+ Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
+ Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
+ Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
+ Abc_Print( -2, "\t-r : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -17864,16 +17655,10 @@ usage:
***********************************************************************/
int Abc_CommandDebug( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
extern void Abc_NtkAutoDebug( Abc_Ntk_t * pNtk, int (*pFuncError) (Abc_Ntk_t *) );
extern int Abc_NtkRetimeDebug( Abc_Ntk_t * pNtk );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -17889,12 +17674,12 @@ int Abc_CommandDebug( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsLogic(pNtk) )
{
- fprintf( pErr, "This command is applicable to logic networks.\n" );
+ Abc_Print( -1, "This command is applicable to logic networks.\n" );
return 1;
}
@@ -17902,9 +17687,9 @@ int Abc_CommandDebug( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pErr, "usage: debug [-h]\n" );
- fprintf( pErr, "\t performs automated debugging of the given procedure\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: debug [-h]\n" );
+ Abc_Print( -2, "\t performs automated debugging of the given procedure\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -17921,8 +17706,7 @@ usage:
***********************************************************************/
int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nFrames;
int nSizeMax;
@@ -17933,13 +17717,10 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
int fNewAlgo;
int nCofFanLit;
int fVerbose;
+ int iFrames;
+ char * pLogFileName = NULL;
- extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int nCofFanLit, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
+ extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int nCofFanLit, int fVerbose, int * piFrames );
// set defaults
nFrames = 20;
nSizeMax = 100000;
@@ -17958,7 +17739,7 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -17969,7 +17750,7 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nSizeMax = atoi(argv[globalUtilOptind]);
@@ -17980,7 +17761,7 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nBTLimit = atoi(argv[globalUtilOptind]);
@@ -17991,7 +17772,7 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'G':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-G\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
goto usage;
}
nBTLimitAll = atoi(argv[globalUtilOptind]);
@@ -18002,7 +17783,7 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
nNodeDelta = atoi(argv[globalUtilOptind]);
@@ -18010,10 +17791,11 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( nNodeDelta < 0 )
goto usage;
break;
+/*
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nCofFanLit = atoi(argv[globalUtilOptind]);
@@ -18021,6 +17803,16 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( nCofFanLit < 0 )
goto usage;
break;
+*/
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
case 'r':
fRewrite ^= 1;
break;
@@ -18038,37 +17830,38 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- fprintf( stdout, "Does not work for combinational networks.\n" );
+ Abc_Print( -1, "Does not work for combinational networks.\n" );
return 0;
}
- Abc_NtkDarBmc( pNtk, 0, nFrames, nSizeMax, nNodeDelta, 0, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, nCofFanLit, fVerbose );
- pAbc->pCex = pNtk->pSeqModel; // temporary ???
+ pAbc->Status = Abc_NtkDarBmc( pNtk, 0, nFrames, nSizeMax, nNodeDelta, 0, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, nCofFanLit, fVerbose, &iFrames );
+ pAbc->nFrames = iFrames;
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, "bmc" );
return 0;
usage:
-// fprintf( pErr, "usage: bmc [-FNCGD num] [-ravh]\n" );
- fprintf( pErr, "usage: bmc [-FNCL num] [-rcvh]\n" );
- fprintf( pErr, "\t performs bounded model checking with static unrolling\n" );
- fprintf( pErr, "\t-F num : the number of time frames [default = %d]\n", nFrames );
- fprintf( pErr, "\t-N num : the max number of nodes in the frames [default = %d]\n", nSizeMax );
- fprintf( pErr, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
-// fprintf( pErr, "\t-G num : the max number of conflicts globally [default = %d]\n", nBTLimitAll );
-// fprintf( pErr, "\t-D num : the delta in the number of nodes [default = %d]\n", nNodeDelta );
- fprintf( pErr, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
- fprintf( pErr, "\t-r : toggle the use of rewriting [default = %s]\n", fRewrite? "yes": "no" );
-// fprintf( pErr, "\t-a : toggle SAT sweeping and SAT solving [default = %s]\n", fNewAlgo? "SAT solving": "SAT sweeping" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: bmc [-FNC num] [-L file] [-rcvh]\n" );
+ Abc_Print( -2, "\t performs bounded model checking with static unrolling\n" );
+ Abc_Print( -2, "\t-F num : the number of time frames [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-N num : the max number of nodes in the frames [default = %d]\n", nSizeMax );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
+// Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+ Abc_Print( -2, "\t-r : toggle the use of rewriting [default = %s]\n", fRewrite? "yes": "no" );
+// Abc_Print( -2, "\t-a : toggle SAT sweeping and SAT solving [default = %s]\n", fNewAlgo? "SAT solving": "SAT sweeping" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -18085,8 +17878,7 @@ usage:
***********************************************************************/
int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int nStart;
int nFrames;
@@ -18098,12 +17890,10 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
int fRewrite;
int fNewAlgo;
int fVerbose;
+ int iFrames;
+ char * pLogFileName = NULL;
- extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int nCofFanLit, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+ extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int nCofFanLit, int fVerbose, int * piFrames );
// set defaults
nStart = 0;
@@ -18117,14 +17907,14 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
fNewAlgo = 0;
fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "SFNTCGDrvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "SFNTCGDLrvh" ) ) != EOF )
{
switch ( c )
{
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
nStart = atoi(argv[globalUtilOptind]);
@@ -18135,7 +17925,7 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -18146,7 +17936,7 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nSizeMax = atoi(argv[globalUtilOptind]);
@@ -18157,7 +17947,7 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
nTimeOut = atoi(argv[globalUtilOptind]);
@@ -18168,7 +17958,7 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nBTLimit = atoi(argv[globalUtilOptind]);
@@ -18179,7 +17969,7 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'G':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-G\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
goto usage;
}
nBTLimitAll = atoi(argv[globalUtilOptind]);
@@ -18190,7 +17980,7 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
nNodeDelta = atoi(argv[globalUtilOptind]);
@@ -18198,6 +17988,15 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( nNodeDelta < 0 )
goto usage;
break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
case 'r':
fRewrite ^= 1;
break;
@@ -18215,41 +18014,193 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- fprintf( stdout, "Does not work for combinational networks.\n" );
+ Abc_Print( -1, "Does not work for combinational networks.\n" );
return 0;
}
- Abc_NtkDarBmc( pNtk, nStart, nFrames, nSizeMax, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, 0, fVerbose );
- pAbc->pCex = pNtk->pSeqModel; // temporary ???
+ pAbc->Status = Abc_NtkDarBmc( pNtk, nStart, nFrames, nSizeMax, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, 0, fVerbose, &iFrames );
+ pAbc->nFrames = iFrames;
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, "bmc2" );
return 0;
usage:
-// fprintf( pErr, "usage: bmc2 [-FNCGD num] [-ravh]\n" );
- fprintf( pErr, "usage: bmc2 [-SFTCGD num] [-vh]\n" );
- fprintf( pErr, "\t performs bounded model checking with dynamic unrolling\n" );
- fprintf( pErr, "\t-S num : the starting time frame [default = %d]\n", nStart );
- fprintf( pErr, "\t-F num : the max number of time frames [default = %d]\n", nFrames );
-// fprintf( pErr, "\t-N num : the max number of nodes in the frames [default = %d]\n", nSizeMax );
- fprintf( pErr, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nTimeOut );
- fprintf( pErr, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
- fprintf( pErr, "\t-G num : the max number of conflicts globally [default = %d]\n", nBTLimitAll );
- fprintf( pErr, "\t-D num : the delta in the number of nodes [default = %d]\n", nNodeDelta );
-// fprintf( pErr, "\t-r : toggle the use of rewriting [default = %s]\n", fRewrite? "yes": "no" );
-// fprintf( pErr, "\t-a : toggle SAT sweeping and SAT solving [default = %s]\n", fNewAlgo? "SAT solving": "SAT sweeping" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+// Abc_Print( -2, "usage: bmc2 [-FNCGD num] [-ravh]\n" );
+ Abc_Print( -2, "usage: bmc2 [-SFTCGD num] [-L file] [-vh]\n" );
+ Abc_Print( -2, "\t performs bounded model checking with dynamic unrolling\n" );
+ Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", nStart );
+ Abc_Print( -2, "\t-F num : the max number of time frames [default = %d]\n", nFrames );
+// Abc_Print( -2, "\t-N num : the max number of nodes in the frames [default = %d]\n", nSizeMax );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nTimeOut );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
+ Abc_Print( -2, "\t-G num : the max number of conflicts globally [default = %d]\n", nBTLimitAll );
+ Abc_Print( -2, "\t-D num : the delta in the number of nodes [default = %d]\n", nNodeDelta );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+// Abc_Print( -2, "\t-r : toggle the use of rewriting [default = %s]\n", fRewrite? "yes": "no" );
+// Abc_Print( -2, "\t-a : toggle SAT sweeping and SAT solving [default = %s]\n", fNewAlgo? "SAT solving": "SAT sweeping" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandBmc3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern Abc_Ntk_t * Abc_NtkDarLatchSweep( Abc_Ntk_t * pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fVerbose );
+ extern int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars );
+ Saig_ParBmc_t Pars, * pPars = &Pars;
+ Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
+ char * pLogFileName = NULL;
+ int c;
+ Saig_ParBmcSetDefaultParams( pPars );
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "SFTCLsdrvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nStart = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nStart < 0 )
+ goto usage;
+ break;
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nFramesMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nFramesMax < 0 )
+ goto usage;
+ break;
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nTimeOut = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nTimeOut < 0 )
+ goto usage;
+ break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nConfLimit = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nConfLimit < 0 )
+ goto usage;
+ break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
+ case 's':
+ pPars->fSolveAll ^= 1;
+ break;
+ case 'd':
+ pPars->fDropSatOuts ^= 1;
+ break;
+ case 'v':
+ pPars->fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pNtk == NULL )
+ {
+ Abc_Print( -1, "Empty network.\n" );
+ return 1;
+ }
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+ return 0;
+ }
+ if ( Abc_NtkLatchNum(pNtk) == 0 )
+ {
+ Abc_Print( -1, "Does not work for combinational networks.\n" );
+ return 0;
+ }
+ pAbc->Status = Abc_NtkDarBmc3( pNtk, pPars );
+ pAbc->nFrames = pPars->iFrame;
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, "bmc3" );
+ if ( pPars->fSolveAll && pPars->fDropSatOuts )
+ {
+ if ( pNtk->pSeqModelVec == NULL )
+ printf( "The array of counter-examples is not available.\n" );
+ else if ( Vec_PtrSize(pNtk->pSeqModelVec) != Abc_NtkPoNum(pNtk) )
+ printf( "The array size does not match the number of outputs.\n" );
+ else
+ {
+ extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
+ Abc_NtkDropSatOutputs( pNtk, pNtk->pSeqModelVec, pPars->fVerbose );
+ pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0 );
+ if ( pNtkRes == NULL )
+ {
+ Abc_Print( -1, "Removing SAT outputs has failed.\n" );
+ return 1;
+ }
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ }
+ }
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: bmc3 [-SFTC num] [-L file] [-sdvh]\n" );
+ Abc_Print( -2, "\t performs bounded model checking with dynamic unrolling\n" );
+ Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", pPars->nStart );
+ Abc_Print( -2, "\t-F num : the max number of time frames [default = %d]\n", pPars->nFramesMax );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->nTimeOut );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nConfLimit );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+ Abc_Print( -2, "\t-s : solve all outputs (do not stop when one is SAT) [default = %s]\n", pPars->fSolveAll? "yes": "no" );
+ Abc_Print( -2, "\t-d : drops (replaces by 0) satisfiable outputs [default = %s]\n", pPars->fDropSatOuts? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
-
/**Function*************************************************************
@@ -18265,27 +18216,22 @@ usage:
int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Inter_ManParams_t Pars, * pPars = &Pars;
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
int c;
+ char * pLogFileName = NULL;
- extern int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
+ extern int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars, Abc_Ntk_t ** ppNtkRes );
// set defaults
Inter_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "CNFrtpomcgbkvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "CFTNLrtpomcgbkdvh" ) ) != EOF )
{
switch ( c )
{
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -18293,10 +18239,10 @@ int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nBTLimit < 0 )
goto usage;
break;
- case 'N':
+ case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesMax = atoi(argv[globalUtilOptind]);
@@ -18304,10 +18250,21 @@ int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nFramesMax < 0 )
goto usage;
break;
- case 'F':
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nSecLimit = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nSecLimit < 0 )
+ goto usage;
+ break;
+ case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesK = atoi(argv[globalUtilOptind]);
@@ -18315,6 +18272,15 @@ int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nFramesK < 0 )
goto usage;
break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
case 'r':
pPars->fRewrite ^= 1;
break;
@@ -18342,6 +18308,9 @@ int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'k':
pPars->fUseSeparate ^= 1;
break;
+ case 'd':
+ pPars->fDropSatOuts ^= 1;
+ break;
case 'v':
pPars->fVerbose ^= 1;
break;
@@ -18353,64 +18322,84 @@ int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
- }
+ }
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
- fprintf( stdout, "Does not work for combinational networks.\n" );
+ Abc_Print( -1, "Does not work for combinational networks.\n" );
return 0;
}
- if ( Abc_NtkPoNum(pNtk) != 1 )
+ if ( Abc_NtkPoNum(pNtk)-Abc_NtkConstrNum(pNtk) != 1 )
{
+ if ( Abc_NtkConstrNum(pNtk) > 0 )
+ {
+ printf( "Cannot solve multiple-output miter with constraints.\n" );
+ return 0;
+ }
if ( pPars->fUseSeparate )
{
- printf( "Each of %d outputs will be solved separately.\n", Abc_NtkPoNum(pNtk) );
- Abc_NtkDarBmcInter( pNtk, pPars );
+ Abc_Print( 0, "Each of %d outputs will be solved separately.\n", Abc_NtkPoNum(pNtk) );
+ pAbc->Status = Abc_NtkDarBmcInter( pNtk, pPars, &pNtkRes );
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+ if ( pNtkRes == NULL )
+ {
+ Abc_Print( -1, "Generating resulting network has failed.\n" );
+ return 0;
+ }
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
}
else
{
Abc_Ntk_t * pNtkNew = Abc_NtkDup( pNtk );
- printf( "All %d outputs will be ORed together.\n", Abc_NtkPoNum(pNtk) );
+ Abc_Print( 0, "All %d outputs will be ORed together.\n", Abc_NtkPoNum(pNtk) );
if ( !Abc_NtkCombinePos( pNtkNew, 0 ) )
{
Abc_NtkDelete( pNtkNew );
- printf( "ORing outputs has failed.\n" );
+ Abc_Print( -1, "ORing outputs has failed.\n" );
return 0;
}
- Abc_NtkDarBmcInter( pNtkNew, pPars );
+ pAbc->Status = Abc_NtkDarBmcInter( pNtkNew, pPars, NULL );
+ Abc_FrameReplaceCex( pAbc, &pNtkNew->pSeqModel );
Abc_NtkDelete( pNtkNew );
}
+ pAbc->nFrames = -1;
}
else
{
- Abc_NtkDarBmcInter( pNtk, pPars );
+ pAbc->Status = Abc_NtkDarBmcInter( pNtk, pPars, NULL );
+ pAbc->nFrames = pPars->iFrameMax;
+ Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
}
- pAbc->pCex = pNtk->pSeqModel; // temporary ???
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, "int" );
return 0;
usage:
- fprintf( pErr, "usage: int [-CNF num] [-rtpomcgbvh]\n" );
- fprintf( pErr, "\t uses interpolation to prove the property\n" );
- fprintf( pErr, "\t-C num : the limit on conflicts for one SAT run [default = %d]\n", pPars->nBTLimit );
- fprintf( pErr, "\t-N num : the limit on number of frames to unroll [default = %d]\n", pPars->nFramesMax );
- fprintf( pErr, "\t-F num : the number of steps in inductive checking [default = %d]\n", pPars->nFramesK );
- fprintf( pErr, "\t-r : toggle rewriting of the unrolled timeframes [default = %s]\n", pPars->fRewrite? "yes": "no" );
- fprintf( pErr, "\t-t : toggle adding transition into the initial state [default = %s]\n", pPars->fTransLoop? "yes": "no" );
- fprintf( pErr, "\t-p : toggle using original Pudlak's interpolation procedure [default = %s]\n", pPars->fUsePudlak? "yes": "no" );
- fprintf( pErr, "\t-o : toggle using optimized Pudlak's interpolation procedure [default = %s]\n", pPars->fUseOther? "yes": "no" );
- fprintf( pErr, "\t-m : toggle using MiniSat-1.14p (now, Windows-only) [default = %s]\n", pPars->fUseMiniSat? "yes": "no" );
- fprintf( pErr, "\t-c : toggle using inductive containment check [default = %s]\n", pPars->fCheckKstep? "yes": "no" );
- fprintf( pErr, "\t-g : toggle using bias for global variables using SAT [default = %s]\n", pPars->fUseBias? "yes": "no" );
- fprintf( pErr, "\t-b : toggle using backward interpolation [default = %s]\n", pPars->fUseBackward? "yes": "no" );
- fprintf( pErr, "\t-k : toggle solving each output separately [default = %s]\n", pPars->fUseSeparate? "yes": "no" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: int [-CFTN num] [-L file] [-rtpomcgbkdvh]\n" );
+ Abc_Print( -2, "\t uses interpolation to prove the property\n" );
+ Abc_Print( -2, "\t-C num : the limit on conflicts for one SAT run [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-F num : the limit on number of frames to unroll [default = %d]\n", pPars->nFramesMax );
+ Abc_Print( -2, "\t-T num : the limit on runtime per output in seconds [default = %d]\n", pPars->nSecLimit );
+ Abc_Print( -2, "\t-N num : the number of steps in inductive checking [default = %d]\n", pPars->nFramesK );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+ Abc_Print( -2, "\t-r : toggle rewriting of the unrolled timeframes [default = %s]\n", pPars->fRewrite? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle adding transition into the initial state [default = %s]\n", pPars->fTransLoop? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle using original Pudlak's interpolation procedure [default = %s]\n", pPars->fUsePudlak? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggle using optimized Pudlak's interpolation procedure [default = %s]\n", pPars->fUseOther? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggle using MiniSat-1.14p (now, Windows-only) [default = %s]\n", pPars->fUseMiniSat? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle using inductive containment check [default = %s]\n", pPars->fCheckKstep? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggle using bias for global variables using SAT [default = %s]\n", pPars->fUseBias? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggle using backward interpolation [default = %s]\n", pPars->fUseBackward? "yes": "no" );
+ Abc_Print( -2, "\t-k : toggle solving each output separately [default = %s]\n", pPars->fUseSeparate? "yes": "no" );
+ Abc_Print( -2, "\t-d : drops (replaces by 0) sat outputs (with -k is used) [default = %s]\n", pPars->fDropSatOuts? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -18427,8 +18416,7 @@ usage:
***********************************************************************/
int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int nFrames;
int nPref;
int nClauses;
@@ -18444,11 +18432,6 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVeryVerbose;
int c;
extern int Abc_NtkDarClau( Abc_Ntk_t * pNtk, int nFrames, int nPref, int nClauses, int nLutSize, int nLevels, int nCutsMax, int nBatches, int fStepUp, int fBmc, int fRegs, int fTarget, int fVerbose, int fVeryVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nFrames = 1;
nPref = 0;
@@ -18471,7 +18454,7 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -18482,7 +18465,7 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPref = atoi(argv[globalUtilOptind]);
@@ -18493,7 +18476,7 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nClauses = atoi(argv[globalUtilOptind]);
@@ -18504,7 +18487,7 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-K\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
goto usage;
}
nLutSize = atoi(argv[globalUtilOptind]);
@@ -18515,7 +18498,7 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nLevels = atoi(argv[globalUtilOptind]);
@@ -18526,7 +18509,7 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nCutsMax = atoi(argv[globalUtilOptind]);
@@ -18537,7 +18520,7 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'B':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-B\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
goto usage;
}
nBatches = atoi(argv[globalUtilOptind]);
@@ -18571,43 +18554,43 @@ int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
if ( nLutSize > 12 )
{
- fprintf( stdout, "The cut size should be not exceed 12.\n" );
+ Abc_Print( -1, "The cut size should be not exceed 12.\n" );
return 0;
}
Abc_NtkDarClau( pNtk, nFrames, nPref, nClauses, nLutSize, nLevels, nCutsMax, nBatches, fStepUp, fBmc, fRegs, fTarget, fVerbose, fVeryVerbose );
return 0;
usage:
- fprintf( pErr, "usage: indcut [-FPCMLNB num] [-sbrtvh]\n" );
- fprintf( pErr, "\t K-step induction strengthened with cut properties\n" );
- fprintf( pErr, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", nFrames );
- fprintf( pErr, "\t-P num : number of time frames in the prefix (0=no prefix) [default = %d]\n", nPref );
- fprintf( pErr, "\t-C num : the max number of clauses to use for strengthening [default = %d]\n", nClauses );
- fprintf( pErr, "\t-M num : the cut size (2 <= M <= 12) [default = %d]\n", nLutSize );
- fprintf( pErr, "\t-L num : the max number of levels for cut computation [default = %d]\n", nLevels );
- fprintf( pErr, "\t-N num : the max number of cuts to compute at a node [default = %d]\n", nCutsMax );
- fprintf( pErr, "\t-B num : the max number of invariant batches to try [default = %d]\n", nBatches );
- fprintf( pErr, "\t-s : toggle increment cut size in each batch [default = %s]\n", fStepUp? "yes": "no" );
- fprintf( pErr, "\t-b : toggle enabling BMC check [default = %s]\n", fBmc? "yes": "no" );
- fprintf( pErr, "\t-r : toggle enabling register clauses [default = %s]\n", fRegs? "yes": "no" );
- fprintf( pErr, "\t-t : toggle proving target / computing don't-cares [default = %s]\n", fTarget? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-// fprintf( pErr, "\t-w : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: indcut [-FPCMLNB num] [-sbrtvh]\n" );
+ Abc_Print( -2, "\t K-step induction strengthened with cut properties\n" );
+ Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-P num : number of time frames in the prefix (0=no prefix) [default = %d]\n", nPref );
+ Abc_Print( -2, "\t-C num : the max number of clauses to use for strengthening [default = %d]\n", nClauses );
+ Abc_Print( -2, "\t-M num : the cut size (2 <= M <= 12) [default = %d]\n", nLutSize );
+ Abc_Print( -2, "\t-L num : the max number of levels for cut computation [default = %d]\n", nLevels );
+ Abc_Print( -2, "\t-N num : the max number of cuts to compute at a node [default = %d]\n", nCutsMax );
+ Abc_Print( -2, "\t-B num : the max number of invariant batches to try [default = %d]\n", nBatches );
+ Abc_Print( -2, "\t-s : toggle increment cut size in each batch [default = %s]\n", fStepUp? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggle enabling BMC check [default = %s]\n", fBmc? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle enabling register clauses [default = %s]\n", fRegs? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle proving target / computing don't-cares [default = %s]\n", fTarget? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+// Abc_Print( -2, "\t-w : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -18624,7 +18607,6 @@ usage:
***********************************************************************/
int Abc_CommandEnlarge( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int nFrames;
int fVerbose;
@@ -18632,9 +18614,6 @@ int Abc_CommandEnlarge( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
nFrames = 5;
fVerbose = 0;
@@ -18646,7 +18625,7 @@ int Abc_CommandEnlarge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -18665,17 +18644,17 @@ int Abc_CommandEnlarge( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
@@ -18683,18 +18662,18 @@ int Abc_CommandEnlarge( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarEnlarge( pNtk, nFrames, fVerbose );
if ( pNtkRes == NULL )
{
- fprintf( pErr, "Target enlargement has failed.\n" );
+ Abc_Print( -1, "Target enlargement has failed.\n" );
return 1;
}
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
return 0;
usage:
- fprintf( pErr, "usage: enlarge [-F num] [-vh]\n" );
- fprintf( pErr, "\t performs structural K-step target enlargement\n" );
- fprintf( pErr, "\t-F num : the number of timeframes for enlargement [default = %d]\n", nFrames );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: enlarge [-F num] [-vh]\n" );
+ Abc_Print( -2, "\t performs structural K-step target enlargement\n" );
+ Abc_Print( -2, "\t-F num : the number of timeframes for enlargement [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -18711,31 +18690,31 @@ usage:
***********************************************************************/
int Abc_CommandInduction( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int nFramesMax;
int nConfMax;
+ int fUnique;
+ int fUniqueAll;
int fVerbose;
+ int fVeryVerbose;
int c;
- extern void Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
+ extern int Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fUnique, int fUniqueAll, int fVerbose, int fVeryVerbose );
// set defaults
- nFramesMax = 100;
- nConfMax = 1000;
- fVerbose = 0;
+ nFramesMax = 100;
+ nConfMax = 1000;
+ fUnique = 0;
+ fUniqueAll = 0;
+ fVerbose = 0;
+ fVeryVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "FCvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "FCuavwh" ) ) != EOF )
{
switch ( c )
{
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFramesMax = atoi(argv[globalUtilOptind]);
@@ -18746,7 +18725,7 @@ int Abc_CommandInduction( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfMax = atoi(argv[globalUtilOptind]);
@@ -18754,9 +18733,18 @@ int Abc_CommandInduction( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( nConfMax < 0 )
goto usage;
break;
+ case 'u':
+ fUnique ^= 1;
+ break;
+ case 'a':
+ fUniqueAll ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
+ case 'w':
+ fVeryVerbose ^= 1;
+ break;
case 'h':
goto usage;
default:
@@ -18765,35 +18753,43 @@ int Abc_CommandInduction( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
if ( Abc_NtkPoNum(pNtk) != 1 )
{
- fprintf( pErr, "Currently this command works only for single-output miter.\n" );
+ Abc_Print( -1, "Currently this command works only for single-output miter.\n" );
+ return 0;
+ }
+ if ( fUnique && fUniqueAll )
+ {
+ Abc_Print( -1, "Only one of the options, \"-u\" or \"-a\", should be selected.\n" );
return 0;
}
// modify the current network
- Abc_NtkDarInduction( pNtk, nFramesMax, nConfMax, fVerbose );
+ pAbc->Status = Abc_NtkDarInduction( pNtk, nFramesMax, nConfMax, fUnique, fUniqueAll, fVerbose, fVeryVerbose );
return 0;
usage:
- fprintf( pErr, "usage: ind [-FC num] [-vh]\n" );
- fprintf( pErr, "\t runs the inductive case of the K-step induction\n" );
- fprintf( pErr, "\t-F num : the max number of timeframes [default = %d]\n", nFramesMax );
- fprintf( pErr, "\t-C num : the max number of conflicts by SAT solver [default = %d]\n", nConfMax );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: ind [-FC num] [-uavwh]\n" );
+ Abc_Print( -2, "\t runs the inductive case of the K-step induction\n" );
+ Abc_Print( -2, "\t-F num : the max number of timeframes [default = %d]\n", nFramesMax );
+ Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver [default = %d]\n", nConfMax );
+ Abc_Print( -2, "\t-u : toggle adding uniqueness constraints on demand [default = %s]\n", fUnique? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggle adding uniqueness constraints always [default = %s]\n", fUniqueAll? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing additional verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -18808,51 +18804,25 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandPBAbstraction( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandCegar( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Gia_ParAbs_t Pars, * pPars = &Pars;
- FILE * pOut, * pErr;
Abc_Ntk_t * pNtk, * pNtkRes;
int c;
- extern Abc_Ntk_t * Abc_NtkDarPBAbstraction( Abc_Ntk_t * pNtk, Gia_ParAbs_t * pPars );
+ extern Abc_Ntk_t * Abc_NtkDarCegar( Abc_Ntk_t * pNtk, Gia_ParAbs_t * pPars );
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Gia_ManAbsSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "FCGDRdesrpfvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "FCRcrpfvh" ) ) != EOF )
{
switch ( c )
{
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-F\" should be followed by an integer.\n" );
- goto usage;
- }
- pPars->nFramesMax = atoi(argv[globalUtilOptind]);
- globalUtilOptind++;
- if ( pPars->nFramesMax < 0 )
- goto usage;
- break;
- case 'C':
- if ( globalUtilOptind >= argc )
- {
- fprintf( pErr, "Command line switch \"-C\" should be followed by an integer.\n" );
- goto usage;
- }
- pPars->nConfMax = atoi(argv[globalUtilOptind]);
- globalUtilOptind++;
- if ( pPars->nConfMax < 0 )
- goto usage;
- break;
- case 'G':
- if ( globalUtilOptind >= argc )
- {
- fprintf( pErr, "Command line switch \"-G\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesBmc = atoi(argv[globalUtilOptind]);
@@ -18860,10 +18830,10 @@ int Abc_CommandPBAbstraction( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nFramesBmc < 0 )
goto usage;
break;
- case 'D':
+ case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nConfMaxBmc = atoi(argv[globalUtilOptind]);
@@ -18874,7 +18844,7 @@ int Abc_CommandPBAbstraction( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'R':
if ( globalUtilOptind >= argc )
{
- fprintf( pErr, "Command line switch \"-R\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
goto usage;
}
pPars->nRatio = atoi(argv[globalUtilOptind]);
@@ -18882,14 +18852,8 @@ int Abc_CommandPBAbstraction( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nRatio < 0 )
goto usage;
break;
- case 'd':
- pPars->fDynamic ^= 1;
- break;
- case 'e':
- pPars->fExtend ^= 1;
- break;
- case 's':
- pPars->fSkipProof ^= 1;
+ case 'c':
+ pPars->fConstr ^= 1;
break;
case 'r':
pPars->fUseBdds ^= 1;
@@ -18911,56 +18875,357 @@ int Abc_CommandPBAbstraction( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( Abc_NtkIsComb(pNtk) )
{
- fprintf( pErr, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( stdout, "Currently only works for structurally hashed circuits.\n" );
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
if ( !(0 <= pPars->nRatio && pPars->nRatio <= 100) )
{
- fprintf( stdout, "Wrong value of parameter \"-R <num>\".\n" );
+ Abc_Print( -1, "Wrong value of parameter \"-R <num>\".\n" );
return 0;
}
// modify the current network
- pNtkRes = Abc_NtkDarPBAbstraction( pNtk, pPars );
+ pNtkRes = Abc_NtkDarCegar( pNtk, pPars );
if ( pNtkRes == NULL )
{
if ( pNtk->pSeqModel == NULL )
- printf( "Abstraction has failed.\n" );
+ Abc_Print( -1, "Abstraction has failed.\n" );
return 0;
}
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
return 0;
usage:
- fprintf( pErr, "usage: abs [-FCGDR num] [-desrpfvh]\n" );
- fprintf( pErr, "\t proof-based abstraction (PBA) using UNSAT core of BMC\n" );
- fprintf( pErr, "\t followed by counter-example-based abstraction\n" );
- fprintf( pErr, "\t-F num : the max number of timeframes for PBA [default = %d]\n", pPars->nFramesMax );
- fprintf( pErr, "\t-C num : the max number of conflicts by SAT solver for PBA [default = %d]\n", pPars->nConfMax );
- fprintf( pErr, "\t-G num : the max number of timeframes for BMC [default = %d]\n", pPars->nFramesBmc );
- fprintf( pErr, "\t-D num : the max number of conflicts by SAT solver for BMC [default = %d]\n", pPars->nConfMaxBmc );
- fprintf( pErr, "\t-R num : the %% of abstracted flops when refinement stops (0<=num<=100) [default = %d]\n", pPars->nRatio );
- fprintf( pErr, "\t-d : toggle dynamic unrolling of timeframes [default = %s]\n", pPars->fDynamic? "yes": "no" );
- fprintf( pErr, "\t-e : toggle extending abstraction using COI of flops [default = %s]\n", pPars->fExtend? "yes": "no" );
- fprintf( pErr, "\t-s : toggle skipping proof-based abstraction [default = %s]\n", pPars->fSkipProof? "yes": "no" );
- fprintf( pErr, "\t-r : toggle using BDD-based reachability for filtering [default = %s]\n", pPars->fUseBdds? "yes": "no" );
- fprintf( pErr, "\t-p : toggle using \"dprove\" for filtering [default = %s]\n", pPars->fUseDprove? "yes": "no" );
- fprintf( pErr, "\t-f : toggle starting BMC from a later frame [default = %s]\n", pPars->fUseStart? "yes": "no" );
- fprintf( pErr, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: abs [-FCR num] [-crpfvh]\n" );
+ Abc_Print( -2, "\t performs counter-example-based abstraction\n" );
+ Abc_Print( -2, "\t-F num : the max number of timeframes for BMC [default = %d]\n", pPars->nFramesBmc );
+ Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver for BMC [default = %d]\n", pPars->nConfMaxBmc );
+ Abc_Print( -2, "\t-R num : the %% of abstracted flops when refinement stops (0<=num<=100) [default = %d]\n", pPars->nRatio );
+ Abc_Print( -2, "\t-c : toggle dynamic addition of constraints [default = %s]\n", pPars->fConstr? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle using BDD-based reachability for filtering [default = %s]\n", pPars->fUseBdds? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle using \"dprove\" for filtering [default = %s]\n", pPars->fUseDprove? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle starting BMC from a later frame [default = %s]\n", pPars->fUseStart? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Abc_Ntk_t * pNtk;
+ int c;
+ int nFrames;
+ int nConfs;
+ int nProps;
+ int fStruct;
+ int fInvert;
+ int fOldAlgo;
+ int fVerbose;
+ int nConstrs;
+ extern void Abc_NtkDarConstr( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
+
+ pNtk = Abc_FrameReadNtk(pAbc);
+ // set defaults
+ nFrames = 1;
+ nConfs = 1000;
+ nProps = 1000;
+ fStruct = 0;
+ fInvert = 0;
+ fOldAlgo = 0;
+ fVerbose = 0;
+ nConstrs = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "FCPNsiavh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nFrames = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nFrames < 0 )
+ goto usage;
+ break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConfs = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConfs < 0 )
+ goto usage;
+ break;
+ case 'P':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nProps = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nProps < 0 )
+ goto usage;
+ break;
+ case 'N':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConstrs = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConstrs < 0 )
+ goto usage;
+ break;
+ case 's':
+ fStruct ^= 1;
+ break;
+ case 'i':
+ fInvert ^= 1;
+ break;
+ case 'a':
+ fOldAlgo ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pNtk == NULL )
+ {
+ Abc_Print( -1, "Empty network.\n" );
+ return 1;
+ }
+ if ( Abc_NtkIsComb(pNtk) )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+ return 0;
+ }
+ // consider the case of already defined constraints
+ if ( Abc_NtkConstrNum(pNtk) > 0 )
+ {
+ extern void Abc_NtkDarConstrProfile( Abc_Ntk_t * pNtk, int fVerbose );
+ if ( fInvert )
+ {
+ Abc_Obj_t * pObj;
+ int i;
+ Abc_NtkForEachPo( pNtk, pObj, i )
+ {
+ if ( i >= Abc_NtkPoNum(pNtk) - Abc_NtkConstrNum(pNtk) )
+ Abc_ObjXorFaninC( pObj, 0 );
+ }
+ if ( Abc_NtkConstrNum(pNtk) == 1 )
+ Abc_Print( 1, "The outputs of %d constraint is complemented.\n", Abc_NtkConstrNum(pNtk) );
+ else
+ Abc_Print( 1, "The outputs of %d constraints are complemented.\n", Abc_NtkConstrNum(pNtk) );
+ }
+ if ( fVerbose )
+ Abc_NtkDarConstrProfile( pNtk, fVerbose );
+ return 0;
+ }
+ // consider the case of manual constraint definition
+ if ( nConstrs > 0 )
+ {
+ if ( Abc_NtkConstrNum(pNtk) > 0 )
+ {
+ Abc_Print( -1, "The network already has constraints.\n" );
+ return 0;
+ }
+ if ( nConstrs >= Abc_NtkPoNum(pNtk) )
+ {
+ Abc_Print( -1, "The number of constraints specified (%d) should be less than POs (%d).\n", nConstrs, Abc_NtkPoNum(pNtk) );
+ return 0;
+ }
+ Abc_Print( 0, "Considering the last %d POs as constraint outputs.\n", nConstrs );
+ pNtk->nConstrs = nConstrs;
+ return 0;
+ }
+ // detect constraints using functional/structural methods
+ Abc_NtkDarConstr( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
+ return 0;
+usage:
+ Abc_Print( -2, "usage: constr [-FCPN num] [-isavh]\n" );
+ Abc_Print( -2, "\t a toolkit for constraint manipulation\n" );
+ Abc_Print( -2, "\t if constraints are absent, detect them functionally\n" );
+ Abc_Print( -2, "\t if constraints are present, profiles them using random simulation\n" );
+ Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
+ Abc_Print( -2, "\t-P num : the max number of propagations in SAT solving [default = %d]\n", nProps );
+ Abc_Print( -2, "\t-N num : manually set the last <num> POs to be constraints [default = %d]\n", nConstrs );
+ Abc_Print( -2, "\t-i : toggle inverting already defined constraints [default = %s]\n", fInvert? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle using structural detection methods [default = %s]\n", fStruct? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandUnfold( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Abc_Ntk_t * pNtk, * pNtkRes;
+ int nFrames;
+ int nConfs;
+ int nProps;
+ int fStruct;
+ int fOldAlgo;
+ int fVerbose;
+ int c;
+ extern Abc_Ntk_t * Abc_NtkDarUnfold( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
+ pNtk = Abc_FrameReadNtk(pAbc);
+ // set defaults
+ nFrames = 1;
+ nConfs = 1000;
+ nProps = 1000;
+ fStruct = 0;
+ fOldAlgo = 0;
+ fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "FCPsavh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nFrames = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nFrames < 0 )
+ goto usage;
+ break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConfs = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConfs < 0 )
+ goto usage;
+ break;
+ case 'P':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nProps = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nProps < 0 )
+ goto usage;
+ break;
+ case 's':
+ fStruct ^= 1;
+ break;
+ case 'a':
+ fOldAlgo ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pNtk == NULL )
+ {
+ Abc_Print( -1, "Empty network.\n" );
+ return 1;
+ }
+ if ( Abc_NtkIsComb(pNtk) )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+ return 0;
+ }
+ if ( Abc_NtkConstrNum(pNtk) > 0 )
+ {
+ Abc_Print( -1, "Constraints are already extracted.\n" );
+ return 0;
+ }
+ if ( Abc_NtkPoNum(pNtk) > 1 )
+ {
+ Abc_Print( -1, "Constraint extraction works for single-output miters (use \"orpos\").\n" );
+ return 0;
+ }
+ // modify the current network
+ pNtkRes = Abc_NtkDarUnfold( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
+ if ( pNtkRes == NULL )
+ {
+ printf( "Transformation has failed.\n" );
+ return 0;
+ }
+ // replace the current network
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ return 0;
+usage:
+ Abc_Print( -2, "usage: unfold [-FCP num] [-savh]\n" );
+ Abc_Print( -2, "\t unfold hidden constraints as separate outputs\n" );
+ Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
+ Abc_Print( -2, "\t-P num : the max number of constraint propagations [default = %d]\n", nProps );
+ Abc_Print( -2, "\t-s : toggle detecting structural constraints [default = %s]\n", fStruct? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
/**Function*************************************************************
@@ -18973,16 +19238,169 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandTraceStart( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandFold( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk, * pNtkRes;
+ int fCompl;
+ int fVerbose;
int c;
+ extern Abc_Ntk_t * Abc_NtkDarFold( Abc_Ntk_t * pNtk, int fCompl, int fVerbose );
+ pNtk = Abc_FrameReadNtk(pAbc);
+ // set defaults
+ fCompl = 0;
+ fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "cvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'c':
+ fCompl ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pNtk == NULL )
+ {
+ Abc_Print( -1, "Empty network.\n" );
+ return 1;
+ }
+ if ( Abc_NtkIsComb(pNtk) )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+ return 0;
+ }
+ if ( Abc_NtkConstrNum(pNtk) == 0 )
+ {
+ Abc_Print( -1, "The network has no constraints.\n" );
+ return 0;
+ }
+ // modify the current network
+ pNtkRes = Abc_NtkDarFold( pNtk, fCompl, fVerbose );
+ if ( pNtkRes == NULL )
+ {
+ printf( "Transformation has failed.\n" );
+ return 0;
+ }
+ // replace the current network
+ Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+ return 0;
+usage:
+ Abc_Print( -2, "usage: fold [-cvh]\n" );
+ Abc_Print( -2, "\t folds constraints represented as separate outputs\n" );
+ Abc_Print( -2, "\t-c : toggle complementing constraints while folding [default = %s]\n", fCompl? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandBm( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ FILE * pOut, * pErr;
+ Abc_Ntk_t *pNtk, *pNtk1, *pNtk2;
+ int fDelete1, fDelete2;
+ char ** pArgvNew;
+ int c, nArgcNew;
+ int p_equivalence = FALSE;
+ extern void bmGateWay( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int p_equivalence );
pNtk = Abc_FrameReadNtk(pAbc);
pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+ pErr = Abc_FrameReadErr(pAbc);
+
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Ph" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ case 'P':
+ p_equivalence = 1;
+ break;
+ default:
+ fprintf( pErr, "Unkown switch.\n");
+ goto usage;
+ }
+ }
+
+ pArgvNew = argv + globalUtilOptind;
+ nArgcNew = argc - globalUtilOptind;
+ if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew , &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+ return 1;
+
+ if( (unsigned)Abc_NtkPiNum(pNtk1) != (unsigned)Abc_NtkPiNum(pNtk2) || (unsigned)Abc_NtkPoNum(pNtk1) != (unsigned)Abc_NtkPoNum(pNtk2) )
+ {
+ fprintf( pErr, "Mismatch in the number of inputs or outputs\n");
+ if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+ if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+ return 1;
+ }
+
+ bmGateWay( pNtk1, pNtk2, p_equivalence );
+
+ if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+ if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+ return 0;
+
+usage:
+ fprintf( pErr, "usage: bm [-P] <file1> <file2>\n" );
+ fprintf( pErr, "\t performs Boolean matching (P-equivalence & PP-equivalence)\n" );
+ fprintf( pErr, "\t for equivalent circuits, I/O matches are printed in IOmatch.txt\n" );
+ fprintf( pErr, "\t-P : performs P-equivalnce checking\n");
+ fprintf( pErr, "\t default is PP-equivalence checking (when -P is not provided)\n" );
+ fprintf( pErr, "\t-h : print the command usage\n");
+ fprintf( pErr, "\tfile1 : the file with the first network\n");
+ fprintf( pErr, "\tfile2 : the file with the second network\n");
+
+ fprintf( pErr, "\t \n" );
+ fprintf( pErr, "\t This command was contributed by Hadi Katebi from U Michigan.\n" );
+ fprintf( pErr, "\t The paper describing the method: H. Katebi and I. L. Markov.\n" );
+ fprintf( pErr, "\t \"Large-scale Boolean matching\". Proc. DATE 2010. \n" );
+ fprintf( pErr, "\t http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
+ fprintf( pErr, "\t \n" );
+
+ return 1;
+}
+
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+***********************************************************************/
+int Abc_CommandTraceStart( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ int c;
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -18998,28 +19416,28 @@ int Abc_CommandTraceStart( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command is applicable to AIGs.\n" );
+ Abc_Print( -1, "This command is applicable to AIGs.\n" );
return 1;
}
/*
Abc_HManStart();
if ( !Abc_HManPopulate( pNtk ) )
{
- fprintf( pErr, "Failed to start the tracing database.\n" );
+ Abc_Print( -1, "Failed to start the tracing database.\n" );
return 1;
}
*/
return 0;
usage:
- fprintf( pErr, "usage: trace_start [-h]\n" );
- fprintf( pErr, "\t starts verification tracing\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: trace_start [-h]\n" );
+ Abc_Print( -2, "\t starts verification tracing\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19036,14 +19454,8 @@ usage:
***********************************************************************/
int Abc_CommandTraceCheck( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
// set defaults
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
@@ -19059,31 +19471,31 @@ int Abc_CommandTraceCheck( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pNtk == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
if ( !Abc_NtkIsStrash(pNtk) )
{
- fprintf( pErr, "This command is applicable to AIGs.\n" );
+ Abc_Print( -1, "This command is applicable to AIGs.\n" );
return 1;
}
/*
if ( !Abc_HManIsRunning(pNtk) )
{
- fprintf( pErr, "The tracing database is not available.\n" );
+ Abc_Print( -1, "The tracing database is not available.\n" );
return 1;
}
if ( !Abc_HManVerify( 1, pNtk->Id ) )
- fprintf( pErr, "Verification failed.\n" );
+ Abc_Print( -1, "Verification failed.\n" );
Abc_HManStop();
*/
return 0;
usage:
- fprintf( pErr, "usage: trace_check [-h]\n" );
- fprintf( pErr, "\t checks the current network using verification trace\n" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: trace_check [-h]\n" );
+ Abc_Print( -2, "\t checks the current network using verification trace\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19107,18 +19519,12 @@ int Abc_CommandAbc8Read( Abc_Frame_t * pAbc, int argc, char ** argv )
int c;
int fMapped;
int fTest;
- int fAlter;
- extern void * Ioa_ReadBlif( char * pFileName, int fCheck );
- extern void Ioa_WriteBlif( void * p, char * pFileName );
- extern void * Ntl_ManExtractNwk( void * p, Aig_Man_t * pAig, Tim_Man_t * pManTime );
- extern void Ntl_ManPrintStats( void * p );
// set defaults
fMapped = 0;
fTest = 0;
- fAlter = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "mtah" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "mth" ) ) != EOF )
{
switch ( c )
{
@@ -19128,9 +19534,6 @@ int Abc_CommandAbc8Read( Abc_Frame_t * pAbc, int argc, char ** argv )
case 't':
fTest ^= 1;
break;
- case 'a':
- fAlter ^= 1;
- break;
case 'h':
goto usage;
default:
@@ -19142,69 +19545,52 @@ int Abc_CommandAbc8Read( Abc_Frame_t * pAbc, int argc, char ** argv )
pFileName = argv[globalUtilOptind];
if ( (pFile = fopen( pFileName, "r" )) == NULL )
{
- fprintf( stdout, "Cannot open input file \"%s\". ", pFileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", pFileName );
if ( (pFileName = Extra_FileGetSimilarName( pFileName, ".blif", NULL, NULL, NULL, NULL )) )
- fprintf( stdout, "Did you mean \"%s\"?", pFileName );
- fprintf( stdout, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", pFileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
if ( fTest )
{
- extern void Ntl_ManFree( void * p );
- void * pTemp = Ioa_ReadBlif( pFileName, 1 );
+ Ntl_Man_t * pTemp = Ntl_ManReadBlif( pFileName, 1 );
if ( pTemp )
{
- Ntl_ManPrintStats( pTemp );
-// Ioa_WriteBlif( pTemp, "test_boxes.blif" );
- Ntl_ManFree( pTemp );
+// Ntl_ManWriteBlif( pTemp, "test_boxes.blif" );
+ Ntl_ManPrintStats( pTemp );
+ Ntl_ManFree( pTemp );
}
return 0;
}
Abc_FrameClearDesign();
- if ( !fAlter )
- {
- pAbc->pAbc8Ntl = Ioa_ReadBlif( pFileName, 1 );
- if ( pAbc->pAbc8Ntl == NULL )
- {
- printf( "Abc_CommandAbc8Read(): Reading BLIF has failed.\n" );
- return 1;
- }
- }
- else
+ pAbc->pAbc8Ntl = Ntl_ManReadBlif( pFileName, 1 );
+ if ( pAbc->pAbc8Ntl == NULL )
{
- pAbc->pAbc8Ntl = NULL;
-// extern void * Nal_ManRead( char * pFileName );
-// pAbc->pAbc8Ntl = Nal_ManRead( pFileName );
-// Ioa_WriteBlif( pAbc->pAbc8Ntl, "test_boxes.blif" );
- if ( pAbc->pAbc8Ntl == NULL )
- {
- printf( "Abc_CommandAbc8Read(): Reading design has failed.\n" );
- return 1;
- }
+ Abc_Print( -1, "Abc_CommandAbc8Read(): Reading BLIF has failed.\n" );
+ return 1;
}
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Read(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Read(): AIG extraction has failed.\n" );
return 1;
}
if ( fMapped )
{
pAbc->pAbc8Nwk = Ntl_ManExtractNwk( pAbc->pAbc8Ntl, pAbc->pAbc8Aig, NULL );
if ( pAbc->pAbc8Nwk == NULL )
- printf( "Abc_CommandAbc8Read(): Warning! Mapped network is not extracted.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Read(): Warning! Mapped network is not extracted.\n" );
}
return 0;
usage:
- fprintf( stdout, "usage: *r [-mtah]\n" );
- fprintf( stdout, "\t reads the design with whiteboxes\n" );
- fprintf( stdout, "\t-m : toggle extracting mapped network [default = %s]\n", fMapped? "yes": "no" );
- fprintf( stdout, "\t-t : toggle reading in the test mode [default = %s]\n", fTest? "yes": "no" );
- fprintf( stdout, "\t-a : toggle reading another file type [default = %s]\n", fAlter? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *r [-mth]\n" );
+ Abc_Print( -2, "\t reads the design with whiteboxes\n" );
+ Abc_Print( -2, "\t-m : toggle extracting mapped network [default = %s]\n", fMapped? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle reading in the test mode [default = %s]\n", fTest? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19223,11 +19609,8 @@ int Abc_CommandAbc8ReadLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
{
FILE * pFile;
char * pFileName;
- void * pNtkNew;
+ Nwk_Man_t * pNtkNew;
int c;
- extern void * Ntl_ManReadNwk( char * pFileName, Aig_Man_t * pAig, Tim_Man_t * pManTime );
- extern Tim_Man_t * Ntl_ManReadTimeMan( void * p );
- extern void Nwk_ManFree( void * p );
// set defaults
Extra_UtilGetoptReset();
@@ -19246,17 +19629,17 @@ int Abc_CommandAbc8ReadLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
pFileName = argv[globalUtilOptind];
if ( (pFile = fopen( pFileName, "r" )) == NULL )
{
- fprintf( stdout, "Cannot open input file \"%s\". ", pFileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", pFileName );
if ( (pFileName = Extra_FileGetSimilarName( pFileName, ".blif", NULL, NULL, NULL, NULL )) )
- fprintf( stdout, "Did you mean \"%s\"?", pFileName );
- fprintf( stdout, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", pFileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
if ( pAbc->pAbc8Ntl == NULL || pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8ReadLogic(): There is no design or its AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8ReadLogic(): There is no design or its AIG.\n" );
return 1;
}
@@ -19264,7 +19647,7 @@ int Abc_CommandAbc8ReadLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkNew = Ntl_ManReadNwk( pFileName, pAbc->pAbc8Aig, Ntl_ManReadTimeMan(pAbc->pAbc8Ntl) );
if ( pNtkNew == NULL )
{
- printf( "Abc_CommandAbc8ReadLogic(): Procedure has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8ReadLogic(): Procedure has failed.\n" );
return 1;
}
if ( pAbc->pAbc8Nwk != NULL )
@@ -19273,11 +19656,11 @@ int Abc_CommandAbc8ReadLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *rlogic [-h]\n" );
- fprintf( stdout, "\t reads the logic part of the design without whiteboxes\n" );
- fprintf( stdout, "\t and sets the new logic as the current mapped network\n" );
- fprintf( stdout, "\t (the logic part should be comb and with the same PIs/POs)\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *rlogic [-h]\n" );
+ Abc_Print( -2, "\t reads the logic part of the design without whiteboxes\n" );
+ Abc_Print( -2, "\t and sets the new logic as the current mapped network\n" );
+ Abc_Print( -2, "\t (the logic part should be comb and with the same PIs/POs)\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19295,17 +19678,12 @@ usage:
int Abc_CommandAbc8Write( Abc_Frame_t * pAbc, int argc, char ** argv )
{
char * pFileName;
- void * pTemp;
+ Aig_Man_t * pTemp;
+ Ntl_Man_t * pTemp2;
int fAig;
int fBlif;
int fCollapsed;
int c;
- extern void Ioa_WriteBlif( void * p, char * pFileName );
- extern void * Ntl_ManInsertNtk( void * p, void * pNtk );
- extern void * Ntl_ManInsertAig( void * p, Aig_Man_t * pAig );
- extern void * Ntl_ManDup( void * pOld );
- extern void Ntl_ManFree( void * p );
- extern Aig_Man_t * Ntl_ManCollapseSeq( void * p, int nMinDomSize, int fVerbose );
// set defaults
fAig = 0;
@@ -19333,7 +19711,7 @@ int Abc_CommandAbc8Write( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Write(): There is no design to write.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Write(): There is no design to write.\n" );
return 1;
}
// create the design to write
@@ -19342,7 +19720,6 @@ int Abc_CommandAbc8Write( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( fCollapsed )
{
- extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int fCompact );
pTemp = Ntl_ManCollapseSeq( pAbc->pAbc8Ntl, 0, 0 );
if ( fBlif )
Saig_ManDumpBlif( pTemp, pFileName );
@@ -19356,21 +19733,21 @@ int Abc_CommandAbc8Write( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( fBlif )
{
- pTemp = Ntl_ManInsertAig( pAbc->pAbc8Ntl, pAbc->pAbc8Aig );
- if ( pTemp == NULL )
+ pTemp2 = Ntl_ManInsertAig( pAbc->pAbc8Ntl, pAbc->pAbc8Aig );
+ if ( pTemp2 == NULL )
{
- printf( "Abc_CommandAbc8Write(): Inserting AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Write(): Inserting AIG has failed.\n" );
return 1;
}
- Ioa_WriteBlif( pTemp, pFileName );
- Ntl_ManFree( pTemp );
+ Ntl_ManWriteBlif( pTemp2, pFileName );
+ Ntl_ManFree( pTemp2 );
}
else
Ioa_WriteAiger( pAbc->pAbc8Aig, pFileName, 0, 0 );
}
else
{
- printf( "There is no AIG to write.\n" );
+ Abc_Print( -1, "There is no AIG to write.\n" );
return 1;
}
}
@@ -19379,31 +19756,31 @@ int Abc_CommandAbc8Write( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( pAbc->pAbc8Nwk != NULL )
{
- pTemp = Ntl_ManInsertNtk( pAbc->pAbc8Ntl, pAbc->pAbc8Nwk );
- if ( pTemp == NULL )
+ pTemp2 = Ntl_ManInsertNtk( pAbc->pAbc8Ntl, pAbc->pAbc8Nwk );
+ if ( pTemp2 == NULL )
{
- printf( "Abc_CommandAbc8Write(): Inserting mapped network has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Write(): Inserting mapped network has failed.\n" );
return 1;
}
- Ioa_WriteBlif( pTemp, pFileName );
- Ntl_ManFree( pTemp );
+ Ntl_ManWriteBlif( pTemp2, pFileName );
+ Ntl_ManFree( pTemp2 );
}
else
{
- printf( "Writing the unmapped netlist.\n" );
- pTemp = pAbc->pAbc8Ntl;
- Ioa_WriteBlif( pTemp, pFileName );
+ Abc_Print( -1, "Writing the unmapped netlist.\n" );
+ pTemp2 = pAbc->pAbc8Ntl;
+ Ntl_ManWriteBlif( pTemp2, pFileName );
}
}
return 0;
usage:
- fprintf( stdout, "usage: *w [-abch]\n" );
- fprintf( stdout, "\t write the design with whiteboxes\n" );
- fprintf( stdout, "\t-a : toggle writing mapped network or AIG [default = %s]\n", fAig? "AIG": "mapped" );
- fprintf( stdout, "\t-b : toggle writing AIG as BLIF or AIGER [default = %s]\n", fBlif? "BLIF": "AIGER" );
- fprintf( stdout, "\t-c : toggle writing collapsed sequential AIG [default = %s]\n", fCollapsed? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *w [-abch]\n" );
+ Abc_Print( -2, "\t write the design with whiteboxes\n" );
+ Abc_Print( -2, "\t-a : toggle writing design or internal AIG [default = %s]\n", fAig? "AIG": "design" );
+ Abc_Print( -2, "\t-b : toggle writing AIG as BLIF or AIGER [default = %s]\n", fBlif? "BLIF": "AIGER" );
+ Abc_Print( -2, "\t-c : toggle writing collapsed sequential AIG [default = %s]\n", fCollapsed? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19424,9 +19801,6 @@ int Abc_CommandAbc8WriteLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
char * pFileName;
int fAig;
int c;
- extern Vec_Ptr_t * Ntl_ManCollectCiNames( void * p );
- extern Vec_Ptr_t * Ntl_ManCollectCoNames( void * p );
- extern void Nwk_ManDumpBlif( void * p, char * pFileName, Vec_Ptr_t * vCiNames, Vec_Ptr_t * vCoNames );
// set defaults
fAig = 0;
@@ -19446,7 +19820,7 @@ int Abc_CommandAbc8WriteLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Write(): There is no design to write.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Write(): There is no design to write.\n" );
return 1;
}
// create the design to write
@@ -19460,7 +19834,7 @@ int Abc_CommandAbc8WriteLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
Aig_ManDumpBlif( pAbc->pAbc8Aig, pFileName, vCiNames, vCoNames );
else
{
- printf( "There is no AIG to write.\n" );
+ Abc_Print( -1, "There is no AIG to write.\n" );
return 1;
}
}
@@ -19470,7 +19844,7 @@ int Abc_CommandAbc8WriteLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
Nwk_ManDumpBlif( pAbc->pAbc8Nwk, pFileName, vCiNames, vCoNames );
else
{
- printf( "There is no mapped network to write.\n" );
+ Abc_Print( -1, "There is no mapped network to write.\n" );
return 1;
}
}
@@ -19479,10 +19853,10 @@ int Abc_CommandAbc8WriteLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *wlogic [-ah]\n" );
- fprintf( stdout, "\t write the logic part of the design without whiteboxes\n" );
- fprintf( stdout, "\t-a : toggle writing mapped network or AIG [default = %s]\n", fAig? "AIG": "mapped" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *wlogic [-ah]\n" );
+ Abc_Print( -2, "\t write the logic part of the design without whiteboxes\n" );
+ Abc_Print( -2, "\t-a : toggle writing mapped network or AIG [default = %s]\n", fAig? "AIG": "network" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19501,7 +19875,7 @@ int Abc_CommandAbc8ReadLut( Abc_Frame_t * pAbc, int argc, char **argv )
{
FILE * pFile;
char * FileName;
- void * pLib;
+ If_Lib_t * pLib;
int c;
extern If_Lib_t * If_LutLibRead( char * FileName );
extern void If_LutLibFree( If_Lib_t * pLutLib );
@@ -19530,10 +19904,10 @@ int Abc_CommandAbc8ReadLut( Abc_Frame_t * pAbc, int argc, char **argv )
FileName = argv[globalUtilOptind];
if ( (pFile = fopen( FileName, "r" )) == NULL )
{
- fprintf( stdout, "Cannot open input file \"%s\". ", FileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
if ( (FileName = Extra_FileGetSimilarName( FileName, ".lut", NULL, NULL, NULL, NULL )) )
- fprintf( stdout, "Did you mean \"%s\"?", FileName );
- fprintf( stdout, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
@@ -19542,7 +19916,7 @@ int Abc_CommandAbc8ReadLut( Abc_Frame_t * pAbc, int argc, char **argv )
pLib = If_LutLibRead( FileName );
if ( pLib == NULL )
{
- fprintf( stdout, "Reading LUT library has failed.\n" );
+ Abc_Print( -1, "Reading LUT library has failed.\n" );
goto usage;
}
// replace the current library
@@ -19552,21 +19926,21 @@ int Abc_CommandAbc8ReadLut( Abc_Frame_t * pAbc, int argc, char **argv )
return 0;
usage:
- fprintf( stdout, "\nusage: *rlut [-h]\n");
- fprintf( stdout, "\t read the LUT library from the file\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
- fprintf( stdout, "\t \n");
- fprintf( stdout, "\t File format for a LUT library:\n");
- fprintf( stdout, "\t (the default library is shown)\n");
- fprintf( stdout, "\t \n");
- fprintf( stdout, "\t # The area/delay of k-variable LUTs:\n");
- fprintf( stdout, "\t # k area delay\n");
- fprintf( stdout, "\t 1 1 1\n");
- fprintf( stdout, "\t 2 2 2\n");
- fprintf( stdout, "\t 3 4 3\n");
- fprintf( stdout, "\t 4 8 4\n");
- fprintf( stdout, "\t 5 16 5\n");
- fprintf( stdout, "\t 6 32 6\n");
+ Abc_Print( -2, "\nusage: *rlut [-h]\n");
+ Abc_Print( -2, "\t read the LUT library from the file\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t \n");
+ Abc_Print( -2, "\t File format for a LUT library:\n");
+ Abc_Print( -2, "\t (the default library is shown)\n");
+ Abc_Print( -2, "\t \n");
+ Abc_Print( -2, "\t # The area/delay of k-variable LUTs:\n");
+ Abc_Print( -2, "\t # k area delay\n");
+ Abc_Print( -2, "\t 1 1 1\n");
+ Abc_Print( -2, "\t 2 2 2\n");
+ Abc_Print( -2, "\t 3 4 3\n");
+ Abc_Print( -2, "\t 4 8 4\n");
+ Abc_Print( -2, "\t 5 16 5\n");
+ Abc_Print( -2, "\t 6 32 6\n");
return 1; /* error exit */
}
@@ -19607,15 +19981,15 @@ int Abc_CommandAbc8PrintLut( Abc_Frame_t * pAbc, int argc, char **argv )
// set the new network
if ( pAbc->pAbc8Lib == NULL )
- printf( "Abc_CommandAbc8PrintLut(): LUT library is not specified.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8PrintLut(): LUT library is not specified.\n" );
else
- If_LutLibPrint( pAbc->pAbc8Lib );
+ If_LutLibPrint( (If_Lib_t *)pAbc->pAbc8Lib );
return 0;
usage:
- fprintf( stdout, "\nusage: *plut [-h]\n");
- fprintf( stdout, "\t print the current LUT library\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\nusage: *plut [-h]\n");
+ Abc_Print( -2, "\t print the current LUT library\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1; /* error exit */
}
@@ -19633,7 +20007,6 @@ usage:
int Abc_CommandAbc8Check( Abc_Frame_t * pAbc, int argc, char **argv )
{
int c;
- extern int Nwk_ManCheck( void * p );
// set the defaults
Extra_UtilGetoptReset();
@@ -19656,15 +20029,15 @@ int Abc_CommandAbc8Check( Abc_Frame_t * pAbc, int argc, char **argv )
// set the new network
if ( pAbc->pAbc8Nwk == NULL )
- printf( "Abc_CommandAbc8Check(): There is no mapped network.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Check(): There is no mapped network.\n" );
else
Nwk_ManCheck( pAbc->pAbc8Nwk );
return 0;
usage:
- fprintf( stdout, "\nusage: *check [-h]\n");
- fprintf( stdout, "\t checks if the current mapped network has duplicated fanins\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\nusage: *check [-h]\n");
+ Abc_Print( -2, "\t checks if the current mapped network has duplicated fanins\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1; /* error exit */
}
@@ -19687,9 +20060,7 @@ int Abc_CommandAbc8Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
int fDumpResult;
int fPower;
int fShort;
- extern void Ntl_ManPrintStats( void * p );
- extern void Nwk_ManPrintStats( void * p, void * pLutLib, int fSaveBest, int fDumpResult, int fPower, void * pNtl );
- extern void Nwk_ManPrintStatsShort( void * p, void * pAig, void * pNtk );
+ extern If_Lib_t * If_SetSimpleLutLib( int nLutSize );
// set defaults
fSaveBest = 0;
@@ -19721,7 +20092,7 @@ int Abc_CommandAbc8Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Ps(): There is no design to show.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Ps(): There is no design to show.\n" );
return 1;
}
@@ -19733,34 +20104,34 @@ int Abc_CommandAbc8Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
// get the input file name
if ( pAbc->pAbc8Ntl )
{
- printf( "NETLIST: " );
+ Abc_Print( -1, "NETLIST: " );
Ntl_ManPrintStats( pAbc->pAbc8Ntl );
}
if ( pAbc->pAbc8Aig )
{
- printf( "AIG: " );
+ Abc_Print( -1, "AIG: " );
Aig_ManPrintStats( pAbc->pAbc8Aig );
}
if ( pAbc->pAbc8Nwk )
{
if ( pAbc->pAbc8Lib == NULL )
{
- printf( "LUT library is not given. Using default LUT library.\n" );
+ Abc_Print( -1, "LUT library is not given. Using default LUT library.\n" );
pAbc->pAbc8Lib = If_SetSimpleLutLib( 6 );
}
- printf( "MAPPED: " );
+ Abc_Print( -1, "MAPPED: " );
Nwk_ManPrintStats( pAbc->pAbc8Nwk, pAbc->pAbc8Lib, fSaveBest, fDumpResult, fPower, pAbc->pAbc8Ntl );
}
return 0;
usage:
- fprintf( stdout, "usage: *ps [-bdpsh]\n" );
- fprintf( stdout, "\t prints design statistics\n" );
- fprintf( stdout, "\t-b : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
- fprintf( stdout, "\t-d : toggles dumping network into file \"<input_file_name>_dump.blif\" [default = %s]\n", fDumpResult? "yes": "no" );
- fprintf( stdout, "\t-p : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
- fprintf( stdout, "\t-s : toggles short printing mode [default = %s]\n", fShort? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *ps [-bdpsh]\n" );
+ Abc_Print( -2, "\t prints design statistics\n" );
+ Abc_Print( -2, "\t-b : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggles dumping network into file \"<input_file_name>_dump.blif\" [default = %s]\n", fDumpResult? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggles short printing mode [default = %s]\n", fShort? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19778,7 +20149,6 @@ usage:
int Abc_CommandAbc8Pfan( Abc_Frame_t * pAbc, int argc, char ** argv )
{
int c;
- extern void Nwk_ManPrintFanioNew( void * p );
// set defaults
Extra_UtilGetoptReset();
@@ -19794,16 +20164,16 @@ int Abc_CommandAbc8Pfan( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Pfan(): There is no mapped network for print fanin/fanout.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Pfan(): There is no mapped network for print fanin/fanout.\n" );
return 1;
}
Nwk_ManPrintFanioNew( pAbc->pAbc8Nwk );
return 0;
usage:
- fprintf( stdout, "usage: *pfan [-h]\n" );
- fprintf( stdout, "\t prints fanin/fanout stats of the mapped network\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *pfan [-h]\n" );
+ Abc_Print( -2, "\t prints fanin/fanout stats of the mapped network\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -19823,17 +20193,12 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
char Buffer[200];
char LutSize[200];
If_Par_t Pars, * pPars = &Pars;
- void * pNtkNew;
+ Nwk_Man_t * pNtkNew;
int c;
- extern void * Nwk_MappingIf( Aig_Man_t * p, Tim_Man_t * pManTime, If_Par_t * pPars );
- extern Tim_Man_t * Ntl_ManReadTimeMan( void * p );
- extern If_Lib_t * If_SetSimpleLutLib( int nLutSize );
- extern void Nwk_ManSetIfParsDefault( If_Par_t * pPars );
- extern void Nwk_ManFree( void * p );
if ( pAbc->pAbc8Lib == NULL )
{
-// printf( "LUT library is not given. Using default LUT library.\n" );
+// Abc_Print( -1, "LUT library is not given. Using default LUT library.\n" );
pAbc->pAbc8Lib = If_SetSimpleLutLib( 6 );
}
@@ -19841,14 +20206,14 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
Nwk_ManSetIfParsDefault( pPars );
pPars->pLutLib = pAbc->pAbc8Lib;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrstbvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbvh" ) ) != EOF )
{
switch ( c )
{
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nLutSize = atoi(argv[globalUtilOptind]);
@@ -19861,7 +20226,7 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nCutsMax = atoi(argv[globalUtilOptind]);
@@ -19872,7 +20237,7 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nFlowIters = atoi(argv[globalUtilOptind]);
@@ -19883,7 +20248,7 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'A':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nAreaIters = atoi(argv[globalUtilOptind]);
@@ -19894,7 +20259,7 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
@@ -19905,7 +20270,7 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'E':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
@@ -19940,11 +20305,11 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 's':
pPars->fSeqMap ^= 1;
break;
- case 't':
- pPars->fLiftLeaves ^= 1;
+ case 'd':
+ pPars->fBidec ^= 1;
break;
case 'b':
- pPars->fBidec ^= 1;
+ pPars->fUseBat ^= 1;
break;
case 'v':
pPars->fVerbose ^= 1;
@@ -19956,28 +20321,39 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8If(): There is no AIG to map.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8If(): There is no AIG to map.\n" );
return 1;
}
if ( pPars->nLutSize < 3 || pPars->nLutSize > IF_MAX_LUTSIZE )
{
- fprintf( stdout, "Incorrect LUT size (%d).\n", pPars->nLutSize );
+ Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
return 1;
}
if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
{
- fprintf( stdout, "Incorrect number of cuts.\n" );
+ Abc_Print( -1, "Incorrect number of cuts.\n" );
return 1;
}
// enable truth table computation if choices are selected
if ( (c = Aig_ManChoiceNum( pAbc->pAbc8Aig )) )
{
-// printf( "Performing LUT mapping with %d choices.\n", c );
+// Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c );
pPars->fExpRed = 0;
}
+
+ if ( pPars->fUseBat )
+ {
+ if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
+ {
+ Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
+ return 1;
+ }
+ pPars->fCutMin = 1;
+ }
+
// enable truth table computation if cut minimization is selected
if ( pPars->fCutMin )
{
@@ -19988,14 +20364,14 @@ int Abc_CommandAbc8If( Abc_Frame_t * pAbc, int argc, char ** argv )
// complain if truth tables are requested but the cut size is too large
if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
{
- fprintf( stdout, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
+ Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
return 1;
}
pNtkNew = Nwk_MappingIf( pAbc->pAbc8Aig, Ntl_ManReadTimeMan(pAbc->pAbc8Ntl), pPars );
if ( pNtkNew == NULL )
{
- printf( "Abc_CommandAbc8If(): Mapping of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8If(): Mapping of the AIG has failed.\n" );
return 1;
}
if ( pAbc->pAbc8Nwk != NULL )
@@ -20012,27 +20388,27 @@ usage:
sprintf( LutSize, "library" );
else
sprintf( LutSize, "%d", pPars->nLutSize );
- fprintf( stdout, "usage: *if [-KCFA num] [-DE float] [-qarlepmbvh]\n" );
- fprintf( stdout, "\t performs FPGA technology mapping of the network\n" );
- fprintf( stdout, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
- fprintf( stdout, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
- fprintf( stdout, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
- fprintf( stdout, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
- fprintf( stdout, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
- fprintf( stdout, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
- fprintf( stdout, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
- fprintf( stdout, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
-// fprintf( stdout, "\t-f : toggles one fancy feature [default = %s]\n", pPars->fFancy? "yes": "no" );
- fprintf( stdout, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
- fprintf( stdout, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
- fprintf( stdout, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
- fprintf( stdout, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
- fprintf( stdout, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
-// fprintf( stdout, "\t-s : toggles sequential mapping [default = %s]\n", pPars->fSeqMap? "yes": "no" );
-// fprintf( stdout, "\t-t : toggles the use of true sequential cuts [default = %s]\n", pPars->fLiftLeaves? "yes": "no" );
- fprintf( stdout, "\t-b : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
- fprintf( stdout, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : prints the command usage\n");
+ Abc_Print( -2, "usage: *if [-KCFA num] [-DE float] [-qarlepmdbvh]\n" );
+ Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
+ Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
+ Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
+ Abc_Print( -2, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
+ Abc_Print( -2, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
+ Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
+ Abc_Print( -2, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
+// Abc_Print( -2, "\t-f : toggles one fancy feature [default = %s]\n", pPars->fFancy? "yes": "no" );
+ Abc_Print( -2, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
+ Abc_Print( -2, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
+ Abc_Print( -2, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
+ Abc_Print( -2, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
+// Abc_Print( -2, "\t-s : toggles sequential mapping [default = %s]\n", pPars->fSeqMap? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : prints the command usage\n");
return 1;
}
@@ -20070,7 +20446,7 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfMax = atoi(argv[globalUtilOptind]);
@@ -20081,7 +20457,7 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nLevelMax = atoi(argv[globalUtilOptind]);
@@ -20109,7 +20485,7 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8DChoice(): There is no AIG to synthesize.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8DChoice(): There is no AIG to synthesize.\n" );
return 1;
}
@@ -20117,7 +20493,7 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
pAigNew = Ntl_ManPerformChoicing( pAbc->pAbc8Aig, fBalance, fUpdateLevel, fConstruct, nConfMax, nLevelMax, fVerbose );
if ( pAigNew == NULL )
{
- printf( "Abc_CommandAbc8DChoice(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8DChoice(): Tranformation has failed.\n" );
return 1;
}
Aig_ManStop( pAbc->pAbc8Aig );
@@ -20125,15 +20501,15 @@ int Abc_CommandAbc8DChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *dchoice [-C num] [-L num] [-blcvh]\n" );
- fprintf( stdout, "\t performs AIG-based synthesis and derives choices\n" );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
- fprintf( stdout, "\t-L num : the max level of nodes to consider (0 = not used) [default = %d]\n", nLevelMax );
- fprintf( stdout, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
- fprintf( stdout, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( stdout, "\t-c : toggle constructive computation of choices [default = %s]\n", fConstruct? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *dchoice [-C num] [-L num] [-blcvh]\n" );
+ Abc_Print( -2, "\t performs AIG-based synthesis and derives choices\n" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
+ Abc_Print( -2, "\t-L num : the max level of nodes to consider (0 = not used) [default = %d]\n", nLevelMax );
+ Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle constructive computation of choices [default = %s]\n", fConstruct? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20165,7 +20541,7 @@ int Abc_CommandAbc8Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWords = atoi(argv[globalUtilOptind]);
@@ -20176,7 +20552,7 @@ int Abc_CommandAbc8Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -20187,7 +20563,7 @@ int Abc_CommandAbc8Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
@@ -20218,7 +20594,7 @@ int Abc_CommandAbc8Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Dch(): There is no AIG to synthesize.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Dch(): There is no AIG to synthesize.\n" );
return 1;
}
@@ -20226,7 +20602,7 @@ int Abc_CommandAbc8Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
pAigNew = Ntl_ManPerformChoicingNew( pAbc->pAbc8Aig, pPars );
if ( pAigNew == NULL )
{
- printf( "Abc_CommandAbc8Dch(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Dch(): Tranformation has failed.\n" );
return 1;
}
// Aig_ManStop( pAbc->pAbc8Aig );
@@ -20234,17 +20610,17 @@ int Abc_CommandAbc8Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *dch [-WCS num] [-sptfvh]\n" );
- fprintf( stdout, "\t computes structural choices using a new approach\n" );
- fprintf( stdout, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
- fprintf( stdout, "\t-s : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
- fprintf( stdout, "\t-p : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
- fprintf( stdout, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
- fprintf( stdout, "\t-f : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *dch [-WCS num] [-sptfvh]\n" );
+ Abc_Print( -2, "\t computes structural choices using a new approach\n" );
+ Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
+ Abc_Print( -2, "\t-s : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20259,7 +20635,7 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandAbc8DC2( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandAbc8Dc2( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Aig_Man_t * pAigNew;
int c;
@@ -20300,7 +20676,7 @@ int Abc_CommandAbc8DC2( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8DC2(): There is no AIG to synthesize.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Dc2(): There is no AIG to synthesize.\n" );
return 1;
}
@@ -20308,7 +20684,7 @@ int Abc_CommandAbc8DC2( Abc_Frame_t * pAbc, int argc, char ** argv )
pAigNew = Dar_ManCompress2( pAbc->pAbc8Aig, fBalance, fUpdateLevel, 1, fPower, fVerbose );
if ( pAigNew == NULL )
{
- printf( "Abc_CommandAbc8DC2(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Dc2(): Tranformation has failed.\n" );
return 1;
}
Aig_ManStop( pAbc->pAbc8Aig );
@@ -20316,13 +20692,13 @@ int Abc_CommandAbc8DC2( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *dc2 [-blpvh]\n" );
- fprintf( stdout, "\t performs AIG-based synthesis without deriving choices\n" );
- fprintf( stdout, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
- fprintf( stdout, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( stdout, "\t-p : toggle power-aware rewriting [default = %s]\n", fPower? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *dc2 [-blpvh]\n" );
+ Abc_Print( -2, "\t performs AIG-based synthesis without deriving choices\n" );
+ Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", fPower? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20341,7 +20717,6 @@ usage:
int Abc_CommandAbc8Bidec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
int c;
- extern void Nwk_ManBidecResyn( void * pNtk, int fVerbose );
// set defaults
Extra_UtilGetoptReset();
@@ -20357,16 +20732,16 @@ int Abc_CommandAbc8Bidec( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Bidec(): There is no mapped network to strash.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Bidec(): There is no mapped network to strash.\n" );
return 1;
}
Nwk_ManBidecResyn( pAbc->pAbc8Nwk, 0 );
return 0;
usage:
- fprintf( stdout, "usage: *bidec [-h]\n" );
- fprintf( stdout, "\t performs bi-decomposition of local functions\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *bidec [-h]\n" );
+ Abc_Print( -2, "\t performs bi-decomposition of local functions\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20385,7 +20760,6 @@ int Abc_CommandAbc8Strash( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Aig_Man_t * pAigNew;
int c;
- extern Aig_Man_t * Nwk_ManStrash( void * pNtk );
// set defaults
Extra_UtilGetoptReset();
@@ -20401,14 +20775,14 @@ int Abc_CommandAbc8Strash( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Strash(): There is no mapped network to strash.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Strash(): There is no mapped network to strash.\n" );
return 1;
}
pAigNew = Nwk_ManStrash( pAbc->pAbc8Nwk );
if ( pAigNew == NULL )
{
- printf( "Abc_CommandAbc8Strash(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Strash(): Tranformation has failed.\n" );
return 1;
}
Aig_ManStop( pAbc->pAbc8Aig );
@@ -20416,9 +20790,9 @@ int Abc_CommandAbc8Strash( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *st [-h]\n" );
- fprintf( stdout, "\t performs structural hashing of mapped network\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *st [-h]\n" );
+ Abc_Print( -2, "\t performs structural hashing of mapped network\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20438,7 +20812,7 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Mfx_Par_t Pars, * pPars = &Pars;
int c;
- extern int Mfx_Perform( void * pNtk, Mfx_Par_t * pPars, If_Lib_t * pLutLib );
+// extern int Mfx_Perform( void * pNtk, Mfx_Par_t * pPars, If_Lib_t * pLutLib );
// set defaults
Mfx_ParsDefault( pPars );
@@ -20450,7 +20824,7 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWinTfoLevs = atoi(argv[globalUtilOptind]);
@@ -20461,7 +20835,7 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFanoutsMax = atoi(argv[globalUtilOptind]);
@@ -20472,7 +20846,7 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nDepthMax = atoi(argv[globalUtilOptind]);
@@ -20483,7 +20857,7 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-M\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWinSizeMax = atoi(argv[globalUtilOptind]);
@@ -20494,7 +20868,7 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
@@ -20505,7 +20879,7 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -20542,18 +20916,18 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Mfs(): There is no mapped network.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Mfs(): There is no mapped network.\n" );
return 1;
}
if ( pAbc->pAbc8Lib == NULL )
{
- printf( "Abc_CommandAbc8Mfs(): There is no LUT library.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Mfs(): There is no LUT library.\n" );
return 1;
}
if ( If_LutLibDelaysAreDifferent(pAbc->pAbc8Lib) )
{
- printf( "Abc_CommandAbc8Mfs(): Cannot perform don't-care simplication with variable-pin-delay LUT model.\n" );
- printf( "The delay model should be fixed-pin-delay, for example, the delay of all pins of all LUTs is 0.4.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Mfs(): Cannot perform don't-care simplication with variable-pin-delay LUT model.\n" );
+ Abc_Print( -1, "The delay model should be fixed-pin-delay, for example, the delay of all pins of all LUTs is 0.4.\n" );
return 1;
}
@@ -20561,28 +20935,28 @@ int Abc_CommandAbc8Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
// modify the current network
if ( !Mfx_Perform( pAbc->pAbc8Nwk, pPars, pAbc->pAbc8Lib ) )
{
- fprintf( stdout, "Abc_CommandAbc8Mfs(): Command has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Mfs(): Command has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( stdout, "usage: *mfs [-WFDMLC <num>] [-raespvh]\n" );
- fprintf( stdout, "\t performs don't-care-based optimization of logic networks\n" );
- fprintf( stdout, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
- fprintf( stdout, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
- fprintf( stdout, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
- fprintf( stdout, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax );
- fprintf( stdout, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
- fprintf( stdout, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-r : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
- fprintf( stdout, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
- fprintf( stdout, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
- fprintf( stdout, "\t-s : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
- fprintf( stdout, "\t-p : toggle power-aware optimization [default = %s]\n", pPars->fPower? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *mfs [-WFDMLC <num>] [-raespvh]\n" );
+ Abc_Print( -2, "\t performs don't-care-based optimization of logic networks\n" );
+ Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
+ Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
+ Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
+ Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax );
+ Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+ Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-r : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
+ Abc_Print( -2, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
+ Abc_Print( -2, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle power-aware optimization [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20601,7 +20975,7 @@ int Abc_CommandAbc8Lutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
{
int c;
- printf( "This command is temporarily disabled.\n" );
+ Abc_Print( -1, "This command is temporarily disabled.\n" );
return 0;
// set defaults
@@ -20618,7 +20992,7 @@ int Abc_CommandAbc8Lutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Lutpack(): There is no mapped network to strash.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Lutpack(): There is no mapped network to strash.\n" );
return 1;
}
@@ -20626,23 +21000,23 @@ int Abc_CommandAbc8Lutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
/*
- fprintf( stdout, "usage: *lp [-h]\n" );
- fprintf( stdout, "usage: lutpack [-N <num>] [-Q <num>] [-S <num>] [-L <num>] [-szfovwh]\n" );
- fprintf( stdout, "\t performs \"rewriting\" for LUT network;\n" );
- fprintf( stdout, "\t determines LUT size as the max fanin count of a node;\n" );
- fprintf( stdout, "\t if the network is not LUT-mapped, packs it into 6-LUTs\n" );
- fprintf( stdout, "\t (there is another command for resynthesis after LUT mapping, \"imfs\")\n" );
- fprintf( stdout, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
- fprintf( stdout, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
- fprintf( stdout, "\t-S <num> : the max number of LUT inputs shared (0 <= num <= 3) [default = %d]\n", pPars->nVarsShared );
- fprintf( stdout, "\t-L <num> : max level increase after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
- fprintf( stdout, "\t-s : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
- fprintf( stdout, "\t-z : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
- fprintf( stdout, "\t-f : toggle using only first node and first cut [default = %s]\n", pPars->fFirst? "yes": "no" );
- fprintf( stdout, "\t-o : toggle using old implementation [default = %s]\n", pPars->fOldAlgo? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-w : toggle detailed printout of decomposed functions [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *lp [-h]\n" );
+ Abc_Print( -2, "usage: lutpack [-N <num>] [-Q <num>] [-S <num>] [-L <num>] [-szfovwh]\n" );
+ Abc_Print( -2, "\t performs \"rewriting\" for LUT network;\n" );
+ Abc_Print( -2, "\t determines LUT size as the max fanin count of a node;\n" );
+ Abc_Print( -2, "\t if the network is not LUT-mapped, packs it into 6-LUTs\n" );
+ Abc_Print( -2, "\t (there is another command for resynthesis after LUT mapping, \"imfs\")\n" );
+ Abc_Print( -2, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
+ Abc_Print( -2, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
+ Abc_Print( -2, "\t-S <num> : the max number of LUT inputs shared (0 <= num <= 3) [default = %d]\n", pPars->nVarsShared );
+ Abc_Print( -2, "\t-L <num> : max level increase after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+ Abc_Print( -2, "\t-s : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
+ Abc_Print( -2, "\t-z : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle using only first node and first cut [default = %s]\n", pPars->fFirst? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggle using old implementation [default = %s]\n", pPars->fOldAlgo? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle detailed printout of decomposed functions [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
*/
return 1;
}
@@ -20693,7 +21067,7 @@ int Abc_CommandAbc8Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Balance(): There is no AIG to synthesize.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Balance(): There is no AIG to synthesize.\n" );
return 1;
}
@@ -20701,7 +21075,7 @@ int Abc_CommandAbc8Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
pAigNew = Dar_ManBalanceXor( pAbc->pAbc8Aig, fExor, fUpdateLevel, fVerbose );
if ( pAigNew == NULL )
{
- printf( "Abc_CommandAbc8Balance(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Balance(): Tranformation has failed.\n" );
return 1;
}
Aig_ManStop( pAbc->pAbc8Aig );
@@ -20709,12 +21083,12 @@ int Abc_CommandAbc8Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *b [-xlvh]\n" );
- fprintf( stdout, "\t performs balanacing of the AIG\n" );
- fprintf( stdout, "\t-x : toggle using XOR-balancing [default = %s]\n", fExor? "yes": "no" );
- fprintf( stdout, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *b [-xlvh]\n" );
+ Abc_Print( -2, "\t performs balancing of the AIG\n" );
+ Abc_Print( -2, "\t-x : toggle using XOR-balancing [default = %s]\n", fExor? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20738,7 +21112,6 @@ int Abc_CommandAbc8Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
int Degree = 5;
int fVerbose = 0;
int fVeryVerbose = 0;
- extern Aig_Man_t * Nwk_ManSpeedup( void * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
// set defaults
fUseLutLib = 0;
@@ -20754,7 +21127,7 @@ int Abc_CommandAbc8Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
Percentage = atoi(argv[globalUtilOptind]);
@@ -20765,7 +21138,7 @@ int Abc_CommandAbc8Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
Degree = atoi(argv[globalUtilOptind]);
@@ -20790,14 +21163,14 @@ int Abc_CommandAbc8Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Speedup(): There is no mapped network to strash.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Speedup(): There is no mapped network to strash.\n" );
return 1;
}
pAigNew = Nwk_ManSpeedup( pAbc->pAbc8Nwk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
if ( pAigNew == NULL )
{
- printf( "Abc_CommandAbc8Speedup(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Speedup(): Tranformation has failed.\n" );
return 1;
}
Aig_ManStop( pAbc->pAbc8Aig );
@@ -20805,15 +21178,15 @@ int Abc_CommandAbc8Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *speedup [-P num] [-N num] [-lvwh]\n" );
- fprintf( stdout, "\t transforms LUT-mapped network into an AIG with choices;\n" );
- fprintf( stdout, "\t the choices are added to speedup the next round of mapping\n" );
- fprintf( stdout, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
- fprintf( stdout, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
- fprintf( stdout, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
- fprintf( stdout, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *speedup [-P num] [-N num] [-lvwh]\n" );
+ Abc_Print( -2, "\t transforms LUT-mapped network into an AIG with choices;\n" );
+ Abc_Print( -2, "\t the choices are added to speedup the next round of mapping\n" );
+ Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
+ Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
+ Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20833,7 +21206,6 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
Nwk_LMPars_t Pars, * pPars = &Pars;
Vec_Int_t * vResult;
int c;
- extern Vec_Int_t * Nwk_ManLutMerge( void * pNtk, Nwk_LMPars_t * pPars );
// set defaults
memset( pPars, 0, sizeof(Nwk_LMPars_t) );
@@ -20854,7 +21226,7 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLutSize = atoi(argv[globalUtilOptind]);
@@ -20865,7 +21237,7 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxSuppSize = atoi(argv[globalUtilOptind]);
@@ -20876,7 +21248,7 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxDistance = atoi(argv[globalUtilOptind]);
@@ -20887,7 +21259,7 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLevelDiff = atoi(argv[globalUtilOptind]);
@@ -20898,7 +21270,7 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxFanout = atoi(argv[globalUtilOptind]);
@@ -20926,7 +21298,7 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Speedup(): There is no mapped network to merge LUTs.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Speedup(): There is no mapped network to merge LUTs.\n" );
return 1;
}
@@ -20935,18 +21307,18 @@ int Abc_CommandAbc8Merge( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *merge [-NSDLF num] [-scwvh]\n" );
- fprintf( stdout, "\t creates pairs of topologically-related LUTs\n" );
- fprintf( stdout, "\t-N <num> : the max LUT size for merging (1 < num) [default = %d]\n", pPars->nMaxLutSize );
- fprintf( stdout, "\t-S <num> : the max total support size after merging (1 < num) [default = %d]\n", pPars->nMaxSuppSize );
- fprintf( stdout, "\t-D <num> : the max distance in terms of LUTs (0 < num) [default = %d]\n", pPars->nMaxDistance );
- fprintf( stdout, "\t-L <num> : the max difference in levels (0 <= num) [default = %d]\n", pPars->nMaxLevelDiff );
- fprintf( stdout, "\t-F <num> : the max number of fanouts to stop traversal (0 < num) [default = %d]\n", pPars->nMaxFanout );
- fprintf( stdout, "\t-s : toggle the use of nodes without support overlap [default = %s]\n", pPars->fUseDiffSupp? "yes" : "no" );
- fprintf( stdout, "\t-c : toggle the use of TFI/TFO nodes as candidates [default = %s]\n", pPars->fUseTfiTfo? "yes" : "no" );
- fprintf( stdout, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *merge [-NSDLF num] [-scwvh]\n" );
+ Abc_Print( -2, "\t creates pairs of topologically-related LUTs\n" );
+ Abc_Print( -2, "\t-N <num> : the max LUT size for merging (1 < num) [default = %d]\n", pPars->nMaxLutSize );
+ Abc_Print( -2, "\t-S <num> : the max total support size after merging (1 < num) [default = %d]\n", pPars->nMaxSuppSize );
+ Abc_Print( -2, "\t-D <num> : the max distance in terms of LUTs (0 < num) [default = %d]\n", pPars->nMaxDistance );
+ Abc_Print( -2, "\t-L <num> : the max difference in levels (0 <= num) [default = %d]\n", pPars->nMaxLevelDiff );
+ Abc_Print( -2, "\t-F <num> : the max number of fanouts to stop traversal (0 < num) [default = %d]\n", pPars->nMaxFanout );
+ Abc_Print( -2, "\t-s : toggle the use of nodes without support overlap [default = %s]\n", pPars->fUseDiffSupp? "yes" : "no" );
+ Abc_Print( -2, "\t-c : toggle the use of TFI/TFO nodes as candidates [default = %s]\n", pPars->fUseTfiTfo? "yes" : "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -20963,8 +21335,7 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Insert( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- extern void * Ntl_ManInsertNtk( void * p, void * pNtk );
- void * pNtlNew;
+ Ntl_Man_t * pNtlNew;
int c;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
@@ -20979,12 +21350,12 @@ int Abc_CommandAbc8Insert( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Insert(): There is no design.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Insert(): There is no design.\n" );
return 1;
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Insert(): There is no network to insert.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Insert(): There is no network to insert.\n" );
return 1;
}
pNtlNew = Ntl_ManInsertNtk( pAbc->pAbc8Ntl, pAbc->pAbc8Nwk );
@@ -20993,9 +21364,9 @@ int Abc_CommandAbc8Insert( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *insert [-h]\n" );
- fprintf( stdout, "\t inserts the mapped network into the netlist\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *insert [-h]\n" );
+ Abc_Print( -2, "\t inserts the mapped network into the netlist\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -21013,8 +21384,7 @@ usage:
***********************************************************************/
int Abc_CommandAbc8ClpLut( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- extern void * Ntl_ManDupCollapseLuts( void * p );
- void * pNtlNew;
+ Ntl_Man_t * pNtlNew;
int c;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
@@ -21029,7 +21399,7 @@ int Abc_CommandAbc8ClpLut( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Insert(): There is no design.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Insert(): There is no design.\n" );
return 1;
}
pNtlNew = Ntl_ManDupCollapseLuts( pAbc->pAbc8Ntl );
@@ -21039,9 +21409,9 @@ int Abc_CommandAbc8ClpLut( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *clplut [-h]\n" );
- fprintf( stdout, "\t collapses comb white boxes whose model name begins with \"LUT\"\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *clplut [-h]\n" );
+ Abc_Print( -2, "\t collapses comb white boxes whose model name begins with \"LUT\"\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
/**Function*************************************************************
@@ -21057,14 +21427,12 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- void * pNtlNew, * pNtlOld;
+ Ntl_Man_t * pNtlNew, * pNtlOld;
int c, fVerbose;
int nPartSize;
int nConfLimit;
int nLevelMax;
int fUseCSat;
- extern void * Ntl_ManFraig( void * p, int nPartSize, int nConfLimit, int nLevelMax, int fUseCSat, int fVerbose );
- extern void Ntl_ManFree( void * p );
// set defaults
nPartSize = 0;
@@ -21080,7 +21448,7 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPartSize = atoi(argv[globalUtilOptind]);
@@ -21091,7 +21459,7 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -21102,7 +21470,7 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nLevelMax = atoi(argv[globalUtilOptind]);
@@ -21125,7 +21493,7 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Fraig(): There is no design to SAT sweep.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Fraig(): There is no design to SAT sweep.\n" );
return 1;
}
@@ -21134,7 +21502,7 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtlNew = Ntl_ManFraig( pNtlOld, nPartSize, nConfLimit, nLevelMax, fUseCSat, fVerbose );
if ( pNtlNew == NULL )
{
- printf( "Abc_CommandAbc8Fraig(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Fraig(): Tranformation has failed.\n" );
return 1;
}
@@ -21142,26 +21510,26 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
pAbc->pAbc8Ntl = pNtlNew;
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Fraig(): Reading BLIF has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Fraig(): Reading BLIF has failed.\n" );
return 1;
}
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Fraig(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Fraig(): AIG extraction has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( stdout, "usage: *fraig [-P num] [-C num] [-L num] [-vh]\n" );
- fprintf( stdout, "\t applies SAT sweeping to netlist with white-boxes\n" );
- fprintf( stdout, "\t-P num : partition size (0 = partitioning is not used) [default = %d]\n", nPartSize );
- fprintf( stdout, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( stdout, "\t-L num : limit on node level to fraig (0 = fraig all nodes) [default = %d]\n", nLevelMax );
-// fprintf( stdout, "\t-c : toggle using new AIG package and SAT solver [default = %s]\n", fUseCSat? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *fraig [-P num] [-C num] [-L num] [-vh]\n" );
+ Abc_Print( -2, "\t applies SAT sweeping to netlist with white-boxes\n" );
+ Abc_Print( -2, "\t-P num : partition size (0 = partitioning is not used) [default = %d]\n", nPartSize );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-L num : limit on node level to fraig (0 = fraig all nodes) [default = %d]\n", nLevelMax );
+// Abc_Print( -2, "\t-c : toggle using new AIG package and SAT solver [default = %s]\n", fUseCSat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -21178,13 +21546,11 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- void * pNtlNew, * pNtlOld;
+ Ntl_Man_t * pNtlNew, * pNtlOld;
int c;
int fLatchConst;
int fLatchEqual;
int fVerbose;
- extern void * Ntl_ManScl( void * p, int fLatchConst, int fLatchEqual, int fVerbose );
- extern int Ntl_ManIsComb( void * p );
// set defaults
fLatchConst = 1;
@@ -21213,13 +21579,13 @@ int Abc_CommandAbc8Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Scl(): There is no design to SAT sweep.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scl(): There is no design to SAT sweep.\n" );
return 1;
}
if ( Ntl_ManIsComb(pAbc->pAbc8Ntl) )
{
- fprintf( stdout, "Abc_CommandAbc8Scl(): The network is combinational.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scl(): The network is combinational.\n" );
return 0;
}
@@ -21228,7 +21594,7 @@ int Abc_CommandAbc8Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtlNew = Ntl_ManScl( pNtlOld, fLatchConst, fLatchEqual, fVerbose );
if ( pNtlNew == NULL )
{
- printf( "Abc_CommandAbc8Scl(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scl(): Tranformation has failed.\n" );
return 1;
}
@@ -21236,25 +21602,25 @@ int Abc_CommandAbc8Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
pAbc->pAbc8Ntl = pNtlNew;
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Scl(): Reading BLIF has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scl(): Reading BLIF has failed.\n" );
return 1;
}
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Scl(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scl(): AIG extraction has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( stdout, "usage: *scl [-cevh]\n" );
- fprintf( stdout, "\t performs sequential cleanup of the netlist\n" );
- fprintf( stdout, "\t by removing nodes and latches that do not feed into POs\n" );
- fprintf( stdout, "\t-c : sweep stuck-at latches detected by ternary simulation [default = %s]\n", fLatchConst? "yes": "no" );
- fprintf( stdout, "\t-e : merge equal latches (same data inputs and init states) [default = %s]\n", fLatchEqual? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *scl [-cevh]\n" );
+ Abc_Print( -2, "\t performs sequential cleanup of the netlist\n" );
+ Abc_Print( -2, "\t by removing nodes and latches that do not feed into POs\n" );
+ Abc_Print( -2, "\t-c : sweep stuck-at latches detected by ternary simulation [default = %s]\n", fLatchConst? "yes": "no" );
+ Abc_Print( -2, "\t-e : merge equal latches (same data inputs and init states) [default = %s]\n", fLatchEqual? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -21271,15 +21637,13 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- void * pNtlNew, * pNtlOld;
+ Ntl_Man_t * pNtlNew, * pNtlOld;
int c;
int fScorrGia;
int fUseCSat;
int nFramesP;
int nConfMax;
int fVerbose;
- extern void * Ntl_ManLcorr( void * p, int nConfMax, int fScorrGia, int fUseCSat, int fVerbose );
- extern int Ntl_ManIsComb( void * p );
// set defaults
fScorrGia = 0;
@@ -21295,7 +21659,7 @@ int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nFramesP = atoi(argv[globalUtilOptind]);
@@ -21306,7 +21670,7 @@ int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfMax = atoi(argv[globalUtilOptind]);
@@ -21332,13 +21696,13 @@ int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Lcorr(): There is no design to SAT sweep.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Lcorr(): There is no design to SAT sweep.\n" );
return 1;
}
if ( Ntl_ManIsComb(pAbc->pAbc8Ntl) )
{
- fprintf( stdout, "Abc_CommandAbc8Lcorr(): The network is combinational.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Lcorr(): The network is combinational.\n" );
return 0;
}
@@ -21347,7 +21711,7 @@ int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtlNew = Ntl_ManLcorr( pNtlOld, nConfMax, fScorrGia, fUseCSat, fVerbose );
if ( pNtlNew == NULL )
{
- printf( "Abc_CommandAbc8Lcorr(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Lcorr(): Tranformation has failed.\n" );
return 1;
}
@@ -21355,26 +21719,26 @@ int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
pAbc->pAbc8Ntl = pNtlNew;
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Lcorr(): Reading BLIF has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Lcorr(): Reading BLIF has failed.\n" );
return 1;
}
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Lcorr(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Lcorr(): AIG extraction has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( stdout, "usage: *lcorr [-C num] [-ncvh]\n" );
- fprintf( stdout, "\t computes latch correspondence for the netlist\n" );
-// fprintf( stdout, "\t-P num : number of time frames to use as the prefix [default = %d]\n", nFramesP );
- fprintf( stdout, "\t-C num : max conflict number when proving latch equivalence [default = %d]\n", nConfMax );
- fprintf( stdout, "\t-n : toggle using new AIG package [default = %s]\n", fScorrGia? "yes": "no" );
- fprintf( stdout, "\t-c : toggle using new AIG package and SAT solver [default = %s]\n", fUseCSat? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *lcorr [-C num] [-ncvh]\n" );
+ Abc_Print( -2, "\t computes latch correspondence for the netlist\n" );
+// Abc_Print( -2, "\t-P num : number of time frames to use as the prefix [default = %d]\n", nFramesP );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfMax );
+ Abc_Print( -2, "\t-n : toggle using new AIG package [default = %s]\n", fScorrGia? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle using new AIG package and SAT solver [default = %s]\n", fUseCSat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -21391,11 +21755,9 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- void * pNtlNew, * pNtlOld;
+ Ntl_Man_t * pNtlNew, * pNtlOld;
Fra_Ssw_t Pars, * pPars = &Pars;
int c;
- extern void * Ntl_ManSsw( void * p, Fra_Ssw_t * pPars );
- extern int Ntl_ManIsComb( void * p );
// set defaults
pPars->nPartSize = 0;
@@ -21421,7 +21783,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
pPars->nPartSize = atoi(argv[globalUtilOptind]);
@@ -21432,7 +21794,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'Q':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-Q\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
goto usage;
}
pPars->nOverSize = atoi(argv[globalUtilOptind]);
@@ -21443,7 +21805,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesP = atoi(argv[globalUtilOptind]);
@@ -21454,7 +21816,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesK = atoi(argv[globalUtilOptind]);
@@ -21465,7 +21827,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxImps = atoi(argv[globalUtilOptind]);
@@ -21476,7 +21838,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
@@ -21487,7 +21849,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMinDomSize = atoi(argv[globalUtilOptind]);
@@ -21525,25 +21887,25 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Ssw(): There is no design to SAT sweep.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Ssw(): There is no design to SAT sweep.\n" );
return 1;
}
if ( Ntl_ManIsComb(pAbc->pAbc8Ntl) )
{
- fprintf( stdout, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
if ( pPars->nFramesK > 1 && pPars->fUse1Hot )
{
- printf( "Currrently can only use one-hotness for simple induction (K=1).\n" );
+ Abc_Print( -1, "Currrently can only use one-hotness for simple induction (K=1).\n" );
return 0;
}
if ( pPars->nFramesP && pPars->fUse1Hot )
{
- printf( "Currrently can only use one-hotness without prefix.\n" );
+ Abc_Print( -1, "Currrently can only use one-hotness without prefix.\n" );
return 0;
}
@@ -21552,7 +21914,7 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtlNew = Ntl_ManSsw( pNtlOld, pPars );
if ( pNtlNew == NULL )
{
- printf( "Abc_CommandAbc8Ssw(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Ssw(): Tranformation has failed.\n" );
return 1;
}
@@ -21560,35 +21922,35 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
pAbc->pAbc8Ntl = pNtlNew;
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Ssw(): Reading BLIF has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Ssw(): Reading BLIF has failed.\n" );
return 1;
}
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Ssw(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Ssw(): AIG extraction has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( stdout, "usage: *ssw [-PQNFLD num] [-lrfetvh]\n" );
- fprintf( stdout, "\t performs sequential sweep using K-step induction on the netlist \n" );
- fprintf( stdout, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
- fprintf( stdout, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
- fprintf( stdout, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
- fprintf( stdout, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
- fprintf( stdout, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
- fprintf( stdout, "\t-D num : min size of a clock domain used for synthesis [default = %d]\n", pPars->nMinDomSize );
-// fprintf( stdout, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
-// fprintf( stdout, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
- fprintf( stdout, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
- fprintf( stdout, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
- fprintf( stdout, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
- fprintf( stdout, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
- fprintf( stdout, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *ssw [-PQNFLD num] [-lrfetvh]\n" );
+ Abc_Print( -2, "\t performs sequential sweep using K-step induction on the netlist \n" );
+ Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+ Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+ Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
+ Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+ Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+ Abc_Print( -2, "\t-D num : min size of a clock domain used for synthesis [default = %d]\n", pPars->nMinDomSize );
+// Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
+// Abc_Print( -2, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
+ Abc_Print( -2, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -21605,23 +21967,21 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- void * pNtlNew, * pNtlOld;
+ Ntl_Man_t * pNtlNew, * pNtlOld;
Ssw_Pars_t Pars, * pPars = &Pars;
int c;
- extern void * Ntl_ManScorr( void * p, Ssw_Pars_t * pPars );
- extern int Ntl_ManIsComb( void * p );
// set defaults
Ssw_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "PQFCLNSDVMpldsncvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "PQFCLSDVMpldsncvh" ) ) != EOF )
{
switch ( c )
{
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
pPars->nPartSize = atoi(argv[globalUtilOptind]);
@@ -21632,7 +21992,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'Q':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-Q\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
goto usage;
}
pPars->nOverSize = atoi(argv[globalUtilOptind]);
@@ -21643,7 +22003,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesK = atoi(argv[globalUtilOptind]);
@@ -21654,7 +22014,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -21665,7 +22025,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
@@ -21673,21 +22033,10 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nMaxLevs <= 0 )
goto usage;
break;
- case 'N':
- if ( globalUtilOptind >= argc )
- {
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
- goto usage;
- }
- pPars->nConstrs = atoi(argv[globalUtilOptind]);
- globalUtilOptind++;
- if ( pPars->nConstrs < 0 )
- goto usage;
- break;
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFramesAddSim = atoi(argv[globalUtilOptind]);
@@ -21698,7 +22047,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMinDomSize = atoi(argv[globalUtilOptind]);
@@ -21709,7 +22058,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'V':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-V\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
goto usage;
}
pPars->nSatVarMax2 = atoi(argv[globalUtilOptind]);
@@ -21720,7 +22069,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-M\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pPars->nRecycleCalls2 = atoi(argv[globalUtilOptind]);
@@ -21758,13 +22107,13 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Ssw(): There is no design to SAT sweep.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Ssw(): There is no design to SAT sweep.\n" );
return 1;
}
if ( Ntl_ManIsComb(pAbc->pAbc8Ntl) )
{
- fprintf( stdout, "The network is combinational.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
return 0;
}
@@ -21772,7 +22121,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
{
pPars->nPartSize = 0;
pPars->nOverSize = 0;
- printf( "With dynamic partitioning (-d) enabled, static one (-P <num> -Q <num>) is ignored.\n" );
+ Abc_Print( -1, "With dynamic partitioning (-d) enabled, static one (-P <num> -Q <num>) is ignored.\n" );
}
// get the input file name
@@ -21780,7 +22129,7 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtlNew = Ntl_ManScorr( pNtlOld, pPars );
if ( pNtlNew == NULL )
{
- printf( "Abc_CommandAbc8Scorr(): Tranformation of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scorr(): Tranformation has failed.\n" );
return 1;
}
@@ -21788,38 +22137,37 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
pAbc->pAbc8Ntl = pNtlNew;
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Scorr(): Reading BLIF has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scorr(): Reading BLIF has failed.\n" );
return 1;
}
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Scorr(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Scorr(): AIG extraction has failed.\n" );
return 1;
}
return 0;
usage:
- fprintf( stdout, "usage: *scorr [-PQFCLNSDVM <num>] [-pldsncvh]\n" );
- fprintf( stdout, "\t performs sequential sweep using K-step induction\n" );
- fprintf( stdout, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
- fprintf( stdout, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
- fprintf( stdout, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
- fprintf( stdout, "\t-C num : max number of conflicts at a node (0=inifinite) [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
- fprintf( stdout, "\t-N num : number of last POs treated as constraints (0=none) [default = %d]\n", pPars->nConstrs );
- fprintf( stdout, "\t-S num : additional simulation frames for c-examples (0=none) [default = %d]\n", pPars->nFramesAddSim );
- fprintf( stdout, "\t-D num : min size of a clock domain used for synthesis [default = %d]\n", pPars->nMinDomSize );
- fprintf( stdout, "\t-V num : min var num needed to recycle the SAT solver [default = %d]\n", pPars->nSatVarMax2 );
- fprintf( stdout, "\t-M num : min call num needed to recycle the SAT solver [default = %d]\n", pPars->nRecycleCalls2 );
- fprintf( stdout, "\t-p : toggle alighning polarity of SAT variables [default = %s]\n", pPars->fPolarFlip? "yes": "no" );
- fprintf( stdout, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
- fprintf( stdout, "\t-d : toggle dynamic addition of constraints [default = %s]\n", pPars->fDynamic? "yes": "no" );
- fprintf( stdout, "\t-s : toggle local simulation in the cone of influence [default = %s]\n", pPars->fLocalSim? "yes": "no" );
- fprintf( stdout, "\t-n : toggle using new AIG package [default = %s]\n", pPars->fScorrGia? "yes": "no" );
- fprintf( stdout, "\t-c : toggle using new AIG package and SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *scorr [-PQFCLSDVM <num>] [-pldsncvh]\n" );
+ Abc_Print( -2, "\t performs sequential sweep using K-step induction\n" );
+ Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+ Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+ Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+ Abc_Print( -2, "\t-C num : max number of conflicts at a node (0=inifinite) [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+ Abc_Print( -2, "\t-S num : additional simulation frames for c-examples (0=none) [default = %d]\n", pPars->nFramesAddSim );
+ Abc_Print( -2, "\t-D num : min size of a clock domain used for synthesis [default = %d]\n", pPars->nMinDomSize );
+ Abc_Print( -2, "\t-V num : min var num needed to recycle the SAT solver [default = %d]\n", pPars->nSatVarMax2 );
+ Abc_Print( -2, "\t-M num : min call num needed to recycle the SAT solver [default = %d]\n", pPars->nRecycleCalls2 );
+ Abc_Print( -2, "\t-p : toggle alighning polarity of SAT variables [default = %s]\n", pPars->fPolarFlip? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggle dynamic addition of constraints [default = %s]\n", pPars->fDynamic? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle local simulation in the cone of influence [default = %s]\n", pPars->fLocalSim? "yes": "no" );
+ Abc_Print( -2, "\t-n : toggle using new AIG package [default = %s]\n", pPars->fScorrGia? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle using new AIG package and SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -21836,15 +22184,11 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- void * pNtlTemp;
+ Ntl_Man_t * pNtlTemp;
int Counter;
int fMapped;
int fVerbose;
int c;
- extern int Ntl_ManSweep( void * p, int fVerbose );
- extern void * Ntl_ManInsertNtk( void * p, void * pNtk );
- extern Aig_Man_t * Ntl_ManExtract( void * p );
- extern void * Ntl_ManExtractNwk( void * p, Aig_Man_t * pAig, Tim_Man_t * pManTime );
// set defaults
fMapped = 0;
@@ -21868,7 +22212,7 @@ int Abc_CommandAbc8Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Sweep(): There is no design to sweep.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Sweep(): There is no design to sweep.\n" );
return 1;
}
@@ -21877,13 +22221,13 @@ int Abc_CommandAbc8Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Sweep(): There is no mapped network to sweep.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Sweep(): There is no mapped network to sweep.\n" );
return 1;
}
pNtlTemp = Ntl_ManInsertNtk( pAbc->pAbc8Ntl, pAbc->pAbc8Nwk );
if ( pNtlTemp == NULL )
{
- printf( "Abc_CommandAbc8Sweep(): Inserting mapped network has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Sweep(): Inserting mapped network has failed.\n" );
return 1;
}
Abc_FrameClearDesign();
@@ -21893,7 +22237,7 @@ int Abc_CommandAbc8Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
// sweep the current design
Counter = Ntl_ManSweep( pAbc->pAbc8Ntl, fVerbose );
if ( Counter == 0 && fVerbose )
- printf( "The netlist is unchanged by sweep.\n" );
+ Abc_Print( -1, "The netlist is unchanged by sweep.\n" );
// if mapped, create new AIG and new mapped network
if ( fMapped )
@@ -21901,13 +22245,13 @@ int Abc_CommandAbc8Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Sweep(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Sweep(): AIG extraction has failed.\n" );
return 1;
}
pAbc->pAbc8Nwk = Ntl_ManExtractNwk( pAbc->pAbc8Ntl, pAbc->pAbc8Aig, NULL );
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Sweep(): Failed to extract the mapped network.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Sweep(): Failed to extract the mapped network.\n" );
return 1;
}
}
@@ -21920,19 +22264,19 @@ int Abc_CommandAbc8Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
pAbc->pAbc8Aig = Ntl_ManExtract( pAbc->pAbc8Ntl );
if ( pAbc->pAbc8Aig == NULL )
{
- printf( "Abc_CommandAbc8Sweep(): AIG extraction has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Sweep(): AIG extraction has failed.\n" );
return 1;
}
}
return 0;
usage:
- fprintf( stdout, "usage: *sw [-mvh]\n" );
- fprintf( stdout, "\t performs structural sweep of the netlist\n" );
- fprintf( stdout, "\t removes dangling nodes, registers, and white-boxes\n" );
- fprintf( stdout, "\t-m : inserts mapped network into netlist and sweeps it [default = %s]\n", fMapped? "yes": "no" );
- fprintf( stdout, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *sw [-mvh]\n" );
+ Abc_Print( -2, "\t performs structural sweep of the netlist\n" );
+ Abc_Print( -2, "\t removes dangling nodes, registers, and white-boxes\n" );
+ Abc_Print( -2, "\t-m : inserts mapped network into netlist and sweeps it [default = %s]\n", fMapped? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -21949,10 +22293,9 @@ usage:
***********************************************************************/
int Abc_CommandAbc8Zero( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- void * pNtlNew;
+ Ntl_Man_t * pNtlNew;
int fVerbose;
int c;
- extern void Ntl_ManTransformInitValues( void * p );
// set defaults
fVerbose = 0;
@@ -21972,7 +22315,7 @@ int Abc_CommandAbc8Zero( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Zero(): There is no design to convert.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Zero(): There is no design to convert.\n" );
return 1;
}
@@ -21987,10 +22330,10 @@ int Abc_CommandAbc8Zero( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *zero [-h]\n" );
- fprintf( stdout, "\t converts registers to have constant-0 initial value\n" );
- fprintf( stdout, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: *zero [-h]\n" );
+ Abc_Print( -2, "\t converts registers to have constant-0 initial value\n" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22008,7 +22351,7 @@ usage:
int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Aig_Man_t * pAig1, * pAig2;
- void * pTemp1, * pTemp2;
+ Ntl_Man_t * pTemp1, * pTemp2;
char ** pArgvNew;
int nArgcNew;
int c;
@@ -22016,14 +22359,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
int nConfLimit;
int fSmart;
int nPartSize;
- extern Aig_Man_t * Ntl_ManCollapse( void * p, int fSeq );
- extern void * Ntl_ManDup( void * pOld );
- extern void Ntl_ManFree( void * p );
- extern void * Ntl_ManInsertNtk( void * p, void * pNtk );
-
- extern void Ntl_ManPrepareCecMans( void * pMan1, void * pMan2, Aig_Man_t ** ppAig1, Aig_Man_t ** ppAig2 );
- extern void Ntl_ManPrepareCec( char * pFileName1, char * pFileName2, Aig_Man_t ** ppMan1, Aig_Man_t ** ppMan2 );
- extern int Fra_FraigCecTop( Aig_Man_t * pMan1, Aig_Man_t * pMan2, int nConfLimit, int nPartSize, int fSmart, int fVerbose );
+ extern int Fra_FraigCecTop( Aig_Man_t * pMan1, Aig_Man_t * pMan2, int nConfLimit, int nPartSize, int fSmart, int fVerbose );
// set defaults
nConfLimit = 100000;
@@ -22038,7 +22374,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nConfLimit = atoi(argv[globalUtilOptind]);
@@ -22049,7 +22385,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
nPartSize = atoi(argv[globalUtilOptind]);
@@ -22072,7 +22408,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew = argc - globalUtilOptind;
if ( nArgcNew != 0 && nArgcNew != 2 )
{
- printf( "Currently can only compare current mapped network against the spec, or designs derived from two files.\n" );
+ Abc_Print( -1, "Currently can only compare current mapped network against the spec, or designs derived from two files.\n" );
return 0;
}
if ( nArgcNew == 2 )
@@ -22088,15 +22424,15 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pAbc->pAbc8Ntl == NULL )
{
- printf( "Abc_CommandAbc8Cec(): There is no design to verify.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Cec(): There is no design to verify.\n" );
return 1;
}
if ( pAbc->pAbc8Nwk == NULL )
{
- printf( "Abc_CommandAbc8Cec(): There is no mapped network to verify.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Cec(): There is no mapped network to verify.\n" );
return 1;
}
-// printf( "Currently *cec works only for two designs given on command line.\n" );
+// Abc_Print( -1, "Currently *cec works only for two designs given on command line.\n" );
// insert the mapped network
pTemp1 = Ntl_ManDup( pAbc->pAbc8Ntl );
@@ -22104,7 +22440,7 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pTemp2 == NULL )
{
Ntl_ManFree( pTemp1 );
- printf( "Abc_CommandAbc8Cec(): Inserting the design has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc8Cec(): Inserting the design has failed.\n" );
return 1;
}
Ntl_ManPrepareCecMans( pTemp1, pTemp2, &pAig1, &pAig2 );
@@ -22118,17 +22454,17 @@ int Abc_CommandAbc8Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *cec [-C num] [-P num] [-svh] <file1> <file2>\n" );
- fprintf( stdout, "\t performs combinational equivalence checking\n" );
- fprintf( stdout, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
- fprintf( stdout, "\t-P num : the partition size for partitioned CEC [default = %d]\n", nPartSize );
- fprintf( stdout, "\t-s : toggle smart and natural output partitioning [default = %s]\n", fSmart? "smart": "natural" );
- fprintf( stdout, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
- fprintf( stdout, "\tfile1 : (optional) the file with the first network\n");
- fprintf( stdout, "\tfile2 : (optional) the file with the second network\n");
- fprintf( stdout, "\t if no files are given, uses the current network and its spec\n");
- fprintf( stdout, "\t if two files are given, compares designs derived from files\n");
+ Abc_Print( -2, "usage: *cec [-C num] [-P num] [-svh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs combinational equivalence checking\n" );
+ Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+ Abc_Print( -2, "\t-P num : the partition size for partitioned CEC [default = %d]\n", nPartSize );
+ Abc_Print( -2, "\t-s : toggle smart and natural output partitioning [default = %s]\n", fSmart? "smart": "natural" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
+ Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
+ Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+ Abc_Print( -2, "\t if two files are given, compares designs derived from files\n");
return 1;
}
@@ -22153,7 +22489,6 @@ int Abc_CommandAbc8DSec( Abc_Frame_t * pAbc, int argc, char ** argv )
extern void Fra_SecSetDefaultParams( Fra_Sec_t * pSecPar );
extern int Fra_FraigSec( Aig_Man_t * p, Fra_Sec_t * pSecPar, Aig_Man_t ** ppResult );
- extern Aig_Man_t * Ntl_ManPrepareSec( char * pFileName1, char * pFileName2 );
// set defaults
Fra_SecSetDefaultParams( pSecPar );
@@ -22169,7 +22504,7 @@ int Abc_CommandAbc8DSec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
@@ -22204,7 +22539,7 @@ int Abc_CommandAbc8DSec( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew = argc - globalUtilOptind;
if ( nArgcNew != 2 )
{
- printf( "Only works for two designs written from files specified on the command line.\n" );
+ Abc_Print( -1, "Only works for two designs written from files specified on the command line.\n" );
return 1;
}
@@ -22216,20 +22551,77 @@ int Abc_CommandAbc8DSec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: *dsec [-F num] [-armfwvh] <file1> <file2>\n" );
- fprintf( stdout, "\t performs sequential equivalence checking for two designs\n" );
- fprintf( stdout, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
- fprintf( stdout, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
- fprintf( stdout, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
- fprintf( stdout, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
- fprintf( stdout, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
- fprintf( stdout, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
- fprintf( stdout, "\tfile1 : the file with the first design\n");
- fprintf( stdout, "\tfile2 : the file with the second design\n");
-// fprintf( stdout, "\t if no files are given, uses the current network and its spec\n");
-// fprintf( stdout, "\t if one file is given, uses the current network and the file\n");
+ Abc_Print( -2, "usage: *dsec [-F num] [-armfwvh] <file1> <file2>\n" );
+ Abc_Print( -2, "\t performs sequential equivalence checking for two designs\n" );
+ Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
+ Abc_Print( -2, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\tfile1 : the file with the first design\n");
+ Abc_Print( -2, "\tfile2 : the file with the second design\n");
+// Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
+// Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
+ return 1;
+}
+
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbcTestNew( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern int Abc_NtkTestProcedure( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2 );
+
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ int c;
+
+ pNtk = Abc_FrameReadNtk(pAbc);
+
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+
+ if ( pNtk == NULL )
+ {
+ Abc_Print( -1, "Empty network.\n" );
+ return 1;
+ }
+
+ if ( !Abc_NtkIsStrash( pNtk) )
+ {
+ Abc_Print( -1, "The current network is not an AIG. Cannot continue.\n" );
+ return 1;
+ }
+
+// Abc_NtkTestProcedure( pNtk, NULL );
+
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: testnew [-h]\n" );
+ Abc_Print( -2, "\t new testing procedure\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22269,7 +22661,7 @@ int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew = argc - globalUtilOptind;
if ( nArgcNew != 1 )
{
- printf( "There is no file name.\n" );
+ Abc_Print( -1, "There is no file name.\n" );
return 1;
}
@@ -22281,31 +22673,24 @@ int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv )
*pTemp = '\\';
if ( (pFile = fopen( FileName, "r" )) == NULL )
{
- fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", ".blif", ".pla", ".eqn", ".bench" )) )
- fprintf( pAbc->Err, "Did you mean \"%s\"?", FileName );
- fprintf( pAbc->Err, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
pAig = Gia_ReadAiger( FileName, 0 );
- if ( pAig == NULL )
- {
- printf( "Reading AIGER has failed.\n" );
- return 0;
- }
- if ( pAbc->pAig )
- Gia_ManStop( pAbc->pAig );
- pAbc->pAig = pAig;
+ Abc_CommandUpdate9( pAbc, pAig );
return 0;
usage:
- fprintf( stdout, "usage: &r [-vh] <file>\n" );
- fprintf( stdout, "\t reads the current AIG from the AIGER file\n" );
- fprintf( stdout, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
- fprintf( stdout, "\t<file> : the file name\n");
+ Abc_Print( -2, "usage: &r [-vh] <file>\n" );
+ Abc_Print( -2, "\t reads the current AIG from the AIGER file\n" );
+ Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : the file name\n");
return 1;
}
@@ -22347,17 +22732,17 @@ int Abc_CommandAbc9Get( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pAbc->pNtkCur == NULL )
{
- printf( "There is no current network\n" );
+ Abc_Print( -1, "There is no current network\n" );
return 1;
}
if ( !Abc_NtkIsStrash( pAbc->pNtkCur ) )
{
- printf( "The current network should be strashed.\n" );
+ Abc_Print( -1, "The current network should be strashed.\n" );
return 1;
}
// if ( Abc_NtkGetChoiceNum(pAbc->pNtkCur) )
// {
-// printf( "Removing %d choices from the AIG.\n", Abc_NtkGetChoiceNum(pAbc->pNtkCur) );
+// Abc_Print( -1, "Removing %d choices from the AIG.\n", Abc_NtkGetChoiceNum(pAbc->pNtkCur) );
// Abc_AigCleanup(pAbc->pNtkCur->pManFunc);
// }
if ( Abc_NtkGetChoiceNum(pAbc->pNtkCur) )
@@ -22366,14 +22751,7 @@ int Abc_CommandAbc9Get( Abc_Frame_t * pAbc, int argc, char ** argv )
pMan = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
pAig = Gia_ManFromAig( pMan );
Aig_ManStop( pMan );
- if ( pAig == NULL )
- {
- printf( "Transferring AIG has failed.\n" );
- return 0;
- }
- if ( pAbc->pAig )
- Gia_ManStop( pAbc->pAig );
- pAbc->pAig = pAig;
+ Abc_CommandUpdate9( pAbc, pAig );
if ( fNames )
{
pAig->vNamesIn = Abc_NtkCollectCiNames( pAbc->pNtkCur );
@@ -22382,12 +22760,12 @@ int Abc_CommandAbc9Get( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: &get [-nvh] <file>\n" );
- fprintf( stdout, "\t converts the network into an AIG and moves to the new ABC\n" );
- fprintf( stdout, "\t-n : toggles saving CI/CO names of the AIG [default = %s]\n", fNames? "yes": "no" );
- fprintf( stdout, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
- fprintf( stdout, "\t<file> : the file name\n");
+ Abc_Print( -2, "usage: &get [-nvh] <file>\n" );
+ Abc_Print( -2, "\t converts the network into an AIG and moves to the new ABC\n" );
+ Abc_Print( -2, "\t-n : toggles saving CI/CO names of the AIG [default = %s]\n", fNames? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : the file name\n");
return 1;
}
@@ -22407,14 +22785,13 @@ int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan );
extern Abc_Ntk_t * Abc_NtkFromDarChoices( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan );
Aig_Man_t * pMan;
- FILE * pOut, * pErr;
- Abc_Ntk_t * pNtk;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
int fVerbose;
pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
+
+
// set defaults
fVerbose = 0;
@@ -22432,14 +22809,14 @@ int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- fprintf( pErr, "Empty network.\n" );
+ Abc_Print( -1, "Empty network.\n" );
return 1;
}
- if ( Gia_ManHasDandling(pAbc->pAig) == 0 )
+ if ( Gia_ManHasDangling(pAbc->pGia) == 0 )
{
- pMan = Gia_ManToAig( pAbc->pAig, 0 );
+ pMan = Gia_ManToAig( pAbc->pGia, 0 );
pNtk = Abc_NtkFromAigPhase( pMan );
pNtk->pName = Extra_UtilStrsav(pMan->pName);
Aig_ManStop( pMan );
@@ -22447,27 +22824,28 @@ int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
else
{
Abc_Ntk_t * pNtkNoCh;
-// printf( "Transforming AIG with %d choice nodes.\n", Gia_ManEquivCountClasses(pAbc->pAig) );
+// Abc_Print( -1, "Transforming AIG with %d choice nodes.\n", Gia_ManEquivCountClasses(pAbc->pGia) );
// create network without choices
- pMan = Gia_ManToAig( pAbc->pAig, 0 );
+ pMan = Gia_ManToAig( pAbc->pGia, 0 );
pNtkNoCh = Abc_NtkFromAigPhase( pMan );
pNtkNoCh->pName = Extra_UtilStrsav(pMan->pName);
Aig_ManStop( pMan );
// derive network with choices
- pMan = Gia_ManToAig( pAbc->pAig, 1 );
+ pMan = Gia_ManToAig( pAbc->pGia, 1 );
pNtk = Abc_NtkFromDarChoices( pNtkNoCh, pMan );
Abc_NtkDelete( pNtkNoCh );
Aig_ManStop( pMan );
}
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
- fprintf( pErr, "usage: &put [-vh]\n" );
- fprintf( pErr, "\t transfer the current network into the old ABC\n" );
- fprintf( pErr, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &put [-vh]\n" );
+ Abc_Print( -2, "\t transfer the current network into the old ABC\n" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22503,24 +22881,24 @@ int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew = argc - globalUtilOptind;
if ( nArgcNew != 1 )
{
- printf( "There is no file name.\n" );
+ Abc_Print( -1, "There is no file name.\n" );
return 1;
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Write(): There is no AIG to write.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Write(): There is no AIG to write.\n" );
return 1;
}
// create the design to write
pFileName = argv[globalUtilOptind];
- Gia_WriteAiger( pAbc->pAig, pFileName, 0, 0 );
+ Gia_WriteAiger( pAbc->pGia, pFileName, 0, 0 );
return 0;
usage:
- fprintf( stdout, "usage: &w [-h] <file>\n" );
- fprintf( stdout, "\t writes the current AIG into the AIGER file\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
- fprintf( stdout, "\t<file> : the file name\n");
+ Abc_Print( -2, "usage: &w [-h] <file>\n" );
+ Abc_Print( -2, "\t writes the current AIG into the AIGER file\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : the file name\n");
return 1;
}
@@ -22553,19 +22931,19 @@ int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Ps(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Ps(): There is no AIG.\n" );
return 1;
}
- Gia_ManPrintStats( pAbc->pAig, fSwitch );
+ Gia_ManPrintStats( pAbc->pGia, fSwitch );
return 0;
usage:
- fprintf( stdout, "usage: &ps [-ph]\n" );
- fprintf( stdout, "\t prints stats of the current AIG\n" );
- fprintf( stdout, "\t-p : toggle printing switching activity [default = %s]\n", fSwitch? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &ps [-ph]\n" );
+ Abc_Print( -2, "\t prints stats of the current AIG\n" );
+ Abc_Print( -2, "\t-p : toggle printing switching activity [default = %s]\n", fSwitch? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22592,7 +22970,7 @@ int Abc_CommandAbc9PFan( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nNodes = atoi(argv[globalUtilOptind]);
@@ -22606,19 +22984,19 @@ int Abc_CommandAbc9PFan( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9PFan(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9PFan(): There is no AIG.\n" );
return 1;
}
- Gia_ManPrintFanio( pAbc->pAig, nNodes );
+ Gia_ManPrintFanio( pAbc->pGia, nNodes );
return 0;
usage:
- fprintf( stdout, "usage: &pfan [-N num] [-h]\n" );
- fprintf( stdout, "\t prints fanin/fanout statistics\n" );
- fprintf( stdout, "\t-N num : the number of high-fanout nodes to explore [default = %d]\n", nNodes );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &pfan [-N num] [-h]\n" );
+ Abc_Print( -2, "\t prints fanin/fanout statistics\n" );
+ Abc_Print( -2, "\t-N num : the number of high-fanout nodes to explore [default = %d]\n", nNodes );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22651,24 +23029,24 @@ int Abc_CommandAbc9PSig( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9PSigs(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9PSigs(): There is no AIG.\n" );
return 1;
}
- if ( Gia_ManRegNum(pAbc->pAig) == 0 )
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
{
- printf( "Abc_CommandAbc9PSigs(): Works only for sequential circuits.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9PSigs(): Works only for sequential circuits.\n" );
return 1;
}
- Gia_ManDetectSeqSignals( pAbc->pAig, fSetReset, 1 );
+ Gia_ManDetectSeqSignals( pAbc->pGia, fSetReset, 1 );
return 0;
usage:
- fprintf( stdout, "usage: &psig [-rh]\n" );
- fprintf( stdout, "\t prints enable/set/reset statistics\n" );
- fprintf( stdout, "\t-r : toggle printing set/reset signals [default = %s]\n", fSetReset? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &psig [-rh]\n" );
+ Abc_Print( -2, "\t prints enable/set/reset statistics\n" );
+ Abc_Print( -2, "\t-r : toggle printing set/reset signals [default = %s]\n", fSetReset? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22697,18 +23075,18 @@ int Abc_CommandAbc9Status( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Status(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Status(): There is no AIG.\n" );
return 1;
}
- Gia_ManPrintMiterStatus( pAbc->pAig );
+ Gia_ManPrintMiterStatus( pAbc->pGia );
return 0;
usage:
- fprintf( stdout, "usage: &status [-h]\n" );
- fprintf( stdout, "\t prints status of the miter\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &status [-h]\n" );
+ Abc_Print( -2, "\t prints status of the miter\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22738,20 +23116,20 @@ int Abc_CommandAbc9Show( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Show(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Show(): There is no AIG.\n" );
return 1;
}
- pMan = Gia_ManToAig( pAbc->pAig, 0 );
+ pMan = Gia_ManToAig( pAbc->pGia, 0 );
Aig_ManShow( pMan, 0, NULL );
Aig_ManStop( pMan );
return 0;
usage:
- fprintf( stdout, "usage: &show [-h]\n" );
- fprintf( stdout, "\t shows the current AIG using GSView\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &show [-h]\n" );
+ Abc_Print( -2, "\t shows the current AIG using GSView\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22785,20 +23163,20 @@ int Abc_CommandAbc9Hash( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Hash(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Hash(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Gia_ManRehash( pTemp = pAbc->pAig, fAddStrash );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManRehash( pAbc->pGia, fAddStrash );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &st [-ah]\n" );
- fprintf( stdout, "\t performs structural hashing\n" );
- fprintf( stdout, "\t-a : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &st [-ah]\n" );
+ Abc_Print( -2, "\t performs structural hashing\n" );
+ Abc_Print( -2, "\t-a : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22831,25 +23209,25 @@ int Abc_CommandAbc9Topand( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Topand(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Topand(): There is no AIG.\n" );
return 1;
}
- if ( Gia_ManRegNum(pAbc->pAig) > 0 )
+ if ( Gia_ManRegNum(pAbc->pGia) > 0 )
{
- printf( "Abc_CommandAbc9Topand(): Can only be applied to a combinational miter.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Topand(): Can only be applied to a combinational miter.\n" );
return 1;
}
- pAbc->pAig = Gia_ManDupTopAnd( pTemp = pAbc->pAig, fVerbose );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManDupTopAnd( pAbc->pGia, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &topand [-vh]\n" );
- fprintf( stdout, "\t performs AND decomposition for combinational miter\n" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &topand [-vh]\n" );
+ Abc_Print( -2, "\t performs AND decomposition for combinational miter\n" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22877,7 +23255,7 @@ int Abc_CommandAbc9Cof( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'V':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-V\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
goto usage;
}
iVar = atoi(argv[globalUtilOptind]);
@@ -22888,7 +23266,7 @@ int Abc_CommandAbc9Cof( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nLimFan = atoi(argv[globalUtilOptind]);
@@ -22905,42 +23283,37 @@ int Abc_CommandAbc9Cof( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Cof(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Cof(): There is no AIG.\n" );
return 1;
}
if ( nLimFan )
{
- printf( "Cofactoring all variables whose fanout count is higher than %d.\n", nLimFan );
- pAbc->pAig = Gia_ManDupCofAll( pTemp = pAbc->pAig, nLimFan, fVerbose );
+ Abc_Print( -1, "Cofactoring all variables whose fanout count is higher than %d.\n", nLimFan );
+ pTemp = Gia_ManDupCofAll( pAbc->pGia, nLimFan, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
}
else if ( iVar )
{
- printf( "Cofactoring one variable with object ID %d.\n", iVar );
- pAbc->pAig = Gia_ManDupCof( pTemp = pAbc->pAig, iVar );
+ Abc_Print( -1, "Cofactoring one variable with object ID %d.\n", iVar );
+ pTemp = Gia_ManDupCof( pAbc->pGia, iVar );
+ Abc_CommandUpdate9( pAbc, pTemp );
}
else
{
- printf( "One of the paramters, -V <num> or -L <num>, should be set on the command line.\n" );
+ Abc_Print( -1, "One of the paramters, -V <num> or -L <num>, should be set on the command line.\n" );
goto usage;
}
- if ( pAbc->pAig == NULL )
- {
- pAbc->pAig = pTemp;
- printf( "Abc_CommandAbc9Cof(): Transformation has failed.\n" );
- return 1;
- }
- Gia_ManStop( pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &cof [-VL num] [-vh]\n" );
- fprintf( stdout, "\t performs cofactoring w.r.t. variable(s)\n" );
- fprintf( stdout, "\t-V num : the zero-based ID of one variable to cofactor [default = %d]\n", iVar );
- fprintf( stdout, "\t-L num : cofactor vars with fanout count higher than this [default = %d]\n", nLimFan );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &cof [-VL num] [-vh]\n" );
+ Abc_Print( -2, "\t performs cofactoring w.r.t. variable(s)\n" );
+ Abc_Print( -2, "\t-V num : the zero-based ID of one variable to cofactor [default = %d]\n", iVar );
+ Abc_Print( -2, "\t-L num : cofactor vars with fanout count higher than this [default = %d]\n", nLimFan );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -22978,21 +23351,21 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Trim(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Trim(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Gia_ManDupTrimmed( pTemp = pAbc->pAig, fTrimCis, fTrimCos );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManDupTrimmed( pAbc->pGia, fTrimCis, fTrimCos );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &trim [-ioh]\n" );
- fprintf( stdout, "\t removes PIs without fanout and PO driven by constants\n" );
- fprintf( stdout, "\t-i : toggle removing PIs [default = %s]\n", fTrimCis? "yes": "no" );
- fprintf( stdout, "\t-o : toggle removing POs [default = %s]\n", fTrimCos? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &trim [-ioh]\n" );
+ Abc_Print( -2, "\t removes PIs without fanout and PO driven by constants\n" );
+ Abc_Print( -2, "\t-i : toggle removing PIs [default = %s]\n", fTrimCis? "yes": "no" );
+ Abc_Print( -2, "\t-o : toggle removing POs [default = %s]\n", fTrimCos? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23034,39 +23407,39 @@ int Abc_CommandAbc9Dfs( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Dfs(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Dfs(): There is no AIG.\n" );
return 1;
}
if ( fNormal )
{
- pAbc->pAig = Gia_ManDupOrderAiger( pTemp = pAbc->pAig );
+ pTemp = Gia_ManDupOrderAiger( pAbc->pGia );
if ( fVerbose )
- printf( "AIG objects are reordered as follows: CIs, ANDs, COs.\n" );
+ Abc_Print( -1, "AIG objects are reordered as follows: CIs, ANDs, COs.\n" );
}
else if ( fReverse )
{
- pAbc->pAig = Gia_ManDupOrderDfsReverse( pTemp = pAbc->pAig );
+ pTemp = Gia_ManDupOrderDfsReverse( pAbc->pGia );
if ( fVerbose )
- printf( "AIG objects are reordered in the reserve DFS order.\n" );
+ Abc_Print( -1, "AIG objects are reordered in the reserve DFS order.\n" );
}
else
{
- pAbc->pAig = Gia_ManDupOrderDfs( pTemp = pAbc->pAig );
+ pTemp = Gia_ManDupOrderDfs( pAbc->pGia );
if ( fVerbose )
- printf( "AIG objects are reordered in the DFS order.\n" );
+ Abc_Print( -1, "AIG objects are reordered in the DFS order.\n" );
}
- Gia_ManStop( pTemp );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &dfs [-nrvh]\n" );
- fprintf( stdout, "\t orders objects in the DFS order\n" );
- fprintf( stdout, "\t-n : toggle using normalized ordering [default = %s]\n", fNormal? "yes": "no" );
- fprintf( stdout, "\t-r : toggle using reverse DFS ordering [default = %s]\n", fReverse? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &dfs [-nrvh]\n" );
+ Abc_Print( -2, "\t orders objects in the DFS order\n" );
+ Abc_Print( -2, "\t-n : toggle using normalized ordering [default = %s]\n", fNormal? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle using reverse DFS ordering [default = %s]\n", fReverse? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23094,7 +23467,7 @@ int Abc_CommandAbc9Sim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWords = atoi(argv[globalUtilOptind]);
@@ -23105,7 +23478,7 @@ int Abc_CommandAbc9Sim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nIters = atoi(argv[globalUtilOptind]);
@@ -23116,7 +23489,7 @@ int Abc_CommandAbc9Sim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
pPars->TimeLimit = atoi(argv[globalUtilOptind]);
@@ -23136,23 +23509,28 @@ int Abc_CommandAbc9Sim( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Sim(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Sim(): There is no AIG.\n" );
return 1;
}
- Gia_ManSimSimulate( pAbc->pAig, pPars );
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
+ Gia_ManSimSimulate( pAbc->pGia, pPars );
return 0;
usage:
- fprintf( stdout, "usage: &sim [-WFT <num>] [-mvh]\n" );
- fprintf( stdout, "\t performs random simulation of the sequential miter\n" );
- fprintf( stdout, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
- fprintf( stdout, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nIters );
- fprintf( stdout, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
- fprintf( stdout, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &sim [-WFT <num>] [-mvh]\n" );
+ Abc_Print( -2, "\t performs random simulation of the sequential miter\n" );
+ Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
+ Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nIters );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23170,7 +23548,7 @@ usage:
int Abc_CommandAbc9Resim( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Cec_ParSim_t Pars, * pPars = &Pars;
- int c;
+ int c, RetValue;
Cec_ManSimSetDefaultParams( pPars );
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
@@ -23180,7 +23558,7 @@ int Abc_CommandAbc9Resim( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFrames = atoi(argv[globalUtilOptind]);
@@ -23200,21 +23578,24 @@ int Abc_CommandAbc9Resim( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Resim(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
return 1;
}
- Cec_ManSeqResimulateCounter( pAbc->pAig, pPars, pAbc->pCex );
+ RetValue = Cec_ManSeqResimulateCounter( pAbc->pGia, pPars, pAbc->pCex );
+ pAbc->Status = RetValue ? 0 : -1;
+ pAbc->nFrames = pAbc->pCex->iFrame;
+// Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
return 0;
usage:
- fprintf( stdout, "usage: &resim [-F <num>] [-mvh]\n" );
- fprintf( stdout, "\t resimulates equivalence classes using counter-example\n" );
- fprintf( stdout, "\t-F num : the number of additinal frames to simulate [default = %d]\n", pPars->nFrames );
- fprintf( stdout, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &resim [-F <num>] [-mvh]\n" );
+ Abc_Print( -2, "\t resimulates equivalence classes using counter-example\n" );
+ Abc_Print( -2, "\t-F num : the number of additinal frames to simulate [default = %d]\n", pPars->nFrames );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23246,7 +23627,7 @@ int Abc_CommandAbc9SpecI( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
nFrames = atoi(argv[globalUtilOptind]);
@@ -23257,7 +23638,7 @@ int Abc_CommandAbc9SpecI( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nBTLimit = atoi(argv[globalUtilOptind]);
@@ -23280,23 +23661,23 @@ int Abc_CommandAbc9SpecI( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9SpecI(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9SpecI(): There is no AIG.\n" );
return 1;
}
- Gia_CommandSpecI( pAbc->pAig, nFrames, nBTLimit, fUseStart, fCheckMiter, fVerbose );
+ Gia_CommandSpecI( pAbc->pGia, nFrames, nBTLimit, fUseStart, fCheckMiter, fVerbose );
return 0;
usage:
- fprintf( stdout, "usage: &speci [-FC <num>] [-fmvh]\n" );
- fprintf( stdout, "\t refines equivalence classes using speculative reduction\n" );
- fprintf( stdout, "\t-F num : the max number of time frames [default = %d]\n", nFrames );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
- fprintf( stdout, "\t-f : toggle starting BMC from a later frame [default = %s]\n", fUseStart? "yes": "no" );
- fprintf( stdout, "\t-m : toggle miter vs. any circuit [default = %s]\n", fCheckMiter? "miter": "circuit" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &speci [-FC <num>] [-fmvh]\n" );
+ Abc_Print( -2, "\t refines equivalence classes using speculative reduction\n" );
+ Abc_Print( -2, "\t-F num : the max number of time frames [default = %d]\n", nFrames );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
+ Abc_Print( -2, "\t-f : toggle starting BMC from a later frame [default = %s]\n", fUseStart? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", fCheckMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23326,7 +23707,7 @@ int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWords = atoi(argv[globalUtilOptind]);
@@ -23337,7 +23718,7 @@ int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFrames = atoi(argv[globalUtilOptind]);
@@ -23348,7 +23729,7 @@ int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'R':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-R\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
goto usage;
}
pPars->nRounds = atoi(argv[globalUtilOptind]);
@@ -23359,7 +23740,7 @@ int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nNonRefines = atoi(argv[globalUtilOptind]);
@@ -23370,7 +23751,7 @@ int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
pPars->TimeLimit = atoi(argv[globalUtilOptind]);
@@ -23396,27 +23777,155 @@ int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Equiv(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Equiv(): There is no AIG.\n" );
return 1;
}
- Cec_ManSimulation( pAbc->pAig, pPars );
+ Cec_ManSimulation( pAbc->pGia, pPars );
return 0;
usage:
- fprintf( stdout, "usage: &equiv [-WFRST <num>] [-smdvh]\n" );
- fprintf( stdout, "\t computes candidate equivalence classes\n" );
- fprintf( stdout, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
- fprintf( stdout, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nFrames );
- fprintf( stdout, "\t-R num : the max number of simulation rounds [default = %d]\n", pPars->nRounds );
- fprintf( stdout, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
- fprintf( stdout, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
- fprintf( stdout, "\t-s : toggle seq vs. comb simulation [default = %s]\n", pPars->fSeqSimulate? "yes": "no" );
- fprintf( stdout, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
- fprintf( stdout, "\t-d : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &equiv [-WFRST <num>] [-smdvh]\n" );
+ Abc_Print( -2, "\t computes candidate equivalence classes\n" );
+ Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
+ Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nFrames );
+ Abc_Print( -2, "\t-R num : the max number of simulation rounds [default = %d]\n", pPars->nRounds );
+ Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+ Abc_Print( -2, "\t-s : toggle seq vs. comb simulation [default = %s]\n", pPars->fSeqSimulate? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-d : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Equiv2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern void Ssw_SignalFilterGia( Gia_Man_t * p, int nFramesMax, int nConfMax, int nRounds, int TimeLimit, int TimeLimit2, Abc_Cex_t * pCex, int fVerbose );
+ int nFramesMax = 20;
+ int nConfMax = 500;
+ int nRounds = 10;
+ int TimeLimit = 0;
+ int TimeLimit2 = 0;
+ int fUseCex = 0;
+ int fVerbose = 0;
+ int c;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "FCRTSxvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nFramesMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nFramesMax < 0 )
+ goto usage;
+ break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nConfMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nConfMax < 0 )
+ goto usage;
+ break;
+ case 'R':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nRounds = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nRounds < 0 )
+ goto usage;
+ break;
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ TimeLimit = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( TimeLimit < 0 )
+ goto usage;
+ break;
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ TimeLimit2 = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( TimeLimit2 < 0 )
+ goto usage;
+ break;
+ case 'x':
+ fUseCex ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Equiv2(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( fUseCex )
+ {
+ if ( pAbc->pCex->nPis != Gia_ManPiNum(pAbc->pGia) )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Equiv2(): The number of PIs differs in cex (%d) and in AIG (%d).\n",
+ pAbc->pCex->nPis, Gia_ManPiNum(pAbc->pGia) );
+ return 1;
+ }
+ }
+ Ssw_SignalFilterGia( pAbc->pGia, nFramesMax, nConfMax, nRounds, TimeLimit, TimeLimit2, fUseCex? pAbc->pCex: NULL, fVerbose );
+ pAbc->Status = -1;
+// pAbc->nFrames = pAbc->pCex->iFrame;
+// Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &equiv2 [-FCRTS <num>] [-xvh]\n" );
+ Abc_Print( -2, "\t computes candidate equivalence classes\n" );
+ Abc_Print( -2, "\t-F num : the max number of frames for BMC [default = %d]\n", nFramesMax );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
+ Abc_Print( -2, "\t-R num : the max number of BMC rounds [default = %d]\n", nRounds );
+ Abc_Print( -2, "\t-T num : runtime limit in seconds for all rounds [default = %d]\n", TimeLimit );
+ Abc_Print( -2, "\t-S num : runtime limit in seconds for one round [default = %d]\n", TimeLimit2 );
+ Abc_Print( -2, "\t-x : toggle using the current cex to perform refinement [default = %s]\n", fUseCex? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23444,7 +23953,7 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWords = atoi(argv[globalUtilOptind]);
@@ -23455,7 +23964,7 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'R':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-R\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
goto usage;
}
pPars->nRounds = atoi(argv[globalUtilOptind]);
@@ -23466,7 +23975,7 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFrames = atoi(argv[globalUtilOptind]);
@@ -23477,7 +23986,7 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nNonRefines = atoi(argv[globalUtilOptind]);
@@ -23488,7 +23997,7 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'M':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-M\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pPars->nMinOutputs = atoi(argv[globalUtilOptind]);
@@ -23499,7 +24008,7 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -23510,7 +24019,7 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
pPars->TimeLimit = atoi(argv[globalUtilOptind]);
@@ -23533,28 +24042,28 @@ int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Resim(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
return 1;
}
- Cec_ManSeqSemiformal( pAbc->pAig, pPars );
+ Cec_ManSeqSemiformal( pAbc->pGia, pPars );
return 0;
usage:
- fprintf( stdout, "usage: &semi [-WRFSMCT <num>] [-mdvh]\n" );
- fprintf( stdout, "\t performs semiformal refinement of equivalence classes\n" );
- fprintf( stdout, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
- fprintf( stdout, "\t-R num : the max number of rounds to simulate [default = %d]\n", pPars->nRounds );
- fprintf( stdout, "\t-F num : the max number of frames to unroll [default = %d]\n", pPars->nFrames );
- fprintf( stdout, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
- fprintf( stdout, "\t-M num : the min number of outputs of bounded SRM [default = %d]\n", pPars->nMinOutputs );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
- fprintf( stdout, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
- fprintf( stdout, "\t-d : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &semi [-WRFSMCT <num>] [-mdvh]\n" );
+ Abc_Print( -2, "\t performs semiformal refinement of equivalence classes\n" );
+ Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
+ Abc_Print( -2, "\t-R num : the max number of rounds to simulate [default = %d]\n", pPars->nRounds );
+ Abc_Print( -2, "\t-F num : the max number of frames to unroll [default = %d]\n", pPars->nFrames );
+ Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
+ Abc_Print( -2, "\t-M num : the min number of outputs of bounded SRM [default = %d]\n", pPars->nMinOutputs );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-d : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23582,7 +24091,7 @@ int Abc_CommandAbc9Times( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
nTimes = atoi(argv[globalUtilOptind]);
@@ -23599,21 +24108,21 @@ int Abc_CommandAbc9Times( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Times(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Times(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Gia_ManDupTimes( pTemp = pAbc->pAig, nTimes );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManDupTimes( pAbc->pGia, nTimes );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &times [-N <num>] [-vh]\n" );
- fprintf( stdout, "\t creates several \"parallel\" copies of the design\n" );
- fprintf( stdout, "\t-N num : number of copies to create [default = %d]\n", nTimes );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &times [-N <num>] [-vh]\n" );
+ Abc_Print( -2, "\t creates several \"parallel\" copies of the design\n" );
+ Abc_Print( -2, "\t-N num : number of copies to create [default = %d]\n", nTimes );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23643,7 +24152,7 @@ int Abc_CommandAbc9Frames( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFrames = atoi(argv[globalUtilOptind]);
@@ -23654,7 +24163,7 @@ int Abc_CommandAbc9Frames( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
nCofFanLit = atoi(argv[globalUtilOptind]);
@@ -23674,26 +24183,31 @@ int Abc_CommandAbc9Frames( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Frames(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Frames(): There is no AIG.\n" );
return 1;
}
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
if ( nCofFanLit )
- pAbc->pAig = Gia_ManUnrollAndCofactor( pTemp = pAbc->pAig, pPars->nFrames, nCofFanLit, pPars->fVerbose );
+ pTemp = Gia_ManUnrollAndCofactor( pAbc->pGia, pPars->nFrames, nCofFanLit, pPars->fVerbose );
else
- pAbc->pAig = Gia_ManFrames( pTemp = pAbc->pAig, pPars );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManFrames( pAbc->pGia, pPars );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &frames [-FL <num>] [-ivh]\n" );
- fprintf( stdout, "\t unrolls the design for several timeframes\n" );
- fprintf( stdout, "\t-F num : the number of frames to unroll [default = %d]\n", pPars->nFrames );
- fprintf( stdout, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
- fprintf( stdout, "\t-i : toggle initializing registers [default = %s]\n", pPars->fInit? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &frames [-FL <num>] [-ivh]\n" );
+ Abc_Print( -2, "\t unrolls the design for several timeframes\n" );
+ Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", pPars->nFrames );
+ Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
+ Abc_Print( -2, "\t-i : toggle initializing registers [default = %s]\n", pPars->fInit? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23722,7 +24236,7 @@ int Abc_CommandAbc9Retime( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
nMaxIters = atoi(argv[globalUtilOptind]);
@@ -23739,21 +24253,26 @@ int Abc_CommandAbc9Retime( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Retime(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Retime(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Gia_ManRetimeForward( pTemp = pAbc->pAig, nMaxIters, fVerbose );
- Gia_ManStop( pTemp );
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
+ pTemp = Gia_ManRetimeForward( pAbc->pGia, nMaxIters, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &retime [-N <num>] [-vh]\n" );
- fprintf( stdout, "\t performs most-forward retiming\n" );
- fprintf( stdout, "\t-N num : the number of incremental iterations [default = %d]\n", nMaxIters );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &retime [-N <num>] [-vh]\n" );
+ Abc_Print( -2, "\t performs most-forward retiming\n" );
+ Abc_Print( -2, "\t-N num : the number of incremental iterations [default = %d]\n", nMaxIters );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23791,24 +24310,187 @@ int Abc_CommandAbc9Enable( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Enable(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Enable(): There is no AIG.\n" );
return 1;
}
if ( fRemove )
- pAbc->pAig = Gia_ManRemoveEnables( pTemp = pAbc->pAig );
+ pTemp = Gia_ManRemoveEnables( pAbc->pGia );
else
- pAbc->pAig = Gia_ManDupSelf( pTemp = pAbc->pAig );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManDupSelf( pAbc->pGia );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &enable [-rvh]\n" );
- fprintf( stdout, "\t adds or removes flop enable signals\n" );
- fprintf( stdout, "\t-r : toggle adding vs. removing enables [default = %s]\n", fRemove? "remove": "add" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &enable [-rvh]\n" );
+ Abc_Print( -2, "\t adds or removes flop enable signals\n" );
+ Abc_Print( -2, "\t-r : toggle adding vs. removing enables [default = %s]\n", fRemove? "remove": "add" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Dc2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_Man_t * pTemp;
+ int c, fVerbose = 0;
+ int fUpdateLevel = 1;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'l':
+ fUpdateLevel ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Dc2(): There is no AIG.\n" );
+ return 1;
+ }
+ pTemp = Gia_ManCompress2( pAbc->pGia, fUpdateLevel, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &dc2 [-lvh]\n" );
+ Abc_Print( -2, "\t performs heavy rewriting of the AIG\n" );
+ Abc_Print( -2, "\t-l : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Bidec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_Man_t * pTemp;
+ int c, fVerbose = 0;
+ int fUpdateLevel = 1;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'l':
+ fUpdateLevel ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Bidec(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( pAbc->pGia->pMapping == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Bidec(): Mapping of the AIG is not defined.\n" );
+ return 1;
+ }
+ pTemp = Gia_ManPerformBidec( pAbc->pGia, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &bidec [-vh]\n" );
+ Abc_Print( -2, "\t performs heavy rewriting of the AIG\n" );
+// Abc_Print( -2, "\t-l : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Shrink( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_Man_t * pTemp;
+ int c,fVerbose = 0;
+ int fKeepLevel = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'l':
+ fKeepLevel ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Shrink(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( pAbc->pGia->pMapping == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.\n" );
+ return 1;
+ }
+ pTemp = Gia_ManPerformMapShrink( pAbc->pGia, fKeepLevel, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &shrink [-lvh]\n" );
+ Abc_Print( -2, "\t performs fast shrinking using current mapping\n" );
+ Abc_Print( -2, "\t-l : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -23861,14 +24543,14 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( fTrans )
{
- if ( (Gia_ManPoNum(pAbc->pAig) & 1) == 1 )
+ if ( (Gia_ManPoNum(pAbc->pGia) & 1) == 1 )
{
- printf( "Abc_CommandAbc9Miter(): The number of outputs should be even.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Miter(): The number of outputs should be even.\n" );
return 0;
}
- pAbc->pAig = Gia_ManTransformMiter( pAux = pAbc->pAig );
+ pAbc->pGia = Gia_ManTransformMiter( pAux = pAbc->pGia );
Gia_ManStop( pAux );
- printf( "The miter (current AIG) is transformed by XORing POs pair-wise.\n" );
+ Abc_Print( -1, "The miter (current AIG) is transformed by XORing POs pair-wise.\n" );
return 0;
}
@@ -23876,7 +24558,7 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew = argc - globalUtilOptind;
if ( nArgcNew != 1 )
{
- printf( "File name is not given on the command line.\n" );
+ Abc_Print( -1, "File name is not given on the command line.\n" );
return 1;
}
@@ -23888,40 +24570,34 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
*pTemp = '\\';
if ( (pFile = fopen( FileName, "r" )) == NULL )
{
- fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
- fprintf( pAbc->Err, "Did you mean \"%s\"?", FileName );
- fprintf( pAbc->Err, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
pSecond = Gia_ReadAiger( FileName, 0 );
if ( pSecond == NULL )
{
- printf( "Reading AIGER has failed.\n" );
+ Abc_Print( -1, "Reading AIGER has failed.\n" );
return 0;
}
// compute the miter
- pAbc->pAig = Gia_ManMiter( pAux = pAbc->pAig, pSecond, fDualOut, fSeq, fVerbose );
+ pAux = Gia_ManMiter( pAbc->pGia, pSecond, fDualOut, fSeq, fVerbose );
Gia_ManStop( pSecond );
- if ( pAbc->pAig == NULL )
- {
- printf( "Miter construction has failed.\n" );
- pAbc->pAig = pAux;
- }
- else
- Gia_ManStop( pAux );
+ Abc_CommandUpdate9( pAbc, pAux );
return 0;
usage:
- fprintf( stdout, "usage: &miter [-dstvh] <file>\n" );
- fprintf( stdout, "\t creates miter of two designs (current AIG vs. <file>)\n" );
- fprintf( stdout, "\t-d : toggle creating dual output miter [default = %s]\n", fDualOut? "yes": "no" );
- fprintf( stdout, "\t-s : toggle creating sequential miter [default = %s]\n", fSeq? "yes": "no" );
- fprintf( stdout, "\t-t : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
- fprintf( stdout, "\t<file> : AIGER file with the design to miter\n");
+ Abc_Print( -2, "usage: &miter [-dstvh] <file>\n" );
+ Abc_Print( -2, "\t creates miter of two designs (current AIG vs. <file>)\n" );
+ Abc_Print( -2, "\t-d : toggle creating dual output miter [default = %s]\n", fDualOut? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle creating sequential miter [default = %s]\n", fSeq? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
return 1;
}
@@ -23961,22 +24637,22 @@ int Abc_CommandAbc9Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Scl(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Scl(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Gia_ManSeqStructSweep( pTemp = pAbc->pAig, fConst, fEquiv, fVerbose );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManSeqStructSweep( pAbc->pGia, fConst, fEquiv, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &scl [-cevh]\n" );
- fprintf( stdout, "\t performs structural sequential cleanup\n" );
- fprintf( stdout, "\t-c : toggle removing stuck-at constant registers [default = %s]\n", fConst? "yes": "no" );
- fprintf( stdout, "\t-e : toggle removing equivalent-driver registers [default = %s]\n", fEquiv? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &scl [-cevh]\n" );
+ Abc_Print( -2, "\t performs structural sequential cleanup\n" );
+ Abc_Print( -2, "\t-c : toggle removing stuck-at constant registers [default = %s]\n", fConst? "yes": "no" );
+ Abc_Print( -2, "\t-e : toggle removing equivalent-driver registers [default = %s]\n", fEquiv? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24006,7 +24682,7 @@ int Abc_CommandAbc9Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFrames = atoi(argv[globalUtilOptind]);
@@ -24017,7 +24693,7 @@ int Abc_CommandAbc9Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -24028,7 +24704,7 @@ int Abc_CommandAbc9Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
pPars->nPrefix = atoi(argv[globalUtilOptind]);
@@ -24049,31 +24725,30 @@ int Abc_CommandAbc9Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Lcorr(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Lcorr(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Cec_ManLSCorrespondence( pTemp = pAbc->pAig, pPars );
- if ( pAbc->pAig == NULL )
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
{
- pAbc->pAig = pTemp;
- printf( "Abc_CommandAbc9Lcorr(): Command has failed.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
}
- else
- Gia_ManStop( pTemp );
+ pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &lcorr [-FCP num] [-rcvh]\n" );
- fprintf( stdout, "\t performs latch correpondence computation\n" );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
- fprintf( stdout, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
- fprintf( stdout, "\t-r : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
- fprintf( stdout, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &lcorr [-FCP num] [-rcvh]\n" );
+ Abc_Print( -2, "\t performs latch correpondence computation\n" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
+ Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
+ Abc_Print( -2, "\t-r : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24102,7 +24777,7 @@ int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
goto usage;
}
pPars->nFrames = atoi(argv[globalUtilOptind]);
@@ -24113,7 +24788,7 @@ int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -24124,7 +24799,7 @@ int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'P':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-P\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
goto usage;
}
pPars->nPrefix = atoi(argv[globalUtilOptind]);
@@ -24151,33 +24826,32 @@ int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Scorr(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Scorr(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Cec_ManLSCorrespondence( pTemp = pAbc->pAig, pPars );
- if ( pAbc->pAig == NULL )
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
{
- pAbc->pAig = pTemp;
- printf( "Abc_CommandAbc9Scorr(): Command has failed.\n" );
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
}
- else
- Gia_ManStop( pTemp );
+ pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &scorr [-FCP num] [-recwvh]\n" );
- fprintf( stdout, "\t performs signal correpondence computation\n" );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
- fprintf( stdout, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
- fprintf( stdout, "\t-r : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
- fprintf( stdout, "\t-e : toggle using equivalences as choices [default = %s]\n", pPars->fMakeChoices? "yes": "no" );
- fprintf( stdout, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
- fprintf( stdout, "\t-w : toggle printing verbose info about equivalent flops [default = %s]\n", pPars->fVerboseFlops? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &scorr [-FCP num] [-recwvh]\n" );
+ Abc_Print( -2, "\t performs signal correpondence computation\n" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
+ Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
+ Abc_Print( -2, "\t-r : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
+ Abc_Print( -2, "\t-e : toggle using equivalences as choices [default = %s]\n", pPars->fMakeChoices? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing verbose info about equivalent flops [default = %s]\n", pPars->fVerboseFlops? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24206,7 +24880,7 @@ int Abc_CommandAbc9Choice( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -24224,28 +24898,22 @@ int Abc_CommandAbc9Choice( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Choice(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Choice(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Cec_ManChoiceComputation( pTemp = pAbc->pAig, pPars );
- if ( pAbc->pAig == NULL )
- {
- pAbc->pAig = pTemp;
- printf( "Abc_CommandAbc9Choice(): Command has failed.\n" );
- }
- else
- Gia_ManStop( pTemp );
+ pTemp = Cec_ManChoiceComputation( pAbc->pGia, pPars );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &choice [-C num] [-cvh]\n" );
- fprintf( stdout, "\t performs computation of structural choices\n" );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &choice [-C num] [-cvh]\n" );
+ Abc_Print( -2, "\t performs computation of structural choices\n" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24275,7 +24943,7 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -24286,7 +24954,7 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
goto usage;
}
pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
@@ -24297,7 +24965,7 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'N':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-N\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
goto usage;
}
pPars->nCallsRecycle = atoi(argv[globalUtilOptind]);
@@ -24324,9 +24992,9 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Sat(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Sat(): There is no AIG.\n" );
return 1;
}
if ( fCSat )
@@ -24334,33 +25002,33 @@ int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
Vec_Int_t * vCounters;
Vec_Str_t * vStatus;
if ( pPars->fLearnCls )
- vCounters = Tas_ManSolveMiterNc( pAbc->pAig, pPars->nBTLimit, &vStatus, pPars->fVerbose );
+ vCounters = Tas_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
else if ( pPars->fNonChrono )
- vCounters = Cbs_ManSolveMiterNc( pAbc->pAig, pPars->nBTLimit, &vStatus, pPars->fVerbose );
+ vCounters = Cbs_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
else
- vCounters = Cbs_ManSolveMiter( pAbc->pAig, pPars->nBTLimit, &vStatus, pPars->fVerbose );
+ vCounters = Cbs_ManSolveMiter( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
Vec_IntFree( vCounters );
Vec_StrFree( vStatus );
}
else
{
- pAbc->pAig = Cec_ManSatSolving( pTemp = pAbc->pAig, pPars );
- Gia_ManStop( pTemp );
+ pTemp = Cec_ManSatSolving( pAbc->pGia, pPars );
+ Abc_CommandUpdate9( pAbc, pTemp );
}
return 0;
usage:
- fprintf( stdout, "usage: &sat [-CSN <num>] [-nmctvh]\n" );
- fprintf( stdout, "\t performs SAT solving for the combinational outputs\n" );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-S num : the min number of variables to recycle the solver [default = %d]\n", pPars->nSatVarMax );
- fprintf( stdout, "\t-N num : the min number of calls to recycle the solver [default = %d]\n", pPars->nCallsRecycle );
- fprintf( stdout, "\t-n : toggle using non-chronological backtracking [default = %s]\n", pPars->fNonChrono? "yes": "no" );
- fprintf( stdout, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
- fprintf( stdout, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", fCSat? "yes": "no" );
- fprintf( stdout, "\t-t : toggle using learning in curcuit-based solver [default = %s]\n", pPars->fLearnCls? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &sat [-CSN <num>] [-nmctvh]\n" );
+ Abc_Print( -2, "\t performs SAT solving for the combinational outputs\n" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-S num : the min number of variables to recycle the solver [default = %d]\n", pPars->nSatVarMax );
+ Abc_Print( -2, "\t-N num : the min number of calls to recycle the solver [default = %d]\n", pPars->nCallsRecycle );
+ Abc_Print( -2, "\t-n : toggle using non-chronological backtracking [default = %s]\n", pPars->fNonChrono? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", fCSat? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle using learning in curcuit-based solver [default = %s]\n", pPars->fLearnCls? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24381,6 +25049,7 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_Man_t * pTemp;
int c;
Cec_ManFraSetDefaultParams( pPars );
+ pPars->fSatSweeping = 1;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "WRILDCrmdwvh" ) ) != EOF )
{
@@ -24389,7 +25058,7 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'W':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-W\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWords = atoi(argv[globalUtilOptind]);
@@ -24400,7 +25069,7 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'R':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-R\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
goto usage;
}
pPars->nRounds = atoi(argv[globalUtilOptind]);
@@ -24411,7 +25080,7 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
pPars->nItersMax = atoi(argv[globalUtilOptind]);
@@ -24422,7 +25091,7 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'L':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
goto usage;
}
pPars->nLevelMax = atoi(argv[globalUtilOptind]);
@@ -24433,7 +25102,7 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nDepthMax = atoi(argv[globalUtilOptind]);
@@ -24444,7 +25113,7 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -24471,34 +25140,30 @@ int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Fraig(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Fraig(): There is no AIG.\n" );
return 1;
}
- pTemp = Cec_ManSatSweeping( pAbc->pAig, pPars );
- if ( pTemp )
- {
- Gia_ManStop( pAbc->pAig );
- pAbc->pAig = pTemp;
- }
+ pTemp = Cec_ManSatSweeping( pAbc->pGia, pPars );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &fraig [-WRILDC <num>] [-rmdwvh]\n" );
- fprintf( stdout, "\t performs combinational SAT sweeping\n" );
- fprintf( stdout, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
- fprintf( stdout, "\t-R num : the number of simulation rounds [default = %d]\n", pPars->nRounds );
- fprintf( stdout, "\t-I num : the number of sweeping iterations [default = %d]\n", pPars->nItersMax );
- fprintf( stdout, "\t-L num : the max number of levels of nodes to consider [default = %d]\n", pPars->nLevelMax );
- fprintf( stdout, "\t-D num : the max number of steps of speculative reduction [default = %d]\n", pPars->nDepthMax );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-r : toggle the use of AIG rewriting [default = %s]\n", pPars->fRewriting? "yes": "no" );
- fprintf( stdout, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
- fprintf( stdout, "\t-d : toggle using double output miters [default = %s]\n", pPars->fDualOut? "yes": "no" );
- fprintf( stdout, "\t-w : toggle printing even more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &fraig [-WRILDC <num>] [-rmdwvh]\n" );
+ Abc_Print( -2, "\t performs combinational SAT sweeping\n" );
+ Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
+ Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n", pPars->nRounds );
+ Abc_Print( -2, "\t-I num : the number of sweeping iterations [default = %d]\n", pPars->nItersMax );
+ Abc_Print( -2, "\t-L num : the max number of levels of nodes to consider [default = %d]\n", pPars->nLevelMax );
+ Abc_Print( -2, "\t-D num : the max number of steps of speculative reduction [default = %d]\n", pPars->nDepthMax );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-r : toggle the use of AIG rewriting [default = %s]\n", pPars->fRewriting? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+ Abc_Print( -2, "\t-d : toggle using double output miters [default = %s]\n", pPars->fDualOut? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing even more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24541,32 +25206,32 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Srm(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Srm(): There is no AIG.\n" );
return 1;
}
- pTemp = Gia_ManSpecReduce( pAbc->pAig, fDualOut, fVerbose );
+ pTemp = Gia_ManSpecReduce( pAbc->pGia, fDualOut, fSynthesis, fVerbose );
if ( pTemp )
{
pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
Gia_ManStop( pAux );
Gia_WriteAiger( pTemp, pFileName, 0, 0 );
- printf( "Speculatively reduced model was written into file \"%s\".\n", pFileName );
+ Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
Gia_ManPrintStatsShort( pTemp );
Gia_ManStop( pTemp );
}
if ( fSynthesis )
{
- pTemp = Gia_ManEquivReduce( pAbc->pAig, 1, fDualOut, fVerbose );
+ pTemp = Gia_ManEquivReduce( pAbc->pGia, 1, fDualOut, fVerbose );
if ( pTemp )
{
pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
Gia_ManStop( pAux );
Gia_WriteAiger( pTemp, pFileName2, 0, 0 );
- printf( "Reduced original network was written into file \"%s\".\n", pFileName2 );
+ Abc_Print( 1, "Reduced original network was written into file \"%s\".\n", pFileName2 );
Gia_ManPrintStatsShort( pTemp );
Gia_ManStop( pTemp );
}
@@ -24574,12 +25239,12 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: &srm [-dsvh]\n" );
- fprintf( stdout, "\t writes speculatively reduced model into file \"%s\"\n", pFileName );
- fprintf( stdout, "\t-d : toggle creating dual output miter [default = %s]\n", fDualOut? "yes": "no" );
- fprintf( stdout, "\t-s : toggle writing reduced network for synthesis [default = %s]\n", fSynthesis? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &srm [-dsvh]\n" );
+ Abc_Print( -2, "\t writes speculatively reduced model into file \"%s\"\n", pFileName );
+ Abc_Print( -2, "\t-d : toggle creating dual output miter [default = %s]\n", fDualOut? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggle writing reduced network for synthesis [default = %s]\n", fSynthesis? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24596,7 +25261,7 @@ usage:
***********************************************************************/
int Abc_CommandAbc9Reduce( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- Gia_Man_t * pTemp;
+ Gia_Man_t * pTemp, * pTemp2;
int c, fVerbose = 0;
int fUseAll = 0;
int fDualOut = 0;
@@ -24620,29 +25285,27 @@ int Abc_CommandAbc9Reduce( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Reduce(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Reduce(): There is no AIG.\n" );
return 1;
}
- pAbc->pAig = Gia_ManEquivReduce( pTemp = pAbc->pAig, fUseAll, fDualOut, fVerbose );
- if ( pAbc->pAig == NULL )
- pAbc->pAig = pTemp;
- else
+ pTemp = Gia_ManEquivReduce( pAbc->pGia, fUseAll, fDualOut, fVerbose );
+ if ( pTemp != NULL )
{
- Gia_ManStop( pTemp );
- pAbc->pAig = Gia_ManSeqStructSweep( pTemp = pAbc->pAig, 1, 1, 0 );
- Gia_ManStop( pTemp );
+ pTemp = Gia_ManSeqStructSweep( pTemp2 = pTemp, 1, 1, 0 );
+ Gia_ManStop( pTemp2 );
+ Abc_CommandUpdate9( pAbc, pTemp );
}
return 0;
usage:
- fprintf( stdout, "usage: &reduce [-advh]\n" );
- fprintf( stdout, "\t reduces the circuit using equivalence classes\n" );
- fprintf( stdout, "\t-a : toggle merging all equivalences [default = %s]\n", fUseAll? "yes": "no" );
- fprintf( stdout, "\t-d : toggle using dual-output merging [default = %s]\n", fDualOut? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &reduce [-advh]\n" );
+ Abc_Print( -2, "\t reduces the circuit using equivalence classes\n" );
+ Abc_Print( -2, "\t-a : toggle merging all equivalences [default = %s]\n", fUseAll? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggle using dual-output merging [default = %s]\n", fDualOut? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24674,7 +25337,7 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
pPars->nBTLimit = atoi(argv[globalUtilOptind]);
@@ -24685,7 +25348,7 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'T':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-T\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
goto usage;
}
pPars->TimeLimit = atoi(argv[globalUtilOptind]);
@@ -24707,8 +25370,13 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( fMiter )
{
- printf( "Assuming the current network is a double-output miter. (Conflict limit = %d.)\n", pPars->nBTLimit );
- Cec_ManVerify( pAbc->pAig, pPars );
+ if ( Gia_ManPoNum(pAbc->pGia) & 1 )
+ {
+ Abc_Print( -1, "The dual-output miter should have an even number of outputs.\n" );
+ return 1;
+ }
+ Abc_Print( 1, "Assuming the current network is a double-output miter. (Conflict limit = %d.)\n", pPars->nBTLimit );
+ Cec_ManVerify( pAbc->pGia, pPars );
return 0;
}
@@ -24716,7 +25384,7 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew = argc - globalUtilOptind;
if ( nArgcNew != 1 )
{
- printf( "File name is not given on the command line.\n" );
+ Abc_Print( -1, "File name is not given on the command line.\n" );
return 1;
}
@@ -24728,21 +25396,21 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
*pTemp = '\\';
if ( (pFile = fopen( FileName, "r" )) == NULL )
{
- fprintf( pAbc->Err, "Cannot open input file \"%s\". ", FileName );
+ Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
- fprintf( pAbc->Err, "Did you mean \"%s\"?", FileName );
- fprintf( pAbc->Err, "\n" );
+ Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+ Abc_Print( 1, "\n" );
return 1;
}
fclose( pFile );
pSecond = Gia_ReadAiger( FileName, 0 );
if ( pSecond == NULL )
{
- printf( "Reading AIGER has failed.\n" );
+ Abc_Print( -1, "Reading AIGER has failed.\n" );
return 0;
}
// compute the miter
- pMiter = Gia_ManMiter( pAbc->pAig, pSecond, 1, 0, pPars->fVerbose );
+ pMiter = Gia_ManMiter( pAbc->pGia, pSecond, 1, 0, pPars->fVerbose );
if ( pMiter )
{
Cec_ManVerify( pMiter, pPars );
@@ -24752,13 +25420,13 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( stdout, "usage: &cec [-CT num] [-mvh]\n" );
- fprintf( stdout, "\t new combinational equivalence checker\n" );
- fprintf( stdout, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
- fprintf( stdout, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
- fprintf( stdout, "\t-m : toggle miter vs. two circuits [default = %s]\n", fMiter? "miter":"two circuits");
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &cec [-CT num] [-mvh]\n" );
+ Abc_Print( -2, "\t new combinational equivalence checker\n" );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+ Abc_Print( -2, "\t-m : toggle miter vs. two circuits [default = %s]\n", fMiter? "miter":"two circuits");
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24787,7 +25455,7 @@ int Abc_CommandAbc9Force( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-I\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
nIters = atoi(argv[globalUtilOptind]);
@@ -24807,22 +25475,22 @@ int Abc_CommandAbc9Force( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Force(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Force(): There is no AIG.\n" );
return 1;
}
- For_ManExperiment( pAbc->pAig, nIters, fClustered, fVerbose );
+ For_ManExperiment( pAbc->pGia, nIters, fClustered, fVerbose );
return 0;
usage:
- fprintf( stdout, "usage: &force [-I <num>] [-cvh]\n" );
- fprintf( stdout, "\t one-dimensional placement algorithm FORCE introduced by\n" );
- fprintf( stdout, "\t F. A. Aloul, I. L. Markov, and K. A. Sakallah (GLSVLSI’03).\n" );
- fprintf( stdout, "\t-I num : the number of refinement iterations [default = %d]\n", nIters );
- fprintf( stdout, "\t-c : toggle clustered representation [default = %s]\n", fClustered? "yes":"no");
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes":"no");
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &force [-I <num>] [-cvh]\n" );
+ Abc_Print( -2, "\t one-dimensional placement algorithm FORCE introduced by\n" );
+ Abc_Print( -2, "\t F. A. Aloul, I. L. Markov, and K. A. Sakallah (GLSVLSI�03).\n" );
+ Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", nIters );
+ Abc_Print( -2, "\t-c : toggle clustered representation [default = %s]\n", fClustered? "yes":"no");
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes":"no");
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24858,7 +25526,7 @@ int Abc_CommandAbc9Embed( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nDims = atoi(argv[globalUtilOptind]);
@@ -24869,7 +25537,7 @@ int Abc_CommandAbc9Embed( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'I':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nIters = atoi(argv[globalUtilOptind]);
@@ -24901,28 +25569,28 @@ int Abc_CommandAbc9Embed( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Embed(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Embed(): There is no AIG.\n" );
return 1;
}
- Gia_ManSolveProblem( pAbc->pAig, pPars );
+ Gia_ManSolveProblem( pAbc->pGia, pPars );
return 0;
usage:
- fprintf( stdout, "usage: &embed [-DI <num>] [-rdlscvh]\n" );
- fprintf( stdout, "\t fast placement based on high-dimensional embedding from\n" );
- fprintf( stdout, "\t D. Harel and Y. Koren, \"Graph drawing by high-dimensional\n" );
- fprintf( stdout, "\t embedding\", J. Graph Algs & Apps, 2004, Vol 8(2), pp. 195-217\n" );
- fprintf( stdout, "\t-D num : the number of dimensions for embedding [default = %d]\n", pPars->nDims );
- fprintf( stdout, "\t-I num : the number of refinement iterations [default = %d]\n", pPars->nIters );
- fprintf( stdout, "\t-r : toggle the use of refinement [default = %s]\n", pPars->fRefine? "yes":"no");
- fprintf( stdout, "\t-c : toggle clustered representation [default = %s]\n", pPars->fCluster? "yes":"no");
- fprintf( stdout, "\t-d : toggle dumping placement into a Gnuplot file [default = %s]\n", pPars->fDump? "yes":"no");
- fprintf( stdout, "\t-l : toggle dumping Gnuplot for large placement [default = %s]\n", pPars->fDumpLarge? "yes":"no");
- fprintf( stdout, "\t-s : toggle showing image if Gnuplot is installed [default = %s]\n", pPars->fShowImage? "yes":"no");
- fprintf( stdout, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &embed [-DI <num>] [-rdlscvh]\n" );
+ Abc_Print( -2, "\t fast placement based on high-dimensional embedding from\n" );
+ Abc_Print( -2, "\t D. Harel and Y. Koren, \"Graph drawing by high-dimensional\n" );
+ Abc_Print( -2, "\t embedding\", J. Graph Algs & Apps, 2004, Vol 8(2), pp. 195-217\n" );
+ Abc_Print( -2, "\t-D num : the number of dimensions for embedding [default = %d]\n", pPars->nDims );
+ Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", pPars->nIters );
+ Abc_Print( -2, "\t-r : toggle the use of refinement [default = %s]\n", pPars->fRefine? "yes":"no");
+ Abc_Print( -2, "\t-c : toggle clustered representation [default = %s]\n", pPars->fCluster? "yes":"no");
+ Abc_Print( -2, "\t-d : toggle dumping placement into a Gnuplot file [default = %s]\n", pPars->fDump? "yes":"no");
+ Abc_Print( -2, "\t-l : toggle dumping Gnuplot for large placement [default = %s]\n", pPars->fDumpLarge? "yes":"no");
+ Abc_Print( -2, "\t-s : toggle showing image if Gnuplot is installed [default = %s]\n", pPars->fShowImage? "yes":"no");
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -24947,21 +25615,21 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
extern int Gia_MappingIf( Gia_Man_t * p, If_Par_t * pPars );
if ( pAbc->pAbc8Lib == NULL )
{
- printf( "LUT library is not given. Using default LUT library.\n" );
+ Abc_Print( -1, "LUT library is not given. Using default LUT library.\n" );
pAbc->pAbc8Lib = If_SetSimpleLutLib( 6 );
}
// set defaults
Gia_ManSetIfParsDefault( pPars );
pPars->pLutLib = pAbc->pAbc8Lib;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrstbvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbvh" ) ) != EOF )
{
switch ( c )
{
case 'K':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nLutSize = atoi(argv[globalUtilOptind]);
@@ -24974,7 +25642,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nCutsMax = atoi(argv[globalUtilOptind]);
@@ -24985,7 +25653,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'F':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nFlowIters = atoi(argv[globalUtilOptind]);
@@ -24996,7 +25664,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'A':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
goto usage;
}
pPars->nAreaIters = atoi(argv[globalUtilOptind]);
@@ -25007,7 +25675,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'D':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
@@ -25018,7 +25686,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'E':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+ Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
goto usage;
}
pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
@@ -25053,11 +25721,11 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case 's':
pPars->fSeqMap ^= 1;
break;
- case 't':
- pPars->fLiftLeaves ^= 1;
+ case 'd':
+ pPars->fBidec ^= 1;
break;
case 'b':
- pPars->fBidec ^= 1;
+ pPars->fUseBat ^= 1;
break;
case 'v':
pPars->fVerbose ^= 1;
@@ -25067,31 +25735,41 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9If(): There is no AIG to map.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9If(): There is no AIG to map.\n" );
return 1;
}
if ( pPars->nLutSize < 3 || pPars->nLutSize > IF_MAX_LUTSIZE )
{
- fprintf( stdout, "Incorrect LUT size (%d).\n", pPars->nLutSize );
+ Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
return 1;
}
if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
{
- fprintf( stdout, "Incorrect number of cuts.\n" );
+ Abc_Print( -1, "Incorrect number of cuts.\n" );
return 1;
}
-/*
+
// enable truth table computation if choices are selected
- if ( (c = Aig_ManChoiceNum( pAbc->pAbc8Aig )) )
+ if ( (c = Gia_ManCountChoiceNodes( pAbc->pGia )) )
{
- printf( "Performing LUT mapping with %d choices.\n", c );
+ Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c );
pPars->fExpRed = 0;
}
-*/
+
+ if ( pPars->fUseBat )
+ {
+ if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
+ {
+ Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
+ return 1;
+ }
+ pPars->fCutMin = 1;
+ }
+
// enable truth table computation if cut minimization is selected
if ( pPars->fCutMin )
{
@@ -25102,13 +25780,13 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
// complain if truth tables are requested but the cut size is too large
if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
{
- fprintf( stdout, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
+ Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
return 1;
}
- if ( !Gia_MappingIf( pAbc->pAig, pPars ) )
+ if ( !Gia_MappingIf( pAbc->pGia, pPars ) )
{
- printf( "Abc_CommandAbc9If(): Mapping of the AIG has failed.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9If(): Mapping of the AIG has failed.\n" );
return 1;
}
return 0;
@@ -25122,27 +25800,184 @@ usage:
sprintf( LutSize, "library" );
else
sprintf( LutSize, "%d", pPars->nLutSize );
- fprintf( stdout, "usage: &if [-KCFA num] [-DE float] [-qarlepmbvh]\n" );
- fprintf( stdout, "\t performs FPGA technology mapping of the network\n" );
- fprintf( stdout, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
- fprintf( stdout, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
- fprintf( stdout, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
- fprintf( stdout, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
- fprintf( stdout, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
- fprintf( stdout, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
- fprintf( stdout, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
- fprintf( stdout, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
-// fprintf( stdout, "\t-f : toggles one fancy feature [default = %s]\n", pPars->fFancy? "yes": "no" );
- fprintf( stdout, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
- fprintf( stdout, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
- fprintf( stdout, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
- fprintf( stdout, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
- fprintf( stdout, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
-// fprintf( stdout, "\t-s : toggles sequential mapping [default = %s]\n", pPars->fSeqMap? "yes": "no" );
-// fprintf( stdout, "\t-t : toggles the use of true sequential cuts [default = %s]\n", pPars->fLiftLeaves? "yes": "no" );
- fprintf( stdout, "\t-b : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
- fprintf( stdout, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : prints the command usage\n");
+ Abc_Print( -2, "usage: &if [-KCFA num] [-DE float] [-qarlepmdbvh]\n" );
+ Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
+ Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
+ Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
+ Abc_Print( -2, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
+ Abc_Print( -2, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
+ Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+ Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
+ Abc_Print( -2, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
+ Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
+// Abc_Print( -2, "\t-f : toggles one fancy feature [default = %s]\n", pPars->fFancy? "yes": "no" );
+ Abc_Print( -2, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
+ Abc_Print( -2, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
+ Abc_Print( -2, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
+ Abc_Print( -2, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
+// Abc_Print( -2, "\t-s : toggles sequential mapping [default = %s]\n", pPars->fSeqMap? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : prints the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Trace( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ int c;
+ int fUseLutLib;
+ int fVerbose;
+ pNtk = Abc_FrameReadNtk(pAbc);
+ // set defaults
+ fUseLutLib = 0;
+ fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'l':
+ fUseLutLib ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
+ return 1;
+ }
+ if ( pAbc->pGia->pMapping == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
+ return 1;
+ }
+ pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
+ Gia_ManDelayTraceLutPrint( pAbc->pGia, fVerbose );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &trace [-lvh]\n" );
+ Abc_Print( -2, "\t performs delay trace of LUT-mapped network\n" );
+ Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_Man_t * pTemp;
+ int fUseLutLib;
+ int Percentage;
+ int Degree;
+ int fVerbose;
+ int c, fVeryVerbose;
+
+ // set defaults
+ fUseLutLib = 0;
+ Percentage = 5;
+ Degree = 2;
+ fVerbose = 0;
+ fVeryVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'P':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ Percentage = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( Percentage < 1 || Percentage > 100 )
+ goto usage;
+ break;
+ case 'N':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ Degree = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( Degree < 1 || Degree > 5 )
+ goto usage;
+ break;
+ case 'l':
+ fUseLutLib ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'w':
+ fVeryVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
+ return 1;
+ }
+ if ( pAbc->pGia->pMapping == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
+ return 1;
+ }
+ pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
+ pTemp = Gia_ManSpeedup( pAbc->pGia, Percentage, Degree, fVerbose, fVeryVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &speedup [-P num] [-N num] [-lvwh]\n" );
+ Abc_Print( -2, "\t transforms LUT-mapped network into an AIG with choices;\n" );
+ Abc_Print( -2, "\t the choices are added to speedup the next round of mapping\n" );
+ Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
+ Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
+ Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
+ Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -25164,8 +25999,8 @@ int Abc_CommandAbc9Era( Abc_Frame_t * pAbc, int argc, char ** argv )
int fUseCubes = 1;
int fMiter = 0;
int nStatesMax = 1000000000;
- extern void Gia_ManCollectReachable( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbose );
- extern void Gia_ManArePerform( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbose );
+ extern int Gia_ManCollectReachable( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbose );
+ extern int Gia_ManArePerform( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbose );
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Smcvh" ) ) != EOF )
@@ -25175,7 +26010,7 @@ int Abc_CommandAbc9Era( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'S':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-S\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
goto usage;
}
nStatesMax = atoi(argv[globalUtilOptind]);
@@ -25198,38 +26033,37 @@ int Abc_CommandAbc9Era( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Era(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Era(): There is no AIG.\n" );
return 1;
}
- if ( Gia_ManRegNum(pAbc->pAig) == 0 )
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
{
- printf( "Abc_CommandAbc9Era(): The network is combinational.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Era(): The network is combinational.\n" );
return 1;
}
- if ( !fUseCubes && Gia_ManPiNum(pAbc->pAig) > 12 )
+ if ( !fUseCubes && Gia_ManPiNum(pAbc->pGia) > 12 )
{
- printf( "Abc_CommandAbc9Era(): The number of PIs (%d) should be no more than 12 when cubes are not used.\n", Gia_ManPiNum(pAbc->pAig) );
+ Abc_Print( -1, "Abc_CommandAbc9Era(): The number of PIs (%d) should be no more than 12 when cubes are not used.\n", Gia_ManPiNum(pAbc->pGia) );
return 1;
}
if ( fUseCubes )
- Gia_ManArePerform( pAbc->pAig, nStatesMax, fMiter, fVerbose );
+ pAbc->Status = Gia_ManArePerform( pAbc->pGia, nStatesMax, fMiter, fVerbose );
else
- Gia_ManCollectReachable( pAbc->pAig, nStatesMax, fMiter, fVerbose );
- pAbc->pCex = ((Gia_Man_t *)pAbc->pAig)->pCexSeq; // temporary ???
- ((Gia_Man_t *)pAbc->pAig)->pCexSeq = NULL;
+ pAbc->Status = Gia_ManCollectReachable( pAbc->pGia, nStatesMax, fMiter, fVerbose );
+ Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
return 0;
usage:
- fprintf( stdout, "usage: &era [-S num] [-mcvh]\n" );
-// fprintf( stdout, "usage: &era [-S num] [-mvh]\n" );
- fprintf( stdout, "\t explicit reachability analysis for small sequential AIGs\n" );
- fprintf( stdout, "\t-S num : the max number of states (num > 0) [default = %d]\n", nStatesMax );
- fprintf( stdout, "\t-m : stop when the miter output is 1 [default = %s]\n", fMiter? "yes": "no" );
- fprintf( stdout, "\t-c : use state cubes instead of state minterms [default = %s]\n", fUseCubes? "yes": "no" );
- fprintf( stdout, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &era [-S num] [-mcvh]\n" );
+// Abc_Print( -2, "usage: &era [-S num] [-mvh]\n" );
+ Abc_Print( -2, "\t explicit reachability analysis for small sequential AIGs\n" );
+ Abc_Print( -2, "\t-S num : the max number of states (num > 0) [default = %d]\n", nStatesMax );
+ Abc_Print( -2, "\t-m : stop when the miter output is 1 [default = %s]\n", fMiter? "yes": "no" );
+ Abc_Print( -2, "\t-c : use state cubes instead of state minterms [default = %s]\n", fUseCubes? "yes": "no" );
+ Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -25246,36 +26080,63 @@ usage:
***********************************************************************/
int Abc_CommandAbc9Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
{
-// extern void Hcd_ComputeChoicesTest( Gia_Man_t * pAig, int nBTLimit, int fSynthesis, int fUseMiniSat, int fVerbose );
- Gia_Man_t * pTemp = NULL;
- int nBTLimit = 100;
- int fSynthesis = 1;
- int fUseMiniSat = 0;
- int c, fVerbose = 0;
+ Gia_Man_t * pTemp;
+ Dch_Pars_t Pars, * pPars = &Pars;
+ int c;
+ // set defaults
+ Dch_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "Csmvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptfvh" ) ) != EOF )
{
switch ( c )
{
+ case 'W':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nWords = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nWords < 0 )
+ goto usage;
+ break;
case 'C':
if ( globalUtilOptind >= argc )
{
- fprintf( stdout, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
- nBTLimit = atoi(argv[globalUtilOptind]);
+ pPars->nBTLimit = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
- if ( nBTLimit < 0 )
+ if ( pPars->nBTLimit < 0 )
+ goto usage;
+ break;
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nSatVarMax < 0 )
goto usage;
break;
case 's':
- fSynthesis ^= 1;
+ pPars->fSynthesis ^= 1;
break;
- case 'm':
- fUseMiniSat ^= 1;
+ case 'p':
+ pPars->fPower ^= 1;
+ break;
+ case 't':
+ pPars->fSimulateTfo ^= 1;
+ break;
+ case 'f':
+ pPars->fLightSynth ^= 1;
break;
case 'v':
- fVerbose ^= 1;
+ pPars->fVerbose ^= 1;
break;
case 'h':
goto usage;
@@ -25283,22 +26144,27 @@ int Abc_CommandAbc9Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Test(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Test(): There is no AIG.\n" );
return 1;
}
-// Hcd_ComputeChoicesTest( pAbc->pAig, nBTLimit, fSynthesis, fUseMiniSat, fVerbose );
+ pTemp = Gia_ManPerformDch( pAbc->pGia, pPars );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &dch [-C num] [-smvh]\n" );
- fprintf( stdout, "\t computing choices using the latest algorithm\n" );
- fprintf( stdout, "\t-C num : the max number of states to traverse (num > 0) [default = %d]\n", nBTLimit );
- fprintf( stdout, "\t-s : toggle printing verbose information [default = %s]\n", fSynthesis? "yes": "no" );
- fprintf( stdout, "\t-m : toggle using MiniSat as a SAT solver [default = %s]\n", fUseMiniSat? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &dch [-WCS num] [-sptfvh]\n" );
+ Abc_Print( -2, "\t computes structural choices using a new approach\n" );
+ Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
+ Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+ Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
+ Abc_Print( -2, "\t-s : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
+ Abc_Print( -2, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -25313,24 +26179,76 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandAbc9AbsStart( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- Gia_Man_t * pTemp = NULL;
- int c, fVerbose = 0;
- int fSwitch = 0;
- extern void Gia_SatSolveTest( Gia_Man_t * p );
- extern void Cbs_ManSolveTest( Gia_Man_t * pGia );
+ Gia_ParAbs_t Pars, * pPars = &Pars;
+ int c;
+ extern void Gia_ManCexAbstractionStart( Gia_Man_t * pGia, Gia_ParAbs_t * pPars );
+ // set defaults
+ Gia_ManAbsSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "FCRrpfvh" ) ) != EOF )
{
switch ( c )
{
- case 's':
- fSwitch ^= 1;
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nFramesBmc = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nFramesBmc < 0 )
+ goto usage;
+ break;
+/*
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nStableMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nStableMax < 0 )
+ goto usage;
+ break;
+*/
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nConfMaxBmc = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nConfMaxBmc < 0 )
+ goto usage;
+ break;
+ case 'R':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nRatio = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nRatio < 0 )
+ goto usage;
+ break;
+ case 'r':
+ pPars->fUseBdds ^= 1;
+ break;
+ case 'p':
+ pPars->fUseDprove ^= 1;
+ break;
+ case 'f':
+ pPars->fUseStart ^= 1;
break;
case 'v':
- fVerbose ^= 1;
+ pPars->fVerbose ^= 1;
break;
case 'h':
goto usage;
@@ -25338,33 +26256,356 @@ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pAig == NULL )
+ if ( pAbc->pGia == NULL )
{
- printf( "Abc_CommandAbc9Test(): There is no AIG.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9AbsStart(): There is no AIG.\n" );
return 1;
+ }
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsStart(): The AIG is combinational.\n" );
+ return 0;
+ }
+ if ( !(0 <= pPars->nRatio && pPars->nRatio <= 100) )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsStart(): Wrong value of parameter \"-R <num>\".\n" );
+ return 0;
+ }
+ Gia_ManCexAbstractionStart( pAbc->pGia, pPars );
+ pAbc->Status = pPars->Status;
+ pAbc->nFrames = pPars->nFramesDone;
+ Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+ return 0;
+usage:
+ Abc_Print( -2, "usage: &abs_start [-FCR num] [-rpfvh]\n" );
+ Abc_Print( -2, "\t initializes flop map using cex-based abstraction\n" );
+ Abc_Print( -2, "\t-F num : the max number of timeframes for BMC [default = %d]\n", pPars->nFramesBmc );
+// Abc_Print( -2, "\t-S num : the max number of stable frames for BMC [default = %d]\n", pPars->nStableMax );
+ Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver for BMC [default = %d]\n", pPars->nConfMaxBmc );
+ Abc_Print( -2, "\t-R num : the %% of abstracted flops when refinement stops (0<=num<=100) [default = %d]\n", pPars->nRatio );
+ Abc_Print( -2, "\t-r : toggle using BDD-based reachability for filtering [default = %s]\n", pPars->fUseBdds? "yes": "no" );
+ Abc_Print( -2, "\t-p : toggle using \"dprove\" for filtering [default = %s]\n", pPars->fUseDprove? "yes": "no" );
+ Abc_Print( -2, "\t-f : toggle starting BMC from a later frame [default = %s]\n", pPars->fUseStart? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9AbsStartNew( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_ParAbs_t Pars, * pPars = &Pars;
+ int c;
+ extern void Gia_ManCexAbstractionStartNew( Gia_Man_t * pGia, Gia_ParAbs_t * pPars );
+
+ // set defaults
+ Gia_ManAbsSetDefaultParams( pPars );
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "AFSCRBTVrpfvwh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'A':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->Algo = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->Algo < 0 )
+ goto usage;
+ break;
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nFramesBmc = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nFramesBmc < 0 )
+ goto usage;
+ break;
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nStableMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nStableMax < 0 )
+ goto usage;
+ break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nConfMaxBmc = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nConfMaxBmc < 0 )
+ goto usage;
+ break;
+ case 'R':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nRatio = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nRatio < 0 )
+ goto usage;
+ break;
+ case 'B':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nBobPar = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nBobPar < 0 )
+ goto usage;
+ break;
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->TimeOut = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->TimeOut < 0 )
+ goto usage;
+ break;
+ case 'V':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->TimeOutVT = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->TimeOutVT < 0 )
+ goto usage;
+ break;
+ case 'r':
+ pPars->fUseBdds ^= 1;
+ break;
+ case 'p':
+ pPars->fUseDprove ^= 1;
+ break;
+ case 'f':
+ pPars->fUseStart ^= 1;
+ break;
+ case 'v':
+ pPars->fVerbose ^= 1;
+ break;
+ case 'w':
+ pPars->fVeryVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsStartNew(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsStartNew(): The AIG is combinational.\n" );
+ return 0;
+ }
+ if ( !(0 <= pPars->nRatio && pPars->nRatio <= 100) )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsStartNew(): Wrong value of parameter \"-R <num>\".\n" );
+ return 0;
+ }
+ Gia_ManCexAbstractionStartNew( pAbc->pGia, pPars );
+ pAbc->Status = pPars->Status;
+ pAbc->nFrames = pPars->nFramesDone;
+ Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+ if ( pPars->fVerbose )
+ printf( "Updating ABC solving status to be %d and bmc_frames_done to be %d.\n", pPars->Status, pAbc->nFrames );
+ return 0;
+usage:
+ Abc_Print( -2, "usage: &abs_newstart [-AFSCBTV num] [-vwh]\n" );
+ Abc_Print( -2, "\t initializes flop map using cex-based abstraction (by Niklas Een)\n" );
+ Abc_Print( -2, "\t-A num : selects the algorithm to use [default = %d]\n", pPars->Algo );
+ Abc_Print( -2, "\t 0 = cba\n" );
+ Abc_Print( -2, "\t 1 = pba\n" );
+ Abc_Print( -2, "\t 2 = cba-then-pba\n" );
+ Abc_Print( -2, "\t 3 = cba-with-pba\n" );
+ Abc_Print( -2, "\t-F num : the max number of timeframes for BMC [default = %d]\n", pPars->nFramesBmc );
+ Abc_Print( -2, "\t-S num : the max number of stable frames for BMC [default = %d]\n", pPars->nStableMax );
+ Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver for BMC [default = %d]\n", pPars->nConfMaxBmc );
+ Abc_Print( -2, "\t-B num : the max number of frames to wait before trying to quit [default = %d]\n", pPars->nBobPar );
+ Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeOut );
+ Abc_Print( -2, "\t-V num : approximate \"virtual time\" limit in seconds (0=infinite) [default = %d]\n", pPars->TimeOutVT );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9PbaStart( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_ParAbs_t Pars, * pPars = &Pars;
+ int c;
+ extern void Gia_ManProofAbstractionStart( Gia_Man_t * pGia, Gia_ParAbs_t * pPars );
+
+ // set defaults
+ Gia_ManAbsSetDefaultParams( pPars );
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "FCdvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nFramesMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nFramesMax < 0 )
+ goto usage;
+ break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nConfMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nConfMax < 0 )
+ goto usage;
+ break;
+ case 'd':
+ pPars->fDynamic ^= 1;
+ break;
+ case 'v':
+ pPars->fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9PbaStart(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9PbaStart(): The AIG is combinational.\n" );
+ return 0;
}
-// Gia_ManFrontTest( pAbc->pAig );
-// Gia_ManReduceConst( pAbc->pAig, 1 );
-// Sat_ManTest( pAbc->pAig, Gia_ManCo(pAbc->pAig, 0), 0 );
-// Gia_ManTestDistance( pAbc->pAig );
-// Gia_SatSolveTest( pAbc->pAig );
-// For_ManExperiment( pAbc->pAig, 20, 1, 1 );
-// Gia_ManUnrollSpecial( pAbc->pAig, 5, 100, 1 );
+ Gia_ManProofAbstractionStart( pAbc->pGia, pPars );
+ pAbc->Status = pPars->Status;
+ Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+ return 0;
+usage:
+ Abc_Print( -2, "usage: &pba_start [-FC num] [-dvh]\n" );
+ Abc_Print( -2, "\t computes initial flop map using proof-based abstraction\n" );
+ Abc_Print( -2, "\t-F num : the max number of timeframes for PBA [default = %d]\n", pPars->nFramesMax );
+ Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver for PBA [default = %d]\n", pPars->nConfMax );
+// Abc_Print( -2, "\t-G num : the max number of timeframes for BMC [default = %d]\n", pPars->nFramesBmc );
+// Abc_Print( -2, "\t-D num : the max number of conflicts by SAT solver for BMC [default = %d]\n", pPars->nConfMaxBmc );
+// Abc_Print( -2, "\t-R num : the %% of abstracted flops when refinement stops (0<=num<=100) [default = %d]\n", pPars->nRatio );
+ Abc_Print( -2, "\t-d : toggle dynamic unrolling of timeframes [default = %s]\n", pPars->fDynamic? "yes": "no" );
+// Abc_Print( -2, "\t-e : toggle extending abstraction using COI of flops [default = %s]\n", pPars->fExtend? "yes": "no" );
+// Abc_Print( -2, "\t-s : toggle skipping proof-based abstraction [default = %s]\n", pPars->fSkipProof? "yes": "no" );
+// Abc_Print( -2, "\t-r : toggle using BDD-based reachability for filtering [default = %s]\n", pPars->fUseBdds? "yes": "no" );
+// Abc_Print( -2, "\t-p : toggle using \"dprove\" for filtering [default = %s]\n", pPars->fUseDprove? "yes": "no" );
+// Abc_Print( -2, "\t-f : toggle starting BMC from a later frame [default = %s]\n", pPars->fUseStart? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
- if ( fSwitch )
- pAbc->pAig = Gia_ManDupSelf( pTemp = pAbc->pAig );
- else
- pAbc->pAig = Gia_ManRemoveEnables( pTemp = pAbc->pAig );
- Gia_ManStop( pTemp );
-// Cbs_ManSolveTest( pAbc->pAig );
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9AbsDerive( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_Man_t * pTemp = NULL;
+ int c, fVerbose = 0;
+ extern Gia_Man_t * Gia_ManCexAbstractionDerive( Gia_Man_t * pGia );
+ 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 ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsDerive(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
+ pTemp = Gia_ManCexAbstractionDerive( pAbc->pGia );
+ Abc_CommandUpdate9( pAbc, pTemp );
return 0;
usage:
- fprintf( stdout, "usage: &test [-svh]\n" );
- fprintf( stdout, "\t testing various procedures\n" );
- fprintf( stdout, "\t-s : toggle enable (yes) vs. disable (no) [default = %s]\n", fSwitch? "yes": "no" );
- fprintf( stdout, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &abs_derive [-vh]\n" );
+ Abc_Print( -2, "\t performs abstraction using the pre-computed flop map\n" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -25379,54 +26620,458 @@ usage:
SeeAlso []
***********************************************************************/
-int Abc_CommandAbcTestNew( Abc_Frame_t * pAbc, int argc, char ** argv )
+int Abc_CommandAbc9AbsRefine( Abc_Frame_t * pAbc, int argc, char ** argv )
{
- extern int Abc_NtkTestProcedure( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2 );
+ Gia_Man_t * pTemp = NULL;
+ int c, fVerbose = 0;
+ extern int Gia_ManCexAbstractionRefine( Gia_Man_t * pGia, Abc_Cex_t * pCex, int fVerbose );
+ 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 ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsRefine(): There is no AIG.\n" );
+ return 1;
+ }
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "The network is combinational.\n" );
+ return 0;
+ }
+ if ( pAbc->pCex == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9AbsRefine(): There is no counter-example.\n" );
+ return 1;
+ }
+ pAbc->Status = Gia_ManCexAbstractionRefine( pAbc->pGia, pAbc->pCex, fVerbose );
+ Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+ return 0;
- Abc_Ntk_t * pNtk;
- int c;
+usage:
+ Abc_Print( -2, "usage: &abs_refine [-vh]\n" );
+ Abc_Print( -2, "\t refines the pre-computed flop map using the counter-example\n" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
- pNtk = Abc_FrameReadNtk(pAbc);
+/**Function*************************************************************
- // set defaults
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Reparam( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_Man_t * pTemp = NULL;
+ int c, fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
{
switch ( c )
{
+ case 'v':
+ fVerbose ^= 1;
+ break;
case 'h':
goto usage;
default:
goto usage;
}
}
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Reparam(): There is no AIG.\n" );
+ return 1;
+ }
+ pTemp = Gia_ManReparm( pAbc->pGia, fVerbose );
+ Abc_CommandUpdate9( pAbc, pTemp );
+ return 0;
- if ( pNtk == NULL )
+usage:
+ Abc_Print( -2, "usage: &reparam [-vh]\n" );
+ Abc_Print( -2, "\t performs input trimming nad reparameterization\n" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Posplit( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern Aig_Man_t * Aig_ManSplit( Aig_Man_t * p, int nVars, int fVerbose );
+ Aig_Man_t * pMan, * pAux;
+ Gia_Man_t * pTemp = NULL;
+ int c, nVars = 5, fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'N':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nVars = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nVars < 0 )
+ goto usage;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
{
- fprintf( stdout, "Empty network.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Posplit(): There is no AIG.\n" );
return 1;
+ }
+ pMan = Gia_ManToAigSimple( pAbc->pGia );
+ pMan = Aig_ManSplit( pAux = pMan, nVars, fVerbose );
+ Aig_ManStop( pAux );
+ if ( pMan != NULL )
+ {
+ pTemp = Gia_ManFromAigSimple( pMan );
+ Aig_ManStop( pMan );
+ Abc_CommandUpdate9( pAbc, pTemp );
}
+ return 0;
- if ( !Abc_NtkIsStrash( pNtk) )
+usage:
+ Abc_Print( -2, "usage: &posplit [-N num] [-vh]\n" );
+ Abc_Print( -2, "\t cofactors the property output w.r.t. a support subset\n" );
+ Abc_Print( -2, "\t (the OR of new PO functions is equal to the original property)\n" );
+ Abc_Print( -2, "\t-N num : the number of random cofactoring variables [default = %d]\n", nVars );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Reach( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_ParLlb_t Pars, * pPars = &Pars;
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ char * pLogFileName = NULL;
+ int c;
+ extern int Llb_ManModelCheckGia( Gia_Man_t * pGia, Gia_ParLlb_t * pPars );
+
+ // set defaults
+ Llb_ManSetDefaultParams( pPars );
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "TBFCHSLripcsyzvwh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->TimeLimit < 0 )
+ goto usage;
+ break;
+ case 'B':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nBddMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nBddMax < 0 )
+ goto usage;
+ break;
+ case 'F':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nIterMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nIterMax < 0 )
+ goto usage;
+ break;
+ case 'C':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nClusterMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nClusterMax < 0 )
+ goto usage;
+ break;
+ case 'H':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->nHintDepth = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->nHintDepth < 0 )
+ goto usage;
+ break;
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->HintFirst = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->HintFirst < 0 )
+ goto usage;
+ break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
+ case 'r':
+ pPars->fReorder ^= 1;
+ break;
+ case 'i':
+ pPars->fIndConstr ^= 1;
+ break;
+ case 'p':
+ pPars->fUsePivots ^= 1;
+ break;
+ case 'c':
+ pPars->fCluster ^= 1;
+ break;
+ case 's':
+ pPars->fSchedule ^= 1;
+ break;
+ case 'y':
+ pPars->fSkipOutCheck ^= 1;
+ break;
+ case 'z':
+ pPars->fSkipReach ^= 1;
+ break;
+ case 'v':
+ pPars->fVerbose ^= 1;
+ break;
+ case 'w':
+ pPars->fVeryVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
{
- fprintf( stdout, "The current network is not an AIG. Cannot continue.\n" );
+ Abc_Print( -1, "Abc_CommandAbc9Reach(): There is no AIG.\n" );
return 1;
}
+ if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Reach(): The current AIG has no latches.\n" );
+ return 0;
+ }
+ pAbc->Status = Llb_ManModelCheckGia( pAbc->pGia, pPars );
+ pAbc->nFrames = pPars->iFrame;
+ Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, "&reach" );
+ return 0;
-// Abc_NtkTestProcedure( pNtk, NULL );
+usage:
+ Abc_Print( -2, "usage: &reach [-TBFCHS num] [-L file] [-ripcsyzvwh]\n" );
+ Abc_Print( -2, "\t verifies sequential miter using BDD-based reachability\n" );
+ Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
+ Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
+ Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
+ Abc_Print( -2, "\t-C num : max number of variables in a cluster [default = %d]\n", pPars->nClusterMax );
+ Abc_Print( -2, "\t-H num : max number of hints to use [default = %d]\n", pPars->nHintDepth );
+ Abc_Print( -2, "\t-S num : the number of the starting hint [default = %d]\n", pPars->HintFirst );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+ Abc_Print( -2, "\t-r : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
+ Abc_Print( -2, "\t-i : enable extraction of inductive constraints [default = %s]\n", pPars->fIndConstr? "yes": "no" );
+ Abc_Print( -2, "\t-p : enable partitions for internal cut-points [default = %s]\n", pPars->fUsePivots? "yes": "no" );
+ Abc_Print( -2, "\t-c : enable clustering of partitions [default = %s]\n", pPars->fCluster? "yes": "no" );
+ Abc_Print( -2, "\t-s : enable scheduling of clusters [default = %s]\n", pPars->fSchedule? "yes": "no" );
+ Abc_Print( -2, "\t-y : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
+ Abc_Print( -2, "\t-z : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
+ Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-w : prints dependency matrix [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Undo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ int c;
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no design.\n" );
+ return 1;
+ }
+ if ( pAbc->pGia2 == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no previously saved network.\n" );
+ return 1;
+ }
+ Gia_ManStop( pAbc->pGia );
+ pAbc->pGia = pAbc->pGia2;
+ pAbc->pGia2 = NULL;
return 0;
usage:
- fprintf( stdout, "usage: testnew [-h]\n" );
- fprintf( stdout, "\t new testing procedure\n" );
- fprintf( stdout, "\t-h : print the command usage\n");
+ Abc_Print( -2, "usage: &undo [-h]\n" );
+ Abc_Print( -2, "\t reverses the previous AIG transformation\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Gia_Man_t * pTemp = NULL;
+ int c, fVerbose = 0;
+ int fSwitch = 0;
+ extern void Gia_SatSolveTest( Gia_Man_t * p );
+ extern void Cbs_ManSolveTest( Gia_Man_t * pGia );
+
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 's':
+ fSwitch ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Test(): There is no AIG.\n" );
+ return 1;
+ }
+// Gia_ManFrontTest( pAbc->pGia );
+// Gia_ManReduceConst( pAbc->pGia, 1 );
+// Sat_ManTest( pAbc->pGia, Gia_ManCo(pAbc->pGia, 0), 0 );
+// Gia_ManTestDistance( pAbc->pGia );
+// Gia_SatSolveTest( pAbc->pGia );
+// For_ManExperiment( pAbc->pGia, 20, 1, 1 );
+// Gia_ManUnrollSpecial( pAbc->pGia, 5, 100, 1 );
+
+ if ( fSwitch )
+ pAbc->pGia = Gia_ManDupSelf( pTemp = pAbc->pGia );
+ else
+ pAbc->pGia = Gia_ManRemoveEnables( pTemp = pAbc->pGia );
+ Gia_ManStop( pTemp );
+// Cbs_ManSolveTest( pAbc->pGia );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &test [-svh]\n" );
+ Abc_Print( -2, "\t testing various procedures\n" );
+ Abc_Print( -2, "\t-s : toggle enable (yes) vs. disable (no) [default = %s]\n", fSwitch? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcAbc8.c b/src/base/abci/abcAbc8.c
index a306a8e4..3bfaaa98 100644
--- a/src/base/abci/abcAbc8.c
+++ b/src/base/abci/abcAbc8.c
@@ -22,6 +22,11 @@
#include "nwk.h"
#include "mfx.h"
+#include "main.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -67,12 +72,12 @@ Nwk_Man_t * Abc_NtkToNtkNew( Abc_Ntk_t * pNtk )
Abc_NtkForEachCi( pNtk, pObj, i )
pObj->pCopy = (Abc_Obj_t *)Nwk_ManCreateCi( pNtkNew, Abc_ObjFanoutNum(pObj) );
vNodes = Abc_NtkDfs( pNtk, 1 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
pObjNew = Nwk_ManCreateNode( pNtkNew, Abc_ObjFaninNum(pObj), Abc_ObjFanoutNum(pObj) );
Abc_ObjForEachFanin( pObj, pFanin, k )
Nwk_ObjAddFanin( pObjNew, (Nwk_Obj_t *)pFanin->pCopy );
- pObjNew->pFunc = Hop_Transfer( pNtk->pManFunc, pNtkNew->pManHop, pObj->pData, Abc_ObjFaninNum(pObj) );
+ pObjNew->pFunc = Hop_Transfer( (Hop_Man_t *)pNtk->pManFunc, pNtkNew->pManHop, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj) );
pObj->pCopy = (Abc_Obj_t *)pObjNew;
}
Vec_PtrFree( vNodes );
@@ -115,14 +120,14 @@ Abc_Ntk_t * Abc_NtkFromNtkNew( Abc_Ntk_t * pNtkOld, Nwk_Man_t * pNtk )
Abc_ObjAssignName( pObjNew, Abc_ObjName( Abc_NtkCi(pNtkOld, i) ), NULL );
}
vNodes = Nwk_ManDfs( pNtk );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
{
if ( !Nwk_ObjIsNode(pObj) )
continue;
pObjNew = Abc_NtkCreateNode( pNtkNew );
Nwk_ObjForEachFanin( pObj, pFanin, k )
- Abc_ObjAddFanin( pObjNew, pFanin->pCopy );
- pObjNew->pData = Hop_Transfer( pNtk->pManHop, pNtkNew->pManFunc, pObj->pFunc, Nwk_ObjFaninNum(pObj) );
+ Abc_ObjAddFanin( pObjNew, (Abc_Obj_t *)pFanin->pCopy );
+ pObjNew->pData = Hop_Transfer( pNtk->pManHop, (Hop_Man_t *)pNtkNew->pManFunc, pObj->pFunc, Nwk_ObjFaninNum(pObj) );
pObj->pCopy = (Nwk_Obj_t *)pObjNew;
}
Vec_PtrFree( vNodes );
@@ -130,9 +135,9 @@ Abc_Ntk_t * Abc_NtkFromNtkNew( Abc_Ntk_t * pNtkOld, Nwk_Man_t * pNtk )
{
pObjNew = Abc_NtkCreatePo( pNtkNew );
if ( pObj->fInvert )
- pFaninNew = Abc_NtkCreateNodeInv( pNtkNew, Nwk_ObjFanin0(pObj)->pCopy );
+ pFaninNew = Abc_NtkCreateNodeInv( pNtkNew, (Abc_Obj_t *)Nwk_ObjFanin0(pObj)->pCopy );
else
- pFaninNew = Nwk_ObjFanin0(pObj)->pCopy;
+ pFaninNew = (Abc_Obj_t *)Nwk_ObjFanin0(pObj)->pCopy;
Abc_ObjAddFanin( pObjNew, pFaninNew );
Abc_ObjAssignName( pObjNew, Abc_ObjName( Abc_NtkCo(pNtkOld, i) ), NULL );
}
@@ -198,7 +203,7 @@ clk = clock();
ABC_PRT( "Time", clock() - clk );
pMan = Abc_NtkToNtkNew( pNtk );
- pMan->pLutLib = Abc_FrameReadLibLut();
+ pMan->pLutLib = (If_Lib_t *)Abc_FrameReadLibLut();
clk = clock();
printf( "%6.2f\n", Nwk_ManDelayTraceLut( pMan ) );
ABC_PRT( "Time", clock() - clk );
@@ -221,7 +226,6 @@ ABC_PRT( "Time", clock() - clk );
***********************************************************************/
Abc_Ntk_t * Abc_NtkNtkTest4( Abc_Ntk_t * pNtk, If_Lib_t * pLutLib )
{
- extern int Mfx_Perform( Nwk_Man_t * pNtk, Mfx_Par_t * pPars, If_Lib_t * pLutLib );
Mfx_Par_t Pars, * pPars = &Pars;
Abc_Ntk_t * pNtkNew;
@@ -272,3 +276,5 @@ Abc_Ntk_t * Abc_NtkNtkTest( Abc_Ntk_t * pNtk, If_Lib_t * pLutLib )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcAttach.c b/src/base/abci/abcAttach.c
index e35cfdf6..d1712f4d 100644
--- a/src/base/abci/abcAttach.c
+++ b/src/base/abci/abcAttach.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -66,7 +69,7 @@ int Abc_NtkAttach( Abc_Ntk_t * pNtk )
assert( Abc_NtkIsSopLogic(pNtk) );
// check that the library is available
- pGenlib = Abc_FrameReadLibGen();
+ pGenlib = (Mio_Library_t *)Abc_FrameReadLibGen();
if ( pGenlib == NULL )
{
printf( "The current library is not available.\n" );
@@ -94,14 +97,14 @@ int Abc_NtkAttach( Abc_Ntk_t * pNtk )
nFanins = Abc_ObjFaninNum(pNode);
if ( nFanins == 0 )
{
- if ( Abc_SopIsConst1(pNode->pData) )
+ if ( Abc_SopIsConst1((char *)pNode->pData) )
pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadConst1(pGenlib);
else
pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadConst0(pGenlib);
}
else if ( nFanins == 1 )
{
- if ( Abc_SopIsBuf(pNode->pData) )
+ if ( Abc_SopIsBuf((char *)pNode->pData) )
pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadBuf(pGenlib);
else
pNode->pCopy = (Abc_Obj_t *)Mio_LibraryReadInv(pGenlib);
@@ -142,7 +145,7 @@ int Abc_NtkAttach( Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pNode, i )
pNode->pData = pNode->pCopy, pNode->pCopy = NULL;
pNtk->ntkFunc = ABC_FUNC_MAP;
- Extra_MmFlexStop( pNtk->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)pNtk->pManFunc );
pNtk->pManFunc = pGenlib;
printf( "Library gates are successfully attached to the nodes.\n" );
@@ -177,7 +180,7 @@ int Abc_NodeAttach( Abc_Obj_t * pNode, Mio_Gate_t ** ppGates, unsigned ** puTrut
int nFanins, i;
// compute the node's truth table
- Abc_AttachComputeTruth( pNode->pData, uTruths, uTruthNode );
+ Abc_AttachComputeTruth( (char *)pNode->pData, uTruths, uTruthNode );
// find the matching gate and permutation
pGate = Abc_AttachFind( ppGates, puTruthGates, nGates, uTruthNode, Perm );
if ( pGate == NULL )
@@ -402,3 +405,5 @@ void Abc_TruthPermute( char * pPerm, int nVars, unsigned * uTruthNode, unsigned
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcAuto.c b/src/base/abci/abcAuto.c
index 13be6eea..b595a536 100644
--- a/src/base/abci/abcAuto.c
+++ b/src/base/abci/abcAuto.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -237,3 +240,5 @@ void Abc_NtkAutoPrintOne( DdManager * dd, int nInputs, DdNode * pbOutputs[], int
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcBalance.c b/src/base/abci/abcBalance.c
index 134a175a..9c16bd2c 100644
--- a/src/base/abci/abcBalance.c
+++ b/src/base/abci/abcBalance.c
@@ -20,14 +20,17 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplicate, bool fSelective, bool fUpdateLevel );
-static Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Level, bool fDuplicate, bool fSelective, bool fUpdateLevel );
-static Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vSuper, int Level, int fDuplicate, bool fSelective );
-static int Abc_NodeBalanceCone_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, bool fFirst, bool fDuplicate, bool fSelective );
+static void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, int fDuplicate, int fSelective, int fUpdateLevel );
+static Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Level, int fDuplicate, int fSelective, int fUpdateLevel );
+static Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vSuper, int Level, int fDuplicate, int fSelective );
+static int Abc_NodeBalanceCone_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, int fFirst, int fDuplicate, int fSelective );
static void Abc_NtkMarkCriticalNodes( Abc_Ntk_t * pNtk );
static Vec_Ptr_t * Abc_NodeBalanceConeExor( Abc_Obj_t * pNode );
@@ -47,7 +50,7 @@ static Vec_Ptr_t * Abc_NodeBalanceConeExor( Abc_Obj_t * pNode );
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective, bool fUpdateLevel )
+Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, int fDuplicate, int fSelective, int fUpdateLevel )
{
// extern void Abc_NtkHaigTranfer( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew );
Abc_Ntk_t * pNtkAig;
@@ -65,6 +68,7 @@ Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective,
// perform balancing
Abc_NtkBalancePerform( pNtk, pNtkAig, fDuplicate, fSelective, fUpdateLevel );
Abc_NtkFinalize( pNtk, pNtkAig );
+ Abc_AigCleanup( pNtkAig->pManFunc );
// undo the required times
if ( fSelective )
{
@@ -94,7 +98,7 @@ Abc_Ntk_t * Abc_NtkBalance( Abc_Ntk_t * pNtk, bool fDuplicate, bool fSelective,
SeeAlso []
***********************************************************************/
-void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, bool fDuplicate, bool fSelective, bool fUpdateLevel )
+void Abc_NtkBalancePerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkAig, int fDuplicate, int fSelective, int fUpdateLevel )
{
ProgressBar * pProgress;
Vec_Vec_t * vStorage;
@@ -142,19 +146,19 @@ int Abc_NodeBalanceFindLeft( Vec_Ptr_t * vSuper )
return 0;
// set the pointer to the one before the last
Current = Vec_PtrSize(vSuper) - 2;
- pNodeRight = Vec_PtrEntry( vSuper, Current );
+ pNodeRight = (Abc_Obj_t *)Vec_PtrEntry( vSuper, Current );
// go through the nodes to the left of this one
for ( Current--; Current >= 0; Current-- )
{
// get the next node on the left
- pNodeLeft = Vec_PtrEntry( vSuper, Current );
+ pNodeLeft = (Abc_Obj_t *)Vec_PtrEntry( vSuper, Current );
// if the level of this node is different, quit the loop
if ( Abc_ObjRegular(pNodeLeft)->Level != Abc_ObjRegular(pNodeRight)->Level )
break;
}
Current++;
// get the node, for which the equality holds
- pNodeLeft = Vec_PtrEntry( vSuper, Current );
+ pNodeLeft = (Abc_Obj_t *)Vec_PtrEntry( vSuper, Current );
assert( Abc_ObjRegular(pNodeLeft)->Level == Abc_ObjRegular(pNodeRight)->Level );
return Current;
}
@@ -181,13 +185,13 @@ void Abc_NodeBalancePermute( Abc_Ntk_t * pNtkNew, Vec_Ptr_t * vSuper, int LeftBo
if ( LeftBound == RightBound )
return;
// get the two last nodes
- pNode1 = Vec_PtrEntry( vSuper, RightBound + 1 );
- pNode2 = Vec_PtrEntry( vSuper, RightBound );
+ pNode1 = (Abc_Obj_t *)Vec_PtrEntry( vSuper, RightBound + 1 );
+ pNode2 = (Abc_Obj_t *)Vec_PtrEntry( vSuper, RightBound );
// find the first node that can be shared
for ( i = RightBound; i >= LeftBound; i-- )
{
- pNode3 = Vec_PtrEntry( vSuper, i );
- if ( Abc_AigAndLookup( pNtkNew->pManFunc, pNode1, pNode3 ) )
+ pNode3 = (Abc_Obj_t *)Vec_PtrEntry( vSuper, i );
+ if ( Abc_AigAndLookup( (Abc_Aig_t *)pNtkNew->pManFunc, pNode1, pNode3 ) )
{
if ( pNode3 == pNode2 )
return;
@@ -220,9 +224,9 @@ void Abc_NodeBalancePermute( Abc_Ntk_t * pNtkNew, Vec_Ptr_t * vSuper, int LeftBo
SeeAlso []
***********************************************************************/
-Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_Vec_t * vStorage, int Level, bool fDuplicate, bool fSelective, bool fUpdateLevel )
+Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_Vec_t * vStorage, int Level, int fDuplicate, int fSelective, int fUpdateLevel )
{
- Abc_Aig_t * pMan = pNtkNew->pManFunc;
+ Abc_Aig_t * pMan = (Abc_Aig_t *)pNtkNew->pManFunc;
Abc_Obj_t * pNodeNew, * pNode1, * pNode2;
Vec_Ptr_t * vSuper;
int i, LeftBound;
@@ -242,13 +246,13 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_
// for each old node, derive the new well-balanced node
for ( i = 0; i < vSuper->nSize; i++ )
{
- pNodeNew = Abc_NodeBalance_rec( pNtkNew, Abc_ObjRegular(vSuper->pArray[i]), vStorage, Level + 1, fDuplicate, fSelective, fUpdateLevel );
- vSuper->pArray[i] = Abc_ObjNotCond( pNodeNew, Abc_ObjIsComplement(vSuper->pArray[i]) );
+ pNodeNew = Abc_NodeBalance_rec( pNtkNew, Abc_ObjRegular((Abc_Obj_t *)vSuper->pArray[i]), vStorage, Level + 1, fDuplicate, fSelective, fUpdateLevel );
+ vSuper->pArray[i] = Abc_ObjNotCond( pNodeNew, Abc_ObjIsComplement((Abc_Obj_t *)vSuper->pArray[i]) );
}
if ( vSuper->nSize < 2 )
printf( "BUG!\n" );
// sort the new nodes by level in the decreasing order
- Vec_PtrSort( vSuper, Abc_NodeCompareLevelsDecrease );
+ Vec_PtrSort( vSuper, (int (*)(void))Abc_NodeCompareLevelsDecrease );
// balance the nodes
assert( vSuper->nSize > 1 );
while ( vSuper->nSize > 1 )
@@ -258,14 +262,14 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_
// find the node that can be shared (if no such node, randomize choice)
Abc_NodeBalancePermute( pNtkNew, vSuper, LeftBound );
// pull out the last two nodes
- pNode1 = Vec_PtrPop(vSuper);
- pNode2 = Vec_PtrPop(vSuper);
+ pNode1 = (Abc_Obj_t *)Vec_PtrPop(vSuper);
+ pNode2 = (Abc_Obj_t *)Vec_PtrPop(vSuper);
Abc_VecObjPushUniqueOrderByLevel( vSuper, Abc_AigAnd(pMan, pNode1, pNode2) );
}
// make sure the balanced node is not assigned
assert( pNodeOld->pCopy == NULL );
// mark the old node with the new node
- pNodeOld->pCopy = vSuper->pArray[0];
+ pNodeOld->pCopy = (Abc_Obj_t *)vSuper->pArray[0];
vSuper->nSize = 0;
// if ( Abc_ObjRegular(pNodeOld->pCopy) == Abc_AigConst1(pNtkNew) )
// printf( "Constant node\n" );
@@ -289,7 +293,7 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_
SeeAlso []
***********************************************************************/
-Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Level, int fDuplicate, bool fSelective )
+Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Level, int fDuplicate, int fSelective )
{
Vec_Ptr_t * vNodes;
int RetValue, i;
@@ -298,7 +302,7 @@ Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Le
if ( Vec_VecSize( vStorage ) <= Level )
Vec_VecPush( vStorage, Level, 0 );
// get the temporary array of nodes
- vNodes = Vec_VecEntry( vStorage, Level );
+ vNodes = (Vec_Ptr_t *)Vec_VecEntry( vStorage, Level );
Vec_PtrClear( vNodes );
// collect the nodes in the implication supergate
RetValue = Abc_NodeBalanceCone_rec( pNode, vNodes, 1, fDuplicate, fSelective );
@@ -327,7 +331,7 @@ Vec_Ptr_t * Abc_NodeBalanceCone( Abc_Obj_t * pNode, Vec_Vec_t * vStorage, int Le
SeeAlso []
***********************************************************************/
-int Abc_NodeBalanceCone_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, bool fFirst, bool fDuplicate, bool fSelective )
+int Abc_NodeBalanceCone_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, int fFirst, int fDuplicate, int fSelective )
{
int RetValue1, RetValue2, i;
// check if the node is visited
@@ -374,7 +378,7 @@ int Abc_NodeBalanceCone_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, bool fFirst,
SeeAlso []
***********************************************************************/
-int Abc_NodeBalanceConeExor_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, bool fFirst )
+int Abc_NodeBalanceConeExor_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vSuper, int fFirst )
{
int RetValue1, RetValue2, i;
// check if the node occurs in the same polarity
@@ -459,7 +463,7 @@ Vec_Ptr_t * Abc_NodeFindCone_rec( Abc_Obj_t * pNode )
RetValue = Abc_NodeBalanceCone_rec( pNode, vNodes, 1, 1, 0 );
assert( vNodes->nSize > 1 );
// unmark the visited nodes
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
Abc_ObjRegular(pNode)->fMarkB = 0;
// if we found the node and its complement in the same implication supergate,
// return empty set of nodes (meaning that we should use constant-0 node)
@@ -467,7 +471,7 @@ Vec_Ptr_t * Abc_NodeFindCone_rec( Abc_Obj_t * pNode )
vNodes->nSize = 0;
}
// call for the fanin
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
pNode = Abc_ObjRegular(pNode);
if ( pNode->pCopy )
@@ -549,7 +553,7 @@ int Abc_NtkBalanceLevel_rec( Abc_Obj_t * pNode )
vSuper = (Vec_Ptr_t *)pNode->pCopy;
assert( vSuper != NULL );
LevelMax = 0;
- Vec_PtrForEachEntry( vSuper, pFanin, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSuper, pFanin, i )
{
pFanin = Abc_ObjRegular(pFanin);
Abc_NtkBalanceLevel_rec(pFanin);
@@ -610,3 +614,5 @@ void Abc_NtkMarkCriticalNodes( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcBidec.c b/src/base/abci/abcBidec.c
index 0b6165fb..bae29e07 100644
--- a/src/base/abci/abcBidec.c
+++ b/src/base/abci/abcBidec.c
@@ -20,12 +20,16 @@
#include "abc.h"
#include "bdc.h"
+#include "kit.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static inline Hop_Obj_t * Bdc_FunCopyHop( Bdc_Fun_t * pObj ) { return Hop_NotCond( Bdc_FuncCopy(Bdc_Regular(pObj)), Bdc_IsComplement(pObj) ); }
+static inline Hop_Obj_t * Bdc_FunCopyHop( Bdc_Fun_t * pObj ) { return Hop_NotCond( (Hop_Obj_t *)Bdc_FuncCopy(Bdc_Regular(pObj)), Bdc_IsComplement(pObj) ); }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -128,9 +132,9 @@ void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose )
{
if ( Abc_ObjFaninNum(pObj) > 15 )
continue;
- nNodes1 = Hop_DagSize(pObj->pData);
- pObj->pData = Abc_NodeIfNodeResyn( p, pNtk->pManFunc, pObj->pData, Abc_ObjFaninNum(pObj), vTruth, NULL, -1.0 );
- nNodes2 = Hop_DagSize(pObj->pData);
+ nNodes1 = Hop_DagSize((Hop_Obj_t *)pObj->pData);
+ pObj->pData = Abc_NodeIfNodeResyn( p, (Hop_Man_t *)pNtk->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj), vTruth, NULL, -1.0 );
+ nNodes2 = Hop_DagSize((Hop_Obj_t *)pObj->pData);
nGainTotal += nNodes1 - nNodes2;
}
Bdc_ManFree( p );
@@ -148,3 +152,5 @@ void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcBm.c b/src/base/abci/abcBm.c
new file mode 100644
index 00000000..8855fd9e
--- /dev/null
+++ b/src/base/abci/abcBm.c
@@ -0,0 +1,2047 @@
+/**CFile****************************************************************
+
+ FileName [bm.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Boolean Matching package.]
+
+ Synopsis [Check P-equivalence and PP-equivalence of two circuits.]
+
+ Author [Hadi Katebi]
+
+ Affiliation [University of Michigan]
+
+ Date [Ver. 1.0. Started - January, 2009.]
+
+ Revision [No revisions so far]
+
+ Comments [This is the cleaned up version of the code I used for DATE 2010 publication.]
+ [If you have any question or if you find a bug, contact me at hadik@umich.edu.]
+ [I don't guarantee that I can fix all the bugs, but I can definitely point you to
+ the right direction so you can fix the bugs yourself].
+
+ Debugging [There are some part of the code that are commented out. Those parts mostly print
+ the contents of the data structures to the standard output. Un-comment them if you
+ find them useful for debugging.]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "sim.h"
+#include "satSolver.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+int match1by1(Abc_Ntk_t * pNtk1, Vec_Ptr_t ** nodesInLevel1, Vec_Int_t ** iMatch1, Vec_Int_t ** iDep1, Vec_Int_t * matchedInputs1, int * iGroup1, Vec_Int_t ** oMatch1, int * oGroup1,
+ Abc_Ntk_t * pNtk2, Vec_Ptr_t ** nodesInLevel2, Vec_Int_t ** iMatch2, Vec_Int_t ** iDep2, Vec_Int_t * matchedInputs2, int * iGroup2, Vec_Int_t ** oMatch2, int * oGroup2,
+ Vec_Int_t * matchedOutputs1, Vec_Int_t * matchedOutputs2, Vec_Int_t * oMatchedGroups, Vec_Int_t * iNonSingleton, int ii, int idx);
+
+int Abc_NtkBmSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Vec_Ptr_t * iMatchPairs, Vec_Ptr_t * oMatchPairs, Vec_Int_t * mismatch, int mode);
+
+void getDependencies(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, Vec_Int_t** oDep)
+{
+ Vec_Ptr_t * vSuppFun;
+ int i, j;
+
+ vSuppFun = Sim_ComputeFunSupp(pNtk, 0);
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++) {
+ char * seg = (char *)vSuppFun->pArray[i];
+
+ for(j = 0; j < Abc_NtkPiNum(pNtk); j+=8) {
+ if(((*seg) & 0x01) == 0x01)
+ Vec_IntPushOrder(oDep[i], j);
+ if(((*seg) & 0x02) == 0x02)
+ Vec_IntPushOrder(oDep[i], j+1);
+ if(((*seg) & 0x04) == 0x04)
+ Vec_IntPushOrder(oDep[i], j+2);
+ if(((*seg) & 0x08) == 0x08)
+ Vec_IntPushOrder(oDep[i], j+3);
+ if(((*seg) & 0x10) == 0x10)
+ Vec_IntPushOrder(oDep[i], j+4);
+ if(((*seg) & 0x20) == 0x20)
+ Vec_IntPushOrder(oDep[i], j+5);
+ if(((*seg) & 0x40) == 0x40)
+ Vec_IntPushOrder(oDep[i], j+6);
+ if(((*seg) & 0x80) == 0x80)
+ Vec_IntPushOrder(oDep[i], j+7);
+
+ seg++;
+ }
+ }
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ for(j = 0; j < Vec_IntSize(oDep[i]); j++)
+ Vec_IntPush(iDep[Vec_IntEntry(oDep[i], j)], i);
+
+
+ /*for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ {
+ printf("Output %d: ", i);
+ for(j = 0; j < Vec_IntSize(oDep[i]); j++)
+ printf("%d ", Vec_IntEntry(oDep[i], j));
+ printf("\n");
+ }
+
+ printf("\n");
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk); i++)
+ {
+ printf("Input %d: ", i);
+ for(j = 0; j < Vec_IntSize(iDep[i]); j++)
+ printf("%d ", Vec_IntEntry(iDep[i], j));
+ printf("\n");
+ }
+
+ printf("\n"); */
+}
+
+void initMatchList(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, Vec_Int_t** oDep, Vec_Int_t** iMatch, int* iLastItem, Vec_Int_t** oMatch, int* oLastItem, int* iGroup, int* oGroup, int p_equivalence)
+{
+ int i, j, curr;
+ Vec_Int_t** temp;
+
+ if(!p_equivalence) {
+ temp = ABC_ALLOC( Vec_Int_t*, Abc_NtkPiNum(pNtk)+1);
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk)+1; i++)
+ temp[i] = Vec_IntAlloc( 0 );
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ Vec_IntPush(temp[Vec_IntSize(oDep[i])], i);
+
+ curr = 0;
+ for(i = 0; i < Abc_NtkPiNum(pNtk)+1; i++)
+ {
+ if(Vec_IntSize(temp[i]) == 0)
+ Vec_IntFree( temp[i] );
+
+ else
+ {
+ oMatch[curr] = temp[i];
+
+ for(j = 0; j < Vec_IntSize(temp[i]); j++)
+ oGroup[Vec_IntEntry(oMatch[curr], j)] = curr;
+
+ curr++;
+ }
+ }
+
+ *oLastItem = curr;
+
+ ABC_FREE( temp );
+ }
+ else {
+ // the else part fixes the outputs for P-equivalence checking
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ {
+ Vec_IntPush(oMatch[i], i);
+ oGroup[i] = i;
+ (*oLastItem) = Abc_NtkPoNum(pNtk);
+ }
+ }
+
+ /*for(j = 0; j < *oLastItem; j++)
+ {
+ printf("oMatch %d: ", j);
+ for(i = 0; i < Vec_IntSize(oMatch[j]); i++)
+ printf("%d ", Vec_IntEntry(oMatch[j], i));
+ printf("\n");
+ }
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ printf("%d: %d ", i, oGroup[i]);*/
+
+ //////////////////////////////////////////////////////////////////////////////
+
+ temp = ABC_ALLOC( Vec_Int_t*, Abc_NtkPoNum(pNtk)+1 );
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk)+1; i++)
+ temp[i] = Vec_IntAlloc( 0 );
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk); i++)
+ Vec_IntPush(temp[Vec_IntSize(iDep[i])], i);
+
+ curr = 0;
+ for(i = 0; i < Abc_NtkPoNum(pNtk)+1; i++)
+ {
+ if(Vec_IntSize(temp[i]) == 0)
+ Vec_IntFree( temp[i] );
+ else
+ {
+ iMatch[curr] = temp[i];
+ for(j = 0; j < Vec_IntSize(iMatch[curr]); j++)
+ iGroup[Vec_IntEntry(iMatch[curr], j)] = curr;
+ curr++;
+ }
+ }
+
+ *iLastItem = curr;
+
+ ABC_FREE( temp );
+
+ /*printf("\n");
+ for(j = 0; j < *iLastItem; j++)
+ {
+ printf("iMatch %d: ", j);
+ for(i = 0; i < Vec_IntSize(iMatch[j]); i++)
+ printf("%d ", Vec_IntEntry(iMatch[j], i));
+ printf("\n");
+ }
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk); i++)
+ printf("%d: %d ", i, iGroup[i]);
+ printf("\n");*/
+}
+
+void iSortDependencies(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, int* oGroup)
+{
+ int i, j, k;
+ Vec_Int_t * temp;
+ Vec_Int_t * oGroupList;
+
+ oGroupList = Vec_IntAlloc( 10 );
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk); i++)
+ {
+ if(Vec_IntSize(iDep[i]) == 1)
+ continue;
+
+ temp = Vec_IntAlloc( Vec_IntSize(iDep[i]) );
+
+ for(j = 0; j < Vec_IntSize(iDep[i]); j++)
+ Vec_IntPushUniqueOrder(oGroupList, oGroup[Vec_IntEntry(iDep[i], j)]);
+
+ for(j = 0; j < Vec_IntSize(oGroupList); j++)
+ {
+ for(k = 0; k < Vec_IntSize(iDep[i]); k++)
+ if(oGroup[Vec_IntEntry(iDep[i], k)] == Vec_IntEntry(oGroupList, j))
+ {
+ Vec_IntPush( temp, Vec_IntEntry(iDep[i], k) );
+ Vec_IntRemove( iDep[i], Vec_IntEntry(iDep[i], k) );
+ k--;
+ }
+ }
+
+ Vec_IntFree( iDep[i] );
+ iDep[i] = temp;
+ Vec_IntClear( oGroupList );
+
+ /*printf("Input %d: ", i);
+ for(j = 0; j < Vec_IntSize(iDep[i]); j++)
+ printf("%d ", Vec_IntEntry(iDep[i], j));
+ printf("\n");*/
+ }
+
+ Vec_IntFree( oGroupList );
+}
+
+void oSortDependencies(Abc_Ntk_t *pNtk, Vec_Int_t** oDep, int* iGroup)
+{
+ int i, j, k;
+ Vec_Int_t * temp;
+ Vec_Int_t * iGroupList;
+
+ iGroupList = Vec_IntAlloc( 10 );
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ {
+ if(Vec_IntSize(oDep[i]) == 1)
+ continue;
+
+ temp = Vec_IntAlloc( Vec_IntSize(oDep[i]) );
+
+ for(j = 0; j < Vec_IntSize(oDep[i]); j++)
+ Vec_IntPushUniqueOrder(iGroupList, iGroup[Vec_IntEntry(oDep[i], j)]);
+
+ for(j = 0; j < Vec_IntSize(iGroupList); j++)
+ {
+ for(k = 0; k < Vec_IntSize(oDep[i]); k++)
+ if(iGroup[Vec_IntEntry(oDep[i], k)] == Vec_IntEntry(iGroupList, j))
+ {
+ Vec_IntPush( temp, Vec_IntEntry(oDep[i], k) );
+ Vec_IntRemove( oDep[i], Vec_IntEntry(oDep[i], k) );
+ k--;
+ }
+ }
+
+ Vec_IntFree( oDep[i] );
+ oDep[i] = temp;
+ Vec_IntClear( iGroupList );
+
+ /*printf("Output %d: ", i);
+ for(j = 0; j < Vec_IntSize(oDep[i]); j++)
+ printf("%d ", Vec_IntEntry(oDep[i], j));
+ printf("\n");*/
+ }
+
+ Vec_IntFree( iGroupList );
+}
+
+int oSplitByDep(Abc_Ntk_t *pNtk, Vec_Int_t** oDep, Vec_Int_t** oMatch, int* oGroup, int* oLastItem, int* iGroup)
+{
+ int i, j, k;
+ int numOfItemsAdded;
+ Vec_Int_t * array, * sortedArray;
+
+ numOfItemsAdded = 0;
+
+ for(i = 0; i < *oLastItem; i++)
+ {
+ if(Vec_IntSize(oMatch[i]) == 1)
+ continue;
+
+ array = Vec_IntAlloc( Vec_IntSize(oMatch[i]) );
+ sortedArray = Vec_IntAlloc( Vec_IntSize(oMatch[i]) );
+
+ for(j = 0; j < Vec_IntSize(oMatch[i]); j++)
+ {
+ int factor, encode;
+
+ encode = 0;
+ factor = 1;
+
+ for(k = 0; k < Vec_IntSize(oDep[Vec_IntEntry(oMatch[i], j)]); k++)
+ encode += iGroup[Vec_IntEntry(oDep[Vec_IntEntry(oMatch[i], j)], k)] * factor;
+
+ Vec_IntPush(array, encode);
+ Vec_IntPushUniqueOrder(sortedArray, encode);
+
+ if( encode < 0)
+ printf("WARNING! Integer overflow!");
+
+ //printf("%d ", Vec_IntEntry(array, j));
+ }
+
+ while( Vec_IntSize(sortedArray) > 1 )
+ {
+ for(k = 0; k < Vec_IntSize(oMatch[i]); k++)
+ {
+ if(Vec_IntEntry(array, k) == Vec_IntEntryLast(sortedArray))
+ {
+ Vec_IntPush(oMatch[*oLastItem+numOfItemsAdded], Vec_IntEntry(oMatch[i], k));
+ oGroup[Vec_IntEntry(oMatch[i], k)] = *oLastItem+numOfItemsAdded;
+ Vec_IntRemove( oMatch[i], Vec_IntEntry(oMatch[i], k) );
+ Vec_IntRemove( array, Vec_IntEntry(array, k) );
+ k--;
+ }
+ }
+ numOfItemsAdded++;
+ Vec_IntPop(sortedArray);
+ }
+
+ Vec_IntFree( array );
+ Vec_IntFree( sortedArray );
+ //printf("\n");
+ }
+
+ *oLastItem += numOfItemsAdded;
+
+ /*printf("\n");
+ for(j = 0; j < *oLastItem ; j++)
+ {
+ printf("oMatch %d: ", j);
+ for(i = 0; i < Vec_IntSize(oMatch[j]); i++)
+ printf("%d ", Vec_IntEntry(oMatch[j], i));
+ printf("\n");
+ }*/
+
+ return numOfItemsAdded;
+}
+
+int iSplitByDep(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, Vec_Int_t** iMatch, int* iGroup, int* iLastItem, int* oGroup)
+{
+ int i, j, k;
+ int numOfItemsAdded = 0;
+ Vec_Int_t * array, * sortedArray;
+
+ for(i = 0; i < *iLastItem; i++)
+ {
+ if(Vec_IntSize(iMatch[i]) == 1)
+ continue;
+
+ array = Vec_IntAlloc( Vec_IntSize(iMatch[i]) );
+ sortedArray = Vec_IntAlloc( Vec_IntSize(iMatch[i]) );
+
+ for(j = 0; j < Vec_IntSize(iMatch[i]); j++)
+ {
+ int factor, encode;
+
+ encode = 0;
+ factor = 1;
+
+ for(k = 0; k < Vec_IntSize(iDep[Vec_IntEntry(iMatch[i], j)]); k++)
+ encode += oGroup[Vec_IntEntry(iDep[Vec_IntEntry(iMatch[i], j)], k)] * factor;
+
+ Vec_IntPush(array, encode);
+ Vec_IntPushUniqueOrder(sortedArray, encode);
+
+ //printf("%d ", Vec_IntEntry(array, j));
+ }
+
+ while( Vec_IntSize(sortedArray) > 1 )
+ {
+ for(k = 0; k < Vec_IntSize(iMatch[i]); k++)
+ {
+ if(Vec_IntEntry(array, k) == Vec_IntEntryLast(sortedArray))
+ {
+ Vec_IntPush(iMatch[*iLastItem+numOfItemsAdded], Vec_IntEntry(iMatch[i], k));
+ iGroup[Vec_IntEntry(iMatch[i], k)] = *iLastItem+numOfItemsAdded;
+ Vec_IntRemove( iMatch[i], Vec_IntEntry(iMatch[i], k) );
+ Vec_IntRemove( array, Vec_IntEntry(array, k) );
+ k--;
+ }
+ }
+ numOfItemsAdded++;
+ Vec_IntPop(sortedArray);
+ }
+
+ Vec_IntFree( array );
+ Vec_IntFree( sortedArray );
+ //printf("\n");
+ }
+
+ *iLastItem += numOfItemsAdded;
+
+ /*printf("\n");
+ for(j = 0; j < *iLastItem ; j++)
+ {
+ printf("iMatch %d: ", j);
+ for(i = 0; i < Vec_IntSize(iMatch[j]); i++)
+ printf("%d ", Vec_IntEntry(iMatch[j], i));
+ printf("\n");
+ }*/
+
+ return numOfItemsAdded;
+}
+
+Vec_Ptr_t ** findTopologicalOrder( Abc_Ntk_t * pNtk )
+{
+ Vec_Ptr_t ** vNodes;
+ Abc_Obj_t * pObj, * pFanout;
+ int i, k;
+
+ extern void Abc_NtkDfsReverse_rec( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes );
+
+ // start the array of nodes
+ vNodes = ABC_ALLOC(Vec_Ptr_t *, Abc_NtkPiNum(pNtk));
+ for(i = 0; i < Abc_NtkPiNum(pNtk); i++)
+ vNodes[i] = Vec_PtrAlloc(50);
+
+ Abc_NtkForEachCi( pNtk, pObj, i )
+ {
+ // set the traversal ID
+ Abc_NtkIncrementTravId( pNtk );
+ Abc_NodeSetTravIdCurrent( pObj );
+ pObj = Abc_ObjFanout0Ntk(pObj);
+ Abc_ObjForEachFanout( pObj, pFanout, k )
+ Abc_NtkDfsReverse_rec( pFanout, vNodes[i] );
+ }
+
+ return vNodes;
+}
+
+
+int * Abc_NtkSimulateOneNode( Abc_Ntk_t * pNtk, int * pModel, int input, Vec_Ptr_t ** topOrder )
+{
+ Abc_Obj_t * pNode;
+ Vec_Ptr_t * vNodes;
+ int * pValues, Value0, Value1, i;
+
+ vNodes = Vec_PtrAlloc( 50 );
+/*
+ printf( "Counter example: " );
+ Abc_NtkForEachCi( pNtk, pNode, i )
+ printf( " %d", pModel[i] );
+ printf( "\n" );
+*/
+ // increment the trav ID
+ Abc_NtkIncrementTravId( pNtk );
+ // set the CI values
+ Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)1;
+ pNode = Abc_NtkCi(pNtk, input);
+ pNode->pCopy = (Abc_Obj_t *)pModel[input];
+
+ // simulate in the topological order
+ for(i = Vec_PtrSize(topOrder[input])-1; i >= 0; i--)
+ {
+ pNode = (Abc_Obj_t *)Vec_PtrEntry(topOrder[input], i);
+
+ Value0 = ((int)(ABC_PTRUINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ Abc_ObjFaninC0(pNode);
+ Value1 = ((int)(ABC_PTRUINT_T)Abc_ObjFanin1(pNode)->pCopy) ^ Abc_ObjFaninC1(pNode);
+
+ if( pNode->pCopy != (Abc_Obj_t *)(Value0 & Value1))
+ {
+ pNode->pCopy = (Abc_Obj_t *)(Value0 & Value1);
+ Vec_PtrPush(vNodes, pNode);
+ }
+
+ }
+ // fill the output values
+ pValues = ABC_ALLOC( int, Abc_NtkCoNum(pNtk) );
+ Abc_NtkForEachCo( pNtk, pNode, i )
+ pValues[i] = ((int)(ABC_PTRUINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ Abc_ObjFaninC0(pNode);
+
+ pNode = Abc_NtkCi(pNtk, input);
+ if(pNode->pCopy == (Abc_Obj_t *)1)
+ pNode->pCopy = (Abc_Obj_t *)0;
+ else
+ pNode->pCopy = (Abc_Obj_t *)1;
+
+ for(i = 0; i < Vec_PtrSize(vNodes); i++)
+ {
+ pNode = (Abc_Obj_t *)Vec_PtrEntry(vNodes, i);
+
+ if(pNode->pCopy == (Abc_Obj_t *)1)
+ pNode->pCopy = (Abc_Obj_t *)0;
+ else
+ pNode->pCopy = (Abc_Obj_t *)1;
+ }
+
+ Vec_PtrFree( vNodes );
+
+ return pValues;
+}
+
+int refineIOBySimulation(Abc_Ntk_t *pNtk, Vec_Int_t** iMatch, int* iLastItem, int * iGroup, Vec_Int_t** iDep, Vec_Int_t** oMatch, int* oLastItem, int * oGroup, Vec_Int_t** oDep, char * vPiValues, int * observability, Vec_Ptr_t ** topOrder)
+{
+ Abc_Obj_t * pObj;
+ int * pModel;//, ** pModel2;
+ int * output, * output2;
+ int lastItem;
+ int i, j, k;
+ Vec_Int_t * iComputedNum, * iComputedNumSorted;
+ Vec_Int_t * oComputedNum; // encoding the number of flips
+ int factor;
+ int isRefined = FALSE;
+
+ pModel = ABC_ALLOC( int, Abc_NtkCiNum(pNtk) );
+
+ Abc_NtkForEachPi( pNtk, pObj, i )
+ pModel[i] = vPiValues[i] - '0';
+ Abc_NtkForEachLatch( pNtk, pObj, i )
+ pModel[Abc_NtkPiNum(pNtk)+i] = pObj->iData - 1;
+
+ output = Abc_NtkVerifySimulatePattern( pNtk, pModel );
+
+ oComputedNum = Vec_IntAlloc( Abc_NtkPoNum(pNtk) );
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ Vec_IntPush(oComputedNum, 0);
+
+ /****************************************************************************************/
+ /********** group outputs that produce 1 and outputs that produce 0 together ************/
+
+ lastItem = *oLastItem;
+ for(i = 0; i < lastItem && (*oLastItem) != Abc_NtkPoNum(pNtk); i++)
+ {
+ int flag = FALSE;
+
+ if(Vec_IntSize(oMatch[i]) == 1)
+ continue;
+
+ for(j = 1; j < Vec_IntSize(oMatch[i]); j++)
+ if(output[Vec_IntEntry(oMatch[i], 0)] != output[Vec_IntEntry(oMatch[i], j)])
+ {
+ flag = TRUE;
+ break;
+ }
+
+ if(flag)
+ {
+ for(j = 0; j < Vec_IntSize(oMatch[i]); j++)
+ if(output[Vec_IntEntry(oMatch[i], j)])
+ {
+ Vec_IntPush(oMatch[*oLastItem], Vec_IntEntry(oMatch[i], j));
+ oGroup[Vec_IntEntry(oMatch[i], j)] = *oLastItem;
+ Vec_IntRemove(oMatch[i], Vec_IntEntry(oMatch[i], j));
+ j--;
+ }
+
+ (*oLastItem)++;
+ }
+ }
+
+ if( (*oLastItem) > lastItem )
+ {
+ isRefined = TRUE;
+ iSortDependencies(pNtk, iDep, oGroup);
+ }
+
+ /****************************************************************************************/
+ /************* group inputs that make the same number of flips in outpus ****************/
+
+ lastItem = *iLastItem;
+ for(i = 0; i < lastItem && (*iLastItem) != Abc_NtkPiNum(pNtk); i++)
+ {
+ int num;
+
+ if(Vec_IntSize(iMatch[i]) == 1)
+ continue;
+
+ iComputedNum = Vec_IntAlloc( Vec_IntSize(iMatch[i]) );
+ iComputedNumSorted = Vec_IntAlloc( Vec_IntSize(iMatch[i]) );
+
+ for(j = 0; j < Vec_IntSize(iMatch[i]); j++)
+ {
+ if( vPiValues[Vec_IntEntry(iMatch[i], j)] == '0' )
+ pModel[Vec_IntEntry(iMatch[i], j)] = 1;
+ else
+ pModel[Vec_IntEntry(iMatch[i], j)] = 0;
+
+ //output2 = Abc_NtkVerifySimulatePattern( pNtk, pModel );
+ output2 = Abc_NtkSimulateOneNode( pNtk, pModel, Vec_IntEntry(iMatch[i], j), topOrder );
+
+ num = 0;
+ factor = 1;
+ for(k = 0; k < Vec_IntSize(iDep[Vec_IntEntry(iMatch[i], j)]); k++)
+ {
+ int outputIndex = Vec_IntEntry(iDep[Vec_IntEntry(iMatch[i], j)], k);
+
+ if(output2[outputIndex])
+ num += (oGroup[outputIndex] + 1) * factor;
+
+ if(output[outputIndex] != output2[outputIndex])
+ {
+ int temp = Vec_IntEntry(oComputedNum, outputIndex) + i + 1;
+ Vec_IntWriteEntry(oComputedNum, outputIndex, temp);
+ observability[Vec_IntEntry(iMatch[i], j)]++;
+ }
+ }
+
+ Vec_IntPush(iComputedNum, num);
+ Vec_IntPushUniqueOrder(iComputedNumSorted, num);
+
+ pModel[Vec_IntEntry(iMatch[i], j)] = vPiValues[Vec_IntEntry(iMatch[i], j)] - '0';
+ ABC_FREE( output2 );
+ }
+
+ while( Vec_IntSize( iComputedNumSorted ) > 1 )
+ {
+ for(k = 0; k < Vec_IntSize(iMatch[i]); k++)
+ {
+ if(Vec_IntEntry(iComputedNum, k) == Vec_IntEntryLast(iComputedNumSorted) )
+ {
+ Vec_IntPush(iMatch[*iLastItem], Vec_IntEntry(iMatch[i], k));
+ iGroup[Vec_IntEntry(iMatch[i], k)] = *iLastItem;
+ Vec_IntRemove( iMatch[i], Vec_IntEntry(iMatch[i], k) );
+ Vec_IntRemove( iComputedNum, Vec_IntEntry(iComputedNum, k) );
+ k--;
+ }
+ }
+ (*iLastItem)++;
+ Vec_IntPop( iComputedNumSorted );
+ }
+
+ Vec_IntFree( iComputedNum );
+ Vec_IntFree( iComputedNumSorted );
+ }
+
+ if( (*iLastItem) > lastItem )
+ {
+ isRefined = TRUE;
+ oSortDependencies(pNtk, oDep, iGroup);
+ }
+
+ /****************************************************************************************/
+ /********** encode the number of flips in each output by flipping the outputs ***********/
+ /********** and group all the outputs that have the same encoding ***********/
+
+ lastItem = *oLastItem;
+ for(i = 0; i < lastItem && (*oLastItem) != Abc_NtkPoNum(pNtk); i++)
+ {
+ Vec_Int_t * encode, * sortedEncode; // encoding the number of flips
+
+ if(Vec_IntSize(oMatch[i]) == 1)
+ continue;
+
+ encode = Vec_IntAlloc( Vec_IntSize(oMatch[i]) );
+ sortedEncode = Vec_IntAlloc( Vec_IntSize(oMatch[i]) );
+
+ for(j = 0; j < Vec_IntSize(oMatch[i]); j++)
+ {
+ Vec_IntPush(encode, Vec_IntEntry(oComputedNum, Vec_IntEntry(oMatch[i], j)) );
+ Vec_IntPushUniqueOrder( sortedEncode, Vec_IntEntry(encode, j) );
+ }
+
+ while( Vec_IntSize(sortedEncode) > 1 )
+ {
+ for(j = 0; j < Vec_IntSize(oMatch[i]); j++)
+ if(Vec_IntEntry(encode, j) == Vec_IntEntryLast(sortedEncode))
+ {
+ Vec_IntPush(oMatch[*oLastItem], Vec_IntEntry(oMatch[i], j));
+ oGroup[Vec_IntEntry(oMatch[i], j)] = *oLastItem;
+ Vec_IntRemove( oMatch[i], Vec_IntEntry(oMatch[i], j) );
+ Vec_IntRemove( encode, Vec_IntEntry(encode, j) );
+ j --;
+ }
+
+ (*oLastItem)++;
+ Vec_IntPop( sortedEncode );
+ }
+
+ Vec_IntFree( encode );
+ Vec_IntFree( sortedEncode );
+ }
+
+ if( (*oLastItem) > lastItem )
+ isRefined = TRUE;
+
+ ABC_FREE( pModel );
+ ABC_FREE( output );
+ Vec_IntFree( oComputedNum );
+
+ return isRefined;
+}
+
+Abc_Ntk_t * Abc_NtkMiterBm( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Vec_Ptr_t * iCurrMatch, Vec_Ptr_t * oCurrMatch )
+{
+ char Buffer[1000];
+ Abc_Ntk_t * pNtkMiter;
+
+ pNtkMiter = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
+ sprintf( Buffer, "%s_%s_miter", pNtk1->pName, pNtk2->pName );
+ pNtkMiter->pName = Extra_UtilStrsav(Buffer);
+
+ //Abc_NtkMiterPrepare( pNtk1, pNtk2, pNtkMiter, fComb, nPartSize );
+ {
+ Abc_Obj_t * pObj, * pObjNew;
+ int i;
+
+ Abc_AigConst1(pNtk1)->pCopy = Abc_AigConst1(pNtkMiter);
+ Abc_AigConst1(pNtk2)->pCopy = Abc_AigConst1(pNtkMiter);
+
+ // create new PIs and remember them in the old PIs
+ if(iCurrMatch == NULL)
+ {
+ Abc_NtkForEachCi( pNtk1, pObj, i )
+ {
+ pObjNew = Abc_NtkCreatePi( pNtkMiter );
+ // remember this PI in the old PIs
+ pObj->pCopy = pObjNew;
+ pObj = Abc_NtkCi(pNtk2, i);
+ pObj->pCopy = pObjNew;
+ // add name
+ Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
+ }
+ }
+ else
+ {
+ for(i = 0; i < Vec_PtrSize( iCurrMatch ); i += 2)
+ {
+ pObjNew = Abc_NtkCreatePi( pNtkMiter );
+ pObj = (Abc_Obj_t *)Vec_PtrEntry(iCurrMatch, i);
+ pObj->pCopy = pObjNew;
+ pObj = (Abc_Obj_t *)Vec_PtrEntry(iCurrMatch, i+1);
+ pObj->pCopy = pObjNew;
+ // add name
+ Abc_ObjAssignName( pObjNew, Abc_ObjName(pObj), NULL );
+ }
+ }
+
+ // create the only PO
+ pObjNew = Abc_NtkCreatePo( pNtkMiter );
+ // add the PO name
+ Abc_ObjAssignName( pObjNew, "miter", NULL );
+ }
+
+ // Abc_NtkMiterAddOne( pNtk1, pNtkMiter );
+ {
+ Abc_Obj_t * pNode;
+ int i;
+ assert( Abc_NtkIsDfsOrdered(pNtk1) );
+ Abc_AigForEachAnd( pNtk1, pNode, i )
+ pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ }
+
+ // Abc_NtkMiterAddOne( pNtk2, pNtkMiter );
+ {
+ Abc_Obj_t * pNode;
+ int i;
+ assert( Abc_NtkIsDfsOrdered(pNtk2) );
+ Abc_AigForEachAnd( pNtk2, pNode, i )
+ pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ }
+
+ // Abc_NtkMiterFinalize( pNtk1, pNtk2, pNtkMiter, fComb, nPartSize );
+ {
+ Vec_Ptr_t * vPairs;
+ Abc_Obj_t * pMiter;
+ int i;
+
+ vPairs = Vec_PtrAlloc( 100 );
+
+ // collect the CO nodes for the miter
+ if(oCurrMatch != NULL)
+ {
+ for(i = 0; i < Vec_PtrSize( oCurrMatch ); i += 2)
+ {
+ Vec_PtrPush( vPairs, Abc_ObjChild0Copy((Abc_Obj_t *)Vec_PtrEntry(oCurrMatch, i)) );
+ Vec_PtrPush( vPairs, Abc_ObjChild0Copy((Abc_Obj_t *)Vec_PtrEntry(oCurrMatch, i+1)) );
+ }
+ }
+ else
+ {
+ Abc_Obj_t * pNode;
+
+ Abc_NtkForEachCo( pNtk1, pNode, i )
+ {
+ Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) );
+ pNode = Abc_NtkCo( pNtk2, i );
+ Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pNode) );
+ }
+ }
+
+ pMiter = Abc_AigMiter( (Abc_Aig_t *)pNtkMiter->pManFunc, vPairs, 0 );
+ Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
+ Vec_PtrFree(vPairs);
+ }
+
+ //Abc_AigCleanup(pNtkMiter->pManFunc);
+
+ return pNtkMiter;
+}
+
+int * pValues1__, * pValues2__;
+
+void Abc_NtkVerifyReportError( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pModel, Vec_Int_t * mismatch )
+{
+ Vec_Ptr_t * vNodes;
+ Abc_Obj_t * pNode;
+ int nErrors, nPrinted, i, iNode = -1;
+
+ assert( Abc_NtkCiNum(pNtk1) == Abc_NtkCiNum(pNtk2) );
+ assert( Abc_NtkCoNum(pNtk1) == Abc_NtkCoNum(pNtk2) );
+ // get the CO values under this model
+ pValues1__ = Abc_NtkVerifySimulatePattern( pNtk1, pModel );
+ pValues2__ = Abc_NtkVerifySimulatePattern( pNtk2, pModel );
+ // count the mismatches
+ nErrors = 0;
+ for ( i = 0; i < Abc_NtkCoNum(pNtk1); i++ )
+ nErrors += (int)( pValues1__[i] != pValues2__[i] );
+ //printf( "Verification failed for at least %d outputs: ", nErrors );
+ // print the first 3 outputs
+ nPrinted = 0;
+ for ( i = 0; i < Abc_NtkCoNum(pNtk1); i++ )
+ if ( pValues1__[i] != pValues2__[i] )
+ {
+ if ( iNode == -1 )
+ iNode = i;
+ //printf( " %s", Abc_ObjName(Abc_NtkCo(pNtk1,i)) );
+ if ( ++nPrinted == 3 )
+ break;
+ }
+ /*if ( nPrinted != nErrors )
+ printf( " ..." );
+ printf( "\n" );*/
+ // report mismatch for the first output
+ if ( iNode >= 0 )
+ {
+ /*printf( "Output %s: Value in Network1 = %d. Value in Network2 = %d.\n",
+ Abc_ObjName(Abc_NtkCo(pNtk1,iNode)), pValues1[iNode], pValues2[iNode] );
+ printf( "Input pattern: " );*/
+ // collect PIs in the cone
+ pNode = Abc_NtkCo(pNtk1,iNode);
+ vNodes = Abc_NtkNodeSupport( pNtk1, &pNode, 1 );
+ // set the PI numbers
+ Abc_NtkForEachCi( pNtk1, pNode, i )
+ pNode->pCopy = (Abc_Obj_t *)i;
+ // print the model
+ pNode = (Abc_Obj_t *)Vec_PtrEntry( vNodes, 0 );
+ if ( Abc_ObjIsCi(pNode) )
+ {
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
+ {
+ assert( Abc_ObjIsCi(pNode) );
+ //printf( " %s=%d", Abc_ObjName(pNode), pModel[(int)pNode->pCopy] );
+ Vec_IntPush(mismatch, Abc_ObjId(pNode)-1);
+ Vec_IntPush(mismatch, pModel[(int)(size_t)pNode->pCopy]);
+ }
+ }
+ //printf( "\n" );
+ Vec_PtrFree( vNodes );
+ }
+ free( pValues1__ );
+ free( pValues2__ );
+}
+
+int Abc_NtkMiterSatBm( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T * pNumConfs, ABC_INT64_T * pNumInspects)
+{
+ static sat_solver * pSat = NULL;
+ lbool status;
+ int RetValue, clk;
+
+ extern int Abc_NodeAddClausesTop( sat_solver * pSat, Abc_Obj_t * pNode, Vec_Int_t * vVars );
+ extern Vec_Int_t * Abc_NtkGetCiSatVarNums( Abc_Ntk_t * pNtk );
+
+ if ( pNumConfs )
+ *pNumConfs = 0;
+ if ( pNumInspects )
+ *pNumInspects = 0;
+
+ assert( Abc_NtkLatchNum(pNtk) == 0 );
+
+// if ( Abc_NtkPoNum(pNtk) > 1 )
+// fprintf( stdout, "Warning: The miter has %d outputs. SAT will try to prove all of them.\n", Abc_NtkPoNum(pNtk) );
+
+ // load clauses into the sat_solver
+ clk = clock();
+
+
+
+ pSat = (sat_solver *)Abc_NtkMiterSatCreate( pNtk, 0 );
+
+ if ( pSat == NULL )
+ return 1;
+//printf( "%d \n", pSat->clauses.size );
+//sat_solver_delete( pSat );
+//return 1;
+
+// printf( "Created SAT problem with %d variable and %d clauses. ", sat_solver_nvars(pSat), sat_solver_nclauses(pSat) );
+// PRT( "Time", clock() - clk );
+
+ // simplify the problem
+ clk = clock();
+ status = sat_solver_simplify(pSat);
+// printf( "Simplified the problem to %d variables and %d clauses. ", sat_solver_nvars(pSat), sat_solver_nclauses(pSat) );
+// PRT( "Time", clock() - clk );
+ if ( status == 0 )
+ {
+ sat_solver_delete( pSat );
+// printf( "The problem is UNSATISFIABLE after simplification.\n" );
+ return 1;
+ }
+
+ // solve the miter
+ clk = clock();
+ if ( fVerbose )
+ pSat->verbosity = 1;
+ status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, (ABC_INT64_T)0, (ABC_INT64_T)0 );
+ if ( status == l_Undef )
+ {
+// printf( "The problem timed out.\n" );
+ RetValue = -1;
+ }
+ else if ( status == l_True )
+ {
+// printf( "The problem is SATISFIABLE.\n" );
+ RetValue = 0;
+ }
+ else if ( status == l_False )
+ {
+// printf( "The problem is UNSATISFIABLE.\n" );
+ RetValue = 1;
+ }
+ else
+ assert( 0 );
+// PRT( "SAT sat_solver time", clock() - clk );
+// printf( "The number of conflicts = %d.\n", (int)pSat->sat_solver_stats.conflicts );
+
+ // if the problem is SAT, get the counterexample
+ if ( status == l_True )
+ {
+// Vec_Int_t * vCiIds = Abc_NtkGetCiIds( pNtk );
+ Vec_Int_t * vCiIds = Abc_NtkGetCiSatVarNums( pNtk );
+ pNtk->pModel = Sat_SolverGetModel( pSat, vCiIds->pArray, vCiIds->nSize );
+ Vec_IntFree( vCiIds );
+ }
+ // free the sat_solver
+ if ( fVerbose )
+ Sat_SolverPrintStats( stdout, pSat );
+
+ if ( pNumConfs )
+ *pNumConfs = (int)pSat->stats.conflicts;
+ if ( pNumInspects )
+ *pNumInspects = (int)pSat->stats.inspects;
+
+//sat_solver_store_write( pSat, "trace.cnf" );
+ sat_solver_store_free( pSat );
+ sat_solver_delete( pSat );
+ return RetValue;
+}
+
+int Abc_NtkBmSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Vec_Ptr_t * iMatchPairs, Vec_Ptr_t * oMatchPairs, Vec_Int_t * mismatch, int mode)
+{
+ extern Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor );
+
+ Abc_Ntk_t * pMiter = NULL;
+ Abc_Ntk_t * pCnf;
+ int RetValue;
+
+ // get the miter of the two networks
+ if( mode == 0 )
+ {
+ //Abc_NtkDelete( pMiter );
+ pMiter = Abc_NtkMiterBm( pNtk1, pNtk2, iMatchPairs, oMatchPairs );
+ }
+ else if( mode == 1 ) // add new outputs
+ {
+ int i;
+ Abc_Obj_t * pObj;
+ Vec_Ptr_t * vPairs;
+ Abc_Obj_t * pNtkMiter;
+
+ vPairs = Vec_PtrAlloc( 100 );
+
+ Abc_NtkForEachCo( pMiter, pObj, i )
+ Abc_ObjRemoveFanins( pObj );
+
+ for(i = 0; i < Vec_PtrSize( oMatchPairs ); i += 2)
+ {
+ Vec_PtrPush( vPairs, Abc_ObjChild0Copy((Abc_Obj_t *)Vec_PtrEntry(oMatchPairs, i)) );
+ Vec_PtrPush( vPairs, Abc_ObjChild0Copy((Abc_Obj_t *)Vec_PtrEntry(oMatchPairs, i+1)) );
+ }
+ pNtkMiter = Abc_AigMiter( (Abc_Aig_t *)pMiter->pManFunc, vPairs, 0 );
+ Abc_ObjAddFanin( Abc_NtkPo(pMiter,0), pNtkMiter );
+ Vec_PtrFree( vPairs);
+ }
+ else if( mode == 2 ) // add some outputs
+ {
+
+ }
+ else if( mode == 3) // remove all outputs
+ {
+ }
+
+ if ( pMiter == NULL )
+ {
+ printf("Miter computation has failed.");
+ return -1;
+ }
+ RetValue = Abc_NtkMiterIsConstant( pMiter );
+ if ( RetValue == 0)
+ {
+ /*printf("Networks are NOT EQUIVALENT after structural hashing."); */
+ // report the error
+ if(mismatch != NULL)
+ {
+ pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, 1 );
+ Abc_NtkVerifyReportError( pNtk1, pNtk2, pMiter->pModel, mismatch );
+ ABC_FREE( pMiter->pModel );
+ }
+ Abc_NtkDelete( pMiter );
+ return RetValue;
+ }
+ if( RetValue == 1 )
+ {
+ /*printf("Networks are equivalent after structural hashing."); */
+ Abc_NtkDelete( pMiter );
+ return RetValue;
+ }
+
+ // convert the miter into a CNF
+ //if(mode == 0)
+ pCnf = Abc_NtkMulti( pMiter, 0, 100, 1, 0, 0, 0 );
+ Abc_NtkDelete( pMiter );
+ if ( pCnf == NULL )
+ {
+ printf("Renoding for CNF has failed.");
+ return -1;
+ }
+
+ // solve the CNF using the SAT solver
+ RetValue = Abc_NtkMiterSat( pCnf, (ABC_INT64_T)10000, (ABC_INT64_T)0, 0, NULL, NULL);
+ /*if ( RetValue == -1 )
+ printf("Networks are undecided (SAT solver timed out).");
+ else if ( RetValue == 0 )
+ printf("Networks are NOT EQUIVALENT after SAT.");
+ else
+ printf("Networks are equivalent after SAT."); */
+ if ( mismatch != NULL && pCnf->pModel )
+ Abc_NtkVerifyReportError( pNtk1, pNtk2, pCnf->pModel, mismatch );
+
+ ABC_FREE( pCnf->pModel );
+ Abc_NtkDelete( pCnf );
+
+ return RetValue;
+}
+
+int checkEquivalence( Abc_Ntk_t * pNtk1, Vec_Int_t* matchedInputs1, Vec_Int_t * matchedOutputs1,
+ Abc_Ntk_t * pNtk2, Vec_Int_t* matchedInputs2, Vec_Int_t * matchedOutputs2)
+{
+ Vec_Ptr_t * iMatchPairs, * oMatchPairs;
+ int i;
+ int result;
+
+ iMatchPairs = Vec_PtrAlloc( Abc_NtkPiNum( pNtk1 ) * 2);
+ oMatchPairs = Vec_PtrAlloc( Abc_NtkPoNum( pNtk1 ) * 2);
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk1); i++)
+ {
+ Vec_PtrPush(iMatchPairs, Abc_NtkPi(pNtk2, Vec_IntEntry(matchedInputs2, i)));
+ Vec_PtrPush(iMatchPairs, Abc_NtkPi(pNtk1, Vec_IntEntry(matchedInputs1, i)));
+ }
+
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk1); i++)
+ {
+ Vec_PtrPush(oMatchPairs, Abc_NtkPo(pNtk2, Vec_IntEntry(matchedOutputs2, i)));
+ Vec_PtrPush(oMatchPairs, Abc_NtkPo(pNtk1, Vec_IntEntry(matchedOutputs1, i)));
+ }
+
+ result = Abc_NtkBmSat(pNtk1, pNtk2, iMatchPairs, oMatchPairs, NULL, 0);
+
+ if( result )
+ printf("*** Circuits are equivalent ***\n");
+ else
+ printf("*** Circuits are NOT equivalent ***\n");
+
+ Vec_PtrFree( iMatchPairs );
+ Vec_PtrFree( oMatchPairs );
+
+ return result;
+}
+
+Abc_Ntk_t * computeCofactor(Abc_Ntk_t * pNtk, Vec_Ptr_t ** nodesInLevel, int * bitVector, Vec_Int_t * currInputs)
+{
+ Abc_Ntk_t * subNtk;
+ Abc_Obj_t * pObj, * pObjNew;
+ int i, j, numOfLevels;
+
+ numOfLevels = Abc_AigLevel( pNtk ); // number of levels excludes PI/POs
+
+ // start a new network
+ subNtk = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
+ subNtk->pName = Extra_UtilStrsav("subNtk");
+
+ Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(subNtk);
+
+ // clean the node copy fields and mark the nodes that need to be copied to the new network
+ Abc_NtkCleanCopy( pNtk );
+
+ if(bitVector != NULL)
+ {
+ for(i = 0; i < Abc_NtkPiNum(pNtk); i++)
+ if(bitVector[i])
+ {
+ pObj = Abc_NtkPi(pNtk, i);
+ pObj->pCopy = (Abc_Obj_t *)(1);
+ }
+ }
+
+ for(i = 0; i < Vec_IntSize(currInputs); i++)
+ {
+ pObj = Abc_NtkPi(pNtk, Vec_IntEntry(currInputs, i));
+ pObjNew = Abc_NtkDupObj( subNtk, pObj, 1 );
+ pObj->pCopy = pObjNew;
+ }
+
+
+ // i = 0 are the inputs and the inputs are not added to the 2d array ( nodesInLevel )
+ for( i = 0; i <= numOfLevels; i++ )
+ for( j = 0; j < Vec_PtrSize( nodesInLevel[i] ); j++)
+ {
+ pObj = (Abc_Obj_t *)Vec_PtrEntry( nodesInLevel[i], j );
+
+ if(Abc_ObjChild0Copy(pObj) == NULL && Abc_ObjChild1Copy(pObj) == NULL)
+ pObj->pCopy = NULL;
+ else if(Abc_ObjChild0Copy(pObj) == NULL && Abc_ObjChild1Copy(pObj) == (void*)(1))
+ pObj->pCopy = NULL;
+ else if(Abc_ObjChild0Copy(pObj) == NULL && (Abc_ObjChild1Copy(pObj) != (NULL) && Abc_ObjChild1Copy(pObj) != (void*)(1)) )
+ pObj->pCopy = NULL;
+ else if(Abc_ObjChild0Copy(pObj) == (void*)(1) && Abc_ObjChild1Copy(pObj) == NULL)
+ pObj->pCopy = NULL;
+ else if(Abc_ObjChild0Copy(pObj) == (void*)(1) && Abc_ObjChild1Copy(pObj) == (void*)(1))
+ pObj->pCopy = (Abc_Obj_t *)(1);
+ else if(Abc_ObjChild0Copy(pObj) == (void*)(1) && (Abc_ObjChild1Copy(pObj) != (NULL) && Abc_ObjChild1Copy(pObj) != (void*)(1)) )
+ pObj->pCopy = Abc_ObjChild1Copy(pObj);
+ else if( (Abc_ObjChild0Copy(pObj) != (NULL) && Abc_ObjChild0Copy(pObj) != (void*)(1)) && Abc_ObjChild1Copy(pObj) == NULL )
+ pObj->pCopy = NULL;
+ else if( (Abc_ObjChild0Copy(pObj) != (NULL) && Abc_ObjChild0Copy(pObj) != (void*)(1)) && Abc_ObjChild1Copy(pObj) == (void*)(1) )
+ pObj->pCopy = Abc_ObjChild0Copy(pObj);
+ else if( (Abc_ObjChild0Copy(pObj) != (NULL) && Abc_ObjChild0Copy(pObj) != (void*)(1)) &&
+ (Abc_ObjChild1Copy(pObj) != (NULL) && Abc_ObjChild1Copy(pObj) != (void*)(1)) )
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)subNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ }
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk); i++)
+ {
+ pObj = Abc_NtkPo(pNtk, i);
+ pObjNew = Abc_NtkDupObj( subNtk, pObj, 1 );
+
+ if( Abc_ObjChild0Copy(pObj) == NULL)
+ {
+ Abc_ObjAddFanin( pObjNew, Abc_AigConst1(subNtk));
+ pObjNew->fCompl0 = 1;
+ }
+ else if( Abc_ObjChild0Copy(pObj) == (void*)(1) )
+ {
+ Abc_ObjAddFanin( pObjNew, Abc_AigConst1(subNtk));
+ pObjNew->fCompl0 = 0;
+ }
+ else
+ Abc_ObjAddFanin( pObjNew, Abc_ObjChild0Copy(pObj) );
+ }
+
+ return subNtk;
+}
+
+FILE *matchFile;
+
+int matchNonSingletonOutputs(Abc_Ntk_t * pNtk1, Vec_Ptr_t ** nodesInLevel1, Vec_Int_t ** iMatch1, Vec_Int_t ** iDep1, Vec_Int_t * matchedInputs1, int * iGroup1, Vec_Int_t ** oMatch1, int * oGroup1,
+ Abc_Ntk_t * pNtk2, Vec_Ptr_t ** nodesInLevel2, Vec_Int_t ** iMatch2, Vec_Int_t ** iDep2, Vec_Int_t * matchedInputs2, int * iGroup2, Vec_Int_t ** oMatch2, int * oGroup2,
+ Vec_Int_t * matchedOutputs1, Vec_Int_t * matchedOutputs2, Vec_Int_t * oMatchedGroups, Vec_Int_t * iNonSingleton,
+ Abc_Ntk_t * subNtk1, Abc_Ntk_t * subNtk2, Vec_Ptr_t * oMatchPairs,
+ Vec_Int_t * oNonSingleton, int oI, int idx, int ii, int iidx)
+{
+ static int MATCH_FOUND;
+ int i;
+ int j, temp;
+ Vec_Int_t * mismatch;
+ int * skipList;
+ static int counter = 0;
+
+ MATCH_FOUND = FALSE;
+
+ if( oI == Vec_IntSize( oNonSingleton ) )
+ {
+ if( iNonSingleton != NULL)
+ if( match1by1(pNtk1, nodesInLevel1, iMatch1, iDep1, matchedInputs1, iGroup1, oMatch1, oGroup1,
+ pNtk2, nodesInLevel2, iMatch2, iDep2, matchedInputs2, iGroup2, oMatch2, oGroup2,
+ matchedOutputs1, matchedOutputs2, oMatchedGroups, iNonSingleton, ii, iidx) )
+ MATCH_FOUND = TRUE;
+
+ if( iNonSingleton == NULL)
+ MATCH_FOUND = TRUE;
+
+ return MATCH_FOUND;
+ }
+
+ i = Vec_IntEntry(oNonSingleton, oI);
+
+ mismatch = Vec_IntAlloc(10);
+
+ skipList = ABC_ALLOC(int, Vec_IntSize(oMatch1[i]));
+
+ for(j = 0; j < Vec_IntSize(oMatch1[i]); j++)
+ skipList[j] = FALSE;
+
+ Vec_PtrPush(oMatchPairs, Abc_NtkPo(subNtk1, Vec_IntEntry(oMatch1[i], idx)) );
+ Vec_IntPush(matchedOutputs1, Vec_IntEntry(oMatch1[i], idx));
+
+ for(j = 0; j < Vec_IntSize( oMatch2[i] ) && MATCH_FOUND == FALSE; j++)
+ {
+ if( Vec_IntEntry(oMatch2[i], j) == -1 || skipList[j] == TRUE)
+ continue;
+
+ Vec_PtrPush(oMatchPairs, Abc_NtkPo(subNtk2, Vec_IntEntry(oMatch2[i], j)));
+ Vec_IntPush(matchedOutputs2, Vec_IntEntry(oMatch2[i], j));
+
+ counter++;
+ if( Abc_NtkBmSat( subNtk1, subNtk2, NULL, oMatchPairs, mismatch, 0) )
+ {
+ /*fprintf(matchFile, "%s matched to %s\n", Abc_ObjName(Abc_NtkPo(pNtk1, Vec_IntEntry(oMatch1[i], idx))),
+ Abc_ObjName(Abc_NtkPo(pNtk2, Vec_IntEntry(oMatch2[i], j)))); */
+
+ temp = Vec_IntEntry(oMatch2[i], j);
+ Vec_IntWriteEntry(oMatch2[i], j, -1);
+
+ if(idx != Vec_IntSize( oMatch1[i] ) - 1)
+ // call the same function with idx+1
+ matchNonSingletonOutputs(pNtk1, nodesInLevel1, iMatch1, iDep1, matchedInputs1, iGroup1, oMatch1, oGroup1,
+ pNtk2, nodesInLevel2, iMatch2, iDep2, matchedInputs2, iGroup2, oMatch2, oGroup2,
+ matchedOutputs1, matchedOutputs2, oMatchedGroups, iNonSingleton,
+ subNtk1, subNtk2, oMatchPairs,
+ oNonSingleton, oI, idx+1, ii, iidx);
+ else
+ // call the same function with idx = 0 and oI++
+ matchNonSingletonOutputs(pNtk1, nodesInLevel1, iMatch1, iDep1, matchedInputs1, iGroup1, oMatch1, oGroup1,
+ pNtk2, nodesInLevel2, iMatch2, iDep2, matchedInputs2, iGroup2, oMatch2, oGroup2,
+ matchedOutputs1, matchedOutputs2, oMatchedGroups, iNonSingleton,
+ subNtk1, subNtk2, oMatchPairs,
+ oNonSingleton, oI+1, 0, ii, iidx);
+
+ Vec_IntWriteEntry(oMatch2[i], j, temp);
+ }
+ else
+ {
+ int * output1, * output2;
+ int k;
+ Abc_Obj_t * pObj;
+ int * pModel;
+ char * vPiValues;
+
+
+ vPiValues = ABC_ALLOC( char, Abc_NtkPiNum(subNtk1) + 1);
+ vPiValues[Abc_NtkPiNum(subNtk1)] = '\0';
+
+ for(k = 0; k < Abc_NtkPiNum(subNtk1); k++)
+ vPiValues[k] = '0';
+
+ for(k = 0; k < Vec_IntSize(mismatch); k += 2)
+ vPiValues[Vec_IntEntry(mismatch, k)] = Vec_IntEntry(mismatch, k+1);
+
+ pModel = ABC_ALLOC( int, Abc_NtkCiNum(subNtk1) );
+
+ Abc_NtkForEachPi( subNtk1, pObj, k )
+ pModel[k] = vPiValues[k] - '0';
+ Abc_NtkForEachLatch( subNtk1, pObj, k )
+ pModel[Abc_NtkPiNum(subNtk1)+k] = pObj->iData - 1;
+
+ output1 = Abc_NtkVerifySimulatePattern( subNtk1, pModel );
+
+ Abc_NtkForEachLatch( subNtk2, pObj, k )
+ pModel[Abc_NtkPiNum(subNtk2)+k] = pObj->iData - 1;
+
+ output2 = Abc_NtkVerifySimulatePattern( subNtk2, pModel );
+
+
+ for(k = 0; k < Vec_IntSize( oMatch1[i] ); k++)
+ if(output1[Vec_IntEntry(oMatch1[i], idx)] != output2[Vec_IntEntry(oMatch2[i], k)])
+ {
+ skipList[k] = TRUE;
+ /*printf("Output is SKIPPED");*/
+ }
+
+ ABC_FREE( vPiValues );
+ ABC_FREE( pModel );
+ ABC_FREE( output1 );
+ ABC_FREE( output2 );
+ }
+
+ if(MATCH_FOUND == FALSE )
+ {
+ Vec_PtrPop(oMatchPairs);
+ Vec_IntPop(matchedOutputs2);
+ }
+ }
+
+ if(MATCH_FOUND == FALSE )
+ {
+ Vec_PtrPop(oMatchPairs);
+ Vec_IntPop(matchedOutputs1);
+ }
+
+ if(MATCH_FOUND && counter != 0)
+ {
+ /*printf("Number of OUTPUT SAT instances = %d", counter);*/
+ counter = 0;
+ }
+
+ ABC_FREE( mismatch );
+ ABC_FREE( skipList );
+
+ return MATCH_FOUND;
+}
+
+int match1by1(Abc_Ntk_t * pNtk1, Vec_Ptr_t ** nodesInLevel1, Vec_Int_t ** iMatch1, Vec_Int_t ** iDep1, Vec_Int_t * matchedInputs1, int * iGroup1, Vec_Int_t ** oMatch1, int * oGroup1,
+ Abc_Ntk_t * pNtk2, Vec_Ptr_t ** nodesInLevel2, Vec_Int_t ** iMatch2, Vec_Int_t ** iDep2, Vec_Int_t * matchedInputs2, int * iGroup2, Vec_Int_t ** oMatch2, int * oGroup2,
+ Vec_Int_t * matchedOutputs1, Vec_Int_t * matchedOutputs2, Vec_Int_t * oMatchedGroups, Vec_Int_t * iNonSingleton, int ii, int idx)
+{
+ static int MATCH_FOUND = FALSE;
+ Abc_Ntk_t * subNtk1, * subNtk2;
+ Vec_Int_t * oNonSingleton;
+ Vec_Ptr_t * oMatchPairs;
+ int * skipList;
+ int j, m;
+ int i;
+ static int counter = 0;
+
+ MATCH_FOUND = FALSE;
+
+ if( ii == Vec_IntSize(iNonSingleton) )
+ {
+ MATCH_FOUND = TRUE;
+ return TRUE;
+ }
+
+ i = Vec_IntEntry(iNonSingleton, ii);
+
+ if( idx == Vec_IntSize(iMatch1[i]) )
+ {
+ // call again with the next element in iNonSingleton
+ return match1by1(pNtk1, nodesInLevel1, iMatch1, iDep1, matchedInputs1, iGroup1, oMatch1, oGroup1,
+ pNtk2, nodesInLevel2, iMatch2, iDep2, matchedInputs2, iGroup2, oMatch2, oGroup2,
+ matchedOutputs1, matchedOutputs2, oMatchedGroups, iNonSingleton, ii+1, 0);
+
+ }
+
+ oNonSingleton = Vec_IntAlloc(10);
+ oMatchPairs = Vec_PtrAlloc(100);
+ skipList = ABC_ALLOC(int, Vec_IntSize(iMatch1[i]));
+
+ for(j = 0; j < Vec_IntSize(iMatch1[i]); j++)
+ skipList[j] = FALSE;
+
+ Vec_IntPush(matchedInputs1, Vec_IntEntry(iMatch1[i], idx));
+ idx++;
+
+ if(idx == 1)
+ {
+ for(j = 0; j < Vec_IntSize(iDep1[Vec_IntEntryLast(iMatch1[i])]); j++)
+ {
+ if( Vec_IntSize(oMatch1[oGroup1[Vec_IntEntry(iDep1[Vec_IntEntryLast(iMatch1[i])], j)]]) == 1 )
+ continue;
+ if( Vec_IntFind( oMatchedGroups, oGroup1[Vec_IntEntry(iDep1[Vec_IntEntryLast(iMatch1[i])], j)]) != -1)
+ continue;
+
+ Vec_IntPushUnique(oNonSingleton, oGroup1[Vec_IntEntry(iDep1[Vec_IntEntryLast(iMatch1[i])], j)]);
+ Vec_IntPushUnique(oMatchedGroups, oGroup1[Vec_IntEntry(iDep1[Vec_IntEntryLast(iMatch1[i])], j)]);
+ }
+ }
+
+ subNtk1 = computeCofactor(pNtk1, nodesInLevel1, NULL, matchedInputs1);
+
+ for(j = idx-1; j < Vec_IntSize(iMatch2[i]) && MATCH_FOUND == FALSE; j++)
+ {
+ int tempJ;
+ Vec_Int_t * mismatch;
+
+ if( skipList[j] )
+ continue;
+
+ mismatch = Vec_IntAlloc(10);
+
+ Vec_IntPush(matchedInputs2, Vec_IntEntry(iMatch2[i], j));
+
+ subNtk2 = computeCofactor(pNtk2, nodesInLevel2, NULL, matchedInputs2);
+
+ for(m = 0; m < Vec_IntSize(matchedOutputs1); m++)
+ {
+ Vec_PtrPush(oMatchPairs, Abc_NtkPo(subNtk1, Vec_IntEntry(matchedOutputs1, m)));
+ Vec_PtrPush(oMatchPairs, Abc_NtkPo(subNtk2, Vec_IntEntry(matchedOutputs2, m)));
+ }
+
+ counter++;
+
+ if( Abc_NtkBmSat( subNtk2, subNtk1, NULL, oMatchPairs, mismatch, 0) )
+ {
+ if(idx-1 != j)
+ {
+ tempJ = Vec_IntEntry(iMatch2[i], idx-1);
+ Vec_IntWriteEntry(iMatch2[i], idx-1, Vec_IntEntry(iMatch2[i], j));
+ Vec_IntWriteEntry(iMatch2[i], j, tempJ);
+ }
+
+ /*fprintf(matchFile, "%s matched to %s\n", Abc_ObjName(Abc_NtkPi(pNtk1, Vec_IntEntry(iMatch1[i], idx-1))),
+ Abc_ObjName(Abc_NtkPi(pNtk2, Vec_IntEntry(iMatch2[i], j))));*/
+
+ // we look for a match for outputs in oNonSingleton
+ matchNonSingletonOutputs(pNtk1, nodesInLevel1, iMatch1, iDep1, matchedInputs1, iGroup1, oMatch1, oGroup1,
+ pNtk2, nodesInLevel2, iMatch2, iDep2, matchedInputs2, iGroup2, oMatch2, oGroup2,
+ matchedOutputs1, matchedOutputs2, oMatchedGroups, iNonSingleton,
+ subNtk1, subNtk2, oMatchPairs, oNonSingleton, 0, 0, ii, idx);
+
+
+ if(idx-1 != j)
+ {
+ tempJ = Vec_IntEntry(iMatch2[i], idx-1);
+ Vec_IntWriteEntry(iMatch2[i], idx-1, Vec_IntEntry(iMatch2[i], j));
+ Vec_IntWriteEntry(iMatch2[i], j, tempJ);
+ }
+ }
+ else
+ {
+ Abc_Ntk_t * FpNtk1, * FpNtk2;
+ int * bitVector1, * bitVector2;
+ Vec_Int_t * currInputs1, * currInputs2;
+ Vec_Ptr_t * vSupp;
+ Abc_Obj_t * pObj;
+ int suppNum1 = 0;
+ int * suppNum2;
+
+ bitVector1 = ABC_ALLOC( int, Abc_NtkPiNum(pNtk1) );
+ bitVector2 = ABC_ALLOC( int, Abc_NtkPiNum(pNtk2) );
+
+ currInputs1 = Vec_IntAlloc(10);
+ currInputs2 = Vec_IntAlloc(10);
+
+ suppNum2 = ABC_ALLOC(int, Vec_IntSize(iMatch2[i])-idx+1);
+
+ for(m = 0; m < Abc_NtkPiNum(pNtk1); m++)
+ {
+ bitVector1[m] = 0;
+ bitVector2[m] = 0;
+ }
+
+ for(m = 0; m < Vec_IntSize(iMatch2[i])-idx+1; m++)
+ suppNum2[m]= 0;
+
+ // First of all set the value of the inputs that are already matched and are in mismatch
+ for(m = 0; m < Vec_IntSize(mismatch); m += 2)
+ {
+ int n = Vec_IntEntry(mismatch, m);
+
+ bitVector1[Vec_IntEntry(matchedInputs1, n)] = Vec_IntEntry(mismatch, m+1);
+ bitVector2[Vec_IntEntry(matchedInputs2, n)] = Vec_IntEntry(mismatch, m+1);
+
+ }
+
+ for(m = idx-1; m < Vec_IntSize(iMatch1[i]); m++)
+ {
+ Vec_IntPush(currInputs1, Vec_IntEntry(iMatch1[i], m));
+ Vec_IntPush(currInputs2, Vec_IntEntry(iMatch2[i], m));
+ }
+
+ // Then add all the inputs that are not yet matched to the currInputs
+ for(m = 0; m < Abc_NtkPiNum(pNtk1); m++)
+ {
+ if(Vec_IntFind( matchedInputs1, m ) == -1)
+ Vec_IntPushUnique(currInputs1, m);
+
+ if(Vec_IntFind( matchedInputs2, m ) == -1)
+ Vec_IntPushUnique(currInputs2, m);
+ }
+
+ FpNtk1 = computeCofactor(pNtk1, nodesInLevel1, bitVector1, currInputs1);
+ FpNtk2 = computeCofactor(pNtk2, nodesInLevel2, bitVector2, currInputs2);
+
+ Abc_NtkForEachPo( FpNtk1, pObj, m )
+ {
+ int n;
+ vSupp = Abc_NtkNodeSupport( FpNtk1, &pObj, 1 );
+
+ for(n = 0; n < vSupp->nSize; n++)
+ if( Abc_ObjId((Abc_Obj_t *)vSupp->pArray[n]) == 1 )
+ suppNum1 += Vec_IntFind( matchedOutputs1, m) + 1;
+
+ Vec_PtrFree( vSupp );
+ }
+
+ Abc_NtkForEachPo( FpNtk2, pObj, m )
+ {
+ int n;
+ vSupp = Abc_NtkNodeSupport( FpNtk2, &pObj, 1 );
+
+ for(n = 0; n < vSupp->nSize; n++)
+ if( Abc_ObjId((Abc_Obj_t *)vSupp->pArray[n])-1 < (unsigned)(Vec_IntSize(iMatch2[i]))-idx+1 &&
+ Abc_ObjId((Abc_Obj_t *)vSupp->pArray[n])-1 >= 0)
+ suppNum2[Abc_ObjId((Abc_Obj_t *)vSupp->pArray[n])-1] += Vec_IntFind( matchedOutputs2, m) + 1;
+
+ Vec_PtrFree( vSupp );
+ }
+
+ /*if(suppNum1 != 0)
+ printf("Ntk1 is trigged");
+
+ if(suppNum2[0] != 0)
+ printf("Ntk2 is trigged");*/
+
+ for(m = 0; m < Vec_IntSize(iMatch2[i])-idx+1; m++)
+ if(suppNum2[m] != suppNum1)
+ {
+ skipList[m+idx-1] = TRUE;
+ /*printf("input is skipped");*/
+ }
+
+ Abc_NtkDelete( FpNtk1 );
+ Abc_NtkDelete( FpNtk2 );
+ ABC_FREE( bitVector1 );
+ ABC_FREE( bitVector2 );
+ Vec_IntFree( currInputs1 );
+ Vec_IntFree( currInputs2 );
+ ABC_FREE( suppNum2 );
+ }
+
+ Vec_PtrClear(oMatchPairs);
+ Abc_NtkDelete( subNtk2 );
+ Vec_IntFree(mismatch);
+
+ //Vec_IntWriteEntry(iMatch2[i], j, tempJ);
+
+ if( MATCH_FOUND == FALSE )
+ Vec_IntPop(matchedInputs2);
+ }
+
+ if( MATCH_FOUND == FALSE )
+ {
+ Vec_IntPop(matchedInputs1);
+
+ if(idx == 1)
+ {
+ for(m = 0; m < Vec_IntSize(oNonSingleton); m++)
+ Vec_IntPop( oMatchedGroups );
+ }
+ }
+
+ Vec_IntFree( oNonSingleton );
+ Vec_PtrFree( oMatchPairs );
+ ABC_FREE( skipList );
+ Abc_NtkDelete( subNtk1 );
+
+ if(MATCH_FOUND && counter != 0)
+ {
+ /*printf("Number of INPUT SAT instances = %d\n", counter);*/
+
+ counter = 0;
+ }
+
+ return MATCH_FOUND;
+}
+
+float refineBySAT(Abc_Ntk_t * pNtk1, Vec_Int_t ** iMatch1, int * iGroup1, Vec_Int_t ** iDep1, int* iLastItem1, Vec_Int_t ** oMatch1, int * oGroup1, Vec_Int_t ** oDep1, int* oLastItem1, int * observability1,
+ Abc_Ntk_t * pNtk2, Vec_Int_t ** iMatch2, int * iGroup2, Vec_Int_t ** iDep2, int* iLastItem2, Vec_Int_t ** oMatch2, int * oGroup2, Vec_Int_t ** oDep2, int* oLastItem2, int * observability2)
+{
+ int i, j;
+ Abc_Obj_t * pObj;
+ Vec_Int_t * iNonSingleton;
+ Vec_Int_t * matchedInputs1, * matchedInputs2;
+ Vec_Int_t * matchedOutputs1, * matchedOutputs2;
+ Vec_Ptr_t ** nodesInLevel1, ** nodesInLevel2;
+ Vec_Int_t * oMatchedGroups;
+ FILE *result;
+ int matchFound;
+ int clk = clock();
+ float satTime = 0.0;
+
+ /*matchFile = fopen("satmatch.txt", "w");*/
+
+ iNonSingleton = Vec_IntAlloc(10);
+
+ matchedInputs1 = Vec_IntAlloc( Abc_NtkPiNum(pNtk1) );
+ matchedInputs2 = Vec_IntAlloc( Abc_NtkPiNum(pNtk2) );
+
+ matchedOutputs1 = Vec_IntAlloc( Abc_NtkPoNum(pNtk1) );
+ matchedOutputs2 = Vec_IntAlloc( Abc_NtkPoNum(pNtk2) );
+
+ nodesInLevel1 = ABC_ALLOC( Vec_Ptr_t *, Abc_AigLevel( pNtk1 ) + 1); // why numOfLevels+1? because the inputs are in level 0
+ for(i = 0; i <= Abc_AigLevel( pNtk1 ); i++)
+ nodesInLevel1[i] = Vec_PtrAlloc( 20 );
+
+ // bucket sort the objects based on their levels
+ Abc_AigForEachAnd( pNtk1, pObj, i )
+ Vec_PtrPush(nodesInLevel1[Abc_ObjLevel(pObj)], pObj);
+
+ nodesInLevel2 = ABC_ALLOC( Vec_Ptr_t *, Abc_AigLevel( pNtk2 ) + 1); // why numOfLevels+1? because the inputs are in level 0
+ for(i = 0; i <= Abc_AigLevel( pNtk2 ); i++)
+ nodesInLevel2[i] = Vec_PtrAlloc( 20 );
+
+ // bucket sort the objects based on their levels
+ Abc_AigForEachAnd( pNtk2, pObj, i )
+ Vec_PtrPush(nodesInLevel2[Abc_ObjLevel(pObj)], pObj);
+
+ oMatchedGroups = Vec_IntAlloc( 10 );
+
+ for(i = 0; i < *iLastItem1; i++)
+ {
+ if(Vec_IntSize(iMatch1[i]) == 1)
+ {
+ Vec_IntPush(matchedInputs1, Vec_IntEntryLast(iMatch1[i]));
+ Vec_IntPush(matchedInputs2, Vec_IntEntryLast(iMatch2[i]));
+ }
+ else
+ Vec_IntPush(iNonSingleton, i);
+ }
+
+ for(i = 0; i < *oLastItem1; i++)
+ {
+ if(Vec_IntSize(oMatch1[i]) == 1)
+ {
+ Vec_IntPush(matchedOutputs1, Vec_IntEntryLast(oMatch1[i]));
+ Vec_IntPush(matchedOutputs2, Vec_IntEntryLast(oMatch2[i]));
+ }
+ }
+
+ for(i = 0; i < Vec_IntSize(iNonSingleton) - 1; i++)
+ {
+ for(j = i + 1; j < Vec_IntSize(iNonSingleton); j++)
+ if( observability2[Vec_IntEntry(iMatch2[Vec_IntEntry(iNonSingleton, j)], 0)] >
+ observability2[Vec_IntEntry(iMatch2[Vec_IntEntry(iNonSingleton, i)], 0)] )
+ {
+ int temp = Vec_IntEntry(iNonSingleton, i);
+ Vec_IntWriteEntry( iNonSingleton, i, Vec_IntEntry(iNonSingleton, j) );
+ Vec_IntWriteEntry( iNonSingleton, j, temp );
+ }
+ else if( observability2[Vec_IntEntry(iMatch2[Vec_IntEntry(iNonSingleton, j)], 0)] ==
+ observability2[Vec_IntEntry(iMatch2[Vec_IntEntry(iNonSingleton, i)], 0)] )
+ {
+ if( Vec_IntSize(iMatch2[Vec_IntEntry(iNonSingleton, j)]) < Vec_IntSize(iMatch2[Vec_IntEntry(iNonSingleton, i)]) )
+ {
+ int temp = Vec_IntEntry(iNonSingleton, i);
+ Vec_IntWriteEntry( iNonSingleton, i, Vec_IntEntry(iNonSingleton, j) );
+ Vec_IntWriteEntry( iNonSingleton, j, temp );
+ }
+ }
+ }
+
+ /*for(i = 0; i < Vec_IntSize(iNonSingleton) - 1; i++)
+ {
+ for(j = i + 1; j < Vec_IntSize(iNonSingleton); j++)
+ if( Vec_IntSize(oDep2[oGroup2[Vec_IntEntryLast(iMatch2[Vec_IntEntry(iNonSingleton, j)])]]) >
+ Vec_IntSize(oDep2[oGroup2[Vec_IntEntryLast(iMatch2[Vec_IntEntry(iNonSingleton, i)])]]) )
+ {
+ int temp = Vec_IntEntry(iNonSingleton, i);
+ Vec_IntWriteEntry( iNonSingleton, i, Vec_IntEntry(iNonSingleton, j) );
+ Vec_IntWriteEntry( iNonSingleton, j, temp );
+ }
+ else if( Vec_IntSize(oDep2[oGroup2[Vec_IntEntryLast(iMatch2[Vec_IntEntry(iNonSingleton, j)])]]) ==
+ Vec_IntSize(oDep2[oGroup2[Vec_IntEntryLast(iMatch2[Vec_IntEntry(iNonSingleton, i)])]]) )
+ {
+ if( observability2[Vec_IntEntry(iMatch2[Vec_IntEntry(iNonSingleton, j)], 0)] >
+ observability2[Vec_IntEntry(iMatch2[Vec_IntEntry(iNonSingleton, i)], 0)] )
+ {
+ int temp = Vec_IntEntry(iNonSingleton, i);
+ Vec_IntWriteEntry( iNonSingleton, i, Vec_IntEntry(iNonSingleton, j) );
+ Vec_IntWriteEntry( iNonSingleton, j, temp );
+ }
+ }
+ }*/
+
+ matchFound = match1by1(pNtk1, nodesInLevel1, iMatch1, iDep1, matchedInputs1, iGroup1, oMatch1, oGroup1,
+ pNtk2, nodesInLevel2, iMatch2, iDep2, matchedInputs2, iGroup2, oMatch2, oGroup2,
+ matchedOutputs1, matchedOutputs2, oMatchedGroups, iNonSingleton, 0, 0);
+
+ if( matchFound && Vec_IntSize(matchedOutputs1) != Abc_NtkPoNum(pNtk1) )
+ {
+ Vec_Int_t * oNonSingleton;
+ Vec_Ptr_t * oMatchPairs;
+ Abc_Ntk_t * subNtk1, * subNtk2;
+
+ oNonSingleton = Vec_IntAlloc( 10 );
+
+ oMatchPairs = Vec_PtrAlloc(Abc_NtkPoNum(pNtk1) * 2);
+
+ for(i = 0; i < *oLastItem1; i++)
+ if( Vec_IntSize(oMatch1[i]) > 1 && Vec_IntFind( oMatchedGroups, i) == -1 )
+ Vec_IntPush(oNonSingleton, i);
+
+ subNtk1 = computeCofactor(pNtk1, nodesInLevel1, NULL, matchedInputs1);
+ subNtk2 = computeCofactor(pNtk2, nodesInLevel2, NULL, matchedInputs2);
+
+ matchFound = matchNonSingletonOutputs(pNtk1, nodesInLevel1, iMatch1, iDep1, matchedInputs1, iGroup1, oMatch1, oGroup1,
+ pNtk2, nodesInLevel2, iMatch2, iDep2, matchedInputs2, iGroup1, oMatch2, oGroup2,
+ matchedOutputs1, matchedOutputs2, oMatchedGroups, NULL,
+ subNtk1, subNtk2, oMatchPairs, oNonSingleton, 0, 0, 0, 0);
+
+ Vec_IntFree( oNonSingleton );
+ Vec_PtrFree( oMatchPairs );
+
+ Abc_NtkDelete(subNtk1);
+ Abc_NtkDelete(subNtk2);
+ }
+
+ satTime = (float)(clock() - clk)/(float)(CLOCKS_PER_SEC);
+
+ if( matchFound )
+ {
+ checkEquivalence( pNtk1, matchedInputs1, matchedOutputs1, pNtk2, matchedInputs2, matchedOutputs2);
+
+ result = fopen("IOmatch.txt", "w");
+
+ fprintf(result, "I/O = %d / %d \n\n", Abc_NtkPiNum(pNtk1), Abc_NtkPoNum(pNtk1));
+
+ for(i = 0; i < Vec_IntSize(matchedInputs1) ; i++)
+ fprintf(result, "{%s}\t{%s}\n", Abc_ObjName(Abc_NtkPi(pNtk1, Vec_IntEntry(matchedInputs1, i))), Abc_ObjName(Abc_NtkPi(pNtk2, Vec_IntEntry(matchedInputs2, i))) );
+
+ fprintf(result, "\n-----------------------------------------\n");
+
+ for(i = 0; i < Vec_IntSize(matchedOutputs1) ; i++)
+ fprintf(result, "{%s}\t{%s}\n", Abc_ObjName(Abc_NtkPo(pNtk1, Vec_IntEntry(matchedOutputs1, i))), Abc_ObjName(Abc_NtkPo(pNtk2, Vec_IntEntry(matchedOutputs2, i))) );
+
+ fclose( result );
+ }
+
+ Vec_IntFree( matchedInputs1 );
+ Vec_IntFree( matchedInputs2 );
+ Vec_IntFree( matchedOutputs1 );
+ Vec_IntFree( matchedOutputs2 );
+ Vec_IntFree( iNonSingleton );
+ Vec_IntFree( oMatchedGroups );
+
+ for(i = 0; i <= Abc_AigLevel( pNtk1 ); i++)
+ Vec_PtrFree( nodesInLevel1[i] );
+ for(i = 0; i <= Abc_AigLevel( pNtk2 ); i++)
+ Vec_PtrFree( nodesInLevel2[i] );
+
+
+ ABC_FREE( nodesInLevel1 );
+ ABC_FREE( nodesInLevel2 );
+ /*fclose(matchFile);*/
+
+ return satTime;
+}
+
+int checkListConsistency(Vec_Int_t ** iMatch1, Vec_Int_t ** oMatch1, Vec_Int_t ** iMatch2, Vec_Int_t ** oMatch2, int iLastItem1, int oLastItem1, int iLastItem2, int oLastItem2)
+{
+ //int i;
+
+ if(iLastItem1 != iLastItem2 || oLastItem1 != oLastItem2)
+ return FALSE;
+
+ /*for(i = 0; i < iLastItem1; i++) {
+ if(Vec_IntSize(iMatch1[i]) != Vec_IntSize(iMatch2[i]))
+ return FALSE;
+ }
+
+ for(i = 0; i < oLastItem1; i++) {
+ if(Vec_IntSize(oMatch1[i]) != Vec_IntSize(oMatch2[i]))
+ return FALSE;
+ }*/
+
+ return TRUE;
+}
+
+
+void bmGateWay( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int p_equivalence )
+{
+ Vec_Int_t ** iDep1, ** oDep1;
+ Vec_Int_t ** iDep2, ** oDep2;
+ Vec_Int_t ** iMatch1, ** oMatch1;
+ Vec_Int_t ** iMatch2, ** oMatch2;
+ int * iGroup1, * oGroup1;
+ int * iGroup2, * oGroup2;
+ int iLastItem1, oLastItem1;
+ int iLastItem2, oLastItem2;
+ int i, j;
+
+ char * vPiValues1, * vPiValues2;
+ int * observability1, * observability2;
+ int clk = clock();
+ float initTime;
+ float simulTime;
+ float satTime;
+ Vec_Ptr_t ** topOrder1 = NULL, ** topOrder2 = NULL;
+
+ extern void getDependencies(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, Vec_Int_t** oDep);
+ extern void initMatchList(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, Vec_Int_t** oDep, Vec_Int_t** iMatch, int* iLastItem, Vec_Int_t** oMatch, int* oLastItem, int* iGroup, int* oGroup, int p_equivalence);
+ extern void iSortDependencies(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, int* oGroup);
+ extern void oSortDependencies(Abc_Ntk_t *pNtk, Vec_Int_t** oDep, int* iGroup);
+ extern int iSplitByDep(Abc_Ntk_t *pNtk, Vec_Int_t** iDep, Vec_Int_t** iMatch, int* iGroup, int* iLastItem, int* oGroup);
+ extern int oSplitByDep(Abc_Ntk_t *pNtk, Vec_Int_t** oDep, Vec_Int_t** oMatch, int* oGroup, int* oLastItem, int* iGroup);
+ extern Vec_Ptr_t ** findTopologicalOrder(Abc_Ntk_t * pNtk);
+ extern int refineIOBySimulation(Abc_Ntk_t *pNtk, Vec_Int_t** iMatch, int* iLastItem, int * iGroup, Vec_Int_t** iDep, Vec_Int_t** oMatch, int* oLastItem, int * oGroup, Vec_Int_t** oDep, char * vPiValues, int * observability, Vec_Ptr_t ** topOrder);
+ extern float refineBySAT(Abc_Ntk_t * pNtk1, Vec_Int_t ** iMatch1, int * iGroup1, Vec_Int_t ** iDep1, int* iLastItem1, Vec_Int_t ** oMatch1, int * oGroup1, Vec_Int_t ** oDep1, int* oLastItem1, int * observability1,
+ Abc_Ntk_t * pNtk2, Vec_Int_t ** iMatch2, int * iGroup2, Vec_Int_t ** iDep2, int* iLastItem2, Vec_Int_t ** oMatch2, int * oGroup2, Vec_Int_t ** oDep2, int* oLastItem2, int * observability2);
+ int checkListConsistency(Vec_Int_t ** iMatch1, Vec_Int_t ** oMatch1, Vec_Int_t ** iMatch2, Vec_Int_t ** oMatch2, int iLastItem1, int oLastItem1, int iLastItem2, int oLastItem2);
+
+ iDep1 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPiNum(pNtk1) );
+ oDep1 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPoNum(pNtk1) );
+
+ iDep2 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPiNum(pNtk2) );
+ oDep2 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPoNum(pNtk2) );
+
+ iMatch1 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPiNum(pNtk1) );
+ oMatch1 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPoNum(pNtk1) );
+
+ iMatch2 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPiNum(pNtk2) );
+ oMatch2 = ABC_ALLOC( Vec_Int_t*, (unsigned)Abc_NtkPoNum(pNtk2) );
+
+ iGroup1 = ABC_ALLOC( int, Abc_NtkPiNum(pNtk1) );
+ oGroup1 = ABC_ALLOC( int, Abc_NtkPoNum(pNtk1) );
+
+ iGroup2 = ABC_ALLOC( int, Abc_NtkPiNum(pNtk2) );
+ oGroup2 = ABC_ALLOC( int, Abc_NtkPoNum(pNtk2) );
+
+ vPiValues1 = ABC_ALLOC( char, Abc_NtkPiNum(pNtk1) + 1);
+ vPiValues1[Abc_NtkPiNum(pNtk1)] = '\0';
+
+ vPiValues2 = ABC_ALLOC( char, Abc_NtkPiNum(pNtk2) + 1);
+ vPiValues2[Abc_NtkPiNum(pNtk2)] = '\0';
+
+ observability1 = ABC_ALLOC(int, (unsigned)Abc_NtkPiNum(pNtk1));
+ observability2 = ABC_ALLOC(int, (unsigned)Abc_NtkPiNum(pNtk2));
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk1); i++)
+ {
+ iDep1[i] = Vec_IntAlloc( 1 );
+ iMatch1[i] = Vec_IntAlloc( 1 );
+
+ iDep2[i] = Vec_IntAlloc( 1 );
+ iMatch2[i] = Vec_IntAlloc( 1 );
+
+ vPiValues1[i] = '0';
+ vPiValues2[i] = '0';
+
+ observability1[i] = 0;
+ observability2[i] = 0;
+ }
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk1); i++)
+ {
+ oDep1[i] = Vec_IntAlloc( 1 );
+ oMatch1[i] = Vec_IntAlloc( 1 );
+
+ oDep2[i] = Vec_IntAlloc( 1 );
+ oMatch2[i] = Vec_IntAlloc( 1 );
+ }
+
+ /************* Strashing ************/
+ pNtk1 = Abc_NtkStrash( pNtk1, 0, 0, 0 );
+ pNtk2 = Abc_NtkStrash( pNtk2, 0, 0, 0 );
+ printf("Network strashing is done!\n");
+ /************************************/
+
+ /******* Getting Dependencies *******/
+ getDependencies(pNtk1, iDep1, oDep1);
+ getDependencies(pNtk2, iDep2, oDep2);
+ printf("Getting dependencies is done!\n");
+ /************************************/
+
+ /***** Intializing match lists ******/
+ initMatchList(pNtk1, iDep1, oDep1, iMatch1, &iLastItem1, oMatch1, &oLastItem1, iGroup1, oGroup1, p_equivalence);
+ initMatchList(pNtk2, iDep2, oDep2, iMatch2, &iLastItem2, oMatch2, &oLastItem2, iGroup2, oGroup2, p_equivalence);
+ printf("Initializing match lists is done!\n");
+ /************************************/
+
+ if( !checkListConsistency(iMatch1, oMatch1, iMatch2, oMatch2, iLastItem1, oLastItem1, iLastItem2, oLastItem2) )
+ {
+ fprintf( stdout, "I/O dependencies of two circuits are different.\n");
+ goto freeAndExit;
+ }
+
+ printf("Refining IOs by dependencies ...");
+ // split match lists further by checking dependencies
+ do
+ {
+ int iNumOfItemsAdded = 1, oNumOfItemsAdded = 1;
+
+ do
+ {
+ if( oNumOfItemsAdded )
+ {
+ iSortDependencies(pNtk1, iDep1, oGroup1);
+ iSortDependencies(pNtk2, iDep2, oGroup2);
+ }
+
+ if( iNumOfItemsAdded )
+ {
+ oSortDependencies(pNtk1, oDep1, iGroup1);
+ oSortDependencies(pNtk2, oDep2, iGroup2);
+ }
+
+ if( iLastItem1 < Abc_NtkPiNum(pNtk1) )
+ {
+ iSplitByDep(pNtk1, iDep1, iMatch1, iGroup1, &iLastItem1, oGroup1);
+ if( oLastItem1 < Abc_NtkPoNum(pNtk1) )
+ oSplitByDep(pNtk1, oDep1, oMatch1, oGroup1, &oLastItem1, iGroup1);
+ }
+
+ if( iLastItem2 < Abc_NtkPiNum(pNtk2) )
+ {
+ iNumOfItemsAdded = iSplitByDep(pNtk2, iDep2, iMatch2, iGroup2, &iLastItem2, oGroup2);
+ if( oLastItem2 < Abc_NtkPoNum(pNtk2) )
+ oNumOfItemsAdded = oSplitByDep(pNtk2, oDep2, oMatch2, oGroup2, &oLastItem2, iGroup2);
+ else
+ oNumOfItemsAdded = 0;
+ }
+ else
+ iNumOfItemsAdded = 0;
+
+ if(!checkListConsistency(iMatch1, oMatch1, iMatch2, oMatch2, iLastItem1, oLastItem1, iLastItem2, oLastItem2))
+ {
+ fprintf( stdout, "I/O dependencies of two circuits are different.\n");
+ goto freeAndExit;
+ }
+ }while(iNumOfItemsAdded != 0 || oNumOfItemsAdded != 0);
+
+ }while(0);
+
+ printf(" done!\n");
+
+ initTime = ((float)(clock() - clk)/(float)(CLOCKS_PER_SEC));
+ clk = clock();
+
+ topOrder1 = findTopologicalOrder(pNtk1);
+ topOrder2 = findTopologicalOrder(pNtk2);
+
+ printf("Refining IOs by simulation ...");
+
+ do
+ {
+ int counter = 0;
+ int ioSuccess1, ioSuccess2;
+
+ do
+ {
+ for(i = 0; i < iLastItem1; i++)
+ {
+ int temp = (int)(SIM_RANDOM_UNSIGNED % 2);
+
+ if(Vec_IntSize(iMatch1[i]) != Vec_IntSize(iMatch2[i]))
+ {
+ fprintf( stdout, "Input refinement by simulation finds two circuits different.\n");
+ goto freeAndExit;
+ }
+
+ for(j = 0; j < Vec_IntSize(iMatch1[i]); j++)
+ {
+ vPiValues1[Vec_IntEntry(iMatch1[i], j)] = temp + '0';
+ vPiValues2[Vec_IntEntry(iMatch2[i], j)] = temp + '0';
+ }
+ }
+
+ ioSuccess1 = refineIOBySimulation(pNtk1, iMatch1, &iLastItem1, iGroup1, iDep1, oMatch1, &oLastItem1, oGroup1, oDep1, vPiValues1, observability1, topOrder1);
+ ioSuccess2 = refineIOBySimulation(pNtk2, iMatch2, &iLastItem2, iGroup2, iDep2, oMatch2, &oLastItem2, oGroup2, oDep2, vPiValues2, observability2, topOrder2);
+
+ if(ioSuccess1 && ioSuccess2)
+ counter = 0;
+ else
+ counter++;
+
+ if(ioSuccess1 != ioSuccess2 ||
+ !checkListConsistency(iMatch1, oMatch1, iMatch2, oMatch2, iLastItem1, oLastItem1, iLastItem2, oLastItem2))
+ {
+ fprintf( stdout, "Input refinement by simulation finds two circuits different.\n");
+ goto freeAndExit;
+ }
+ }while(counter <= 200);
+
+ }while(0);
+
+ printf(" done!\n");
+
+ simulTime = (float)(clock() - clk)/(float)(CLOCKS_PER_SEC);
+ printf("SAT-based search started ...\n");
+
+ satTime = refineBySAT(pNtk1, iMatch1, iGroup1, iDep1, &iLastItem1, oMatch1, oGroup1, oDep1, &oLastItem1, observability1,
+ pNtk2, iMatch2, iGroup2, iDep2, &iLastItem2, oMatch2, oGroup2, oDep2, &oLastItem2, observability2);
+
+ printf( "Init Time = %4.2f\n", initTime );
+ printf( "Simulation Time = %4.2f\n", simulTime );
+ printf( "SAT Time = %4.2f\n", satTime );
+ printf( "Overall Time = %4.2f\n", initTime + simulTime + satTime );
+
+freeAndExit:
+
+ for(i = 0; i < iLastItem1 ; i++)
+ {
+
+ Vec_IntFree( iMatch1[i] );
+ Vec_IntFree( iMatch2[i] );
+ }
+
+ for(i = 0; i < oLastItem1 ; i++)
+ {
+
+ Vec_IntFree( oMatch1[i] );
+ Vec_IntFree( oMatch2[i] );
+ }
+
+ for(i = 0; i < Abc_NtkPiNum(pNtk1); i++)
+ {
+ Vec_IntFree( iDep1[i] );
+ Vec_IntFree( iDep2[i] );
+ if(topOrder1 != NULL) {
+ Vec_PtrFree( topOrder1[i] );
+ Vec_PtrFree( topOrder2[i] );
+ }
+ }
+
+ for(i = 0; i < Abc_NtkPoNum(pNtk1); i++)
+ {
+ Vec_IntFree( oDep1[i] );
+ Vec_IntFree( oDep2[i] );
+ }
+
+ ABC_FREE( iMatch1 );
+ ABC_FREE( iMatch2 );
+ ABC_FREE( oMatch1 );
+ ABC_FREE( oMatch2 );
+ ABC_FREE( iDep1 );
+ ABC_FREE( iDep2 );
+ ABC_FREE( oDep1 );
+ ABC_FREE( oDep2 );
+ ABC_FREE( iGroup1 );
+ ABC_FREE( iGroup2 );
+ ABC_FREE( oGroup1 );
+ ABC_FREE( oGroup2 );
+ ABC_FREE( vPiValues1 );
+ ABC_FREE( vPiValues2 );
+ ABC_FREE( observability1 );
+ ABC_FREE( observability2 );
+ if(topOrder1 != NULL) {
+ ABC_FREE( topOrder1 );
+ ABC_FREE( topOrder2 );
+ }
+}ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcBmc.c b/src/base/abci/abcBmc.c
index 1512c76f..21f2d484 100644
--- a/src/base/abci/abcBmc.c
+++ b/src/base/abci/abcBmc.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "ivy.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -93,7 +96,7 @@ void Abc_NtkBmcReport( Ivy_Man_t * pMan, Ivy_Man_t * pFrames, Ivy_Man_t * pFraig
{
Ivy_ManForEachNode( pMan, pFirst1, i )
{
- pFirst2 = Ivy_Regular( Vec_PtrEntry(vMapping, f * nIdMax + pFirst1->Id) );
+ pFirst2 = Ivy_Regular( (Ivy_Obj_t *)Vec_PtrEntry(vMapping, f * nIdMax + pFirst1->Id) );
if ( Ivy_ObjIsConst1(pFirst2) || pFirst2->Type == 0 )
continue;
pFirst3 = Ivy_Regular( pFirst2->pEquiv );
@@ -115,3 +118,5 @@ void Abc_NtkBmcReport( Ivy_Man_t * pMan, Ivy_Man_t * pFrames, Ivy_Man_t * pFraig
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcCas.c b/src/base/abci/abcCas.c
index ff0d761e..76fe5e9f 100644
--- a/src/base/abci/abcCas.c
+++ b/src/base/abci/abcCas.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
This LUT cascade synthesis algorithm is described in the paper:
A. Mishchenko and T. Sasao, "Encoding of Boolean functions and its
@@ -109,3 +112,5 @@ Abc_Ntk_t * Abc_NtkCascade( Abc_Ntk_t * pNtk, int nLutSize, int fCheck, int fVer
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcCascade.c b/src/base/abci/abcCascade.c
new file mode 100644
index 00000000..a2e6d234
--- /dev/null
+++ b/src/base/abci/abcCascade.c
@@ -0,0 +1,284 @@
+/**CFile****************************************************************
+
+ FileName [abcCascade.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [Collapsing the network into two-levels.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: abcCollapse.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "reo.h"
+
+ABC_NAMESPACE_IMPL_START
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+#define BDD_FUNC_MAX 256
+
+//extern void Abc_NodeShowBddOne( DdManager * dd, DdNode * bFunc );
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Find the constant node corresponding to the encoded output value.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+DdNode * Abc_NtkBddFindAddConst( DdManager * dd, DdNode * bFunc, int nOuts )
+{
+ int i, TermMask = 0;
+ DdNode * bFunc0, * bFunc1, * bConst0, * bConst1;
+ bConst0 = Cudd_ReadLogicZero( dd );
+ bConst1 = Cudd_ReadOne( dd );
+ for ( i = 0; i < nOuts; i++ )
+ {
+ if ( Cudd_IsComplement(bFunc) )
+ {
+ bFunc0 = Cudd_Not(Cudd_E(bFunc));
+ bFunc1 = Cudd_Not(Cudd_T(bFunc));
+ }
+ else
+ {
+ bFunc0 = Cudd_E(bFunc);
+ bFunc1 = Cudd_T(bFunc);
+ }
+ assert( bFunc0 == bConst0 || bFunc1 == bConst0 );
+ if ( bFunc0 == bConst0 )
+ {
+ TermMask ^= (1 << i);
+ bFunc = bFunc1;
+ }
+ else
+ bFunc = bFunc0;
+ }
+ assert( bFunc == bConst1 );
+ return Cudd_addConst( dd, TermMask );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Recursively construct ADD for BDD.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+DdNode * Abc_NtkBddToAdd_rec( DdManager * dd, DdNode * bFunc, int nOuts, stmm_table * tTable, int fCompl )
+{
+ DdNode * aFunc0, * aFunc1, * aFunc;
+ DdNode ** ppSlot;
+ assert( !Cudd_IsComplement(bFunc) );
+ if ( stmm_find_or_add( tTable, (char *)bFunc, (char ***)&ppSlot ) )
+ return *ppSlot;
+ if ( (int)bFunc->index >= Cudd_ReadSize(dd) - nOuts )
+ {
+ assert( Cudd_ReadPerm(dd, bFunc->index) >= Cudd_ReadSize(dd) - nOuts );
+ aFunc = Abc_NtkBddFindAddConst( dd, Cudd_NotCond(bFunc, fCompl), nOuts ); Cudd_Ref( aFunc );
+ }
+ else
+ {
+ aFunc0 = Abc_NtkBddToAdd_rec( dd, Cudd_Regular(cuddE(bFunc)), nOuts, tTable, fCompl ^ Cudd_IsComplement(cuddE(bFunc)) );
+ aFunc1 = Abc_NtkBddToAdd_rec( dd, cuddT(bFunc), nOuts, tTable, fCompl );
+ aFunc = Cudd_addIte( dd, Cudd_addIthVar(dd, bFunc->index), aFunc1, aFunc0 ); Cudd_Ref( aFunc );
+ }
+ return (*ppSlot = aFunc);
+}
+
+/**Function*************************************************************
+
+ Synopsis [R]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+DdNode * Abc_NtkBddToAdd( DdManager * dd, DdNode * bFunc, int nOuts )
+{
+ DdNode * aFunc, * aTemp, * bTemp;
+ stmm_table * tTable;
+ stmm_generator * gen;
+ tTable = stmm_init_table( st_ptrcmp, st_ptrhash );
+ aFunc = Abc_NtkBddToAdd_rec( dd, Cudd_Regular(bFunc), nOuts, tTable, Cudd_IsComplement(bFunc) ); Cudd_Ref(aFunc);
+ stmm_foreach_item( tTable, gen, (char **)&bTemp, (char **)&aTemp )
+ Cudd_RecursiveDeref( dd, aFunc );
+ stmm_free_table( tTable );
+ Cudd_Deref( aFunc );
+ return aFunc;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Computes the characteristic function.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+DdNode * Abc_NtkBddDecCharFunc( DdManager * dd, DdNode ** pFuncs, int nOuts, int Mask, int nBits )
+{
+ DdNode * bFunc, * bTemp, * bExor, * bVar;
+ int i, Count = 0;
+ bFunc = Cudd_ReadOne( dd ); Cudd_Ref( bFunc );
+ for ( i = 0; i < nOuts; i++ )
+ {
+ if ( (Mask & (1 << i)) == 0 )
+ continue;
+ Count++;
+ bVar = Cudd_bddIthVar( dd, dd->size - nOuts + i );
+ bExor = Cudd_bddXor( dd, pFuncs[i], bVar ); Cudd_Ref( bExor );
+ bFunc = Cudd_bddAnd( dd, bTemp = bFunc, Cudd_Not(bExor) ); Cudd_Ref( bFunc );
+ Cudd_RecursiveDeref( dd, bTemp );
+ Cudd_RecursiveDeref( dd, bExor );
+ }
+ Cudd_Deref( bFunc );
+ assert( Count == nBits );
+ return bFunc;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Evaluate Sasao's decomposition.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkBddDecTry( reo_man * pReo, DdManager * dd, DdNode ** pFuncs, int nOuts, int Mask, int nBits )
+{
+ DdNode * bFunc, * aFunc, * aFuncNew;
+ // drive the characteristic function
+ bFunc = Abc_NtkBddDecCharFunc( dd, pFuncs, nOuts, Mask, nBits ); Cudd_Ref( bFunc );
+//Abc_NodeShowBddOne( dd, bFunc );
+ // transfer to ADD
+ aFunc = Abc_NtkBddToAdd( dd, bFunc, nOuts ); Cudd_Ref( aFunc );
+ Cudd_RecursiveDeref( dd, bFunc );
+//Abc_NodeShowBddOne( dd, aFunc );
+ // perform reordering for BDD width
+ aFuncNew = Extra_Reorder( pReo, dd, aFunc, NULL ); Cudd_Ref( aFuncNew );
+ Cudd_RecursiveDeref( dd, aFuncNew );
+ Cudd_RecursiveDeref( dd, aFunc );
+ // print the result
+ reoProfileWidthPrint( pReo );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Evaluate Sasao's decomposition.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkBddDecInt( reo_man * pReo, DdManager * dd, DdNode ** pFuncs, int nOuts )
+{
+/*
+ int i, k;
+ for ( i = 1; i <= nOuts; i++ )
+ {
+ for ( k = 0; k < (1<<nOuts); k++ )
+ if ( Extra_WordCountOnes(k) == i )
+ {
+ Extra_PrintBinary( stdout, (unsigned *)&k, nOuts );
+ Abc_NtkBddDecTry( pReo, dd, pFuncs, nOuts, k, i );
+ printf( "\n" );
+ }
+ }
+*/
+ Abc_NtkBddDecTry( pReo, dd, pFuncs, nOuts, ~(1<<(32-nOuts)), nOuts );
+
+}
+
+/**Function*************************************************************
+
+ Synopsis [Evaluate Sasao's decomposition.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkBddDec( Abc_Ntk_t * pNtk, int fVerbose )
+{
+ int nBddSizeMax = 1000000;
+ int fDropInternal = 0;
+ int fReorder = 1;
+ reo_man * pReo;
+ DdManager * dd;
+ DdNode * pFuncs[BDD_FUNC_MAX];
+ Abc_Obj_t * pNode;
+ int i;
+ assert( Abc_NtkIsStrash(pNtk) );
+ assert( Abc_NtkCoNum(pNtk) <= BDD_FUNC_MAX );
+ dd = Abc_NtkBuildGlobalBdds( pNtk, nBddSizeMax, fDropInternal, fReorder, fVerbose );
+ if ( dd == NULL )
+ {
+ Abc_Print( -1, "Construction of global BDDs has failed.\n" );
+ return;
+ }
+
+ assert( dd->size == Abc_NtkCiNum(pNtk) );
+ // create new variables at the bottom
+ for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
+ Cudd_addNewVarAtLevel( dd, dd->size );
+ // create terminals of MTBDD
+// for ( i = 0; i < (1 << Abc_NtkCoNum(pNtk)); i++ )
+// Cudd_addConst( dd, i );
+ // collect global BDDs
+ Abc_NtkForEachCo( pNtk, pNode, i )
+ pFuncs[i] = Abc_ObjGlobalBdd(pNode);
+
+ pReo = Extra_ReorderInit( Abc_NtkCiNum(pNtk), 1000 );
+ Extra_ReorderSetMinimizationType( pReo, REO_MINIMIZE_WIDTH );
+
+ Abc_NtkBddDecInt( pReo, dd, pFuncs, Abc_NtkCoNum(pNtk) );
+ Extra_ReorderQuit( pReo );
+
+ Abc_NtkFreeGlobalBdds( pNtk, 1 );
+}
+
+ABC_NAMESPACE_IMPL_END
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/base/abci/abcClpSop.c b/src/base/abci/abcClpSop.c
deleted file mode 100644
index de92243f..00000000
--- a/src/base/abci/abcClpSop.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/**CFile****************************************************************
-
- FileName [abcCollapse.c]
-
- SystemName [ABC: Logic synthesis and verification system.]
-
- PackageName [Network and node package.]
-
- Synopsis [Collapsing the network into two-levels.]
-
- Author [Alan Mishchenko]
-
- Affiliation [UC Berkeley]
-
- Date [Ver. 1.0. Started - June 20, 2005.]
-
- Revision [$Id: abcCollapse.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
-
-***********************************************************************/
-
-#include "abc.h"
-
-////////////////////////////////////////////////////////////////////////
-/// DECLARATIONS ///
-////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////
-/// FUNCTION DEFINITIONS ///
-////////////////////////////////////////////////////////////////////////
-
-/**Function*************************************************************
-
- Synopsis [Collapses the network.]
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-Abc_Ntk_t * Abc_NtkCollapseSop( Abc_Ntk_t * pNtk, int fVerbose )
-{
- Abc_Ntk_t * pNtkNew;
- pNtkNew = NULL;
- return pNtkNew;
-}
-
-////////////////////////////////////////////////////////////////////////
-/// END OF FILE ///
-////////////////////////////////////////////////////////////////////////
-
-
diff --git a/src/base/abci/abcClpBdd.c b/src/base/abci/abcCollapse.c
index 27cba249..1b7709c5 100644
--- a/src/base/abci/abcClpBdd.c
+++ b/src/base/abci/abcCollapse.c
@@ -21,6 +21,9 @@
#include "abc.h"
//#include "reo.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -120,7 +123,7 @@ Abc_Ntk_t * Abc_NtkFromGlobalBdds( Abc_Ntk_t * pNtk )
// start the new network
pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
// make sure the new manager has the same number of inputs
- Cudd_bddIthVar( pNtkNew->pManFunc, dd->size-1 );
+ Cudd_bddIthVar( (DdManager *)pNtkNew->pManFunc, dd->size-1 );
// process the POs
pProgress = Extra_ProgressBarStart( stdout, Abc_NtkCoNum(pNtk) );
Abc_NtkForEachCo( pNtk, pNode, i )
@@ -169,7 +172,7 @@ Abc_Obj_t * Abc_NodeFromGlobalBdds( Abc_Ntk_t * pNtkNew, DdManager * dd, DdNode
Abc_NtkForEachCi( pNtkNew, pTemp, i )
Abc_ObjAddFanin( pNodeNew, Abc_NtkCi(pNtkNew, dd->invperm[i]) );
// transfer the function
- pNodeNew->pData = Extra_TransferLevelByLevel( dd, pNtkNew->pManFunc, bFunc ); Cudd_Ref( pNodeNew->pData );
+ pNodeNew->pData = Extra_TransferLevelByLevel( dd, (DdManager *)pNtkNew->pManFunc, bFunc ); Cudd_Ref( (DdNode *)pNodeNew->pData );
return pNodeNew;
}
@@ -179,3 +182,5 @@ Abc_Obj_t * Abc_NodeFromGlobalBdds( Abc_Ntk_t * pNtkNew, DdManager * dd, DdNode
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcCut.c b/src/base/abci/abcCut.c
index cc97796f..e80ddb92 100644
--- a/src/base/abci/abcCut.c
+++ b/src/base/abci/abcCut.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "cut.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -155,7 +158,7 @@ Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams )
vNodes = Abc_AigDfs( pNtk, 0, 1 ); // collects POs
vChoices = Vec_IntAlloc( 100 );
pProgress = Extra_ProgressBarStart( stdout, Vec_PtrSize(vNodes) );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
// when we reached a CO, it is time to deallocate the cuts
if ( Abc_ObjIsCo(pObj) )
@@ -180,7 +183,7 @@ Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams )
if ( Abc_AigNodeIsChoice(pObj) )
{
Vec_IntClear( vChoices );
- for ( pNode = pObj; pNode; pNode = pNode->pData )
+ for ( pNode = pObj; pNode; pNode = (Abc_Obj_t *)pNode->pData )
Vec_IntPush( vChoices, pNode->Id );
Cut_NodeUnionCuts( p, vChoices );
}
@@ -233,7 +236,7 @@ void Abc_NtkCutsOracle( Abc_Ntk_t * pNtk, Cut_Oracle_t * p )
// compute cuts for internal nodes
vNodes = Abc_AigDfs( pNtk, 0, 1 ); // collects POs
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
// when we reached a CO, it is time to deallocate the cuts
if ( Abc_ObjIsCo(pObj) )
@@ -429,7 +432,7 @@ void * Abc_NodeGetCuts( void * p, Abc_Obj_t * pObj, int fDag, int fTree )
// check if the node is a DAG node
fDagNode = (Abc_ObjFanoutNum(pObj) > 1 && !Abc_NodeIsMuxControlType(pObj));
// increment the counter of DAG nodes
- if ( fDagNode ) Cut_ManIncrementDagNodes( p );
+ if ( fDagNode ) Cut_ManIncrementDagNodes( (Cut_Man_t *)p );
// add the trivial cut if the node is a DAG node, or if we compute all cuts
fTriv = fDagNode || !fDag;
// check if fanins are DAG nodes
@@ -444,12 +447,12 @@ void * Abc_NodeGetCuts( void * p, Abc_Obj_t * pObj, int fDag, int fTree )
// changes due to the global/local cut computation
{
- Cut_Params_t * pParams = Cut_ManReadParams(p);
+ Cut_Params_t * pParams = Cut_ManReadParams((Cut_Man_t *)p);
if ( pParams->fLocal )
{
- Vec_Int_t * vNodeAttrs = Cut_ManReadNodeAttrs(p);
+ Vec_Int_t * vNodeAttrs = Cut_ManReadNodeAttrs((Cut_Man_t *)p);
fDagNode = Vec_IntEntry( vNodeAttrs, pObj->Id );
- if ( fDagNode ) Cut_ManIncrementDagNodes( p );
+ if ( fDagNode ) Cut_ManIncrementDagNodes( (Cut_Man_t *)p );
// fTriv = fDagNode || !pParams->fGlobal;
fTriv = !Vec_IntEntry( vNodeAttrs, pObj->Id );
TreeCode = 0;
@@ -459,7 +462,7 @@ void * Abc_NodeGetCuts( void * p, Abc_Obj_t * pObj, int fDag, int fTree )
TreeCode |= (Vec_IntEntry( vNodeAttrs, pFanin->Id ) << 1);
}
}
- return Cut_NodeComputeCuts( p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
+ return Cut_NodeComputeCuts( (Cut_Man_t *)p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj), fTriv, TreeCode );
}
@@ -500,7 +503,7 @@ void Abc_NodeGetCutsSeq( void * p, Abc_Obj_t * pObj, int fTriv )
***********************************************************************/
void * Abc_NodeReadCuts( void * p, Abc_Obj_t * pObj )
{
- return Cut_NodeReadCutsNew( p, pObj->Id );
+ return Cut_NodeReadCutsNew( (Cut_Man_t *)p, pObj->Id );
}
/**Function*************************************************************
@@ -516,7 +519,7 @@ void * Abc_NodeReadCuts( void * p, Abc_Obj_t * pObj )
***********************************************************************/
void Abc_NodeFreeCuts( void * p, Abc_Obj_t * pObj )
{
- Cut_NodeFreeCuts( p, pObj->Id );
+ Cut_NodeFreeCuts( (Cut_Man_t *)p, pObj->Id );
}
/**Function*************************************************************
@@ -538,7 +541,7 @@ void Abc_NtkPrintCuts( void * p, Abc_Ntk_t * pNtk, int fSeq )
printf( "Cuts of the network:\n" );
Abc_NtkForEachObj( pNtk, pObj, i )
{
- pList = Abc_NodeReadCuts( p, pObj );
+ pList = (Cut_Cut_t *)Abc_NodeReadCuts( (Cut_Man_t *)p, pObj );
printf( "Node %s:\n", Abc_ObjName(pObj) );
Cut_CutPrintList( pList, fSeq );
}
@@ -560,7 +563,7 @@ void Abc_NtkPrintCuts_( void * p, Abc_Ntk_t * pNtk, int fSeq )
Cut_Cut_t * pList;
Abc_Obj_t * pObj;
pObj = Abc_NtkObj( pNtk, 2 * Abc_NtkObjNum(pNtk) / 3 );
- pList = Abc_NodeReadCuts( p, pObj );
+ pList = (Cut_Cut_t *)Abc_NodeReadCuts( (Cut_Man_t *)p, pObj );
printf( "Node %s:\n", Abc_ObjName(pObj) );
Cut_CutPrintList( pList, fSeq );
}
@@ -616,7 +619,7 @@ Vec_Int_t * Abc_NtkGetNodeAttributes( Abc_Ntk_t * pNtk )
if ( Vec_IntEntry( vAttrs, pObj->Id ) )
{
vNodes = Abc_NodeMffcInsideCollect( pObj );
- Vec_PtrForEachEntry( vNodes, pTemp, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pTemp, k )
if ( pTemp != pObj )
Vec_IntWriteEntry( vAttrs, pTemp->Id, 0 );
Vec_PtrFree( vNodes );
@@ -689,3 +692,5 @@ Vec_Int_t * Abc_NtkGetNodeAttributes2( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c
index dbe98631..31ef986c 100644
--- a/src/base/abci/abcDar.c
+++ b/src/base/abci/abcDar.c
@@ -19,6 +19,7 @@
***********************************************************************/
#include "abc.h"
+#include "main.h"
#include "giaAig.h"
#include "saig.h"
#include "dar.h"
@@ -29,11 +30,14 @@
#include "dch.h"
#include "ssw.h"
#include "cgt.h"
-//#include "fsim.h"
+#include "bbr.h"
#include "gia.h"
#include "cec.h"
+#include "csw.h"
#include "giaAbs.h"
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -100,6 +104,7 @@ Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters )
// create the manager
pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
pMan->fCatchExor = fExors;
+ pMan->nConstrs = pNtk->nConstrs;
pMan->pName = Extra_UtilStrsav( pNtk->pName );
// transfer the pointers to the basic nodes
@@ -174,6 +179,7 @@ Aig_Man_t * Abc_NtkToDarChoices( Abc_Ntk_t * pNtk )
// create the manager
pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
pMan->pName = Extra_UtilStrsav( pNtk->pName );
+ pMan->nConstrs = pNtk->nConstrs;
if ( Abc_NtkGetChoiceNum(pNtk) )
{
pMan->pEquivs = ABC_ALLOC( Aig_Obj_t *, Abc_NtkObjNum(pNtk) );
@@ -184,13 +190,13 @@ Aig_Man_t * Abc_NtkToDarChoices( Abc_Ntk_t * pNtk )
Abc_NtkForEachCi( pNtk, pObj, i )
pObj->pCopy = (Abc_Obj_t *)Aig_ObjCreatePi(pMan);
// perform the conversion of the internal nodes (assumes DFS ordering)
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
pObj->pCopy = (Abc_Obj_t *)Aig_And( pMan, (Aig_Obj_t *)Abc_ObjChild0Copy(pObj), (Aig_Obj_t *)Abc_ObjChild1Copy(pObj) );
// printf( "%d->%d ", pObj->Id, ((Aig_Obj_t *)pObj->pCopy)->Id );
if ( Abc_AigNodeIsChoice( pObj ) )
{
- for ( pPrev = pObj, pFanin = pObj->pData; pFanin; pPrev = pFanin, pFanin = pFanin->pData )
+ for ( pPrev = pObj, pFanin = (Abc_Obj_t *)pObj->pData; pFanin; pPrev = pFanin, pFanin = (Abc_Obj_t *)pFanin->pData )
Aig_ObjSetEquiv( pMan, (Aig_Obj_t *)pPrev->pCopy, (Aig_Obj_t *)pFanin->pCopy );
// Aig_ManCreateChoice( pIfMan, (Aig_Obj_t *)pNode->pCopy );
}
@@ -232,17 +238,18 @@ Abc_Ntk_t * Abc_NtkFromDar( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
// assert( Aig_ManRegNum(pMan) == Abc_NtkLatchNum(pNtkOld) );
// perform strashing
pNtkNew = Abc_NtkStartFrom( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG );
+ pNtkNew->nConstrs = pMan->nConstrs;
// transfer the pointers to the basic nodes
Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew);
Aig_ManForEachPi( pMan, pObj, i )
pObj->pData = Abc_NtkCi(pNtkNew, i);
// rebuild the AIG
vNodes = Aig_ManDfs( pMan, 1 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
if ( Aig_ObjIsBuf(pObj) )
pObj->pData = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
else
- pObj->pData = Abc_AigAnd( pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
Vec_PtrFree( vNodes );
// connect the PO nodes
Aig_ManForEachPo( pMan, pObj, i )
@@ -287,6 +294,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeqSweep( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
// assert( Aig_ManRegNum(pMan) != Abc_NtkLatchNum(pNtkOld) );
// perform strashing
pNtkNew = Abc_NtkStartFromNoLatches( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG );
+ pNtkNew->nConstrs = pMan->nConstrs;
// consider the case of target enlargement
if ( Abc_NtkCiNum(pNtkNew) < Aig_ManPiNum(pMan) - Aig_ManRegNum(pMan) )
{
@@ -309,17 +317,17 @@ Abc_Ntk_t * Abc_NtkFromDarSeqSweep( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
pObjNew = Abc_NtkCreateLatch( pNtkNew );
pObjLi->pData = Abc_NtkCreateBi( pNtkNew );
pObjLo->pData = Abc_NtkCreateBo( pNtkNew );
- Abc_ObjAddFanin( pObjNew, pObjLi->pData );
- Abc_ObjAddFanin( pObjLo->pData, pObjNew );
+ Abc_ObjAddFanin( pObjNew, (Abc_Obj_t *)pObjLi->pData );
+ Abc_ObjAddFanin( (Abc_Obj_t *)pObjLo->pData, pObjNew );
Abc_LatchSetInit0( pObjNew );
}
// rebuild the AIG
vNodes = Aig_ManDfs( pMan, 1 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
if ( Aig_ObjIsBuf(pObj) )
pObj->pData = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
else
- pObj->pData = Abc_AigAnd( pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
Vec_PtrFree( vNodes );
// connect the PO nodes
Aig_ManForEachPo( pMan, pObj, i )
@@ -412,6 +420,7 @@ Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan )
assert( pMan->nAsserts == 0 );
// perform strashing
pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
+ pNtkNew->nConstrs = pMan->nConstrs;
// duplicate the name and the spec
// pNtkNew->pName = Extra_UtilStrsav(pMan->pName);
// pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec);
@@ -438,19 +447,19 @@ Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan )
pObjNew = Abc_NtkCreateLatch( pNtkNew );
pObjLi->pData = Abc_NtkCreateBi( pNtkNew );
pObjLo->pData = Abc_NtkCreateBo( pNtkNew );
- Abc_ObjAddFanin( pObjNew, pObjLi->pData );
- Abc_ObjAddFanin( pObjLo->pData, pObjNew );
+ Abc_ObjAddFanin( pObjNew, (Abc_Obj_t *)pObjLi->pData );
+ Abc_ObjAddFanin( (Abc_Obj_t *)pObjLo->pData, pObjNew );
Abc_LatchSetInit0( pObjNew );
- Abc_ObjAssignName( pObjLi->pData, Abc_ObjName(pObjLi->pData), NULL );
- Abc_ObjAssignName( pObjLo->pData, Abc_ObjName(pObjLo->pData), NULL );
+ Abc_ObjAssignName( (Abc_Obj_t *)pObjLi->pData, Abc_ObjName((Abc_Obj_t *)pObjLi->pData), NULL );
+ Abc_ObjAssignName( (Abc_Obj_t *)pObjLo->pData, Abc_ObjName((Abc_Obj_t *)pObjLo->pData), NULL );
}
// rebuild the AIG
vNodes = Aig_ManDfs( pMan, 1 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
if ( Aig_ObjIsBuf(pObj) )
pObj->pData = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
else
- pObj->pData = Abc_AigAnd( pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
Vec_PtrFree( vNodes );
// connect the PO nodes
Aig_ManForEachPo( pMan, pObj, i )
@@ -490,6 +499,7 @@ Abc_Ntk_t * Abc_NtkAfterTrim( Aig_Man_t * pMan, Abc_Ntk_t * pNtkOld )
assert( pMan->vCiNumsOrig != NULL );
// perform strashing
pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
+ pNtkNew->nConstrs = pMan->nConstrs;
// duplicate the name and the spec
// pNtkNew->pName = Extra_UtilStrsav(pMan->pName);
// pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec);
@@ -520,23 +530,23 @@ Abc_Ntk_t * Abc_NtkAfterTrim( Aig_Man_t * pMan, Abc_Ntk_t * pNtkOld )
pObjNew = Abc_NtkCreateLatch( pNtkNew );
pObjLi->pData = Abc_NtkCreateBi( pNtkNew );
pObjLo->pData = Abc_NtkCreateBo( pNtkNew );
- Abc_ObjAddFanin( pObjNew, pObjLi->pData );
- Abc_ObjAddFanin( pObjLo->pData, pObjNew );
+ Abc_ObjAddFanin( pObjNew, (Abc_Obj_t *)pObjLi->pData );
+ Abc_ObjAddFanin( (Abc_Obj_t *)pObjLo->pData, pObjNew );
Abc_LatchSetInit0( pObjNew );
// find the name
pObjOld = Abc_NtkCi( pNtkOld, Vec_IntEntry(pMan->vCiNumsOrig, Saig_ManPiNum(pMan)+i) );
- Abc_ObjAssignName( pObjLo->pData, Abc_ObjName(pObjOld), NULL );
+ Abc_ObjAssignName( (Abc_Obj_t *)pObjLo->pData, Abc_ObjName(pObjOld), NULL );
// find the name
pObjOld = Abc_NtkCo( pNtkOld, Saig_ManPoNum(pMan)+i );
- Abc_ObjAssignName( pObjLi->pData, Abc_ObjName(pObjOld), NULL );
+ Abc_ObjAssignName( (Abc_Obj_t *)pObjLi->pData, Abc_ObjName(pObjOld), NULL );
}
// rebuild the AIG
vNodes = Aig_ManDfs( pMan, 1 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
if ( Aig_ObjIsBuf(pObj) )
pObj->pData = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
else
- pObj->pData = Abc_AigAnd( pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
Vec_PtrFree( vNodes );
// connect the PO nodes
Aig_ManForEachPo( pMan, pObj, i )
@@ -546,7 +556,7 @@ Abc_Ntk_t * Abc_NtkAfterTrim( Aig_Man_t * pMan, Abc_Ntk_t * pNtkOld )
}
// check the resulting AIG
if ( !Abc_NtkCheck( pNtkNew ) )
- fprintf( stdout, "Abc_NtkFromAigPhase(): Network check has failed.\n" );
+ fprintf( stdout, "Abc_NtkAfterTrim(): Network check has failed.\n" );
return pNtkNew;
}
@@ -571,6 +581,7 @@ Abc_Ntk_t * Abc_NtkFromDarChoices( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
assert( Aig_ManBufNum(pMan) == 0 );
// perform strashing
pNtkNew = Abc_NtkStartFrom( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG );
+ pNtkNew->nConstrs = pMan->nConstrs;
// transfer the pointers to the basic nodes
Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew);
Aig_ManForEachPi( pMan, pObj, i )
@@ -578,15 +589,15 @@ Abc_Ntk_t * Abc_NtkFromDarChoices( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
// rebuild the AIG
vNodes = Aig_ManDfsChoices( pMan );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
{
- pObj->pData = Abc_AigAnd( pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
if ( (pTemp = Aig_ObjEquiv(pMan, pObj)) )
{
Abc_Obj_t * pAbcRepr, * pAbcObj;
assert( pTemp->pData != NULL );
- pAbcRepr = pObj->pData;
- pAbcObj = pTemp->pData;
+ pAbcRepr = (Abc_Obj_t *)pObj->pData;
+ pAbcObj = (Abc_Obj_t *)pTemp->pData;
pAbcObj->pData = pAbcRepr->pData;
pAbcRepr->pData = pAbcObj;
}
@@ -622,6 +633,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
// assert( Aig_ManLatchNum(pMan) > 0 );
// perform strashing
pNtkNew = Abc_NtkStartFromNoLatches( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG );
+ pNtkNew->nConstrs = pMan->nConstrs;
// transfer the pointers to the basic nodes
Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew);
Aig_ManForEachPi( pMan, pObj, i )
@@ -640,7 +652,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
Abc_NtkAddDummyBoxNames( pNtkNew );
// rebuild the AIG
vNodes = Aig_ManDfs( pMan, 1 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
{
// add the first fanin
pObj->pData = pFaninNew0 = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
@@ -650,9 +662,9 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
pFaninNew1 = (Abc_Obj_t *)Aig_ObjChild1Copy(pObj);
// create the new node
if ( Aig_ObjIsExor(pObj) )
- pObj->pData = pObjNew = Abc_AigXor( pNtkNew->pManFunc, pFaninNew0, pFaninNew1 );
+ pObj->pData = pObjNew = Abc_AigXor( (Abc_Aig_t *)pNtkNew->pManFunc, pFaninNew0, pFaninNew1 );
else
- pObj->pData = pObjNew = Abc_AigAnd( pNtkNew->pManFunc, pFaninNew0, pFaninNew1 );
+ pObj->pData = pObjNew = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pFaninNew0, pFaninNew1 );
}
Vec_PtrFree( vNodes );
// connect the PO nodes
@@ -665,7 +677,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
Aig_ManForEachObj( pMan, pObj, i )
{
pFaninNew = (Abc_Obj_t *)Aig_ObjChild0Copy( pObj );
- Abc_ObjAddFanin( Abc_ObjFanin0(Abc_ObjFanin0(pObj->pData)), pFaninNew );
+ Abc_ObjAddFanin( Abc_ObjFanin0(Abc_ObjFanin0((Abc_Obj_t *)pObj->pData)), pFaninNew );
}
if ( !Abc_NtkCheck( pNtkNew ) )
fprintf( stdout, "Abc_NtkFromIvySeq(): Network check has failed.\n" );
@@ -860,7 +872,7 @@ Abc_Ntk_t * Abc_NtkDarFraigPart( Abc_Ntk_t * pNtk, int nPartSize, int nConfLimit
***********************************************************************/
Abc_Ntk_t * Abc_NtkCSweep( Abc_Ntk_t * pNtk, int nCutsMax, int nLeafMax, int fVerbose )
{
- extern Aig_Man_t * Csw_Sweep( Aig_Man_t * pAig, int nCutsMax, int nLeafMax, int fVerbose );
+// extern Aig_Man_t * Csw_Sweep( Aig_Man_t * pAig, int nCutsMax, int nLeafMax, int fVerbose );
Abc_Ntk_t * pNtkAig;
Aig_Man_t * pMan, * pTemp;
pMan = Abc_NtkToDar( pNtk, 0, 0 );
@@ -1026,7 +1038,7 @@ Abc_Ntk_t * Abc_NtkDChoice( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, in
***********************************************************************/
Abc_Ntk_t * Abc_NtkDch( Abc_Ntk_t * pNtk, Dch_Pars_t * pPars )
{
- extern Gia_Man_t * Dar_NewChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, int fPower, int fVerbose );
+ extern Gia_Man_t * Dar_NewChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, int fPower, int fLightSynth, int fVerbose );
extern Aig_Man_t * Cec_ComputeChoices( Gia_Man_t * pGia, Dch_Pars_t * pPars );
Aig_Man_t * pMan, * pTemp;
@@ -1039,7 +1051,7 @@ Abc_Ntk_t * Abc_NtkDch( Abc_Ntk_t * pNtk, Dch_Pars_t * pPars )
return NULL;
clk = clock();
if ( pPars->fSynthesis )
- pGia = Dar_NewChoiceSynthesis( pMan, 1, 1, pPars->fPower, 0 );
+ pGia = Dar_NewChoiceSynthesis( pMan, 1, 1, pPars->fPower, pPars->fLightSynth, pPars->fVerbose );
else
{
pGia = Gia_ManFromAig( pMan );
@@ -1121,23 +1133,23 @@ Abc_Ntk_t * Abc_NtkConstructFromCnf( Abc_Ntk_t * pNtk, Cnf_Man_t * p, Vec_Ptr_t
Aig_ManPi(p->pManAig, i)->pData = pNode->pCopy;
// process the nodes in topological order
vCover = Vec_IntAlloc( 1 << 16 );
- Vec_PtrForEachEntry( vMapped, pObj, i )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vMapped, pObj, i )
{
// create new node
pNodeNew = Abc_NtkCreateNode( pNtkNew );
// add fanins according to the cut
- pCut = pObj->pData;
+ pCut = (Cnf_Cut_t *)pObj->pData;
Cnf_CutForEachLeaf( p->pManAig, pCut, pLeaf, k )
- Abc_ObjAddFanin( pNodeNew, pLeaf->pData );
+ Abc_ObjAddFanin( pNodeNew, (Abc_Obj_t *)pLeaf->pData );
// add logic function
if ( pCut->nFanins < 5 )
{
uTruth = 0xFFFF & *Cnf_CutTruth(pCut);
Cnf_SopConvertToVector( p->pSops[uTruth], p->pSopSizes[uTruth], vCover );
- pNodeNew->pData = Abc_SopCreateFromIsop( pNtkNew->pManFunc, pCut->nFanins, vCover );
+ pNodeNew->pData = Abc_SopCreateFromIsop( (Extra_MmFlex_t *)pNtkNew->pManFunc, pCut->nFanins, vCover );
}
else
- pNodeNew->pData = Abc_SopCreateFromIsop( pNtkNew->pManFunc, pCut->nFanins, pCut->vIsop[1] );
+ pNodeNew->pData = Abc_SopCreateFromIsop( (Extra_MmFlex_t *)pNtkNew->pManFunc, pCut->nFanins, pCut->vIsop[1] );
// save the node
pObj->pData = pNodeNew;
}
@@ -1146,7 +1158,7 @@ Abc_Ntk_t * Abc_NtkConstructFromCnf( Abc_Ntk_t * pNtk, Cnf_Man_t * p, Vec_Ptr_t
Abc_NtkForEachCo( pNtk, pNode, i )
{
pObj = Aig_ManPo(p->pManAig, i);
- pNodeNew = Abc_ObjNotCond( Aig_ObjFanin0(pObj)->pData, Aig_ObjFaninC0(pObj) );
+ pNodeNew = Abc_ObjNotCond( (Abc_Obj_t *)Aig_ObjFanin0(pObj)->pData, Aig_ObjFaninC0(pObj) );
Abc_ObjAddFanin( pNode->pCopy, pNodeNew );
}
@@ -1240,7 +1252,7 @@ int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit
assert( Abc_NtkPoNum(pNtk) == 1 );
pMan = Abc_NtkToDar( pNtk, 0, 0 );
RetValue = Fra_FraigSat( pMan, nConfLimit, nInsLimit, fAlignPol, fAndOuts, fVerbose );
- pNtk->pModel = pMan->pData, pMan->pData = NULL;
+ pNtk->pModel = (int *)pMan->pData, pMan->pData = NULL;
Aig_ManStop( pMan );
return RetValue;
}
@@ -1265,7 +1277,7 @@ int Abc_NtkPartitionedSat( Abc_Ntk_t * pNtk, int nAlgo, int nPartSize, int nConf
assert( Abc_NtkLatchNum(pNtk) == 0 );
pMan = Abc_NtkToDar( pNtk, 0, 0 );
RetValue = Aig_ManPartitionedSat( pMan, nAlgo, nPartSize, nConfPart, nConfTotal, fAlignPol, fSynthesize, fVerbose );
- pNtk->pModel = pMan->pData, pMan->pData = NULL;
+ pNtk->pModel = (int *)pMan->pData, pMan->pData = NULL;
Aig_ManStop( pMan );
return RetValue;
}
@@ -1362,7 +1374,7 @@ int Abc_NtkDarCec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int fPa
RetValue = Fra_FraigCec( &pMan, 100000, fVerbose );
// transfer model if given
if ( pNtk2 == NULL )
- pNtk1->pModel = pMan->pData, pMan->pData = NULL;
+ pNtk1->pModel = (int *)pMan->pData, pMan->pData = NULL;
Aig_ManStop( pMan );
finish:
@@ -1458,10 +1470,10 @@ ABC_PRT( "Initial fraiging time", clock() - clk );
***********************************************************************/
void Abc_NtkPrintLatchEquivClasses( Abc_Ntk_t * pNtk, Aig_Man_t * pAig )
{
- bool header_dumped = false;
+ int header_dumped = 0;
int num_orig_latches = Abc_NtkLatchNum(pNtk);
char **pNames = ABC_ALLOC( char *, num_orig_latches );
- bool *p_irrelevant = ABC_ALLOC( bool, num_orig_latches );
+ int *p_irrelevant = ABC_ALLOC( int, num_orig_latches );
char * pFlopName, * pReprName;
Aig_Obj_t * pFlop, * pRepr;
Abc_Obj_t * pNtkFlop;
@@ -1560,7 +1572,7 @@ Abc_Ntk_t * Abc_NtkDarSeqSweep2( Abc_Ntk_t * pNtk, Ssw_Pars_t * pPars )
if ( pPars->fFlopVerbose )
Abc_NtkPrintLatchEquivClasses(pNtk, pTemp);
- Aig_ManStop( pTemp );
+ Aig_ManStop( pTemp );
if ( pMan == NULL )
return NULL;
@@ -1681,7 +1693,7 @@ static void sigfunc( int signo )
SeeAlso []
***********************************************************************/
-int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int nCofFanLit, int fVerbose )
+int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int nCofFanLit, int fVerbose, int * piFrames )
{
Aig_Man_t * pMan;
int status, RetValue = -1, clk = clock();
@@ -1711,25 +1723,31 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int
{
int iFrame;
RetValue = Saig_ManBmcSimple( pMan, nFrames, nSizeMax, nBTLimit, fRewrite, fVerbose, &iFrame, nCofFanLit );
+ if ( piFrames )
+ *piFrames = iFrame;
ABC_FREE( pNtk->pModel );
ABC_FREE( pNtk->pSeqModel );
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
if ( RetValue == 1 )
- printf( "No output was asserted in %d frames. ", iFrame );
+ {
+// printf( "No output was asserted in %d frames. ", iFrame );
+ printf( "Incorrect return value. " );
+ }
else if ( RetValue == -1 )
printf( "No output was asserted in %d frames. Reached conflict limit (%d). ", iFrame, nBTLimit );
else // if ( RetValue == 0 )
{
-// extern void Aig_ManCounterExampleValueTest( Aig_Man_t * pAig, Fra_Cex_t * pCex );
+// extern void Aig_ManCounterExampleValueTest( Aig_Man_t * pAig, Abc_Cex_t * pCex );
- Fra_Cex_t * pCex = pNtk->pSeqModel;
+ Abc_Cex_t * pCex = pNtk->pSeqModel;
printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness). ", pCex->iPo, pCex->iFrame );
// Aig_ManCounterExampleValueTest( pMan, pCex );
}
+ABC_PRT( "Time", clock() - clk );
}
else
- {
+ {
/*
Fra_BmcPerformSimple( pMan, nFrames, nBTLimit, fRewrite, fVerbose );
ABC_FREE( pNtk->pModel );
@@ -1737,7 +1755,7 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
if ( pNtk->pSeqModel )
{
- Fra_Cex_t * pCex = pNtk->pSeqModel;
+ Abc_Cex_t * pCex = pNtk->pSeqModel;
printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness). ", pCex->iPo, pCex->iFrame );
RetValue = 0;
}
@@ -1759,16 +1777,15 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int
printf( "No output was asserted in %d frames. Reached conflict limit (%d). ", iFrame, nBTLimit );
else // if ( RetValue == 0 )
{
- Fra_Cex_t * pCex = pNtk->pSeqModel;
+ Abc_Cex_t * pCex = pNtk->pSeqModel;
printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness). ", pCex->iPo, pCex->iFrame );
}
*/
- Saig_BmcPerform( pMan, nStart, nFrames, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fVerbose, 0 );
+ RetValue = Saig_BmcPerform( pMan, nStart, nFrames, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fVerbose, 0, piFrames );
ABC_FREE( pNtk->pModel );
ABC_FREE( pNtk->pSeqModel );
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
}
-ABC_PRT( "Time", clock() - clk );
// verify counter-example
if ( pNtk->pSeqModel )
{
@@ -1782,6 +1799,73 @@ ABC_PRT( "Time", clock() - clk );
/**Function*************************************************************
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars )
+{
+ Aig_Man_t * pMan;
+ int status, RetValue = -1, clk = clock();
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ {
+ printf( "Converting miter into AIG has failed.\n" );
+ return RetValue;
+ }
+ assert( pMan->nRegs > 0 );
+ RetValue = Saig_ManBmcScalable( pMan, pPars );
+ ABC_FREE( pNtk->pModel );
+ ABC_FREE( pNtk->pSeqModel );
+ pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
+ if ( RetValue == 1 )
+ {
+// printf( "No output was asserted in %d frames. ", pPars->iFrame );
+ printf( "Incorrect return value. " );
+ }
+ else if ( RetValue == -1 )
+ {
+ if ( pPars->nFailOuts == 0 )
+ printf( "No output was asserted in %d frames. Reached conflict limit (%d). ", pPars->iFrame, pPars->nConfLimit );
+ else
+ {
+ printf( "The total of %d outputs was asserted in %d frames. Reached conflict limit (%d). ", pPars->nFailOuts, pPars->iFrame, pPars->nConfLimit );
+ if ( pNtk->pSeqModelVec )
+ Vec_PtrFreeFree( pNtk->pSeqModelVec );
+ pNtk->pSeqModelVec = pMan->pSeqModelVec; pMan->pSeqModelVec = NULL;
+ }
+ }
+ else // if ( RetValue == 0 )
+ {
+ if ( !pPars->fSolveAll )
+ {
+ Abc_Cex_t * pCex = pNtk->pSeqModel;
+ printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness). ", pCex->iPo, pCex->iFrame );
+ }
+ else
+ {
+ printf( "Incorrect return value. " );
+// printf( "At least one output was asserted (out=%d, frame=%d). ", pCex->iPo, pCex->iFrame );
+ }
+ }
+ ABC_PRT( "Time", clock() - clk );
+ if ( pNtk->pSeqModel )
+ {
+ status = Ssw_SmlRunCounterExample( pMan, pNtk->pSeqModel );
+ if ( status == 0 )
+ printf( "Abc_NtkDarBmc3(): Counter-example verification has FAILED.\n" );
+ }
+ Aig_ManStop( pMan );
+ return RetValue;
+}
+
+/**Function*************************************************************
+
Synopsis [Gives the current ABC network to AIG manager for processing.]
Description []
@@ -1791,10 +1875,13 @@ ABC_PRT( "Time", clock() - clk );
SeeAlso []
***********************************************************************/
-int Abc_NtkDarBmcInter_int( Aig_Man_t * pMan, Inter_ManParams_t * pPars )
+int Abc_NtkDarBmcInter_int( Aig_Man_t * pMan, Inter_ManParams_t * pPars, Aig_Man_t ** ppNtkRes )
{
int RetValue, iFrame, clk = clock();
+ int nTotalProvedSat = 0;
assert( pMan->nRegs > 0 );
+ if ( ppNtkRes )
+ *ppNtkRes = NULL;
if ( pPars->fUseSeparate )
{
Aig_Man_t * pTemp, * pAux;
@@ -1804,17 +1891,39 @@ int Abc_NtkDarBmcInter_int( Aig_Man_t * pMan, Inter_ManParams_t * pPars )
{
if ( Aig_ObjFanin0(pObjPo) == Aig_ManConst1(pMan) )
continue;
+ if ( pPars->fVerbose )
+ printf( "Solving output %2d (out of %2d):\n", i, Saig_ManPoNum(pMan) );
pTemp = Aig_ManDupOneOutput( pMan, i, 1 );
pTemp = Aig_ManScl( pAux = pTemp, 1, 1, 0 );
Aig_ManStop( pAux );
- RetValue = Inter_ManPerformInterpolation( pTemp, pPars, &iFrame );
+ if ( Aig_ManRegNum(pTemp) == 0 )
+ {
+ pTemp->pSeqModel = NULL;
+ RetValue = Fra_FraigSat( pTemp, pPars->nBTLimit, 0, 0, 0, 0 );
+ if ( pTemp->pData )
+ pTemp->pSeqModel = Gia_ManCreateFromComb( Aig_ManRegNum(pMan), Saig_ManPiNum(pMan), i, (int *)pTemp->pData );
+// pNtk->pModel = pTemp->pData, pTemp->pData = NULL;
+ }
+ else
+ RetValue = Inter_ManPerformInterpolation( pTemp, pPars, &iFrame );
if ( pTemp->pSeqModel )
{
- Ssw_Cex_t * pCex;
- pCex = pMan->pSeqModel = pTemp->pSeqModel; pTemp->pSeqModel = NULL;
- pCex->iPo = i;
- Aig_ManStop( pTemp );
- break;
+ if ( pPars->fDropSatOuts )
+ {
+ printf( "Output %d proved SAT in frame %d (replacing by const 0 and continuing...)\n", i, pTemp->pSeqModel->iFrame );
+ Aig_ObjPatchFanin0( pMan, pObjPo, Aig_ManConst0(pMan) );
+ Aig_ManStop( pTemp );
+ nTotalProvedSat++;
+ continue;
+ }
+ else
+ {
+ Abc_Cex_t * pCex;
+ pCex = pMan->pSeqModel = pTemp->pSeqModel; pTemp->pSeqModel = NULL;
+ pCex->iPo = i;
+ Aig_ManStop( pTemp );
+ break;
+ }
}
// if solved, remove the output
if ( RetValue == 1 )
@@ -1838,17 +1947,19 @@ int Abc_NtkDarBmcInter_int( Aig_Man_t * pMan, Inter_ManParams_t * pPars )
if ( Counter )
RetValue = -1;
}
-/*
- pMan = Aig_ManDupUnsolvedOutputs( pTemp = pMan, 1 );
- Aig_ManStop( pTemp );
- pMan = Aig_ManScl( pTemp = pMan, 1, 1, 0 );
- Aig_ManStop( pTemp );
-*/
+ if ( ppNtkRes )
+ {
+ pTemp = Aig_ManDupUnsolvedOutputs( pMan, 1 );
+ *ppNtkRes = Aig_ManScl( pTemp, 1, 1, 0 );
+ Aig_ManStop( pTemp );
+ }
}
else
{
RetValue = Inter_ManPerformInterpolation( pMan, pPars, &iFrame );
}
+ if ( nTotalProvedSat )
+ printf( "The total of %d outputs proved SAT and replaced by const 0 in this run.\n", nTotalProvedSat );
if ( RetValue == 1 )
printf( "Property proved. " );
else if ( RetValue == 0 )
@@ -1872,21 +1983,34 @@ ABC_PRT( "Time", clock() - clk );
SeeAlso []
***********************************************************************/
-int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars )
+int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars, Abc_Ntk_t ** ppNtkRes )
{
Aig_Man_t * pMan;
+ int RetValue;
+ if ( ppNtkRes )
+ *ppNtkRes = NULL;
pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( pMan == NULL )
{
printf( "Converting miter into AIG has failed.\n" );
return -1;
}
- Abc_NtkDarBmcInter_int( pMan, pPars );
+ if ( pPars->fUseSeparate && ppNtkRes )
+ {
+ Aig_Man_t * pManNew;
+ RetValue = Abc_NtkDarBmcInter_int( pMan, pPars, &pManNew );
+ *ppNtkRes = Abc_NtkFromAigPhase( pManNew );
+ Aig_ManStop( pManNew );
+ }
+ else
+ {
+ RetValue = Abc_NtkDarBmcInter_int( pMan, pPars, NULL );
+ }
ABC_FREE( pNtk->pModel );
ABC_FREE( pNtk->pSeqModel );
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
Aig_ManStop( pMan );
- return 1;
+ return RetValue;
}
/**Function*************************************************************
@@ -1945,7 +2069,7 @@ int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk )
int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar )
{
Aig_Man_t * pMan;
- int RetValue, clkTotal = clock();
+ int RetValue = -1, clkTotal = clock();
if ( pSecPar->fTryComb || Abc_NtkLatchNum(pNtk) == 0 )
{
Prove_Params_t Params, * pParams = &Params;
@@ -1990,7 +2114,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar )
}
if ( pSecPar->fTryBmc )
{
- RetValue = Abc_NtkDarBmc( pNtk, 0, 20, 100000, -1, 0, 2000, -1, 0, 1, 0, 0 );
+ RetValue = Abc_NtkDarBmc( pNtk, 0, 20, 100000, -1, 0, 2000, -1, 0, 1, 0, 0, NULL );
if ( RetValue == 0 )
{
printf( "Networks are not equivalent.\n" );
@@ -2023,7 +2147,7 @@ int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar )
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
if ( pNtk->pSeqModel )
{
- Fra_Cex_t * pCex = pNtk->pSeqModel;
+ Abc_Cex_t * pCex = pNtk->pSeqModel;
printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness).\n", pCex->iPo, pCex->iFrame );
if ( !Ssw_SmlRunCounterExample( pMan, pNtk->pSeqModel ) )
printf( "Abc_NtkDarProve(): Counter-example verification has FAILED.\n" );
@@ -2065,7 +2189,7 @@ int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Fra_Sec_t * pSecPar )
printf( "Networks are NOT EQUIVALENT after structural hashing.\n" );
// report the error
pMiter->pModel = Abc_NtkVerifyGetCleanModel( pMiter, pSecPar->nFramesMax );
- Abc_NtkVerifyReportErrorSeq( pNtk1, pNtk2, pMiter->pModel, pSecPar->nFramesMax );
+// Abc_NtkVerifyReportErrorSeq( pNtk1, pNtk2, pMiter->pModel, pSecPar->nFramesMax );
ABC_FREE( pMiter->pModel );
Abc_NtkDelete( pMiter );
return 0;
@@ -2272,7 +2396,7 @@ Abc_Ntk_t * Abc_NtkDarMatch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nDist, in
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkDarLatchSweep( Abc_Ntk_t * pNtk, int fLatchConst, int fLatchEqual, int fVerbose )
+Abc_Ntk_t * Abc_NtkDarLatchSweep( Abc_Ntk_t * pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fVerbose )
{
extern void Aig_ManPrintControlFanouts( Aig_Man_t * p );
Abc_Ntk_t * pNtkAig;
@@ -2280,17 +2404,23 @@ Abc_Ntk_t * Abc_NtkDarLatchSweep( Abc_Ntk_t * pNtk, int fLatchConst, int fLatchE
pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( pMan == NULL )
return NULL;
-// Aig_ManSeqCleanup( pMan );
-// if ( fLatchConst && pMan->nRegs )
-// pMan = Aig_ManConstReduce( pMan, fVerbose );
-// if ( fLatchEqual && pMan->nRegs )
-// pMan = Aig_ManReduceLaches( pMan, fVerbose );
- if ( pMan->vFlopNums )
- Vec_IntFree( pMan->vFlopNums );
- pMan->vFlopNums = NULL;
+ if ( fSaveNames )
+ {
+ Aig_ManSeqCleanup( pMan );
+ if ( fLatchConst && pMan->nRegs )
+ pMan = Aig_ManConstReduce( pMan, fVerbose );
+ if ( fLatchEqual && pMan->nRegs )
+ pMan = Aig_ManReduceLaches( pMan, fVerbose );
+ }
+ else
+ {
+ if ( pMan->vFlopNums )
+ Vec_IntFree( pMan->vFlopNums );
+ pMan->vFlopNums = NULL;
+ pMan = Aig_ManScl( pTemp = pMan, fLatchConst, fLatchEqual, fVerbose );
+ Aig_ManStop( pTemp );
+ }
- pMan = Aig_ManScl( pTemp = pMan, fLatchConst, fLatchEqual, fVerbose );
- Aig_ManStop( pTemp );
pNtkAig = Abc_NtkFromDarSeqSweep( pNtk, pMan );
//Aig_ManPrintControlFanouts( pMan );
Aig_ManStop( pMan );
@@ -2512,12 +2642,12 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
extern int Cec_ManSimulate( Aig_Man_t * pAig, int nWords, int nIters, int TimeLimit, int fMiter, int fVerbose );
extern int Raig_ManSimulate( Aig_Man_t * pAig, int nWords, int nIters, int TimeLimit, int fMiter, int fVerbose );
Aig_Man_t * pMan;
- Fra_Cex_t * pCex;
- int status, RetValue, clk = clock();
+ Abc_Cex_t * pCex;
+ int status, RetValue = -1, clk = clock();
if ( Abc_NtkGetChoiceNum(pNtk) )
{
printf( "Removing %d choices from the AIG.\n", Abc_NtkGetChoiceNum(pNtk) );
- Abc_AigCleanup(pNtk->pManFunc);
+ Abc_AigCleanup((Abc_Aig_t *)pNtk->pManFunc);
}
pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( fComb || Abc_NtkLatchNum(pNtk) == 0 )
@@ -2530,7 +2660,7 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
{
printf( "Simulation iterated %d times with %d words asserted output %d in frame %d. ",
nFrames, nWords, pCex->iPo, pCex->iFrame );
- status = Ssw_SmlRunCounterExample( pMan, (Ssw_Cex_t *)pCex );
+ status = Ssw_SmlRunCounterExample( pMan, pCex );
if ( status == 0 )
printf( "Abc_NtkDarSeqSim(): Counter-example verification has FAILED.\n" );
}
@@ -2557,7 +2687,7 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
{
printf( "Simulation of %d frames with %d words asserted output %d in frame %d. ",
nFrames, nWords, pCex->iPo, pCex->iFrame );
- status = Ssw_SmlRunCounterExample( pMan, (Ssw_Cex_t *)pCex );
+ status = Ssw_SmlRunCounterExample( pMan, pCex );
if ( status == 0 )
printf( "Abc_NtkDarSeqSim(): Counter-example verification has FAILED.\n" );
}
@@ -2587,7 +2717,7 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
{
printf( "Simulation of %d frames with %d words asserted output %d in frame %d. ",
nFrames, nWords, pCex->iPo, pCex->iFrame );
- status = Ssw_SmlRunCounterExample( pMan, (Ssw_Cex_t *)pCex );
+ status = Ssw_SmlRunCounterExample( pMan, pCex );
if ( status == 0 )
printf( "Abc_NtkDarSeqSim(): Counter-example verification has FAILED.\n" );
}
@@ -2614,22 +2744,21 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
pGia = Gia_ManFromAig( pMan );
if ( Gia_ManSimSimulate( pGia, pPars ) )
{
- if ( (pCex = (Fra_Cex_t *)pGia->pCexSeq) )
+ if ( pGia->pCexSeq )
{
printf( "Simulation of %d frames with %d words asserted output %d in frame %d. ",
- nFrames, nWords, pCex->iPo, pCex->iFrame );
- status = Ssw_SmlRunCounterExample( pMan, (Ssw_Cex_t *)pCex );
+ nFrames, nWords, pGia->pCexSeq->iPo, pGia->pCexSeq->iFrame );
+ status = Ssw_SmlRunCounterExample( pMan, pGia->pCexSeq );
if ( status == 0 )
printf( "Abc_NtkDarSeqSim(): Counter-example verification has FAILED.\n" );
}
ABC_FREE( pNtk->pModel );
ABC_FREE( pNtk->pSeqModel );
- pNtk->pSeqModel = pCex; pMan->pSeqModel = NULL;
- RetValue = 1;
+ pNtk->pSeqModel = pGia->pCexSeq; pGia->pCexSeq = NULL;
+ RetValue = 0;
}
else
{
- RetValue = 0;
printf( "Simulation of %d frames with %d words did not assert the outputs. ",
nFrames, nWords );
}
@@ -2646,18 +2775,17 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
{
printf( "Simulation of %d frames with %d words asserted output %d in frame %d. ",
nFrames, nWords, pCex->iPo, pCex->iFrame );
- status = Ssw_SmlRunCounterExample( pMan, (Ssw_Cex_t *)pCex );
+ status = Ssw_SmlRunCounterExample( pMan, pCex );
if ( status == 0 )
printf( "Abc_NtkDarSeqSim(): Counter-example verification has FAILED.\n" );
}
ABC_FREE( pNtk->pModel );
ABC_FREE( pNtk->pSeqModel );
pNtk->pSeqModel = pCex;
- RetValue = 1;
+ RetValue = 0;
}
else
{
- RetValue = 0;
printf( "Simulation of %d frames with %d words did not assert the outputs. ",
nFrames, nWords );
}
@@ -2669,7 +2797,7 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in
{
printf( "Simulation of %d frames with %d words asserted output %d in frame %d. ",
nFrames, nWords, pCex->iPo, pCex->iFrame );
- status = Ssw_SmlRunCounterExample( pMan, (Ssw_Cex_t *)pCex );
+ status = Ssw_SmlRunCounterExample( pMan, pCex );
if ( status == 0 )
printf( "Abc_NtkDarSeqSim(): Counter-example verification has FAILED.\n" );
}
@@ -2762,15 +2890,15 @@ Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
SeeAlso []
***********************************************************************/
-void Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fVerbose )
-{
+int Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fUnique, int fUniqueAll, int fVerbose, int fVeryVerbose )
+{
Aig_Man_t * pMan, * pTemp;
int clkTotal = clock();
int RetValue;
pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( pMan == NULL )
- return;
- RetValue = Saig_ManInduction( pTemp = pMan, nFramesMax, nConfMax, fVerbose );
+ return -1;
+ RetValue = Saig_ManInduction( pTemp = pMan, nFramesMax, nConfMax, fUnique, fUniqueAll, fVerbose, fVeryVerbose );
Aig_ManStop( pTemp );
if ( RetValue == 1 )
{
@@ -2787,6 +2915,7 @@ ABC_PRT( "Time", clock() - clkTotal );
printf( "Networks are UNDECIDED. " );
ABC_PRT( "Time", clock() - clkTotal );
}
+ return RetValue;
}
@@ -2801,7 +2930,7 @@ ABC_PRT( "Time", clock() - clkTotal );
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkDarPBAbstraction( Abc_Ntk_t * pNtk, Gia_ParAbs_t * pPars )
+Abc_Ntk_t * Abc_NtkDarCegar( Abc_Ntk_t * pNtk, Gia_ParAbs_t * pPars )
{
Abc_Ntk_t * pNtkAig;
Aig_Man_t * pMan, * pTemp;
@@ -2810,8 +2939,29 @@ Abc_Ntk_t * Abc_NtkDarPBAbstraction( Abc_Ntk_t * pNtk, Gia_ParAbs_t * pPars )
if ( pMan == NULL )
return NULL;
- Aig_ManSetRegNum( pMan, pMan->nRegs );
- pMan = Saig_ManProofAbstraction( pTemp = pMan, pPars );
+ if ( pPars->fConstr )
+ {
+ printf( "This option is currently not implemented.\n" );
+ Aig_ManStop( pMan );
+ return NULL;
+ }
+ if ( pPars->fConstr )
+ {
+ if ( Saig_ManDetectConstrTest(pMan) )
+ {
+ printf( "Performing abstraction while dynamically adding constraints...\n" );
+ pMan = Saig_ManDupUnfoldConstrs( pTemp = pMan );
+ Aig_ManStop( pTemp );
+ pMan = Saig_ManConCexAbstraction( pTemp = pMan, pPars );
+ }
+ else
+ {
+ printf( "Constraints are not available. Performing abstraction w/o constraints.\n" );
+ pMan = Saig_ManCexAbstraction( pTemp = pMan, pPars );
+ }
+ }
+ else
+ pMan = Saig_ManCexAbstraction( pTemp = pMan, pPars );
if ( pTemp->pSeqModel )
{
ABC_FREE( pNtk->pModel );
@@ -3024,16 +3174,17 @@ void Abc_NtkPrintSccs( Abc_Ntk_t * pNtk, int fVerbose )
SeeAlso []
***********************************************************************/
-void Abc_NtkDarPrintCone( Abc_Ntk_t * pNtk )
+int Abc_NtkDarPrintCone( Abc_Ntk_t * pNtk )
{
extern void Saig_ManPrintCones( Aig_Man_t * pAig );
Aig_Man_t * pMan;
pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( pMan == NULL )
- return;
+ return 0;
assert( Aig_ManRegNum(pMan) > 0 );
Saig_ManPrintCones( pMan );
Aig_ManStop( pMan );
+ return 1;
}
/**Function*************************************************************
@@ -3114,6 +3265,33 @@ Abc_Ntk_t * Abc_NtkPhaseAbstract( Abc_Ntk_t * pNtk, int nFrames, int nPref, int
SeeAlso []
***********************************************************************/
+int Abc_NtkPhaseFrameNum( Abc_Ntk_t * pNtk )
+{
+ extern int Saig_ManPhaseFrameNum( Aig_Man_t * p, Vec_Int_t * vInits );
+ Vec_Int_t * vInits;
+ Aig_Man_t * pMan;
+ int nFrames;
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ return 1;
+ vInits = Abc_NtkGetLatchValues(pNtk);
+ nFrames = Saig_ManPhaseFrameNum( pMan, vInits );
+ Vec_IntFree( vInits );
+ Aig_ManStop( pMan );
+ return nFrames;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs phase abstraction.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
Abc_Ntk_t * Abc_NtkDarSynchOne( Abc_Ntk_t * pNtk, int nWords, int fVerbose )
{
extern Aig_Man_t * Saig_SynchSequenceApply( Aig_Man_t * pAig, int nWords, int fVerbose );
@@ -3406,23 +3584,29 @@ Abc_Ntk_t * Abc_NtkDarCleanupAig( Abc_Ntk_t * pNtk, int fCleanupPis, int fCleanu
SeeAlso []
***********************************************************************/
-void Abc_NtkDarReach( Abc_Ntk_t * pNtk, int nBddMax, int nIterMax, int fPartition, int fReorder, int fReorderImage, int fVerbose )
+int Abc_NtkDarReach( Abc_Ntk_t * pNtk, Saig_ParBbr_t * pPars )
{
- extern int Aig_ManVerifyUsingBdds( Aig_Man_t * p, int nBddMax, int nIterMax, int fPartition, int fReorder, int fReorderImage, int fVerbose, int fSilent );
Aig_Man_t * pMan;
+ int RetValue;
pMan = Abc_NtkToDar( pNtk, 0, 1 );
if ( pMan == NULL )
- return;
- Aig_ManVerifyUsingBdds( pMan, nBddMax, nIterMax, fPartition, fReorder, fReorderImage, fVerbose, 0 );
+ return -1;
+ RetValue = Aig_ManVerifyUsingBdds( pMan, pPars );
ABC_FREE( pNtk->pModel );
ABC_FREE( pNtk->pSeqModel );
pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
Aig_ManStop( pMan );
+ return RetValue;
}
+ABC_NAMESPACE_IMPL_END
+
#include "amap.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
/**Function*************************************************************
Synopsis []
@@ -3436,15 +3620,15 @@ void Abc_NtkDarReach( Abc_Ntk_t * pNtk, int nBddMax, int nIterMax, int fPartitio
***********************************************************************/
Abc_Ntk_t * Amap_ManProduceNetwork( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMapping )
{
- extern void * Abc_FrameReadLibGen();
- Mio_Library_t * pLib = Abc_FrameReadLibGen();
+// extern void * Abc_FrameReadLibGen();
+ Mio_Library_t * pLib = (Mio_Library_t *)Abc_FrameReadLibGen();
Amap_Out_t * pRes;
Vec_Ptr_t * vNodesNew;
Abc_Ntk_t * pNtkNew;
Abc_Obj_t * pNodeNew, * pFaninNew;
int i, k, iPis, iPos, nDupGates;
// make sure gates exist in the current library
- Vec_PtrForEachEntry( vMapping, pRes, i )
+ Vec_PtrForEachEntry( Amap_Out_t *, vMapping, pRes, i )
if ( pRes->pName && Mio_LibraryReadGateByName( pLib, pRes->pName ) == NULL )
{
printf( "Current library does not contain gate \"%s\".\n", pRes->pName );
@@ -3455,7 +3639,7 @@ Abc_Ntk_t * Amap_ManProduceNetwork( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMapping )
pNtkNew->pManFunc = pLib;
iPis = iPos = 0;
vNodesNew = Vec_PtrAlloc( Vec_PtrSize(vMapping) );
- Vec_PtrForEachEntry( vMapping, pRes, i )
+ Vec_PtrForEachEntry( Amap_Out_t *, vMapping, pRes, i )
{
if ( pRes->Type == -1 )
pNodeNew = Abc_NtkCi( pNtkNew, iPis++ );
@@ -3468,7 +3652,7 @@ Abc_Ntk_t * Amap_ManProduceNetwork( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMapping )
}
for ( k = 0; k < pRes->nFans; k++ )
{
- pFaninNew = Vec_PtrEntry( vNodesNew, pRes->pFans[k] );
+ pFaninNew = (Abc_Obj_t *)Vec_PtrEntry( vNodesNew, pRes->pFans[k] );
Abc_ObjAddFanin( pNodeNew, pFaninNew );
}
Vec_PtrPush( vNodesNew, pNodeNew );
@@ -3477,7 +3661,7 @@ Abc_Ntk_t * Amap_ManProduceNetwork( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMapping )
assert( iPis == Abc_NtkCiNum(pNtkNew) );
assert( iPos == Abc_NtkCoNum(pNtkNew) );
// decouple the PO driver nodes to reduce the number of levels
- nDupGates = Abc_NtkLogicMakeSimpleCos( pNtkNew, 1 );
+ nDupGates = Abc_NtkLogicMakeSimpleCos( pNtkNew, 0 );
// if ( nDupGates && Map_ManReadVerbose(pMan) )
// printf( "Duplicated %d gates to decouple the CO drivers.\n", nDupGates );
return pNtkNew;
@@ -3513,7 +3697,7 @@ Abc_Ntk_t * Abc_NtkDarAmap( Abc_Ntk_t * pNtk, Amap_Par_t * pPars )
Aig_ManStop( pMan );
if ( vMapping == NULL )
return NULL;
- pMem = Vec_PtrPop( vMapping );
+ pMem = (Aig_MmFlex_t *)Vec_PtrPop( vMapping );
pNtkAig = Amap_ManProduceNetwork( pNtk, vMapping );
Aig_MmFlexStop( pMem, 0 );
Vec_PtrFree( vMapping );
@@ -3539,8 +3723,149 @@ Abc_Ntk_t * Abc_NtkDarAmap( Abc_Ntk_t * pNtk, Amap_Par_t * pPars )
SeeAlso []
***********************************************************************/
+void Abc_NtkDarConstr( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose )
+{
+ Aig_Man_t * pMan;//, * pMan2;//, * pTemp;
+ assert( Abc_NtkIsStrash(pNtk) );
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ return;
+ if ( fStruct )
+ Saig_ManDetectConstrTest( pMan );
+ else
+ Saig_ManDetectConstrFuncTest( pMan, nFrames, nConfs, nProps, fOldAlgo, fVerbose );
+ Aig_ManStop( pMan );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs BDD-based reachability analysis.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Abc_Ntk_t * Abc_NtkDarUnfold( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose )
+{
+ Abc_Ntk_t * pNtkAig;
+ Aig_Man_t * pMan, * pTemp;
+ assert( Abc_NtkIsStrash(pNtk) );
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ return NULL;
+ if ( fStruct )
+ pMan = Saig_ManDupUnfoldConstrs( pTemp = pMan );
+ else
+ pMan = Saig_ManDupUnfoldConstrsFunc( pTemp = pMan, nFrames, nConfs, nProps, fOldAlgo, fVerbose );
+ Aig_ManStop( pTemp );
+ if ( pMan == NULL )
+ return NULL;
+ pNtkAig = Abc_NtkFromAigPhase( pMan );
+ pNtkAig->pName = Extra_UtilStrsav(pMan->pName);
+ pNtkAig->pSpec = Extra_UtilStrsav(pMan->pSpec);
+ Aig_ManStop( pMan );
+ return pNtkAig;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs BDD-based reachability analysis.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Abc_Ntk_t * Abc_NtkDarFold( Abc_Ntk_t * pNtk, int fCompl, int fVerbose )
+{
+ Abc_Ntk_t * pNtkAig;
+ Aig_Man_t * pMan, * pTemp;
+ assert( Abc_NtkIsStrash(pNtk) );
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ return NULL;
+ pMan = Saig_ManDupFoldConstrsFunc( pTemp = pMan, fCompl, fVerbose );
+ Aig_ManStop( pTemp );
+ pNtkAig = Abc_NtkFromAigPhase( pMan );
+ pNtkAig->pName = Extra_UtilStrsav(pMan->pName);
+ pNtkAig->pSpec = Extra_UtilStrsav(pMan->pSpec);
+ Aig_ManStop( pMan );
+ return pNtkAig;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs BDD-based reachability analysis.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkDarConstrProfile( Abc_Ntk_t * pNtk, int fVerbose )
+{
+ extern int Ssw_ManProfileConstraints( Aig_Man_t * p, int nWords, int nFrames, int fVerbose );
+ extern Vec_Int_t * Saig_ManComputeSwitchProbs( Aig_Man_t * p, int nFrames, int nPref, int fProbOne );
+ Aig_Man_t * pMan;
+// Vec_Int_t * vProbOne;
+// Aig_Obj_t * pObj;
+// int i, Entry;
+ assert( Abc_NtkIsStrash(pNtk) );
+ assert( Abc_NtkConstrNum(pNtk) );
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ return;
+ // value in the init state
+// Abc_AigSetNodePhases( pNtk );
+/*
+ // derive probabilities
+ vProbOne = Saig_ManComputeSwitchProbs( pMan, 48, 16, 1 );
+ // iterate over the constraint outputs
+ Saig_ManForEachPo( pMan, pObj, i )
+ {
+ Entry = Vec_IntEntry( vProbOne, Aig_ObjId(pObj) );
+ if ( i < Saig_ManPoNum(pMan) - Saig_ManConstrNum(pMan) )
+ printf( "Primary output : ", i );
+ else
+ printf( "Constraint %3d : ", i-(Saig_ManPoNum(pMan) - Saig_ManConstrNum(pMan)) );
+ printf( "ProbOne = %f ", Aig_Int2Float(Entry) );
+ printf( "AllZeroValue = %d ", Aig_ObjPhase(pObj) );
+ printf( "\n" );
+ }
+*/
+ // double-check
+ Ssw_ManProfileConstraints( pMan, 16, 64, 1 );
+ printf( "TwoFrameSatValue = %d.\n", Ssw_ManSetConstrPhases(pMan, 2, NULL) );
+ // clean up
+// Vec_IntFree( vProbOne );
+ Aig_ManStop( pMan );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs BDD-based reachability analysis.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
void Abc_NtkDarTest( Abc_Ntk_t * pNtk )
{
+// extern void Saig_ManDetectConstr( Aig_Man_t * p );
+// extern void Saig_ManDetectConstrFuncTest( Aig_Man_t * p );
+ extern void Saig_ManFoldConstrTest( Aig_Man_t * pAig );
+
+
// extern void Fsim_ManTest( Aig_Man_t * pAig );
extern Vec_Int_t * Saig_StrSimPerformMatching( Aig_Man_t * p0, Aig_Man_t * p1, int nDist, int fVerbose, Aig_Man_t ** ppMiter );
// Vec_Int_t * vPairs;
@@ -3571,8 +3896,24 @@ Aig_ManPrintStats( pMan );
Aig_ManStop( pMan );
Aig_ManStop( pMan2 );
*/
+// Ioa_WriteAigerBufferTest( pMan, "test.aig", 0, 0 );
+// Saig_ManFoldConstrTest( pMan );
+ {
+ extern void Saig_ManBmcSectionsTest( Aig_Man_t * p );
+ extern void Saig_ManBmcTerSimTest( Aig_Man_t * p );
+ extern void Saig_ManBmcSupergateTest( Aig_Man_t * p );
+ extern void Saig_ManBmcMappingTest( Aig_Man_t * p );
+// Saig_ManBmcSectionsTest( pMan );
+// Saig_ManBmcTerSimTest( pMan );
+// Saig_ManBmcSupergateTest( pMan );
+// Saig_ManBmcMappingTest( pMan );
+ }
+
+
// Saig_MvManSimulate( pMan, 1 );
+// Saig_ManDetectConstr( pMan );
+// Saig_ManDetectConstrFuncTest( pMan );
// Fsim_ManTest( pMan );
Aig_ManStop( pMan );
@@ -3624,7 +3965,7 @@ Abc_Ntk_t * Abc_NtkDarTestNtk( Abc_Ntk_t * pNtk )
return NULL;
/*
Aig_ManSetRegNum( pMan, pMan->nRegs );
- pMan = Saig_ManProofAbstraction( pTemp = pMan, 5, 10000, 0, 0, 0, -1, -1, 99, fUseBdds, fUseDprove, 0, 1 );
+ pMan = Saig_ManCexAbstraction( pTemp = pMan, 5, 10000, 0, 0, 0, -1, -1, 99, fUseBdds, fUseDprove, 0, 1 );
Aig_ManStop( pTemp );
if ( pMan == NULL )
return NULL;
@@ -3642,7 +3983,6 @@ Abc_Ntk_t * Abc_NtkDarTestNtk( Abc_Ntk_t * pNtk )
Aig_ManStop( pMan );
*/
-
pNtkAig = Abc_NtkFromDar( pNtk, pMan );
Aig_ManStop( pMan );
@@ -3655,3 +3995,5 @@ Abc_Ntk_t * Abc_NtkDarTestNtk( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcDebug.c b/src/base/abci/abcDebug.c
index 6d8d9bfa..43ceb63a 100644
--- a/src/base/abci/abcDebug.c
+++ b/src/base/abci/abcDebug.c
@@ -19,6 +19,10 @@
***********************************************************************/
#include "abc.h"
+#include "ioAbc.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -27,8 +31,6 @@
static int Abc_NtkCountFaninsTotal( Abc_Ntk_t * pNtk );
static Abc_Ntk_t * Abc_NtkAutoDebugModify( Abc_Ntk_t * pNtk, int ObjNum, int fConst1 );
-extern void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches );
-
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
@@ -206,3 +208,5 @@ Abc_Ntk_t * Abc_NtkAutoDebugModify( Abc_Ntk_t * pNtkInit, int Step, int fConst1
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcDprove2.c b/src/base/abci/abcDprove2.c
new file mode 100644
index 00000000..7d432612
--- /dev/null
+++ b/src/base/abci/abcDprove2.c
@@ -0,0 +1,405 @@
+/**CFile****************************************************************
+
+ FileName [abcDprove2.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [Implementation of "dprove2".]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: abcDprove2.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "aig.h"
+#include "saig.h"
+#include "fra.h"
+#include "ssw.h"
+#include "gia.h"
+#include "giaAig.h"
+#include "cec.h"
+#include "int.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+extern int Abc_NtkDarBmcInter_int( Aig_Man_t * pMan, Inter_ManParams_t * pPars );
+
+extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
+extern Abc_Ntk_t * Abc_NtkFromDar( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan );
+extern Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan );
+extern int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar );
+
+extern void * Abc_FrameReadSave1();
+extern void * Abc_FrameReadSave2();
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Implements model checking based on abstraction and speculation.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkDProve2( Abc_Ntk_t * pNtk, int nConfLast, int fSeparate, int fVeryVerbose, int fVerbose )
+{
+ Abc_Ntk_t * pNtk2;
+ Aig_Man_t * pMan, * pTemp;
+ Aig_Man_t * pSave1 = NULL;
+ Gia_Man_t * pGia, * pSrm;
+ int spectried = 0;
+ int absquit = 0;
+ int absfail = 0;
+ int RetValue = -1;
+ int clkTotal = clock();
+ // derive the AIG manager
+ ABC_FREE( pNtk->pModel );
+ ABC_FREE( pNtk->pSeqModel );
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan == NULL )
+ {
+ printf( "Converting miter into AIG has failed.\n" );
+ return RetValue;
+ }
+ assert( pMan->nRegs > 0 );
+
+ if ( fVerbose )
+ {
+ printf( "Starting BMC...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ // bmc2 -C 10000
+ {
+ int nFrames = 2000;
+ int nNodeDelta = 2000;
+ int nBTLimit = 10000; // different from default
+ int nBTLimitAll = 2000000;
+ Saig_BmcPerform( pMan, 0, nFrames, nNodeDelta, 0, nBTLimit, nBTLimitAll, fVeryVerbose, 0, NULL );
+ pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
+ if ( pNtk->pSeqModel )
+ goto finish;
+ }
+
+ if ( fVerbose )
+ {
+ printf( "Starting \"dprove\"...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ // dprove -r -F 8
+ {
+ Fra_Sec_t SecPar, * pSecPar = &SecPar;
+ Fra_SecSetDefaultParams( pSecPar );
+ pSecPar->fTryBmc ^= 1;
+ pSecPar->fRetimeFirst ^= 1;
+ pSecPar->nFramesMax = 8;
+ pSecPar->fInterSeparate = 0; //fSeparate;
+ pSecPar->fVerbose = fVeryVerbose;
+ RetValue = Abc_NtkDarProve( pNtk, pSecPar );
+ // analize the result
+ if ( RetValue != -1 )
+ goto finish;
+ }
+ Aig_ManStop( pMan );
+ pSave1 = (Aig_Man_t *)Abc_FrameReadSave1();
+ pMan = Aig_ManDupSimple( pSave1 );
+
+ // abstraction
+
+ if ( fVerbose )
+ {
+ printf( "Abstraction...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+abstraction:
+ {
+ Gia_ParAbs_t Pars, * pPars = &Pars;
+ Gia_ManAbsSetDefaultParams( pPars );
+ pPars->nConfMaxBmc = 25000;
+ pPars->nRatio = 2;
+ pPars->fVerbose = fVeryVerbose;
+/*
+ int nFramesMax = 10;
+ int nConfMax = 10000;
+ int fDynamic = 1;
+ int fExtend = 0;
+ int fSkipProof = 0;
+ int nFramesBmc = 2000;
+ int nConfMaxBmc = 25000; // default 5000;
+ int nRatio = 2; // default 10;
+ int fUseBdds = 0;
+ int fUseDprove = 0;
+ int fVerbose = fVeryVerbose;
+ fExtend ^= 1;
+ fSkipProof ^= 1;
+*/
+ pMan = Saig_ManCexAbstraction( pTemp = pMan, pPars );
+ // if abstractin has solved the problem
+ if ( pTemp->pSeqModel )
+ {
+ pNtk->pSeqModel = pTemp->pSeqModel; pTemp->pSeqModel = NULL;
+ Aig_ManStop( pTemp );
+ goto finish;
+ }
+ Aig_ManStop( pTemp );
+ if ( pMan == NULL ) // abstraction quits
+ {
+ absquit = 1;
+ pMan = Aig_ManDupSimple( pSave1 );
+ goto speculation;
+ }
+ }
+ if ( fVerbose )
+ {
+ printf( "Problem before trimming...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ // trim off useless primary inputs
+ pMan = Aig_ManDupTrim( pTemp = pMan );
+ Aig_ManStop( pTemp );
+ if ( fVerbose )
+ {
+ printf( "\"dprove\" after abstraction...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ // dprove -r -F 8
+ {
+ Fra_Sec_t SecPar, * pSecPar = &SecPar;
+ Fra_SecSetDefaultParams( pSecPar );
+ pSecPar->fTryBmc ^= 1;
+ pSecPar->fRetimeFirst ^= 1;
+ pSecPar->nFramesMax = 8;
+ pSecPar->fInterSeparate = 0; //fSeparate;
+ pSecPar->fVerbose = fVeryVerbose;
+ // convert pMan into pNtk
+ pNtk2 = Abc_NtkFromAigPhase( pMan );
+ RetValue = Abc_NtkDarProve( pNtk2, pSecPar );
+ Abc_NtkDelete( pNtk2 );
+ // analize the result
+ if ( RetValue == 1 )
+ goto finish;
+ if ( RetValue == 0 )
+ {
+ // transfer the counter-example!!!
+ goto finish;
+ }
+ assert( RetValue == -1 );
+ Aig_ManStop( pMan );
+ pMan = (Aig_Man_t *)Abc_FrameReadSave1(); // save2
+ }
+
+speculation:
+ if ( spectried )
+ goto finalbmc;
+ spectried = 1;
+
+ if ( fVerbose )
+ {
+ printf( "Speculation...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ // convert AIG into GIA
+// pGia = Gia_ManFromAigSimple( pMan ); // DID NOT WORK!
+ pGia = Gia_ManFromAig( pMan );
+ Aig_ManStop( pMan );
+ // &get, eclass,
+ {
+ Cec_ParSim_t Pars, * pPars = &Pars;
+ Cec_ManSimSetDefaultParams( pPars );
+ pPars->fSeqSimulate ^= 1;
+ pPars->nWords = 255;
+ pPars->nFrames = 1000;
+ Cec_ManSimulation( pGia, pPars );
+ }
+ // (spech)* where spech = &srm; restore save3; bmc2 -F 100 -C 25000; &resim
+ while ( 1 )
+ {
+ // perform speculative reduction
+ pSrm = Gia_ManSpecReduce( pGia, 0, 0, fVeryVerbose ); // save3
+// Gia_ManPrintStats( pGia, 0 );
+// Gia_ManPrintStats( pSrm, 0 );
+ // bmc2 -F 100 -C 25000
+ {
+ Abc_Cex_t * pCex;
+ int nFrames = 100; // different from default
+ int nNodeDelta = 2000;
+ int nBTLimit = 25000; // different from default
+ int nBTLimitAll = 2000000;
+ pTemp = Gia_ManToAig( pSrm, 0 );
+// Aig_ManPrintStats( pTemp );
+ Gia_ManStop( pSrm );
+ Saig_BmcPerform( pTemp, 0, nFrames, nNodeDelta, 0, nBTLimit, nBTLimitAll, fVeryVerbose, 0, NULL );
+ pCex = pTemp->pSeqModel; pTemp->pSeqModel = NULL;
+ Aig_ManStop( pTemp );
+ if ( pCex == NULL )
+ break;
+ // perform simulation
+ {
+ Cec_ParSim_t Pars, * pPars = &Pars;
+ Cec_ManSimSetDefaultParams( pPars );
+ Cec_ManSeqResimulateCounter( pGia, pPars, pCex );
+ ABC_FREE( pCex );
+ }
+ }
+ }
+ Gia_ManStop( pGia );
+ // speculatively reduced model is available in pTemp
+ // trim off useless primary inputs
+ if ( fVerbose )
+ {
+ printf( "Problem before trimming...\n" );
+ Aig_ManPrintStats( pTemp );
+ }
+ pMan = Aig_ManDupTrim( pTemp );
+ Aig_ManStop( pTemp );
+ if ( fVerbose )
+ {
+ printf( "After speculation...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+/*
+ // solve the speculatively reduced model
+ // dprove -r -F 8
+ {
+ Fra_Sec_t SecPar, * pSecPar = &SecPar;
+ Fra_SecSetDefaultParams( pSecPar );
+ pSecPar->fTryBmc ^= 1;
+ pSecPar->fRetimeFirst ^= 1;
+ pSecPar->nFramesMax = 8;
+ pSecPar->fVerbose = fVeryVerbose;
+ pSecPar->fInterSeparate = 0; //fSeparate;
+ // convert pMan into pNtk
+ pNtk2 = Abc_NtkFromAigPhase( pMan );
+ RetValue = Abc_NtkDarProve( pNtk2, pSecPar );
+ Abc_NtkDelete( pNtk2 );
+ // analize the result
+ if ( RetValue == 1 )
+ goto finish;
+ if ( RetValue == 0 )
+ goto finalbmc;
+ // could not solve
+ Aig_ManStop( pMan );
+ pMan = Abc_FrameReadSave1(); // save4
+ if ( absquit || absfail )
+ goto abstraction;
+ }
+*/
+ // scorr; dc2; orpos; int -r -C 25000
+ {
+ Ssw_Pars_t Pars, * pPars = &Pars;
+ Ssw_ManSetDefaultParams( pPars );
+ pMan = Ssw_SignalCorrespondence( pTemp = pMan, pPars );
+ Aig_ManStop( pTemp );
+ if ( fVerbose )
+ {
+ printf( "After \"scorr\"...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ pMan = Dar_ManCompress2( pTemp = pMan, 1, 0, 1, 0, 0 );
+ Aig_ManStop( pTemp );
+ if ( fVerbose )
+ {
+ printf( "After \"dc2\"...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ }
+ {
+ Inter_ManParams_t Pars, * pPars = &Pars;
+ Inter_ManSetDefaultParams( pPars );
+ pPars->fUseSeparate = fSeparate;
+ pPars->fRewrite = 1;
+ pPars->nBTLimit = 25000;
+ if ( Saig_ManPoNum(pMan) > 1 && !fSeparate )
+ {
+ Aig_Man_t * pAux = Aig_ManDupSimple(pMan);
+ pTemp = Aig_ManDupOrpos( pAux, 1 );
+ RetValue = Abc_NtkDarBmcInter_int( pTemp, pPars );
+ Aig_ManStop( pTemp );
+ Aig_ManStop( pAux );
+ }
+ else
+ RetValue = Abc_NtkDarBmcInter_int( pMan, pPars );
+ // analize the result
+ if ( RetValue == 1 )
+ goto finish;
+ if ( RetValue == 0 )
+ goto finalbmc;
+ // could not solve
+// Aig_ManStop( pMan );
+// pMan = Abc_FrameReadSave1(); // save4
+ if ( absquit || absfail )
+ goto abstraction;
+ }
+
+finalbmc:
+ Aig_ManStop( pMan );
+ pMan = pSave1; pSave1 = NULL;
+ if ( fVerbose )
+ {
+ printf( "Final BMC...\n" );
+ Aig_ManPrintStats( pMan );
+ }
+ // bmc2 unlimited
+ {
+ int nFrames = 2000;
+ int nNodeDelta = 2000;
+ int nBTLimit = nConfLast; // different from default
+ int nBTLimitAll = 2000000;
+ Saig_BmcPerform( pMan, 0, nFrames, nNodeDelta, 0, nBTLimit, nBTLimitAll, fVeryVerbose, 0, NULL );
+ ABC_FREE( pNtk->pModel );
+ ABC_FREE( pNtk->pSeqModel );
+ pNtk->pSeqModel = pMan->pSeqModel; pMan->pSeqModel = NULL;
+ if ( pNtk->pSeqModel )
+ goto finish;
+ }
+
+finish:
+ if ( RetValue == 1 )
+ printf( "Networks are equivalent. " );
+ if ( RetValue == 0 )
+ printf( "Networks are not equivalent. " );
+ if ( RetValue == -1 )
+ printf( "Networks are UNDECIDED. " );
+ ABC_PRT( "Time", clock() - clkTotal );
+ if ( pNtk->pSeqModel )
+ printf( "Output %d was asserted in frame %d (use \"write_counter\" to dump a witness).\n", pNtk->pSeqModel->iPo, pNtk->pSeqModel->iFrame );
+ // verify counter-example
+ if ( pNtk->pSeqModel )
+ {
+ int status = Ssw_SmlRunCounterExample( pMan, pNtk->pSeqModel );
+ if ( status == 0 )
+ printf( "Abc_NtkDarBmc(): Counter-example verification has FAILED.\n" );
+ }
+ if ( pSave1 )
+ Aig_ManStop( pSave1 );
+ Aig_ManStop( pMan );
+ return RetValue;
+}
+
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcDress.c b/src/base/abci/abcDress.c
index f262a5d0..c9c956e4 100644
--- a/src/base/abci/abcDress.c
+++ b/src/base/abci/abcDress.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -207,3 +210,5 @@ void Abc_NtkDressTransferNames( Abc_Ntk_t * pNtk, stmm_table * tMapping, int fVe
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcDress2.c b/src/base/abci/abcDress2.c
new file mode 100644
index 00000000..039a4fed
--- /dev/null
+++ b/src/base/abci/abcDress2.c
@@ -0,0 +1,435 @@
+/**CFile****************************************************************
+
+ FileName [abcDressw.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [Transfers names from one netlist to the other.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: abcDressw.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "aig.h"
+#include "dch.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+/*
+ Procedure Abc_NtkDressComputeEquivs() implemented in this file computes
+ equivalence classes of objects of the two networks (pNtk1 and pNtk2).
+
+ It is possible that pNtk1 is the network before synthesis and pNtk2 is the
+ network after synthesis. The equiv classes of nodes from these networks
+ can be used to transfer the names from pNtk1 to pNtk2, or vice versa.
+
+ The above procedure returns the array (Vec_Ptr_t) of integer arrays (Vec_Int_t).
+ Each of the integer arrays contains entries of one equivalence class.
+ Each entry (EquivId) contains the following information:
+ (1) object ID, which is a number 'num', such that 0 <= 'num' < MaxId
+ where MaxId is the largest ID of nodes in a network
+ (2) the polarity of the node, which is a binary number, 0 or 1, giving
+ the node's value when pattern (000...0) is applied to the inputs
+ (3) the number of the network, 0 or 1, which stands for pNtk1 and pNtk2, respectively
+ The first array in the array of arrays is empty, or contains nodes that
+ are equivalent to a constant (if such nodes appear in the network).
+
+ Given EquivID defined above, use the APIs below to get its components.
+*/
+
+// declarations to be added to the application code
+extern int Abc_ObjEquivId2ObjId( int EquivId );
+extern int Abc_ObjEquivId2Polar( int EquivId );
+extern int Abc_ObjEquivId2NtkId( int EquivId );
+
+// definition that may remain in this file
+int Abc_ObjEquivId2ObjId( int EquivId ) { return EquivId >> 2; }
+int Abc_ObjEquivId2Polar( int EquivId ) { return (EquivId >> 1) & 1; }
+int Abc_ObjEquivId2NtkId( int EquivId ) { return EquivId & 1; }
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
+extern void Dch_ComputeEquivalences( Aig_Man_t * pAig, Dch_Pars_t * pPars );
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Creates the dual output miter.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Aig_Man_t * Aig_ManCreateDualOutputMiter( Aig_Man_t * p1, Aig_Man_t * p2 )
+{
+ Aig_Man_t * pNew;
+ Aig_Obj_t * pObj;
+ int i;
+ assert( Aig_ManPiNum(p1) == Aig_ManPiNum(p2) );
+ assert( Aig_ManPoNum(p1) == Aig_ManPoNum(p2) );
+ pNew = Aig_ManStart( Aig_ManObjNumMax(p1) + Aig_ManObjNumMax(p2) );
+ // add first AIG
+ Aig_ManConst1(p1)->pData = Aig_ManConst1(pNew);
+ Aig_ManForEachPi( p1, pObj, i )
+ pObj->pData = Aig_ObjCreatePi( pNew );
+ Aig_ManForEachNode( p1, pObj, i )
+ pObj->pData = Aig_And( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
+ // add second AIG
+ Aig_ManConst1(p2)->pData = Aig_ManConst1(pNew);
+ Aig_ManForEachPi( p2, pObj, i )
+ pObj->pData = Aig_ManPi( pNew, i );
+ Aig_ManForEachNode( p2, pObj, i )
+ pObj->pData = Aig_And( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
+ // add the outputs
+ for ( i = 0; i < Aig_ManPoNum(p1); i++ )
+ {
+ Aig_ObjCreatePo( pNew, Aig_ObjChild0Copy(Aig_ManPo(p1, i)) );
+ Aig_ObjCreatePo( pNew, Aig_ObjChild0Copy(Aig_ManPo(p2, i)) );
+ }
+ Aig_ManCleanup( pNew );
+ return pNew;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Sets polarity attribute of each object in the network.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkDressMapSetPolarity( Abc_Ntk_t * pNtk )
+{
+ Abc_Obj_t * pObj, * pAnd;
+ int i;
+ // each node refers to the the strash copy whose polarity is set
+ Abc_NtkForEachObj( pNtk, pObj, i )
+ {
+ if ( (pAnd = Abc_ObjRegular(pObj->pCopy)) && Abc_ObjType(pAnd) != ABC_OBJ_NONE ) // strashed object is present and legal
+ pObj->fPhase = pAnd->fPhase ^ Abc_ObjIsComplement(pObj->pCopy);
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Create mapping of node IDs of pNtk into equiv classes of pMiter.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Abc_NtkDressMapClasses( Aig_Man_t * pMiter, Abc_Ntk_t * pNtk )
+{
+ Vec_Int_t * vId2Lit;
+ Abc_Obj_t * pObj, * pAnd;
+ Aig_Obj_t * pObjMan, * pObjMiter, * pObjRepr;
+ int i;
+ vId2Lit = Vec_IntAlloc( 0 );
+ Vec_IntFill( vId2Lit, Abc_NtkObjNumMax(pNtk), -1 );
+ Abc_NtkForEachNode( pNtk, pObj, i )
+ {
+ // get the pointer to the miter node corresponding to pObj
+ if ( (pAnd = Abc_ObjRegular(pObj->pCopy)) && Abc_ObjType(pAnd) != ABC_OBJ_NONE && // strashed node is present and legal
+ (pObjMan = Aig_Regular((Aig_Obj_t *)pAnd->pCopy)) && Aig_ObjType(pObjMan) != AIG_OBJ_NONE && // AIG node is present and legal
+ (pObjMiter = Aig_Regular((Aig_Obj_t *)pObjMan->pData)) && Aig_ObjType(pObjMiter) != AIG_OBJ_NONE ) // miter node is present and legal
+ {
+ // get the representative of the miter node
+ pObjRepr = Aig_ObjRepr( pMiter, pObjMiter );
+ pObjRepr = pObjRepr? pObjRepr : pObjMiter;
+ // map pObj (whose ID is i) into the repr node ID (i.e. equiv class)
+ Vec_IntWriteEntry( vId2Lit, i, Aig_ObjId(pObjRepr) );
+ }
+ }
+ return vId2Lit;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Returns the vector of given equivalence class of objects.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Abc_ObjDressClass( Vec_Ptr_t * vRes, Vec_Int_t * vClass2Num, int Class )
+{
+ int ClassNumber;
+ assert( Class > 0 );
+ ClassNumber = Vec_IntEntry( vClass2Num, Class );
+ assert( ClassNumber != 0 );
+ if ( ClassNumber > 0 )
+ return (Vec_Int_t *)Vec_PtrEntry( vRes, ClassNumber ); // previous class
+ // create new class
+ Vec_IntWriteEntry( vClass2Num, Class, Vec_PtrSize(vRes) );
+ Vec_PtrPush( vRes, Vec_IntAlloc(4) );
+ return (Vec_Int_t *)Vec_PtrEntryLast( vRes );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Returns the ID of a node in an equivalence class.]
+
+ Description [The ID is composed of three parts: object ID, followed
+ by one bit telling the phase of this node, followed by one bit
+ telling the network to which this node belongs.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_ObjDressMakeId( Abc_Ntk_t * pNtk, int ObjId, int iNtk )
+{
+ return (ObjId << 2) | (Abc_NtkObj(pNtk,ObjId)->fPhase << 1) | iNtk;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Computes equivalence classes of objects in pNtk1 and pNtk2.]
+
+ Description [Internal procedure.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t * Abc_NtkDressMapIds( Aig_Man_t * pMiter, Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2 )
+{
+ Vec_Ptr_t * vRes;
+ Vec_Int_t * vId2Lit1, * vId2Lit2, * vCounts0, * vCounts1, * vClassC, * vClass2Num;
+ int i, Class;
+ // start the classes
+ vRes = Vec_PtrAlloc( 1000 );
+ // set polarity of the nodes
+ Abc_NtkDressMapSetPolarity( pNtk1 );
+ Abc_NtkDressMapSetPolarity( pNtk2 );
+ // create mapping of node IDs of pNtk1/pNtk2 into the IDs of equiv classes of pMiter
+ vId2Lit1 = Abc_NtkDressMapClasses( pMiter, pNtk1 );
+ vId2Lit2 = Abc_NtkDressMapClasses( pMiter, pNtk2 );
+ // count the number of nodes in each equivalence class
+ vCounts0 = Vec_IntStart( Aig_ManObjNumMax(pMiter) );
+ Vec_IntForEachEntry( vId2Lit1, Class, i )
+ if ( Class >= 0 )
+ Vec_IntAddToEntry( vCounts0, Class, 1 );
+ vCounts1 = Vec_IntStart( Aig_ManObjNumMax(pMiter) );
+ Vec_IntForEachEntry( vId2Lit2, Class, i )
+ if ( Class >= 0 )
+ Vec_IntAddToEntry( vCounts1, Class, 1 );
+ // get the costant class
+ vClassC = Vec_IntAlloc( 100 );
+ Vec_IntForEachEntry( vId2Lit1, Class, i )
+ if ( Class == 0 )
+ Vec_IntPush( vClassC, Abc_ObjDressMakeId(pNtk1, i, 0) );
+ Vec_IntForEachEntry( vId2Lit2, Class, i )
+ if ( Class == 0 )
+ Vec_IntPush( vClassC, Abc_ObjDressMakeId(pNtk2, i, 1) );
+ Vec_PtrPush( vRes, vClassC );
+ // map repr node IDs into class numbers
+ vClass2Num = Vec_IntAlloc( 0 );
+ Vec_IntFill( vClass2Num, Aig_ManObjNumMax(pMiter), -1 );
+ // keep classes having at least one element from pNtk1 and one from pNtk2
+ Vec_IntForEachEntry( vId2Lit1, Class, i )
+ if ( Class > 0 && Vec_IntEntry(vCounts0, Class) && Vec_IntEntry(vCounts1, Class) )
+ Vec_IntPush( Abc_ObjDressClass(vRes, vClass2Num, Class), Abc_ObjDressMakeId(pNtk1, i, 0) );
+ Vec_IntForEachEntry( vId2Lit2, Class, i )
+ if ( Class > 0 && Vec_IntEntry(vCounts0, Class) && Vec_IntEntry(vCounts1, Class) )
+ Vec_IntPush( Abc_ObjDressClass(vRes, vClass2Num, Class), Abc_ObjDressMakeId(pNtk2, i, 1) );
+ // package them accordingly
+ Vec_IntFree( vClass2Num );
+ Vec_IntFree( vCounts0 );
+ Vec_IntFree( vCounts1 );
+ Vec_IntFree( vId2Lit1 );
+ Vec_IntFree( vId2Lit2 );
+ return vRes;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Computes equivalence classes of objects in pNtk1 and pNtk2.]
+
+ Description [Returns the array (Vec_Ptr_t) of integer arrays (Vec_Int_t).
+ Each of the integer arrays contains entries of one equivalence class.
+ Each entry contains the following information: the network number (0/1),
+ the polarity (0/1) and the object ID in the the network (0 <= num < MaxId)
+ where MaxId is the largest number of an ID of an object in that network.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t * Abc_NtkDressComputeEquivs( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConflictLimit, int fVerbose )
+{
+ Dch_Pars_t Pars, * pPars = &Pars;
+ Abc_Ntk_t * pAig1, * pAig2;
+ Aig_Man_t * pMan1, * pMan2, * pMiter;
+ Vec_Ptr_t * vRes;
+ assert( !Abc_NtkIsStrash(pNtk1) );
+ assert( !Abc_NtkIsStrash(pNtk2) );
+ // convert network into AIG
+ pAig1 = Abc_NtkStrash( pNtk1, 1, 1, 0 );
+ pAig2 = Abc_NtkStrash( pNtk2, 1, 1, 0 );
+ pMan1 = Abc_NtkToDar( pAig1, 0, 0 );
+ pMan2 = Abc_NtkToDar( pAig2, 0, 0 );
+ // derive the miter
+ pMiter = Aig_ManCreateDualOutputMiter( pMan1, pMan2 );
+ // set up parameters for SAT sweeping
+ Dch_ManSetDefaultParams( pPars );
+ pPars->nBTLimit = nConflictLimit;
+ pPars->fVerbose = fVerbose;
+ // perform SAT sweeping
+ Dch_ComputeEquivalences( pMiter, pPars );
+ // now, pMiter is annotated with the equivl class info
+ // convert this info into the resulting array
+ vRes = Abc_NtkDressMapIds( pMiter, pNtk1, pNtk2 );
+ Aig_ManStop( pMiter );
+ Aig_ManStop( pMan1 );
+ Aig_ManStop( pMan2 );
+ Abc_NtkDelete( pAig1 );
+ Abc_NtkDelete( pAig2 );
+ return vRes;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Prints information about node equivalences.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkDressPrintEquivs( Vec_Ptr_t * vRes )
+{
+ Vec_Int_t * vClass;
+ int i, k, Entry;
+ Vec_PtrForEachEntry( Vec_Int_t *, vRes, vClass, i )
+ {
+ printf( "Class %5d : ", i );
+ printf( "Num =%5d ", Vec_IntSize(vClass) );
+ Vec_IntForEachEntry( vClass, Entry, k )
+ printf( "%5d%c%d ",
+ Abc_ObjEquivId2ObjId(Entry),
+ Abc_ObjEquivId2Polar(Entry)? '-':'+',
+ Abc_ObjEquivId2NtkId(Entry) );
+ printf( "\n" );
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Prints information about node equivalences.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkDressPrintStats( Vec_Ptr_t * vRes, int nNodes0, int nNodes1, int Time )
+{
+ Vec_Int_t * vClass;
+ int i, k, Entry;
+ int NegAll[2] = {0}, PosAll[2] = {0}, PairsAll = 0, PairsOne = 0;
+ int Pos[2], Neg[2];
+ // count the number of equivalences in each class
+ Vec_PtrForEachEntry( Vec_Int_t *, vRes, vClass, i )
+ {
+ Pos[0] = Pos[1] = 0;
+ Neg[0] = Neg[1] = 0;
+ Vec_IntForEachEntry( vClass, Entry, k )
+ {
+ if ( Abc_ObjEquivId2NtkId(Entry) )
+ {
+ if ( Abc_ObjEquivId2Polar(Entry) )
+ Neg[1]++; // negative polarity in network 1
+ else
+ Pos[1]++; // positive polarity in network 1
+ }
+ else
+ {
+ if ( Abc_ObjEquivId2Polar(Entry) )
+ Neg[0]++; // negative polarity in network 0
+ else
+ Pos[0]++; // positive polarity in network 0
+ }
+ }
+ PosAll[0] += Pos[0]; // total positive polarity in network 0
+ PosAll[1] += Pos[1]; // total positive polarity in network 1
+ NegAll[0] += Neg[0]; // total negative polarity in network 0
+ NegAll[1] += Neg[1]; // total negative polarity in network 1
+
+ // assuming that the name can be transferred to only one node
+ PairsAll += ABC_MIN(Neg[0] + Pos[0], Neg[1] + Pos[1]);
+ PairsOne += ABC_MIN(Neg[0], Neg[1]) + ABC_MIN(Pos[0], Pos[1]);
+ }
+ printf( "Total number of equiv classes = %7d.\n", Vec_PtrSize(vRes) );
+ printf( "Participating nodes from both networks = %7d.\n", NegAll[0]+PosAll[0]+NegAll[1]+PosAll[1] );
+ printf( "Participating nodes from the first network = %7d. (%7.2f %% of nodes)\n", NegAll[0]+PosAll[0], 100.0*(NegAll[0]+PosAll[0])/(nNodes0+1) );
+ printf( "Participating nodes from the second network = %7d. (%7.2f %% of nodes)\n", NegAll[1]+PosAll[1], 100.0*(NegAll[1]+PosAll[1])/(nNodes1+1) );
+ printf( "Node pairs (any polarity) = %7d. (%7.2f %% of names can be moved)\n", PairsAll, 100.0*PairsAll/(nNodes0+1) );
+ printf( "Node pairs (same polarity) = %7d. (%7.2f %% of names can be moved)\n", PairsOne, 100.0*PairsOne/(nNodes0+1) );
+ ABC_PRT( "Total runtime", Time );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Transfers names from pNtk1 to pNtk2.]
+
+ Description [Internally calls new procedure for mapping node IDs of
+ both networks into the shared equivalence classes.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkDress2( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConflictLimit, int fVerbose )
+{
+ Vec_Ptr_t * vRes;
+ int clk = clock();
+ vRes = Abc_NtkDressComputeEquivs( pNtk1, pNtk2, nConflictLimit, fVerbose );
+// Abc_NtkDressPrintEquivs( vRes );
+ Abc_NtkDressPrintStats( vRes, Abc_NtkNodeNum(pNtk1), Abc_NtkNodeNum(pNtk1), clock() - clk );
+ Vec_VecFree( (Vec_Vec_t *)vRes );
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcDsd.c b/src/base/abci/abcDsd.c
index 796a51a4..0bfb4ec0 100644
--- a/src/base/abci/abcDsd.c
+++ b/src/base/abci/abcDsd.c
@@ -21,17 +21,20 @@
#include "abc.h"
#include "dsd.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static Abc_Ntk_t * Abc_NtkDsdInternal( Abc_Ntk_t * pNtk, bool fVerbose, bool fPrint, bool fShort );
+static Abc_Ntk_t * Abc_NtkDsdInternal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int fShort );
static void Abc_NtkDsdConstruct( Dsd_Manager_t * pManDsd, Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew );
static Abc_Obj_t * Abc_NtkDsdConstructNode( Dsd_Manager_t * pManDsd, Dsd_Node_t * pNodeDsd, Abc_Ntk_t * pNtkNew, int * pCounters );
static Vec_Ptr_t * Abc_NtkCollectNodesForDsd( Abc_Ntk_t * pNtk );
-static void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager_t * pManDsd, bool fRecursive, int * pCounters );
-static bool Abc_NodeIsForDsd( Abc_Obj_t * pNode );
+static void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager_t * pManDsd, int fRecursive, int * pCounters );
+static int Abc_NodeIsForDsd( Abc_Obj_t * pNode );
static int Abc_NodeFindMuxVar( DdManager * dd, DdNode * bFunc, int nVars );
////////////////////////////////////////////////////////////////////////
@@ -53,7 +56,7 @@ static int Abc_NodeFindMuxVar( DdManager * dd, DdNode * bFunc, int n
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, bool fVerbose, bool fPrint, bool fShort )
+Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int fShort )
{
DdManager * dd;
Abc_Ntk_t * pNtkNew;
@@ -91,7 +94,7 @@ Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, bool fVerbose, bool fPrint, bool
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkDsdInternal( Abc_Ntk_t * pNtk, bool fVerbose, bool fPrint, bool fShort )
+Abc_Ntk_t * Abc_NtkDsdInternal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int fShort )
{
char ** ppNamesCi, ** ppNamesCo;
Vec_Ptr_t * vFuncsGlob;
@@ -121,7 +124,7 @@ Abc_Ntk_t * Abc_NtkDsdInternal( Abc_Ntk_t * pNtk, bool fVerbose, bool fPrint, bo
// start the new network
pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
// make sure the new manager has enough inputs
- Cudd_bddIthVar( pNtkNew->pManFunc, dd->size-1 );
+ Cudd_bddIthVar( (DdManager *)pNtkNew->pManFunc, dd->size-1 );
// put the results into the new network (save new CO drivers in old CO drivers)
Abc_NtkDsdConstruct( pManDsd, pNtk, pNtkNew );
// finalize the new network
@@ -204,7 +207,7 @@ void Abc_NtkDsdConstruct( Dsd_Manager_t * pManDsd, Abc_Ntk_t * pNtk, Abc_Ntk_t *
Abc_Obj_t * Abc_NtkDsdConstructNode( Dsd_Manager_t * pManDsd, Dsd_Node_t * pNodeDsd, Abc_Ntk_t * pNtkNew, int * pCounters )
{
DdManager * ddDsd = Dsd_ManagerReadDd( pManDsd );
- DdManager * ddNew = pNtkNew->pManFunc;
+ DdManager * ddNew = (DdManager *)pNtkNew->pManFunc;
Dsd_Node_t * pFaninDsd;
Abc_Obj_t * pNodeNew, * pFanin;
DdNode * bLocal, * bTemp, * bVar;
@@ -226,7 +229,7 @@ Abc_Obj_t * Abc_NtkDsdConstructNode( Dsd_Manager_t * pManDsd, Dsd_Node_t * pNode
}
// create the local function depending on the type of the node
- ddNew = pNtkNew->pManFunc;
+ ddNew = (DdManager *)pNtkNew->pManFunc;
switch ( Type )
{
case DSD_NODE_CONST1:
@@ -305,10 +308,10 @@ printf( "\n" );
SeeAlso []
***********************************************************************/
-int Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, bool fVerbose, bool fRecursive )
+int Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, int fVerbose, int fRecursive )
{
Dsd_Manager_t * pManDsd;
- DdManager * dd = pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNtk->pManFunc;
Vec_Ptr_t * vNodes;
int i;
int pCounters[11] = {0};
@@ -324,7 +327,7 @@ int Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, bool fVerbose, bool fRecursive )
// collect nodes for decomposition
vNodes = Abc_NtkCollectNodesForDsd( pNtk );
for ( i = 0; i < vNodes->nSize; i++ )
- Abc_NodeDecompDsdAndMux( vNodes->pArray[i], vNodes, pManDsd, fRecursive, pCounters );
+ Abc_NodeDecompDsdAndMux( (Abc_Obj_t *)vNodes->pArray[i], vNodes, pManDsd, fRecursive, pCounters );
Vec_PtrFree( vNodes );
printf( "Number of non-decomposable functions:\n" );
@@ -381,15 +384,15 @@ Vec_Ptr_t * Abc_NtkCollectNodesForDsd( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager_t * pManDsd, bool fRecursive, int * pCounters )
+void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager_t * pManDsd, int fRecursive, int * pCounters )
{
- DdManager * dd = pNode->pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNode->pNtk->pManFunc;
Abc_Obj_t * pRoot = NULL, * pFanin, * pNode1, * pNode2, * pNodeC;
Dsd_Node_t ** ppNodesDsd, * pNodeDsd, * pFaninDsd;
int i, nNodesDsd, iVar, fCompl;
// try disjoint support decomposition
- pNodeDsd = Dsd_DecomposeOne( pManDsd, pNode->pData );
+ pNodeDsd = Dsd_DecomposeOne( pManDsd, (DdNode *)pNode->pData );
fCompl = Dsd_IsComplement( pNodeDsd );
pNodeDsd = Dsd_Regular( pNodeDsd );
@@ -420,25 +423,25 @@ void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager
// add fanin to the root
Abc_ObjAddFanin( pNode, pRoot );
// update the function to be that of buffer
- Cudd_RecursiveDeref( dd, pNode->pData );
- pNode->pData = Cudd_NotCond( dd->vars[0], fCompl ); Cudd_Ref( pNode->pData );
+ Cudd_RecursiveDeref( dd, (DdNode *)pNode->pData );
+ pNode->pData = Cudd_NotCond( (DdNode *)dd->vars[0], fCompl ); Cudd_Ref( (DdNode *)pNode->pData );
}
else // perform MUX-decomposition
{
// get the cofactoring variable
- iVar = Abc_NodeFindMuxVar( dd, pNode->pData, Abc_ObjFaninNum(pNode) );
+ iVar = Abc_NodeFindMuxVar( dd, (DdNode *)pNode->pData, Abc_ObjFaninNum(pNode) );
pNodeC = Abc_ObjFanin( pNode, iVar );
// get the negative cofactor
pNode1 = Abc_NtkCloneObj( pNode );
- pNode1->pData = Cudd_Cofactor( dd, pNode->pData, Cudd_Not(dd->vars[iVar]) ); Cudd_Ref( pNode1->pData );
+ pNode1->pData = Cudd_Cofactor( dd, (DdNode *)pNode->pData, Cudd_Not(dd->vars[iVar]) ); Cudd_Ref( (DdNode *)pNode1->pData );
Abc_NodeMinimumBase( pNode1 );
if ( Abc_NodeIsForDsd(pNode1) )
Vec_PtrPush( vNodes, pNode1 );
// get the positive cofactor
pNode2 = Abc_NtkCloneObj( pNode );
- pNode2->pData = Cudd_Cofactor( dd, pNode->pData, dd->vars[iVar] ); Cudd_Ref( pNode2->pData );
+ pNode2->pData = Cudd_Cofactor( dd, (DdNode *)pNode->pData, dd->vars[iVar] ); Cudd_Ref( (DdNode *)pNode2->pData );
Abc_NodeMinimumBase( pNode2 );
if ( Abc_NodeIsForDsd(pNode2) )
Vec_PtrPush( vNodes, pNode2 );
@@ -450,8 +453,8 @@ void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager
Abc_ObjAddFanin( pNode, pNode2 );
Abc_ObjAddFanin( pNode, pNode1 );
// update the function to be that of MUX
- Cudd_RecursiveDeref( dd, pNode->pData );
- pNode->pData = Cudd_bddIte( dd, dd->vars[0], dd->vars[1], dd->vars[2] ); Cudd_Ref( pNode->pData );
+ Cudd_RecursiveDeref( dd, (DdNode *)pNode->pData );
+ pNode->pData = Cudd_bddIte( dd, dd->vars[0], dd->vars[1], dd->vars[2] ); Cudd_Ref( (DdNode *)pNode->pData );
}
}
@@ -466,7 +469,7 @@ void Abc_NodeDecompDsdAndMux( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes, Dsd_Manager
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsForDsd( Abc_Obj_t * pNode )
+int Abc_NodeIsForDsd( Abc_Obj_t * pNode )
{
// DdManager * dd = pNode->pNtk->pManFunc;
// DdNode * bFunc, * bFunc0, * bFunc1;
@@ -551,3 +554,5 @@ int Abc_NodeFindMuxVar( DdManager * dd, DdNode * bFunc, int nVars )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcEspresso.c b/src/base/abci/abcEspresso.c
index 8f9c7277..c8c1d8e1 100644
--- a/src/base/abci/abcEspresso.c
+++ b/src/base/abci/abcEspresso.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "espresso.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -248,3 +251,5 @@ pset_family Abc_EspressoMinimize( pset_family pOnset, pset_family pDcset )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcExtract.c b/src/base/abci/abcExtract.c
index 52ea03a3..8eca34a6 100644
--- a/src/base/abci/abcExtract.c
+++ b/src/base/abci/abcExtract.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -49,3 +52,5 @@ void Abc_MvCostTest( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abc_.c b/src/base/abci/abcFlop.c
index 75ec88c3..a735f279 100644
--- a/src/base/abci/abc_.c
+++ b/src/base/abci/abcFlop.c
@@ -1,12 +1,12 @@
/**CFile****************************************************************
- FileName [abc_.c]
+ FileName [abcFlop.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
- Synopsis []
+ Synopsis [Flop dependency visualization.]
Author [Alan Mishchenko]
@@ -14,12 +14,15 @@
Date [Ver. 1.0. Started - June 20, 2005.]
- Revision [$Id: abc_.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+ Revision [$Id: abcFlop.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -28,21 +31,10 @@
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
-/**Function*************************************************************
-
- Synopsis []
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-
-
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcFpga.c b/src/base/abci/abcFpga.c
index b87edb6b..0c45c7d2 100644
--- a/src/base/abci/abcFpga.c
+++ b/src/base/abci/abcFpga.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "fpgaInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -57,7 +60,7 @@ Abc_Ntk_t * Abc_NtkFpga( Abc_Ntk_t * pNtk, float DelayTarget, int fRecovery, int
// print a warning about choice nodes
if ( (Num = Abc_NtkGetChoiceNum( pNtk )) )
- printf( "Performing LUT mapping with %d choices.\n", Num );
+ Abc_Print( 0, "Performing LUT mapping with %d choices.\n", Num );
// compute switching activity
fShowSwitching |= fSwitching;
@@ -156,7 +159,7 @@ Fpga_Man_t * Abc_NtkToFpga( Abc_Ntk_t * pNtk, int fRecovery, float * pSwitching,
// load the AIG into the mapper
vNodes = Abc_AigDfs( pNtk, 0, 0 );
pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
// add the node to the mapper
@@ -170,7 +173,7 @@ Fpga_Man_t * Abc_NtkToFpga( Abc_Ntk_t * pNtk, int fRecovery, float * pSwitching,
Fpga_NodeSetSwitching( pNodeFpga, pSwitching[pNode->Id] );
// set up the choice node
if ( Abc_AigNodeIsChoice( pNode ) )
- for ( pPrev = pNode, pFanin = pNode->pData; pFanin; pPrev = pFanin, pFanin = pFanin->pData )
+ for ( pPrev = pNode, pFanin = (Abc_Obj_t *)pNode->pData; pFanin; pPrev = pFanin, pFanin = (Abc_Obj_t *)pFanin->pData )
{
Fpga_NodeSetNextE( (Fpga_Node_t *)pPrev->pCopy, (Fpga_Node_t *)pFanin->pCopy );
Fpga_NodeSetRepr( (Fpga_Node_t *)pFanin->pCopy, (Fpga_Node_t *)pNode->pCopy );
@@ -267,7 +270,7 @@ Abc_Obj_t * Abc_NodeFromFpga_rec( Abc_Ntk_t * pNtkNew, Fpga_Node_t * pNodeFpga )
for ( i = 0; i < nLeaves; i++ )
Abc_ObjAddFanin( pNodeNew, Abc_NodeFromFpga_rec(pNtkNew, ppLeaves[i]) );
// derive the function of this node
- pNodeNew->pData = Fpga_TruthsCutBdd( pNtkNew->pManFunc, pCutBest ); Cudd_Ref( pNodeNew->pData );
+ pNodeNew->pData = Fpga_TruthsCutBdd( pNtkNew->pManFunc, pCutBest ); Cudd_Ref( (DdNode *)pNodeNew->pData );
Fpga_NodeSetData0( pNodeFpga, (char *)pNodeNew );
return pNodeNew;
}
@@ -277,3 +280,5 @@ Abc_Obj_t * Abc_NodeFromFpga_rec( Abc_Ntk_t * pNtkNew, Fpga_Node_t * pNodeFpga )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcFpgaFast.c b/src/base/abci/abcFpgaFast.c
index 356b855e..46572fa8 100644
--- a/src/base/abci/abcFpgaFast.c
+++ b/src/base/abci/abcFpgaFast.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "ivy.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -30,8 +33,8 @@ extern Ivy_Man_t * Abc_NtkIvyBefore( Abc_Ntk_t * pNtk, int fSeq, int fUseDc );
static Abc_Ntk_t * Ivy_ManFpgaToAbc( Abc_Ntk_t * pNtk, Ivy_Man_t * pMan );
static Abc_Obj_t * Ivy_ManToAbcFast_rec( Abc_Ntk_t * pNtkNew, Ivy_Man_t * pMan, Ivy_Obj_t * pObjIvy, Vec_Int_t * vNodes );
-static inline void Abc_ObjSetIvy2Abc( Ivy_Man_t * p, int IvyId, Abc_Obj_t * pObjAbc ) { assert(Vec_PtrEntry(p->pCopy, IvyId) == NULL); assert(!Abc_ObjIsComplement(pObjAbc)); Vec_PtrWriteEntry( p->pCopy, IvyId, pObjAbc ); }
-static inline Abc_Obj_t * Abc_ObjGetIvy2Abc( Ivy_Man_t * p, int IvyId ) { return Vec_PtrEntry( p->pCopy, IvyId ); }
+static inline void Abc_ObjSetIvy2Abc( Ivy_Man_t * p, int IvyId, Abc_Obj_t * pObjAbc ) { assert(Vec_PtrEntry((Vec_Ptr_t *)p->pCopy, IvyId) == NULL); assert(!Abc_ObjIsComplement(pObjAbc)); Vec_PtrWriteEntry( (Vec_Ptr_t *)p->pCopy, IvyId, pObjAbc ); }
+static inline Abc_Obj_t * Abc_ObjGetIvy2Abc( Ivy_Man_t * p, int IvyId ) { return (Abc_Obj_t *)Vec_PtrEntry( (Vec_Ptr_t *)p->pCopy, IvyId ); }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -118,7 +121,7 @@ Abc_Ntk_t * Ivy_ManFpgaToAbc( Abc_Ntk_t * pNtk, Ivy_Man_t * pMan )
// clone the node
pObj = Abc_NtkCloneObj( pObjAbc );
// set complemented functions
- pObj->pData = Hop_Not( pObjAbc->pData );
+ pObj->pData = Hop_Not( (Hop_Obj_t *)pObjAbc->pData );
// return the new node
pObjAbc = pObj;
}
@@ -126,7 +129,7 @@ Abc_Ntk_t * Ivy_ManFpgaToAbc( Abc_Ntk_t * pNtk, Ivy_Man_t * pMan )
Abc_ObjAddFanin( Abc_NtkCo(pNtkNew, i), pObjAbc );
}
Vec_IntFree( vNodes );
- Vec_PtrFree( pMan->pCopy );
+ Vec_PtrFree( (Vec_Ptr_t *)pMan->pCopy );
pMan->pCopy = NULL;
// remove dangling nodes
Abc_NtkCleanup( pNtkNew, 0 );
@@ -172,9 +175,9 @@ Abc_Obj_t * Ivy_ManToAbcFast_rec( Abc_Ntk_t * pNtkNew, Ivy_Man_t * pMan, Ivy_Obj
Ivy_ManForEachNodeVec( pMan, vNodes, pNodeIvy, i )
{
if ( i < Vec_IntSize(vSupp) )
- pNodeIvy->pEquiv = (Ivy_Obj_t *)Hop_IthVar( pNtkNew->pManFunc, i );
+ pNodeIvy->pEquiv = (Ivy_Obj_t *)Hop_IthVar( (Hop_Man_t *)pNtkNew->pManFunc, i );
else
- pNodeIvy->pEquiv = (Ivy_Obj_t *)Hop_And( pNtkNew->pManFunc, (Hop_Obj_t *)Ivy_ObjChild0Equiv(pNodeIvy), (Hop_Obj_t *)Ivy_ObjChild1Equiv(pNodeIvy) );
+ pNodeIvy->pEquiv = (Ivy_Obj_t *)Hop_And( (Hop_Man_t *)pNtkNew->pManFunc, (Hop_Obj_t *)Ivy_ObjChild0Equiv(pNodeIvy), (Hop_Obj_t *)Ivy_ObjChild1Equiv(pNodeIvy) );
}
// set the local function
pObjAbc->pData = (Abc_Obj_t *)pObjIvy->pEquiv;
@@ -188,3 +191,5 @@ Abc_Obj_t * Ivy_ManToAbcFast_rec( Abc_Ntk_t * pNtkNew, Ivy_Man_t * pMan, Ivy_Obj
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcFraig.c b/src/base/abci/abcFraig.c
index 1db939b2..1beab4f4 100644
--- a/src/base/abci/abcFraig.c
+++ b/src/base/abci/abcFraig.c
@@ -22,6 +22,9 @@
#include "fraig.h"
#include "main.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -54,14 +57,14 @@ static Abc_Obj_t * Abc_NodeFraigTrust( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode
***********************************************************************/
Abc_Ntk_t * Abc_NtkFraig( Abc_Ntk_t * pNtk, void * pParams, int fAllNodes, int fExdc )
{
- Fraig_Params_t * pPars = pParams;
+ Fraig_Params_t * pPars = (Fraig_Params_t *)pParams;
Abc_Ntk_t * pNtkNew;
Fraig_Man_t * pMan;
// check if EXDC is present
if ( fExdc && pNtk->pExdc == NULL )
fExdc = 0, printf( "Warning: Networks has no EXDC.\n" );
// perform fraiging
- pMan = Abc_NtkToFraig( pNtk, pParams, fAllNodes, fExdc );
+ pMan = (Fraig_Man_t *)Abc_NtkToFraig( pNtk, pParams, fAllNodes, fExdc );
// add algebraic choices
// if ( pPars->fChoicing )
// Fraig_ManAddChoices( pMan, 0, 6 );
@@ -109,7 +112,7 @@ void * Abc_NtkToFraig( Abc_Ntk_t * pNtk, void * pParams, int fAllNodes, int fExd
assert( Abc_NtkIsStrash(pNtk) );
// create the FRAIG manager
- pMan = Fraig_ManCreate( pParams );
+ pMan = Fraig_ManCreate( (Fraig_Params_t *)pParams );
// map the constant node
Abc_NtkCleanCopy( pNtk );
@@ -122,22 +125,18 @@ void * Abc_NtkToFraig( Abc_Ntk_t * pNtk, void * pParams, int fAllNodes, int fExd
vNodes = Abc_AigDfs( pNtk, fAllNodes, 0 );
if ( !fInternal )
pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjFaninNum(pNode) == 0 )
continue;
- if ( !fInternal ) {
- assert(pProgress);
+ if ( pProgress )
Extra_ProgressBarUpdate( pProgress, i, NULL );
- }
pNode->pCopy = (Abc_Obj_t *)Fraig_NodeAnd( pMan,
- Fraig_NotCond( Abc_ObjFanin0(pNode)->pCopy, Abc_ObjFaninC0(pNode) ),
- Fraig_NotCond( Abc_ObjFanin1(pNode)->pCopy, Abc_ObjFaninC1(pNode) ) );
+ Fraig_NotCond( Abc_ObjFanin0(pNode)->pCopy, (int)Abc_ObjFaninC0(pNode) ),
+ Fraig_NotCond( Abc_ObjFanin1(pNode)->pCopy, (int)Abc_ObjFaninC1(pNode) ) );
}
- if ( !fInternal ) {
- assert(pProgress);
+ if ( pProgress )
Extra_ProgressBarStop( pProgress );
- }
Vec_PtrFree( vNodes );
// use EXDC to change the mapping of nodes into FRAIG nodes
@@ -189,11 +188,11 @@ Fraig_Node_t * Abc_NtkToFraigExdc( Fraig_Man_t * pMan, Abc_Ntk_t * pNtkMain, Abc
// build FRAIG for each node
Abc_AigForEachAnd( pNtkStrash, pObj, i )
pObj->pCopy = (Abc_Obj_t *)Fraig_NodeAnd( pMan,
- Fraig_NotCond( Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) ),
- Fraig_NotCond( Abc_ObjFanin1(pObj)->pCopy, Abc_ObjFaninC1(pObj) ) );
+ Fraig_NotCond( Abc_ObjFanin0(pObj)->pCopy, (int)Abc_ObjFaninC0(pObj) ),
+ Fraig_NotCond( Abc_ObjFanin1(pObj)->pCopy, (int)Abc_ObjFaninC1(pObj) ) );
// get the EXDC to be returned
pObj = Abc_NtkPo( pNtkStrash, 0 );
- gResult = Fraig_NotCond( Abc_ObjFanin0(pObj)->pCopy, Abc_ObjFaninC0(pObj) );
+ gResult = Fraig_NotCond( Abc_ObjFanin0(pObj)->pCopy, (int)Abc_ObjFaninC0(pObj) );
Abc_NtkDelete( pNtkStrash );
return gResult;
}
@@ -262,7 +261,7 @@ void Abc_NtkFraigRemapUsingExdc( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk )
// restore the next pointers
Abc_NtkCleanNext( pNtk );
Abc_NtkForEachNode( pNtk, pNode, i )
- pNode->pNext = Vec_PtrEntry( vNexts, pNode->Id );
+ pNode->pNext = (Abc_Obj_t *)Vec_PtrEntry( vNexts, pNode->Id );
Vec_PtrFree( vNexts );
}
@@ -326,7 +325,7 @@ Abc_Obj_t * Abc_NodeFromFraig_rec( Abc_Ntk_t * pNtkNew, Fraig_Node_t * pNodeFrai
pRes0 = Abc_NodeFromFraig_rec( pNtkNew, Fraig_NodeReadOne(pNodeFraigR) );
pRes1 = Abc_NodeFromFraig_rec( pNtkNew, Fraig_NodeReadTwo(pNodeFraigR) );
// derive the new node
- pRes = Abc_AigAnd( pNtkNew->pManFunc, pRes0, pRes1 );
+ pRes = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pRes0, pRes1 );
pRes->fPhase = Fraig_NodeReadSimInv( pNodeFraigR );
// if the node has an equivalence class, find its representative
if ( Fraig_NodeReadRepr(pNodeFraigR) == NULL && Fraig_NodeReadNextE(pNodeFraigR) != NULL )
@@ -459,7 +458,7 @@ void Abc_NtkFromFraig2_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Ptr_t *
Abc_NodeSetTravIdCurrent( pNode );
assert( Abc_ObjIsNode( pNode ) );
// get the node's representative
- if ( (pRepr = Vec_PtrEntry(vNodeReprs, pNode->Id)) )
+ if ( (pRepr = (Abc_Obj_t *)Vec_PtrEntry(vNodeReprs, pNode->Id)) )
{
Abc_NtkFromFraig2_rec( pNtkNew, pRepr, vNodeReprs );
pNode->pCopy = Abc_ObjNotCond( pRepr->pCopy, pRepr->fPhase ^ pNode->fPhase );
@@ -467,7 +466,7 @@ void Abc_NtkFromFraig2_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Ptr_t *
}
Abc_NtkFromFraig2_rec( pNtkNew, Abc_ObjFanin0(pNode), vNodeReprs );
Abc_NtkFromFraig2_rec( pNtkNew, Abc_ObjFanin1(pNode), vNodeReprs );
- pNode->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
}
@@ -538,9 +537,9 @@ int Abc_NtkFraigTrustCheck( Abc_Ntk_t * pNtk )
nFanins = Abc_ObjFaninNum(pNode);
if ( nFanins < 2 )
continue;
- if ( nFanins == 2 && Abc_SopIsAndType(pNode->pData) )
+ if ( nFanins == 2 && Abc_SopIsAndType((char *)pNode->pData) )
continue;
- if ( !Abc_SopIsOrType(pNode->pData) )
+ if ( !Abc_SopIsOrType((char *)pNode->pData) )
return 0;
}
return 1;
@@ -567,7 +566,7 @@ void Abc_NtkFraigTrustOne( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
// perform strashing
vNodes = Abc_NtkDfs( pNtk, 0 );
pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
// get the node
@@ -608,18 +607,18 @@ Abc_Obj_t * Abc_NodeFraigTrust( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode )
assert( Abc_ObjIsNode(pNode) );
// get the number of node's fanins
nFanins = Abc_ObjFaninNum( pNode );
- assert( nFanins == Abc_SopGetVarNum(pNode->pData) );
+ assert( nFanins == Abc_SopGetVarNum((char *)pNode->pData) );
// check if it is a constant
if ( nFanins == 0 )
- return Abc_ObjNotCond( Abc_AigConst1(pNtkNew), Abc_SopIsConst0(pNode->pData) );
+ return Abc_ObjNotCond( Abc_AigConst1(pNtkNew), Abc_SopIsConst0((char *)pNode->pData) );
if ( nFanins == 1 )
- return Abc_ObjNotCond( Abc_ObjFanin0(pNode)->pCopy, Abc_SopIsInv(pNode->pData) );
- if ( nFanins == 2 && Abc_SopIsAndType(pNode->pData) )
- return Abc_AigAnd( pNtkNew->pManFunc,
- Abc_ObjNotCond( Abc_ObjFanin0(pNode)->pCopy, !Abc_SopGetIthCareLit(pNode->pData,0) ),
- Abc_ObjNotCond( Abc_ObjFanin1(pNode)->pCopy, !Abc_SopGetIthCareLit(pNode->pData,1) ) );
- assert( Abc_SopIsOrType(pNode->pData) );
- fCompl = Abc_SopGetIthCareLit(pNode->pData,0);
+ return Abc_ObjNotCond( Abc_ObjFanin0(pNode)->pCopy, Abc_SopIsInv((char *)pNode->pData) );
+ if ( nFanins == 2 && Abc_SopIsAndType((char *)pNode->pData) )
+ return Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc,
+ Abc_ObjNotCond( Abc_ObjFanin0(pNode)->pCopy, !Abc_SopGetIthCareLit((char *)pNode->pData,0) ),
+ Abc_ObjNotCond( Abc_ObjFanin1(pNode)->pCopy, !Abc_SopGetIthCareLit((char *)pNode->pData,1) ) );
+ assert( Abc_SopIsOrType((char *)pNode->pData) );
+ fCompl = Abc_SopGetIthCareLit((char *)pNode->pData,0);
// get the root of the choice node (the first fanin)
pSum = Abc_ObjFanin0(pNode)->pCopy;
// connect other fanins
@@ -631,7 +630,7 @@ Abc_Obj_t * Abc_NodeFraigTrust( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode )
*ppTail = pFanin->pCopy;
ppTail = &pFanin->pCopy->pData;
// set the complemented bit of this cut
- if ( fCompl ^ Abc_SopGetIthCareLit(pNode->pData, i) )
+ if ( fCompl ^ Abc_SopGetIthCareLit((char *)pNode->pData, i) )
pFanin->pCopy->fPhase = 1;
}
assert( *ppTail == NULL );
@@ -669,7 +668,7 @@ int Abc_NtkFraigStore( Abc_Ntk_t * pNtkAdd )
{
// check that the networks have the same PIs
// reorder PIs of pNtk2 according to pNtk1
- if ( !Abc_NtkCompareSignals( pNtk, Vec_PtrEntry(vStore, 0), 1, 1 ) )
+ if ( !Abc_NtkCompareSignals( pNtk, (Abc_Ntk_t *)Vec_PtrEntry(vStore, 0), 1, 1 ) )
{
printf( "Trying to store the network with different primary inputs.\n" );
printf( "The previously stored networks are deleted and this one is added.\n" );
@@ -709,11 +708,11 @@ Abc_Ntk_t * Abc_NtkFraigRestore()
return NULL;
}
// printf( "Currently stored %d networks will be fraiged.\n", Vec_PtrSize(vStore) );
- pNtk = Vec_PtrEntry( vStore, 0 );
+ pNtk = (Abc_Ntk_t *)Vec_PtrEntry( vStore, 0 );
// swap the first and last network
// this should lead to the primary choice being "better" because of synthesis
- pNtk = Vec_PtrPop( vStore );
+ pNtk = (Abc_Ntk_t *)Vec_PtrPop( vStore );
Vec_PtrPush( vStore, Vec_PtrEntry(vStore,0) );
Vec_PtrWriteEntry( vStore, 0, pNtk );
@@ -763,7 +762,7 @@ void Abc_NtkFraigStoreClean()
Abc_Ntk_t * pNtk;
int i;
vStore = Abc_FrameReadStore();
- Vec_PtrForEachEntry( vStore, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vStore, pNtk, i )
Abc_NtkDelete( pNtk );
Vec_PtrClear( vStore );
}
@@ -806,3 +805,5 @@ void Abc_NtkFraigStoreCheck( Abc_Ntk_t * pFraig )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcFxu.c b/src/base/abci/abcFxu.c
index 6109870e..bd030609 100644
--- a/src/base/abci/abcFxu.c
+++ b/src/base/abci/abcFxu.c
@@ -21,11 +21,14 @@
#include "abc.h"
#include "fxu.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static bool Abc_NtkFxuCheck( Abc_Ntk_t * pNtk );
+static int Abc_NtkFxuCheck( Abc_Ntk_t * pNtk );
static void Abc_NtkFxuCollectInfo( Abc_Ntk_t * pNtk, Fxu_Data_t * p );
static void Abc_NtkFxuReconstruct( Abc_Ntk_t * pNtk, Fxu_Data_t * p );
@@ -50,7 +53,7 @@ static void Abc_NtkFxuReconstruct( Abc_Ntk_t * pNtk, Fxu_Data_t * p );
SeeAlso []
***********************************************************************/
-bool Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
+int Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
{
assert( Abc_NtkIsLogic(pNtk) );
// if the network is already in the SOP form, it may come from BLIF file
@@ -103,7 +106,7 @@ bool Abc_NtkFastExtract( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
SeeAlso []
***********************************************************************/
-bool Abc_NtkFxuCheck( Abc_Ntk_t * pNtk )
+int Abc_NtkFxuCheck( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode, * pFanin1, * pFanin2;
int n, i, k;
@@ -141,7 +144,7 @@ void Abc_NtkFxuCollectInfo( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
Abc_Obj_t * pNode;
int i;
// add information to the manager
- p->pManSop = pNtk->pManFunc;
+ p->pManSop = (Extra_MmFlex_t *)pNtk->pManFunc;
p->vSops = Vec_PtrAlloc(0);
p->vFanins = Vec_PtrAlloc(0);
p->vSopsNew = Vec_PtrAlloc(0);
@@ -153,9 +156,9 @@ void Abc_NtkFxuCollectInfo( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
// add SOPs and fanin array
Abc_NtkForEachNode( pNtk, pNode, i )
{
- if ( Abc_SopGetVarNum(pNode->pData) < 2 )
+ if ( Abc_SopGetVarNum((char *)pNode->pData) < 2 )
continue;
- if ( Abc_SopGetCubeNum(pNode->pData) < 1 )
+ if ( Abc_SopGetCubeNum((char *)pNode->pData) < 1 )
continue;
p->vSops->pArray[i] = pNode->pData;
p->vFanins->pArray[i] = &pNode->vFanins;
@@ -181,7 +184,7 @@ void Abc_NtkFxuFreeInfo( Fxu_Data_t * p )
if ( p->vFaninsNew )
for ( i = 0; i < p->vFaninsNew->nSize; i++ )
if ( p->vFaninsNew->pArray[i] )
- Vec_IntFree( p->vFaninsNew->pArray[i] );
+ Vec_IntFree( (Vec_Int_t *)p->vFaninsNew->pArray[i] );
// free the arrays
if ( p->vSops ) Vec_PtrFree( p->vSops );
if ( p->vSopsNew ) Vec_PtrFree( p->vSopsNew );
@@ -219,14 +222,14 @@ void Abc_NtkFxuReconstruct( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
for ( i = 0; i < p->vFanins->nSize; i++ )
{
// the new array of fanins
- vFanins = p->vFaninsNew->pArray[i];
+ vFanins = (Vec_Int_t *)p->vFaninsNew->pArray[i];
if ( vFanins == NULL )
continue;
// remove old fanins
pNode = Abc_NtkObj( pNtk, i );
Abc_ObjRemoveFanins( pNode );
// add new fanins
- vFanins = p->vFaninsNew->pArray[i];
+ vFanins = (Vec_Int_t *)p->vFaninsNew->pArray[i];
for ( k = 0; k < vFanins->nSize; k++ )
{
pFanin = Abc_NtkObj( pNtk, vFanins->pArray[k] );
@@ -241,7 +244,7 @@ void Abc_NtkFxuReconstruct( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
// get the new node
pNode = Abc_NtkObj( pNtk, i );
// add the fanins
- vFanins = p->vFaninsNew->pArray[i];
+ vFanins = (Vec_Int_t *)p->vFaninsNew->pArray[i];
for ( k = 0; k < vFanins->nSize; k++ )
{
pFanin = Abc_NtkObj( pNtk, vFanins->pArray[k] );
@@ -258,3 +261,5 @@ void Abc_NtkFxuReconstruct( Abc_Ntk_t * pNtk, Fxu_Data_t * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcGen.c b/src/base/abci/abcGen.c
index f6111dfd..dc376826 100644
--- a/src/base/abci/abcGen.c
+++ b/src/base/abci/abcGen.c
@@ -20,6 +20,8 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -565,7 +567,7 @@ void Abc_GenOneHotIntervals( char * pFileName, int nPis, int nRegs, Vec_Ptr_t *
fprintf( pFile, "# One-hotness with %d vars and %d regs generated by ABC on %s\n", nPis, nRegs, Extra_TimeStamp() );
fprintf( pFile, "# Used %d intervals of 1-hot registers: { ", Vec_PtrSize(vOnehots) );
Counter = 0;
- Vec_PtrForEachEntry( vOnehots, vLine, k )
+ Vec_PtrForEachEntry( Vec_Int_t *, vOnehots, vLine, k )
{
fprintf( pFile, "%d ", Vec_IntSize(vLine) );
Counter += Vec_IntSize(vLine) * (Vec_IntSize(vLine) - 1) / 2;
@@ -583,7 +585,7 @@ void Abc_GenOneHotIntervals( char * pFileName, int nPis, int nRegs, Vec_Ptr_t *
fprintf( pFile, " o%0*d", nDigitsOut, i );
fprintf( pFile, "\n" );
Counter2 = 0;
- Vec_PtrForEachEntry( vOnehots, vLine, k )
+ Vec_PtrForEachEntry( Vec_Int_t *, vOnehots, vLine, k )
{
Vec_IntForEachEntry( vLine, iReg1, i )
Vec_IntForEachEntryStart( vLine, iReg2, j, i+1 )
@@ -599,8 +601,13 @@ void Abc_GenOneHotIntervals( char * pFileName, int nPis, int nRegs, Vec_Ptr_t *
fclose( pFile );
}
+ABC_NAMESPACE_IMPL_END
+
#include "aig.h"
+ABC_NAMESPACE_IMPL_START
+
+
/**Function*************************************************************
Synopsis [Generates structure of L K-LUTs implementing an N-var function.]
@@ -655,3 +662,5 @@ void Abc_GenRandom( char * pFileName, int nPis )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcHaig.c b/src/base/abci/abcHaig.c
index 3f3fefcd..b102e04f 100644
--- a/src/base/abci/abcHaig.c
+++ b/src/base/abci/abcHaig.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -169,7 +172,7 @@ Vec_Ptr_t * Abc_NtkHaigCollectMembers( Hop_Man_t * p )
Hop_Obj_t * pObj;
int i;
vObjs = Vec_PtrAlloc( 4098 );
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
if ( pObj->pData == NULL )
continue;
@@ -198,9 +201,9 @@ Vec_Ptr_t * Abc_NtkHaigCreateClasses( Vec_Ptr_t * vMembers )
// count classes
vClasses = Vec_PtrAlloc( 4098 );
- Vec_PtrForEachEntry( vMembers, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, vMembers, pObj, i )
{
- pRepr = pObj->pData;
+ pRepr = (Hop_Obj_t *)pObj->pData;
assert( pRepr->pData == NULL );
if ( pRepr->fMarkA == 0 ) // new
{
@@ -210,44 +213,44 @@ Vec_Ptr_t * Abc_NtkHaigCreateClasses( Vec_Ptr_t * vMembers )
}
// set representatives as representatives
- Vec_PtrForEachEntry( vClasses, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, vClasses, pObj, i )
{
pObj->fMarkA = 0;
pObj->pData = pObj;
}
// go through the members and update
- Vec_PtrForEachEntry( vMembers, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, vMembers, pObj, i )
{
- pRepr = pObj->pData;
+ pRepr = (Hop_Obj_t *)pObj->pData;
if ( ((Hop_Obj_t *)pRepr->pData)->Id > pObj->Id )
pRepr->pData = pObj;
}
// change representatives of the class
- Vec_PtrForEachEntry( vMembers, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, vMembers, pObj, i )
{
- pRepr = pObj->pData;
+ pRepr = (Hop_Obj_t *)pObj->pData;
pObj->pData = pRepr->pData;
assert( ((Hop_Obj_t *)pObj->pData)->Id <= pObj->Id );
}
// update classes
- Vec_PtrForEachEntry( vClasses, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, vClasses, pObj, i )
{
- pRepr = pObj->pData;
+ pRepr = (Hop_Obj_t *)pObj->pData;
assert( pRepr->pData == pRepr );
// pRepr->pData = NULL;
Vec_PtrWriteEntry( vClasses, i, pRepr );
Vec_PtrPush( vMembers, pObj );
}
- Vec_PtrForEachEntry( vMembers, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, vMembers, pObj, i )
if ( pObj->pData == pObj )
pObj->pData = NULL;
/*
- Vec_PtrForEachEntry( vMembers, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, vMembers, pObj, i )
{
printf( "ObjId = %4d : ", pObj->Id );
if ( pObj->pData == NULL )
@@ -280,7 +283,7 @@ int Abc_NtkHaigCountFans( Hop_Man_t * p )
{
Hop_Obj_t * pObj;
int i, Counter = 0;
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
if ( pObj->pData == NULL )
continue;
@@ -309,7 +312,7 @@ static inline Hop_Obj_t * Hop_ObjReprHop( Hop_Obj_t * pObj )
assert( pObj->pNext != NULL );
if ( pObj->pData == NULL )
return pObj->pNext;
- pRepr = pObj->pData;
+ pRepr = (Hop_Obj_t *)pObj->pData;
assert( pRepr->pData == pRepr );
return Hop_NotCond( pRepr->pNext, pObj->fPhase ^ pRepr->fPhase );
}
@@ -344,7 +347,7 @@ Hop_Man_t * Abc_NtkHaigReconstruct( Hop_Man_t * p )
Hop_Man_t * pNew;
Hop_Obj_t * pObj;
int i, Counter = 0;
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
pObj->pNext = NULL;
// start the HOP package
pNew = Hop_ManStart();
@@ -356,7 +359,7 @@ Hop_Man_t * Abc_NtkHaigReconstruct( Hop_Man_t * p )
Hop_ManForEachPi( p, pObj, i )
pObj->pNext = Hop_ObjCreatePi(pNew);
// map the internal nodes
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
if ( !Hop_ObjIsNode(pObj) )
continue;
@@ -414,7 +417,7 @@ int Abc_NtkHaigCheckTfi_rec( Abc_Obj_t * pNode, Abc_Obj_t * pOld )
if ( Abc_NtkHaigCheckTfi_rec( Abc_ObjFanin1(pNode), pOld ) )
return 1;
// check equivalent nodes
- return Abc_NtkHaigCheckTfi_rec( pNode->pData, pOld );
+ return Abc_NtkHaigCheckTfi_rec( (Abc_Obj_t *)pNode->pData, pOld );
}
/**Function*************************************************************
@@ -478,11 +481,11 @@ Abc_Ntk_t * Abc_NtkHaigRecreateAig( Abc_Ntk_t * pNtk, Hop_Man_t * p )
pObj->pNext = (Hop_Obj_t *)Abc_NtkCi( pNtkAig, i );
// construct new nodes
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
if ( !Hop_ObjIsNode(pObj) )
continue;
- pObj->pNext = (Hop_Obj_t *)Abc_AigAnd( pNtkAig->pManFunc, Hop_ObjChild0Next(pObj), Hop_ObjChild1Next(pObj) );
+ pObj->pNext = (Hop_Obj_t *)Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Hop_ObjChild0Next(pObj), Hop_ObjChild1Next(pObj) );
assert( !Hop_IsComplement(pObj->pNext) );
}
@@ -491,7 +494,7 @@ Abc_Ntk_t * Abc_NtkHaigRecreateAig( Abc_Ntk_t * pNtk, Hop_Man_t * p )
Abc_ObjAddFanin( pObjOld->pCopy, Hop_ObjChild0Next(Hop_ManPo(p,i)) );
// construct choice nodes
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
// skip the node without choices
if ( pObj->pData == NULL )
@@ -500,7 +503,7 @@ Abc_Ntk_t * Abc_NtkHaigRecreateAig( Abc_Ntk_t * pNtk, Hop_Man_t * p )
if ( pObj->pData == pObj )
continue;
// do not create choices for constant 1 and PIs
- if ( !Hop_ObjIsNode(pObj->pData) )
+ if ( !Hop_ObjIsNode((Hop_Obj_t *)pObj->pData) )
continue;
// get the corresponding new nodes
pObjAbcThis = (Abc_Obj_t *)pObj->pNext;
@@ -516,7 +519,7 @@ Abc_Ntk_t * Abc_NtkHaigRecreateAig( Abc_Ntk_t * pNtk, Hop_Man_t * p )
{
// find the last node in the class
while ( pObjAbcRepr->pData )
- pObjAbcRepr = pObjAbcRepr->pData;
+ pObjAbcRepr = (Abc_Obj_t *)pObjAbcRepr->pData;
// add the new node at the end of the list
pObjAbcRepr->pData = pObjAbcThis;
}
@@ -579,10 +582,10 @@ int Abc_NtkHaigResetReprs( Hop_Man_t * p )
Hop_Obj_t * pObj, * pRepr;
int i, nClasses, nMembers, nFanouts, nNormals;
// clear self-classes
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
// fix the strange situation of double-loop
- pRepr = pObj->pData;
+ pRepr = (Hop_Obj_t *)pObj->pData;
if ( pRepr && pRepr->pData == pObj )
pRepr->pData = pRepr;
// remove self-loops
@@ -590,7 +593,7 @@ int Abc_NtkHaigResetReprs( Hop_Man_t * p )
pObj->pData = NULL;
}
// set representatives
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
if ( pObj->pData == NULL )
continue;
@@ -601,7 +604,7 @@ int Abc_NtkHaigResetReprs( Hop_Man_t * p )
pObj->pData = pRepr;
}
// make each class point to the smallest topological order
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
if ( pObj->pData == NULL )
continue;
@@ -616,7 +619,7 @@ int Abc_NtkHaigResetReprs( Hop_Man_t * p )
}
// count classes, members, and fanouts - and verify
nMembers = nClasses = nFanouts = nNormals = 0;
- Vec_PtrForEachEntry( p->vObjs, pObj, i )
+ Vec_PtrForEachEntry( Hop_Obj_t *, p->vObjs, pObj, i )
{
if ( pObj->pData == NULL )
continue;
@@ -731,3 +734,5 @@ Abc_Ntk_t * Abc_NtkHopRemoveLoops( Abc_Ntk_t * pNtk, Hop_Man_t * pMan )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcIf.c b/src/base/abci/abcIf.c
index facf06bc..82e968bd 100644
--- a/src/base/abci/abcIf.c
+++ b/src/base/abci/abcIf.c
@@ -23,6 +23,9 @@
#include "kit.h"
#include "aig.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -64,14 +67,14 @@ void Abc_NtkIfComputeSwitching( Abc_Ntk_t * pNtk, If_Man_t * pIfMan )
int i, clk = clock();
// map IF objects into old network
Abc_NtkForEachObj( pNtk, pObjAbc, i )
- if ( (pObjIf = pObjAbc->pTemp) )
+ if ( (pObjIf = (If_Obj_t *)pObjAbc->pTemp) )
pObjIf->pCopy = pObjAbc;
// map network into an AIG
pAig = Abc_NtkToDar( pNtk, 0, 0 );
vSwitching = Saig_ManComputeSwitchProbs( pAig, 48, 16, 0 );
pSwitching = (float *)vSwitching->pArray;
Abc_NtkForEachObj( pNtk, pObjAbc, i )
- if ( (pObjAig = pObjAbc->pTemp) )
+ if ( (pObjAig = (Aig_Obj_t *)pObjAbc->pTemp) )
{
pObjAbc->dTemp = pSwitching[pObjAig->Id];
// J. Anderson and F. N. Najm, “Power-Aware Technology Mapping for LUT-Based FPGAs,”
@@ -85,7 +88,7 @@ void Abc_NtkIfComputeSwitching( Abc_Ntk_t * pNtk, If_Man_t * pIfMan )
pIfMan->vSwitching = Vec_IntStart( If_ManObjNum(pIfMan) );
pSwitching = (float *)pIfMan->vSwitching->pArray;
If_ManForEachObj( pIfMan, pObjIf, i )
- if ( (pObjAbc = pObjIf->pCopy) )
+ if ( (pObjAbc = (Abc_Obj_t *)pObjIf->pCopy) )
pSwitching[i] = pObjAbc->dTemp;
if ( pIfMan->pPars->fVerbose )
{
@@ -199,7 +202,7 @@ If_Man_t * Abc_NtkToIf( Abc_Ntk_t * pNtk, If_Par_t * pPars )
// load the AIG into the mapper
pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
// Abc_AigForEachAnd( pNtk, pNode, i )
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
Extra_ProgressBarUpdate( pProgress, i, "Initial" );
// add the node to the mapper
@@ -210,7 +213,7 @@ If_Man_t * Abc_NtkToIf( Abc_Ntk_t * pNtk, If_Par_t * pPars )
if ( Abc_AigNodeIsChoice( pNode ) )
{
pIfMan->nChoices++;
- for ( pPrev = pNode, pFanin = pNode->pData; pFanin; pPrev = pFanin, pFanin = pFanin->pData )
+ for ( pPrev = pNode, pFanin = (Abc_Obj_t *)pNode->pData; pFanin; pPrev = pFanin, pFanin = (Abc_Obj_t *)pFanin->pData )
If_ObjSetChoice( (If_Obj_t *)pPrev->pCopy, (If_Obj_t *)pFanin->pCopy );
If_ManCreateChoice( pIfMan, (If_Obj_t *)pNode->pCopy );
}
@@ -285,6 +288,71 @@ Abc_Ntk_t * Abc_NtkFromIf( If_Man_t * pIfMan, Abc_Ntk_t * pNtk )
return pNtkNew;
}
+
+/**Function*************************************************************
+
+ Synopsis [Inserts the entry while sorting them by delay.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Hop_Obj_t * Abc_NodeTruthToHopInt( Hop_Man_t * pMan, Vec_Wrd_t * vAnds, int nVars )
+{
+ Vec_Ptr_t * vResults;
+ Hop_Obj_t * pRes0, * pRes1, * pRes;
+ If_And_t This;
+ word Entry;
+ int i;
+ if ( Vec_WrdSize(vAnds) == 0 )
+ return Hop_ManConst0(pMan);
+ if ( Vec_WrdSize(vAnds) == 1 && Vec_WrdEntry(vAnds,0) == 0 )
+ return Hop_ManConst1(pMan);
+ vResults = Vec_PtrAlloc( Vec_WrdSize(vAnds) );
+ for ( i = 0; i < nVars; i++ )
+ Vec_PtrPush( vResults, Hop_IthVar(pMan, i) );
+ Vec_WrdForEachEntryStart( vAnds, Entry, i, nVars )
+ {
+ This = If_WrdToAnd( Entry );
+ pRes0 = Hop_NotCond( (Hop_Obj_t *)Vec_PtrEntry(vResults, This.iFan0), This.fCompl0 );
+ pRes1 = Hop_NotCond( (Hop_Obj_t *)Vec_PtrEntry(vResults, This.iFan1), This.fCompl1 );
+ pRes = Hop_And( pMan, pRes0, pRes1 );
+ Vec_PtrPush( vResults, pRes );
+/*
+ printf( "fan0 = %c%d fan1 = %c%d Del = %d\n",
+ This.fCompl0? '-':'+', This.iFan0,
+ This.fCompl1? '-':'+', This.iFan1,
+ This.Delay );
+*/
+ }
+ Vec_PtrFree( vResults );
+ return Hop_NotCond( pRes, This.fCompl );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Creates the mapped network.]
+
+ Description [Assuming the copy field of the mapped nodes are NULL.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Hop_Obj_t * Abc_NodeTruthToHop( Hop_Man_t * pMan, If_Man_t * p, If_Cut_t * pCut )
+{
+ Hop_Obj_t * pResult;
+ Vec_Wrd_t * vArray;
+ vArray = If_CutDelaySopArray( p, pCut );
+ pResult = Abc_NodeTruthToHopInt( pMan, vArray, If_CutLeaveNum(pCut) );
+ Vec_WrdFree( vArray );
+ return pResult;
+}
+
/**Function*************************************************************
Synopsis [Derive one node after FPGA mapping.]
@@ -311,8 +379,10 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
// create a new node
pNodeNew = Abc_NtkCreateNode( pNtkNew );
pCutBest = If_ObjCutBest( pIfObj );
+// printf( "%d 0x%02X %d\n", pCutBest->nLeaves, 0xff & *If_CutTruth(pCutBest), pIfMan->pPars->pFuncCost(pCutBest) );
// if ( pIfMan->pPars->pLutLib && pIfMan->pPars->pLutLib->fVarPinDelays )
- If_CutRotatePins( pIfMan, pCutBest );
+ if ( !pIfMan->pPars->fDelayOpt )
+ If_CutRotatePins( pIfMan, pCutBest );
if ( pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
{
If_CutForEachLeafReverse( pIfMan, pCutBest, pIfLeaf, i )
@@ -331,12 +401,12 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
if ( pIfMan->pPars->fUseBdds )
{
// transform truth table into the BDD
- pNodeNew->pData = Kit_TruthToBdd( pNtkNew->pManFunc, If_CutTruth(pCutBest), If_CutLeaveNum(pCutBest), 0 ); Cudd_Ref(pNodeNew->pData);
+ pNodeNew->pData = Kit_TruthToBdd( (DdManager *)pNtkNew->pManFunc, If_CutTruth(pCutBest), If_CutLeaveNum(pCutBest), 0 ); Cudd_Ref((DdNode *)pNodeNew->pData);
}
else if ( pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
{
// transform truth table into the BDD
- pNodeNew->pData = Kit_TruthToBdd( pNtkNew->pManFunc, If_CutTruth(pCutBest), If_CutLeaveNum(pCutBest), 1 ); Cudd_Ref(pNodeNew->pData);
+ pNodeNew->pData = Kit_TruthToBdd( (DdManager *)pNtkNew->pManFunc, If_CutTruth(pCutBest), If_CutLeaveNum(pCutBest), 1 ); Cudd_Ref((DdNode *)pNodeNew->pData);
}
else if ( pIfMan->pPars->fUseSops )
{
@@ -347,21 +417,26 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
if ( Vec_IntSize(vCover) == 0 || (Vec_IntSize(vCover) == 1 && Vec_IntEntry(vCover,0) == 0) )
{
assert( RetValue == 0 );
- pNodeNew->pData = Abc_SopCreateAnd( pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), NULL );
+ pNodeNew->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), NULL );
pNodeNew = (Vec_IntSize(vCover) == 0) ? Abc_NtkCreateNodeConst0(pNtkNew) : Abc_NtkCreateNodeConst1(pNtkNew);
}
else
{
// derive the AIG for that tree
- pNodeNew->pData = Abc_SopCreateFromIsop( pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), vCover );
+ pNodeNew->pData = Abc_SopCreateFromIsop( (Extra_MmFlex_t *)pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), vCover );
if ( RetValue )
- Abc_SopComplement( pNodeNew->pData );
+ Abc_SopComplement( (char *)pNodeNew->pData );
}
}
- else
+ else if ( pIfMan->pPars->fDelayOpt )
+ {
+ extern Hop_Obj_t * Abc_NodeTruthToHop( Hop_Man_t * pMan, If_Man_t * pIfMan, If_Cut_t * pCut );
+ pNodeNew->pData = Abc_NodeTruthToHop( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest );
+ }
+ else
{
extern Hop_Obj_t * Kit_TruthToHop( Hop_Man_t * pMan, unsigned * pTruth, int nVars, Vec_Int_t * vMemory );
- pNodeNew->pData = Kit_TruthToHop( pNtkNew->pManFunc, If_CutTruth(pCutBest), If_CutLeaveNum(pCutBest), vCover );
+ pNodeNew->pData = Kit_TruthToHop( (Hop_Man_t *)pNtkNew->pManFunc, If_CutTruth(pCutBest), If_CutLeaveNum(pCutBest), vCover );
}
// complement the node if the cut was complemented
if ( pCutBest->fCompl )
@@ -369,9 +444,18 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
}
else
{
- pNodeNew->pData = Abc_NodeIfToHop( pNtkNew->pManFunc, pIfMan, pIfObj );
+ pNodeNew->pData = Abc_NodeIfToHop( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pIfObj );
}
If_ObjSetCopy( pIfObj, pNodeNew );
+/*
+printf( "%3d : Delay = %d Cutsize = %d\n", pNodeNew->Id, (int)pCutBest->Delay, pCutBest->nLeaves );
+{
+ Abc_Obj_t * pFanin;
+ int i;
+Abc_ObjForEachFanin( pNodeNew, pFanin, i )
+printf( "fanin%d = %2d\n", i, pFanin->Id );
+}
+*/
return pNodeNew;
}
@@ -394,7 +478,7 @@ Hop_Obj_t * Abc_NodeIfToHop_rec( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_
pCut = If_ObjCutBest(pIfObj);
// if the cut is visited, return the result
if ( If_CutData(pCut) )
- return If_CutData(pCut);
+ return (Hop_Obj_t *)If_CutData(pCut);
// compute the functions of the children
gFunc0 = Abc_NodeIfToHop_rec( pHopMan, pIfMan, pIfObj->pFanin0, vVisited );
gFunc1 = Abc_NodeIfToHop_rec( pHopMan, pIfMan, pIfObj->pFanin1, vVisited );
@@ -428,14 +512,14 @@ Hop_Obj_t * Abc_NodeIfToHop2_rec( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj
pCut = If_ObjCutBest(pIfObj);
// if the cut is visited, return the result
if ( If_CutData(pCut) )
- return If_CutData(pCut);
+ return (Hop_Obj_t *)If_CutData(pCut);
// mark the node as visited
Vec_PtrPush( vVisited, pCut );
// insert the worst case
If_CutSetData( pCut, (void *)1 );
// skip in case of primary input
if ( If_ObjIsCi(pIfObj) )
- return If_CutData(pCut);
+ return (Hop_Obj_t *)If_CutData(pCut);
// compute the functions of the children
for ( pTemp = pIfObj; pTemp; pTemp = pTemp->pEquiv )
{
@@ -452,7 +536,7 @@ Hop_Obj_t * Abc_NodeIfToHop2_rec( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj
If_CutSetData( pCut, gFunc );
break;
}
- return If_CutData(pCut);
+ return (Hop_Obj_t *)If_CutData(pCut);
}
/**Function*************************************************************
@@ -490,7 +574,7 @@ Hop_Obj_t * Abc_NodeIfToHop( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_t *
// clean the cuts
If_CutForEachLeaf( pIfMan, pCut, pLeaf, i )
If_CutSetData( If_ObjCutBest(pLeaf), NULL );
- Vec_PtrForEachEntry( pIfMan->vTemp, pCut, i )
+ Vec_PtrForEachEntry( If_Cut_t *, pIfMan->vTemp, pCut, i )
If_CutSetData( pCut, NULL );
return gFunc;
}
@@ -590,14 +674,14 @@ Vec_Ptr_t * Abc_NtkFindGoodOrder( Abc_Ntk_t * pNtk )
qsort( (Abc_Obj_t **)Vec_PtrArray(vCos), Abc_NtkCoNum(pNtk),
sizeof(Abc_Obj_t *), (int (*)(const void *, const void *))Abc_ObjCompareFlow );
// verify sorting
- pFanin0 = Vec_PtrEntry(vCos, 0);
- pFanin1 = Vec_PtrEntryLast(vCos);
+ pFanin0 = (Abc_Obj_t *)Vec_PtrEntry(vCos, 0);
+ pFanin1 = (Abc_Obj_t *)Vec_PtrEntryLast(vCos);
assert( Abc_Int2Float((int)(ABC_PTRINT_T)pFanin0->pCopy) >= Abc_Int2Float((int)(ABC_PTRINT_T)pFanin1->pCopy) );
// collect the nodes in the topological order from the new array
Abc_NtkIncrementTravId( pNtk );
vNodes = Vec_PtrAlloc( 100 );
- Vec_PtrForEachEntry( vCos, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vCos, pNode, i )
{
Abc_NtkFindGoodOrder_rec( Abc_ObjFanin0(pNode), vNodes );
// printf( "%.2f ", Abc_Int2Float((int)pNode->pCopy) );
@@ -613,3 +697,5 @@ Vec_Ptr_t * Abc_NtkFindGoodOrder( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcIfMux.c b/src/base/abci/abcIfMux.c
new file mode 100644
index 00000000..bf9d6cff
--- /dev/null
+++ b/src/base/abci/abcIfMux.c
@@ -0,0 +1,422 @@
+/**CFile****************************************************************
+
+ FileName [abcIf.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [Interface with the FPGA mapping package.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - November 21, 2006.]
+
+ Revision [$Id: abcIf.c,v 1.00 2006/11/21 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "if.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int Abc_NtkFuncCof0( int t, int v )
+{
+ static int s_Truth[3] = { 0xAA, 0xCC, 0xF0 };
+ return 0xff & ((t & ~s_Truth[v]) | ((t & ~s_Truth[v]) << (1<<v)));
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int Abc_NtkFuncCof1( int t, int v )
+{
+ static int s_Truth[3] = { 0xAA, 0xCC, 0xF0 };
+ return 0xff & ((t & s_Truth[v]) | ((t & s_Truth[v]) >> (1<<v)));
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int Abc_NtkFuncHasVar( int t, int v )
+{
+ static int s_Truth[3] = { 0xAA, 0xCC, 0xF0 };
+ return ((t & s_Truth[v]) >> (1<<v)) != (t & ~s_Truth[v]);
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int Abc_NtkFuncSuppSize( int t )
+{
+ return Abc_NtkFuncHasVar(t, 0) + Abc_NtkFuncHasVar(t, 1) + Abc_NtkFuncHasVar(t, 2);
+}
+
+/**Function*************************************************************
+
+ Synopsis [Precomputes MUXes and functions of less than 3 inputs.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkCutCostMuxPrecompute()
+{
+ int i, Value;
+ int CounterM = 0;
+ for ( i = 0; i < 256; i++ )
+ {
+ Value = 0;
+ if ( Abc_NtkFuncSuppSize( i ) < 3 )
+ Value = 1;
+ else
+ {
+ if ( (Abc_NtkFuncSuppSize(Abc_NtkFuncCof0(i,0)) == 1 && Abc_NtkFuncSuppSize(Abc_NtkFuncCof1(i,0)) == 1) ||
+ (Abc_NtkFuncSuppSize(Abc_NtkFuncCof0(i,1)) == 1 && Abc_NtkFuncSuppSize(Abc_NtkFuncCof1(i,1)) == 1) ||
+ (Abc_NtkFuncSuppSize(Abc_NtkFuncCof0(i,2)) == 1 && Abc_NtkFuncSuppSize(Abc_NtkFuncCof1(i,2)) == 1) )
+ {
+ Value = 1;
+ CounterM++;
+ }
+ }
+ printf( "%d, // %3d 0x%02X\n", Value, i, i );
+ }
+ printf( "Total number of MUXes = %d.\n", CounterM );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Procedure returning the cost of the cut.]
+
+ Description [The number of MUXes needed to implement the function.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkCutCostMux( If_Cut_t * pCut )
+{
+ static char uLookup[256] = {
+ 1, // 0 0x00
+ 0, // 1 0x01
+ 0, // 2 0x02
+ 1, // 3 0x03
+ 0, // 4 0x04
+ 1, // 5 0x05
+ 0, // 6 0x06
+ 0, // 7 0x07
+ 0, // 8 0x08
+ 0, // 9 0x09
+ 1, // 10 0x0A
+ 0, // 11 0x0B
+ 1, // 12 0x0C
+ 0, // 13 0x0D
+ 0, // 14 0x0E
+ 1, // 15 0x0F
+ 0, // 16 0x10
+ 1, // 17 0x11
+ 0, // 18 0x12
+ 0, // 19 0x13
+ 0, // 20 0x14
+ 0, // 21 0x15
+ 0, // 22 0x16
+ 0, // 23 0x17
+ 0, // 24 0x18
+ 0, // 25 0x19
+ 0, // 26 0x1A
+ 1, // 27 0x1B
+ 0, // 28 0x1C
+ 1, // 29 0x1D
+ 0, // 30 0x1E
+ 0, // 31 0x1F
+ 0, // 32 0x20
+ 0, // 33 0x21
+ 1, // 34 0x22
+ 0, // 35 0x23
+ 0, // 36 0x24
+ 0, // 37 0x25
+ 0, // 38 0x26
+ 1, // 39 0x27
+ 0, // 40 0x28
+ 0, // 41 0x29
+ 0, // 42 0x2A
+ 0, // 43 0x2B
+ 0, // 44 0x2C
+ 0, // 45 0x2D
+ 1, // 46 0x2E
+ 0, // 47 0x2F
+ 1, // 48 0x30
+ 0, // 49 0x31
+ 0, // 50 0x32
+ 1, // 51 0x33
+ 0, // 52 0x34
+ 1, // 53 0x35
+ 0, // 54 0x36
+ 0, // 55 0x37
+ 0, // 56 0x38
+ 0, // 57 0x39
+ 1, // 58 0x3A
+ 0, // 59 0x3B
+ 1, // 60 0x3C
+ 0, // 61 0x3D
+ 0, // 62 0x3E
+ 1, // 63 0x3F
+ 0, // 64 0x40
+ 0, // 65 0x41
+ 0, // 66 0x42
+ 0, // 67 0x43
+ 1, // 68 0x44
+ 0, // 69 0x45
+ 0, // 70 0x46
+ 1, // 71 0x47
+ 0, // 72 0x48
+ 0, // 73 0x49
+ 0, // 74 0x4A
+ 0, // 75 0x4B
+ 0, // 76 0x4C
+ 0, // 77 0x4D
+ 1, // 78 0x4E
+ 0, // 79 0x4F
+ 1, // 80 0x50
+ 0, // 81 0x51
+ 0, // 82 0x52
+ 1, // 83 0x53
+ 0, // 84 0x54
+ 1, // 85 0x55
+ 0, // 86 0x56
+ 0, // 87 0x57
+ 0, // 88 0x58
+ 0, // 89 0x59
+ 1, // 90 0x5A
+ 0, // 91 0x5B
+ 1, // 92 0x5C
+ 0, // 93 0x5D
+ 0, // 94 0x5E
+ 1, // 95 0x5F
+ 0, // 96 0x60
+ 0, // 97 0x61
+ 0, // 98 0x62
+ 0, // 99 0x63
+ 0, // 100 0x64
+ 0, // 101 0x65
+ 1, // 102 0x66
+ 0, // 103 0x67
+ 0, // 104 0x68
+ 0, // 105 0x69
+ 0, // 106 0x6A
+ 0, // 107 0x6B
+ 0, // 108 0x6C
+ 0, // 109 0x6D
+ 0, // 110 0x6E
+ 0, // 111 0x6F
+ 0, // 112 0x70
+ 0, // 113 0x71
+ 1, // 114 0x72
+ 0, // 115 0x73
+ 1, // 116 0x74
+ 0, // 117 0x75
+ 0, // 118 0x76
+ 1, // 119 0x77
+ 0, // 120 0x78
+ 0, // 121 0x79
+ 0, // 122 0x7A
+ 0, // 123 0x7B
+ 0, // 124 0x7C
+ 0, // 125 0x7D
+ 0, // 126 0x7E
+ 0, // 127 0x7F
+ 0, // 128 0x80
+ 0, // 129 0x81
+ 0, // 130 0x82
+ 0, // 131 0x83
+ 0, // 132 0x84
+ 0, // 133 0x85
+ 0, // 134 0x86
+ 0, // 135 0x87
+ 1, // 136 0x88
+ 0, // 137 0x89
+ 0, // 138 0x8A
+ 1, // 139 0x8B
+ 0, // 140 0x8C
+ 1, // 141 0x8D
+ 0, // 142 0x8E
+ 0, // 143 0x8F
+ 0, // 144 0x90
+ 0, // 145 0x91
+ 0, // 146 0x92
+ 0, // 147 0x93
+ 0, // 148 0x94
+ 0, // 149 0x95
+ 0, // 150 0x96
+ 0, // 151 0x97
+ 0, // 152 0x98
+ 1, // 153 0x99
+ 0, // 154 0x9A
+ 0, // 155 0x9B
+ 0, // 156 0x9C
+ 0, // 157 0x9D
+ 0, // 158 0x9E
+ 0, // 159 0x9F
+ 1, // 160 0xA0
+ 0, // 161 0xA1
+ 0, // 162 0xA2
+ 1, // 163 0xA3
+ 0, // 164 0xA4
+ 1, // 165 0xA5
+ 0, // 166 0xA6
+ 0, // 167 0xA7
+ 0, // 168 0xA8
+ 0, // 169 0xA9
+ 1, // 170 0xAA
+ 0, // 171 0xAB
+ 1, // 172 0xAC
+ 0, // 173 0xAD
+ 0, // 174 0xAE
+ 1, // 175 0xAF
+ 0, // 176 0xB0
+ 1, // 177 0xB1
+ 0, // 178 0xB2
+ 0, // 179 0xB3
+ 0, // 180 0xB4
+ 0, // 181 0xB5
+ 0, // 182 0xB6
+ 0, // 183 0xB7
+ 1, // 184 0xB8
+ 0, // 185 0xB9
+ 0, // 186 0xBA
+ 1, // 187 0xBB
+ 0, // 188 0xBC
+ 0, // 189 0xBD
+ 0, // 190 0xBE
+ 0, // 191 0xBF
+ 1, // 192 0xC0
+ 0, // 193 0xC1
+ 0, // 194 0xC2
+ 1, // 195 0xC3
+ 0, // 196 0xC4
+ 1, // 197 0xC5
+ 0, // 198 0xC6
+ 0, // 199 0xC7
+ 0, // 200 0xC8
+ 0, // 201 0xC9
+ 1, // 202 0xCA
+ 0, // 203 0xCB
+ 1, // 204 0xCC
+ 0, // 205 0xCD
+ 0, // 206 0xCE
+ 1, // 207 0xCF
+ 0, // 208 0xD0
+ 1, // 209 0xD1
+ 0, // 210 0xD2
+ 0, // 211 0xD3
+ 0, // 212 0xD4
+ 0, // 213 0xD5
+ 0, // 214 0xD6
+ 0, // 215 0xD7
+ 1, // 216 0xD8
+ 0, // 217 0xD9
+ 0, // 218 0xDA
+ 0, // 219 0xDB
+ 0, // 220 0xDC
+ 1, // 221 0xDD
+ 0, // 222 0xDE
+ 0, // 223 0xDF
+ 0, // 224 0xE0
+ 0, // 225 0xE1
+ 1, // 226 0xE2
+ 0, // 227 0xE3
+ 1, // 228 0xE4
+ 0, // 229 0xE5
+ 0, // 230 0xE6
+ 0, // 231 0xE7
+ 0, // 232 0xE8
+ 0, // 233 0xE9
+ 0, // 234 0xEA
+ 0, // 235 0xEB
+ 0, // 236 0xEC
+ 0, // 237 0xED
+ 1, // 238 0xEE
+ 0, // 239 0xEF
+ 1, // 240 0xF0
+ 0, // 241 0xF1
+ 0, // 242 0xF2
+ 1, // 243 0xF3
+ 0, // 244 0xF4
+ 1, // 245 0xF5
+ 0, // 246 0xF6
+ 0, // 247 0xF7
+ 0, // 248 0xF8
+ 0, // 249 0xF9
+ 1, // 250 0xFA
+ 0, // 251 0xFB
+ 1, // 252 0xFC
+ 0, // 253 0xFD
+ 0, // 254 0xFE
+ 1 // 255 0xFF
+ };
+ if ( pCut->nLeaves < 3 )
+ return 1;
+ if ( pCut->nLeaves == 3 && uLookup[0xff & *If_CutTruth(pCut)] )
+ return 1;
+ return (1 << pCut->nLeaves) - 1;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcIvy.c b/src/base/abci/abcIvy.c
index 904d612b..759c96a7 100644
--- a/src/base/abci/abcIvy.c
+++ b/src/base/abci/abcIvy.c
@@ -20,8 +20,19 @@
#include "abc.h"
#include "dec.h"
+#include "fra.h"
#include "ivy.h"
#include "fraig.h"
+#include "mio.h"
+#include "aig.h"
+
+ABC_NAMESPACE_IMPL_START
+
+extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
+extern void Aig_ManStop( Aig_Man_t * pMan );
+//extern int Fra_FraigSat( Aig_Man_t * pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fFlipBits, int fAndOuts, int fVerbose );
+extern Ivy_Obj_t * Dec_GraphToNetworkIvy( Ivy_Man_t * pMan, Dec_Graph_t * pGraph );
+extern void Ivy_CutComputeAll( Ivy_Man_t * p, int nInputs );
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -36,7 +47,6 @@ static Ivy_Obj_t * Abc_NodeStrashAig( Ivy_Man_t * pMan, Abc_Obj_t * pNode );
static Ivy_Obj_t * Abc_NodeStrashAigSopAig( Ivy_Man_t * pMan, Abc_Obj_t * pNode, char * pSop );
static Ivy_Obj_t * Abc_NodeStrashAigExorAig( Ivy_Man_t * pMan, Abc_Obj_t * pNode, char * pSop );
static Ivy_Obj_t * Abc_NodeStrashAigFactorAig( Ivy_Man_t * pMan, Abc_Obj_t * pNode, char * pSop );
-extern char * Mio_GateReadSop( void * pGate );
typedef int Abc_Edge_t;
static inline Abc_Edge_t Abc_EdgeCreate( int Id, int fCompl ) { return (Id << 1) | fCompl; }
@@ -133,7 +143,7 @@ Abc_Ntk_t * Abc_NtkIvyAfter( Abc_Ntk_t * pNtk, Ivy_Man_t * pMan, int fSeq, int f
else
pNtkAig = Abc_NtkFromIvy( pNtk, pMan );
// report the cleanup results
- if ( !fHaig && fCleanup && (nNodes = Abc_AigCleanup(pNtkAig->pManFunc)) )
+ if ( !fHaig && fCleanup && (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
// duplicate EXDC
if ( pNtk->pExdc )
@@ -252,7 +262,6 @@ clk = clock();
***********************************************************************/
void Abc_NtkIvyCuts( Abc_Ntk_t * pNtk, int nInputs )
{
- extern void Ivy_CutComputeAll( Ivy_Man_t * p, int nInputs );
Ivy_Man_t * pMan;
pMan = Abc_NtkIvyBefore( pNtk, 1, 0 );
if ( pMan == NULL )
@@ -487,10 +496,12 @@ Abc_Ntk_t * Abc_NtkIvyFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, in
***********************************************************************/
int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars )
{
- Prove_Params_t * pParams = pPars;
+
+ Prove_Params_t * pParams = (Prove_Params_t *)pPars;
Abc_Ntk_t * pNtk = *ppNtk, * pNtkTemp;
Abc_Obj_t * pObj, * pFanin;
Ivy_Man_t * pMan;
+ Aig_Man_t * pMan2;
int RetValue;
assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) );
// experiment with various parameters settings
@@ -515,8 +526,18 @@ int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars )
return 0;
}
+ // changed in "src\sat\fraig\fraigMan.c"
+ // pParams->nMiteringLimitStart = 300; // starting mitering limit
+ // to be
+ // pParams->nMiteringLimitStart = 5000; // starting mitering limit
+
// if SAT only, solve without iteration
- RetValue = Abc_NtkMiterSat( pNtk, 2*(ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, NULL, NULL );
+// RetValue = Abc_NtkMiterSat( pNtk, 2*(ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, NULL, NULL );
+ pMan2 = Abc_NtkToDar( pNtk, 0, 0 );
+ RetValue = Fra_FraigSat( pMan2, (ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 1, 0, 0 );
+ pNtk->pModel = (int *)pMan2->pData, pMan2->pData = NULL;
+ Aig_ManStop( pMan2 );
+// pNtk->pModel = Aig_ManReleaseData( pMan2 );
if ( RetValue >= 0 )
return RetValue;
@@ -546,7 +567,7 @@ int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars )
pNtk = Abc_NtkIvyAfter( pNtkTemp = pNtk, pMan, 0, 0 );
Abc_NtkDelete( pNtkTemp );
// transfer model if given
- pNtk->pModel = pMan->pData; pMan->pData = NULL;
+ pNtk->pModel = (int *)pMan->pData; pMan->pData = NULL;
Ivy_ManStop( pMan );
// try to prove it using brute force SAT
@@ -561,7 +582,7 @@ int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars )
if ( pNtk )
{
Abc_NtkDelete( pNtkTemp );
- RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero(pNtk->pManFunc)) );
+ RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc)) );
}
else
pNtk = pNtkTemp;
@@ -724,9 +745,9 @@ Abc_Ntk_t * Abc_NtkFromIvy( Abc_Ntk_t * pNtkOld, Ivy_Man_t * pMan )
pFaninNew1 = Abc_ObjFanin1Ivy( pNtk, pNode );
// create the new node
if ( Ivy_ObjIsExor(pNode) )
- pObjNew = Abc_AigXor( pNtk->pManFunc, pFaninNew0, pFaninNew1 );
+ pObjNew = Abc_AigXor( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
else
- pObjNew = Abc_AigAnd( pNtk->pManFunc, pFaninNew0, pFaninNew1 );
+ pObjNew = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
pNode->TravId = Abc_EdgeFromNode( pObjNew );
}
// connect the PO nodes
@@ -799,9 +820,9 @@ Abc_Ntk_t * Abc_NtkFromIvySeq( Abc_Ntk_t * pNtkOld, Ivy_Man_t * pMan, int fHaig
pFaninNew1 = Abc_ObjFanin1Ivy( pNtk, pNode );
// create the new node
if ( Ivy_ObjIsExor(pNode) )
- pObjNew = Abc_AigXor( pNtk->pManFunc, pFaninNew0, pFaninNew1 );
+ pObjNew = Abc_AigXor( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
else
- pObjNew = Abc_AigAnd( pNtk->pManFunc, pFaninNew0, pFaninNew1 );
+ pObjNew = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
pNode->TravId = Abc_EdgeFromNode( pObjNew );
// process the choice nodes
if ( fHaig && pNode->pEquiv && Ivy_ObjRefs(pNode) > 0 )
@@ -896,7 +917,7 @@ void Abc_NtkStrashPerformAig( Abc_Ntk_t * pNtk, Ivy_Man_t * pMan )
int i;
vNodes = Abc_NtkDfs( pNtk, 0 );
// pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
// Extra_ProgressBarUpdate( pProgress, i, NULL );
pNode->pCopy = (Abc_Obj_t *)Abc_NodeStrashAig( pMan, pNode );
@@ -938,9 +959,9 @@ Ivy_Obj_t * Abc_NodeStrashAig( Ivy_Man_t * pMan, Abc_Obj_t * pNode )
// get the SOP of the node
if ( Abc_NtkHasMapping(pNode->pNtk) )
- pSop = Mio_GateReadSop(pNode->pData);
+ pSop = Mio_GateReadSop((Mio_Gate_t *)pNode->pData);
else
- pSop = pNode->pData;
+ pSop = (char *)pNode->pData;
// consider the constant node
if ( Abc_NodeIsConst(pNode) )
@@ -1049,7 +1070,6 @@ Ivy_Obj_t * Abc_NodeStrashAigFactorAig( Ivy_Man_t * pMan, Abc_Obj_t * pRoot, cha
int i;
// extern Ivy_Obj_t * Dec_GraphToNetworkAig( Ivy_Man_t * pMan, Dec_Graph_t * pGraph );
- extern Ivy_Obj_t * Dec_GraphToNetworkIvy( Ivy_Man_t * pMan, Dec_Graph_t * pGraph );
// assert( 0 );
@@ -1102,3 +1122,5 @@ Vec_Int_t * Abc_NtkCollectLatchValuesIvy( Abc_Ntk_t * pNtk, int fUseDcs )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcLog.c b/src/base/abci/abcLog.c
new file mode 100644
index 00000000..45dafb98
--- /dev/null
+++ b/src/base/abci/abcLog.c
@@ -0,0 +1,215 @@
+/**CFile****************************************************************
+
+ FileName [abcLog.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [Log file printing.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: abcLog.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "gia.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/*
+ Log file format (Jiang, Mon, 28 Sep 2009)
+
+ <result> <cyc> <engine_name>
+ <TRACE> : default is "NULL"
+ <INIT_STATE> : default is "NULL"
+
+ <retult> is the following:
+ snl_SAT
+ snl_UNSAT
+ snl_UNK
+ snl_ABORT
+
+ <cyc> : # of cycles
+
+ <INIT_STATE> : initial state
+ <TRACE> : input vector
+
+ <INIT_STATE>and <TRACE> are strings of 0/1/- ( - means don't care). The length is equivalent to #input*#<cyc>.
+*/
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkWriteLogFile( char * pFileName, Abc_Cex_t * pCex, int Status, char * pCommand )
+{
+ FILE * pFile;
+ int i;
+ pFile = fopen( pFileName, "w" );
+ if ( pFile == NULL )
+ {
+ printf( "Cannot open log file for writing \"%s\".\n" , pFileName );
+ return;
+ }
+ // write <result>
+ if ( Status == 1 )
+ fprintf( pFile, "snl_UNSAT" );
+ else if ( Status == 0 )
+ fprintf( pFile, "snl_SAT" );
+ else if ( Status == -1 )
+ fprintf( pFile, "snl_UNK" );
+ else
+ printf( "Abc_NtkWriteLogFile(): Cannot recognize solving status.\n" );
+ fprintf( pFile, " " );
+ // write <cyc>
+ fprintf( pFile, "%d", pCex ? pCex->iFrame + 1 : -1 );
+ fprintf( pFile, " " );
+ // write <engine_name>
+ fprintf( pFile, "%s", pCommand ? pCommand : "unknown" );
+ fprintf( pFile, "\n" );
+ // write <INIT_STATE>
+ if ( pCex == NULL )
+ fprintf( pFile, "NULL" );
+ else
+ {
+ for ( i = 0; i < pCex->nRegs; i++ )
+ fprintf( pFile, "%d", Gia_InfoHasBit(pCex->pData,i) );
+ }
+ fprintf( pFile, "\n" );
+ // write <TRACE>
+ if ( pCex == NULL )
+ fprintf( pFile, "NULL" );
+ else
+ {
+ assert( pCex->nBits - pCex->nRegs == pCex->nPis * (pCex->iFrame + 1) );
+ for ( i = pCex->nRegs; i < pCex->nBits; i++ )
+ fprintf( pFile, "%d", Gia_InfoHasBit(pCex->pData,i) );
+ }
+ fprintf( pFile, "\n" );
+ fclose( pFile );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex )
+{
+ Abc_Cex_t * pCex;
+ Vec_Int_t * vNums;
+ char Buffer[1000];
+ FILE * pFile;
+ int c, nRegs = -1, nFrames = -1, Status = -1;
+ pFile = fopen( pFileName, "r" );
+ if ( pFile == NULL )
+ {
+ printf( "Cannot open log file for reading \"%s\".\n" , pFileName );
+ return -1;
+ }
+ fgets( Buffer, 1000, pFile );
+ if ( !strncmp( Buffer, "snl_UNSAT", strlen("snl_UNSAT") ) )
+ {
+ Status = 1;
+ nFrames = atoi( Buffer + strlen("snl_UNSAT") );
+ }
+ else if ( !strncmp( Buffer, "snl_SAT", strlen("snl_SAT") ) )
+ {
+ Status = 0;
+ nFrames = atoi( Buffer + strlen("snl_SAT") );
+ }
+ else if ( !strncmp( Buffer, "snl_UNK", strlen("snl_UNK") ) )
+ {
+ Status = -1;
+ nFrames = atoi( Buffer + strlen("snl_UNK") );
+ }
+ else
+ {
+ printf( "Unrecognized status.\n" );
+ }
+ // found regs till the new line
+ vNums = Vec_IntAlloc( 100 );
+ while ( (c = fgetc(pFile)) != EOF )
+ {
+ if ( c == '\n' )
+ break;
+ if ( c == '0' || c == '1' )
+ Vec_IntPush( vNums, c - '0' );
+ }
+ nRegs = Vec_IntSize(vNums);
+ // skip till the new line
+ while ( (c = fgetc(pFile)) != EOF )
+ {
+ if ( c == '0' || c == '1' )
+ Vec_IntPush( vNums, c - '0' );
+ }
+ fclose( pFile );
+ if ( Vec_IntSize(vNums) )
+ {
+ if ( nRegs == 0 )
+ {
+ printf( "Cannot read register number.\n" );
+ return -1;
+ }
+ if ( Vec_IntSize(vNums)-nRegs == 0 )
+ {
+ printf( "Cannot read counter example.\n" );
+ return -1;
+ }
+ if ( (Vec_IntSize(vNums)-nRegs) % nFrames != 0 )
+ {
+ printf( "Incorrect number of bits.\n" );
+ return -1;
+ }
+ pCex = Gia_ManAllocCounterExample( nRegs, (Vec_IntSize(vNums)-nRegs)/nFrames, nFrames );
+ pCex->iPo = 0;
+ pCex->iFrame = nFrames - 1;
+ assert( Vec_IntSize(vNums) == pCex->nBits );
+ for ( c = 0; c < pCex->nBits; c++ )
+ if ( Vec_IntEntry(vNums, c) )
+ Gia_InfoSetBit( pCex->pData, c );
+ Vec_IntFree( vNums );
+ if ( ppCex )
+ *ppCex = pCex;
+ else
+ ABC_FREE( pCex );
+ }
+ return Status;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcLut.c b/src/base/abci/abcLut.c
index 089f4107..a33cc7db 100644
--- a/src/base/abci/abcLut.c
+++ b/src/base/abci/abcLut.c
@@ -21,6 +21,8 @@
#include "abc.h"
#include "cut.h"
+ABC_NAMESPACE_IMPL_START
+
#define LARGE_LEVEL 1000000
////////////////////////////////////////////////////////////////////////
@@ -346,10 +348,10 @@ unsigned * Abc_NodeSuperChoiceTruth( Abc_ManScl_t * pManScl )
char * pSop;
int i, k;
// set elementary truth tables
- Vec_PtrForEachEntry( pManScl->vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pManScl->vLeaves, pObj, i )
pObj->pNext = (Abc_Obj_t *)pManScl->uVars[i];
// compute truth tables for internal nodes
- Vec_PtrForEachEntry( pManScl->vVolume, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pManScl->vVolume, pObj, i )
{
// set storage for the node's simulation info
pObj->pNext = (Abc_Obj_t *)pManScl->uSims[i];
@@ -358,7 +360,7 @@ unsigned * Abc_NodeSuperChoiceTruth( Abc_ManScl_t * pManScl )
puData0 = (unsigned *)Abc_ObjFanin0(pObj)->pNext;
puData1 = (unsigned *)Abc_ObjFanin1(pObj)->pNext;
// simulate
- pSop = pObj->pData;
+ pSop = (char *)pObj->pData;
if ( pSop[0] == '0' && pSop[1] == '0' )
for ( k = 0; k < pManScl->nWords; k++ )
puData[k] = ~puData0[k] & ~puData1[k];
@@ -412,13 +414,13 @@ void Abc_NodeSuperChoiceCollect2( Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, Vec_Pt
{
Abc_Obj_t * pObj;
int i;
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->fMarkC = 1;
Vec_PtrClear( vVolume );
Abc_NodeSuperChoiceCollect2_rec( pRoot, vVolume );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->fMarkC = 0;
- Vec_PtrForEachEntry( vVolume, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVolume, pObj, i )
pObj->fMarkC = 0;
}
@@ -465,15 +467,15 @@ void Abc_NodeSuperChoiceCollect( Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, Vec_Ptr
Abc_Obj_t * pObj;
int i, nLeaves;
nLeaves = Vec_PtrSize(vLeaves);
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->fMarkB = pObj->fMarkC = 1;
Vec_PtrClear( vVolume );
Vec_PtrClear( vLeaves );
Abc_NodeSuperChoiceCollect_rec( pRoot, vLeaves, vVolume );
assert( Vec_PtrSize(vLeaves) == nLeaves );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->fMarkC = 0;
- Vec_PtrForEachEntry( vVolume, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVolume, pObj, i )
pObj->fMarkC = 0;
}
@@ -554,7 +556,7 @@ Abc_Obj_t * Abc_NodeSuperChoiceLut( Abc_ManScl_t * p, Abc_Obj_t * pObj )
if ( uSupport & (1 << i) )
break;
assert( i < nVars );
- pFanin = Vec_PtrEntry( p->vLeaves, i );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( p->vLeaves, i );
pObj->Level = pFanin->Level;
return NULL;
}
@@ -570,17 +572,17 @@ Abc_Obj_t * Abc_NodeSuperChoiceLut( Abc_ManScl_t * p, Abc_Obj_t * pObj )
while ( Vec_PtrSize(p->vLeaves) > p->nLutSize )
if ( !Abc_NodeDecomposeStep( p ) )
{
- Vec_PtrForEachEntry( p->vLeaves, pFanin, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pFanin, i )
if ( Abc_ObjIsNode(pFanin) && Abc_ObjFanoutNum(pFanin) == 0 )
Abc_NtkDeleteObj_rec( pFanin, 1 );
return NULL;
}
// create the topmost node
pObjNew = Abc_NtkCreateNode( pObj->pNtk );
- Vec_PtrForEachEntry( p->vLeaves, pFanin, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pFanin, i )
Abc_ObjAddFanin( pObjNew, pFanin );
// create the function
- pObjNew->pData = Abc_SopCreateFromTruth( pObj->pNtk->pManFunc, Vec_PtrSize(p->vLeaves), p->uTruth ); // need ISOP
+ pObjNew->pData = Abc_SopCreateFromTruth( (Extra_MmFlex_t *)pObj->pNtk->pManFunc, Vec_PtrSize(p->vLeaves), p->uTruth ); // need ISOP
pObjNew->Level = Abc_NodeGetLevel( pObjNew );
return pObjNew;
}
@@ -599,8 +601,8 @@ Abc_Obj_t * Abc_NodeSuperChoiceLut( Abc_ManScl_t * p, Abc_Obj_t * pObj )
int Abc_NodeCompareLevelsInc( int * pp1, int * pp2 )
{
Abc_Obj_t * pNode1, * pNode2;
- pNode1 = Vec_PtrEntry(s_pLeaves, *pp1);
- pNode2 = Vec_PtrEntry(s_pLeaves, *pp2);
+ pNode1 = (Abc_Obj_t *)Vec_PtrEntry(s_pLeaves, *pp1);
+ pNode2 = (Abc_Obj_t *)Vec_PtrEntry(s_pLeaves, *pp2);
if ( pNode1->Level < pNode2->Level )
return -1;
if ( pNode1->Level > pNode2->Level )
@@ -757,11 +759,11 @@ int Abc_NodeDecomposeStep( Abc_ManScl_t * p )
pObjNew = Abc_NtkCreateNode( pNtk );
for ( i = 0; i < p->nLutSize; i++ )
{
- pFanin = Vec_PtrEntry( p->vLeaves, p->pBSet[i] );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( p->vLeaves, p->pBSet[i] );
Abc_ObjAddFanin( pObjNew, pFanin );
}
// create the function
- pObjNew->pData = Abc_SopCreateFromTruth( pNtk->pManFunc, p->nLutSize, pTruth ); // need ISOP
+ pObjNew->pData = Abc_SopCreateFromTruth( (Extra_MmFlex_t *)pNtk->pManFunc, p->nLutSize, pTruth ); // need ISOP
pObjNew->Level = Abc_NodeGetLevel( pObjNew );
pNodesNew[v] = pObjNew;
}
@@ -785,4 +787,7 @@ int Abc_NodeDecomposeStep( Abc_ManScl_t * p )
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
+
diff --git a/src/base/abci/abcLutmin.c b/src/base/abci/abcLutmin.c
index 41ee25fe..71dea2e1 100644
--- a/src/base/abci/abcLutmin.c
+++ b/src/base/abci/abcLutmin.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
Implememented here is the algorithm for minimal-LUT decomposition
described in the paper: T. Sasao et al. "On the number of LUTs
@@ -47,7 +50,7 @@
***********************************************************************/
Abc_Obj_t * Abc_NtkBddMux21( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
{
- DdManager * dd = pNtkNew->pManFunc;
+ DdManager * dd = (DdManager *)pNtkNew->pManFunc;
Abc_Obj_t * pNode;
DdNode * bSpin, * bCof0, * bCof1;
pNode = Abc_NtkCreateNode( pNtkNew );
@@ -57,7 +60,7 @@ Abc_Obj_t * Abc_NtkBddMux21( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
bSpin = Cudd_bddIthVar(dd, 0);
bCof0 = Cudd_bddIthVar(dd, 1);
bCof1 = Cudd_bddIthVar(dd, 2);
- pNode->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( (DdNode *)pNode->pData );
return pNode;
}
@@ -74,7 +77,7 @@ Abc_Obj_t * Abc_NtkBddMux21( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
***********************************************************************/
Abc_Obj_t * Abc_NtkBddMux411( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
{
- DdManager * dd = pNtkNew->pManFunc;
+ DdManager * dd = (DdManager *)pNtkNew->pManFunc;
Abc_Obj_t * pNode;
DdNode * bSpin, * bCof0, * bCof1;
pNode = Abc_NtkCreateNode( pNtkNew );
@@ -88,7 +91,7 @@ Abc_Obj_t * Abc_NtkBddMux411( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
bCof0 = Cudd_bddIte( dd, bSpin, Cudd_bddIthVar(dd, 3), Cudd_bddIthVar(dd, 2) ); Cudd_Ref( bCof0 );
bCof1 = Cudd_bddIte( dd, bSpin, Cudd_bddIthVar(dd, 5), Cudd_bddIthVar(dd, 4) ); Cudd_Ref( bCof1 );
bSpin = Cudd_bddIthVar(dd, 0);
- pNode->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( (DdNode *)pNode->pData );
Cudd_RecursiveDeref( dd, bCof0 );
Cudd_RecursiveDeref( dd, bCof1 );
return pNode;
@@ -107,7 +110,7 @@ Abc_Obj_t * Abc_NtkBddMux411( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
***********************************************************************/
Abc_Obj_t * Abc_NtkBddMux412( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
{
- DdManager * dd = pNtkNew->pManFunc;
+ DdManager * dd = (DdManager *)pNtkNew->pManFunc;
Abc_Obj_t * pNodeBot, * pNodeTop;
DdNode * bSpin, * bCof0, * bCof1;
// bottom node
@@ -119,7 +122,7 @@ Abc_Obj_t * Abc_NtkBddMux412( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
bSpin = Cudd_bddIthVar(dd, 0);
bCof0 = Cudd_bddIte( dd, Cudd_bddIthVar(dd, 1), Cudd_bddIthVar(dd, 3), Cudd_bddIthVar(dd, 2) ); Cudd_Ref( bCof0 );
bCof1 = Cudd_bddIthVar(dd, 1);
- pNodeBot->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( pNodeBot->pData );
+ pNodeBot->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( (DdNode *)pNodeBot->pData );
Cudd_RecursiveDeref( dd, bCof0 );
// top node
pNodeTop = Abc_NtkCreateNode( pNtkNew );
@@ -130,7 +133,7 @@ Abc_Obj_t * Abc_NtkBddMux412( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
bSpin = Cudd_bddIthVar(dd, 0);
bCof0 = Cudd_bddIthVar(dd, 1);
bCof1 = Cudd_bddIte( dd, Cudd_bddIthVar(dd, 1), Cudd_bddIthVar(dd, 3), Cudd_bddIthVar(dd, 2) ); Cudd_Ref( bCof1 );
- pNodeTop->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( pNodeTop->pData );
+ pNodeTop->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( (DdNode *)pNodeTop->pData );
Cudd_RecursiveDeref( dd, bCof1 );
return pNodeTop;
}
@@ -148,7 +151,7 @@ Abc_Obj_t * Abc_NtkBddMux412( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
***********************************************************************/
Abc_Obj_t * Abc_NtkBddMux412a( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
{
- DdManager * dd = pNtkNew->pManFunc;
+ DdManager * dd = (DdManager *)pNtkNew->pManFunc;
Abc_Obj_t * pNodeBot, * pNodeTop;
DdNode * bSpin, * bCof0, * bCof1;
// bottom node
@@ -159,7 +162,7 @@ Abc_Obj_t * Abc_NtkBddMux412a( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
bSpin = Cudd_bddIthVar(dd, 0);
bCof0 = Cudd_bddIthVar(dd, 1);
bCof1 = Cudd_bddIthVar(dd, 2);
- pNodeBot->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( pNodeBot->pData );
+ pNodeBot->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( (DdNode *)pNodeBot->pData );
// top node
pNodeTop = Abc_NtkCreateNode( pNtkNew );
Abc_ObjAddFanin( pNodeTop, pFanins[0] );
@@ -170,7 +173,7 @@ Abc_Obj_t * Abc_NtkBddMux412a( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanins[] )
bSpin = Cudd_bddIthVar(dd, 0);
bCof0 = Cudd_bddIthVar(dd, 2);
bCof1 = Cudd_bddIte( dd, Cudd_bddIthVar(dd, 1), Cudd_bddIthVar(dd, 4), Cudd_bddIthVar(dd, 3) ); Cudd_Ref( bCof1 );
- pNodeTop->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( pNodeTop->pData );
+ pNodeTop->pData = Cudd_bddIte( dd, bSpin, bCof1, bCof0 ); Cudd_Ref( (DdNode *)pNodeTop->pData );
Cudd_RecursiveDeref( dd, bCof1 );
return pNodeTop;
}
@@ -319,7 +322,7 @@ Extra_bddPrint( dd, bFuncNew );
printf( "\n" );
printf( "\n" );
}
- pNodeNew->pData = Extra_TransferLevelByLevel( dd, pNtkNew->pManFunc, bFuncNew ); Cudd_Ref( pNodeNew->pData );
+ pNodeNew->pData = Extra_TransferLevelByLevel( dd, (DdManager *)pNtkNew->pManFunc, bFuncNew ); Cudd_Ref( (DdNode *)pNodeNew->pData );
//Extra_bddPrint( pNtkNew->pManFunc, pNodeNew->pData );
//printf( "\n" );
//printf( "\n" );
@@ -340,8 +343,8 @@ printf( "\n" );
***********************************************************************/
Abc_Obj_t * Abc_NtkBddCurtis( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Ptr_t * vCofs, Vec_Ptr_t * vUniq )
{
- DdManager * ddOld = pNode->pNtk->pManFunc;
- DdManager * ddNew = pNtkNew->pManFunc;
+ DdManager * ddOld = (DdManager *)pNode->pNtk->pManFunc;
+ DdManager * ddNew = (DdManager *)pNtkNew->pManFunc;
DdNode * bCof, * bUniq, * bMint, * bTemp, * bFunc, * bBits[10], ** pbCodeVars;
Abc_Obj_t * pNodeNew = NULL, * pNodeBS[10];
int nLutSize = Extra_Base2Log( Vec_PtrSize(vCofs) );
@@ -353,9 +356,9 @@ Abc_Obj_t * Abc_NtkBddCurtis( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Ptr_t
for ( b = 0; b < nBits; b++ )
bBits[b] = Cudd_ReadLogicZero(ddNew), Cudd_Ref( bBits[b] );
// add each bound set minterm to one of the blccks
- Vec_PtrForEachEntry( vCofs, bCof, c )
+ Vec_PtrForEachEntry( DdNode *, vCofs, bCof, c )
{
- Vec_PtrForEachEntry( vUniq, bUniq, u )
+ Vec_PtrForEachEntry( DdNode *, vUniq, bUniq, u )
if ( bUniq == bCof )
break;
assert( u < Vec_PtrSize(vUniq) );
@@ -388,7 +391,7 @@ Abc_Obj_t * Abc_NtkBddCurtis( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Ptr_t
// derive function of the composition node
bFunc = Cudd_ReadLogicZero(ddNew); Cudd_Ref( bFunc );
pbCodeVars = ddNew->vars + Abc_ObjFaninNum(pNode) - nLutSize;
- Vec_PtrForEachEntry( vUniq, bUniq, u )
+ Vec_PtrForEachEntry( DdNode *, vUniq, bUniq, u )
{
bUniq = Extra_bddMove( ddOld, bUniq, -nLutSize ); Cudd_Ref( bUniq );
bUniq = Extra_TransferLevelByLevel( ddOld, ddNew, bTemp = bUniq ); Cudd_Ref( bUniq );
@@ -421,8 +424,8 @@ Abc_Obj_t * Abc_NtkBddCurtis( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, Vec_Ptr_t
Abc_Obj_t * Abc_NtkBddFindCofactor( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int nLutSize )
{
Abc_Obj_t * pNodeBot, * pNodeTop;
- DdManager * ddOld = pNode->pNtk->pManFunc;
- DdManager * ddNew = pNtkNew->pManFunc;
+ DdManager * ddOld = (DdManager *)pNode->pNtk->pManFunc;
+ DdManager * ddNew = (DdManager *)pNtkNew->pManFunc;
DdNode * bCof0, * bCof1, * bSupp, * bTemp, * bVar;
DdNode * bCof0n, * bCof1n;
int i, iCof, iFreeVar, fCof1Smaller = -1;
@@ -430,8 +433,8 @@ Abc_Obj_t * Abc_NtkBddFindCofactor( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int
for ( iCof = 0; iCof < Abc_ObjFaninNum(pNode); iCof++ )
{
bVar = Cudd_bddIthVar( ddOld, iCof );
- bCof0 = Cudd_Cofactor( ddOld, pNode->pData, Cudd_Not(bVar) ); Cudd_Ref( bCof0 );
- bCof1 = Cudd_Cofactor( ddOld, pNode->pData, bVar ); Cudd_Ref( bCof1 );
+ bCof0 = Cudd_Cofactor( ddOld, (DdNode *)pNode->pData, Cudd_Not(bVar) ); Cudd_Ref( bCof0 );
+ bCof1 = Cudd_Cofactor( ddOld, (DdNode *)pNode->pData, bVar ); Cudd_Ref( bCof1 );
if ( Cudd_SupportSize( ddOld, bCof0 ) <= nLutSize - 2 )
{
fCof1Smaller = 0;
@@ -488,7 +491,7 @@ Abc_Obj_t * Abc_NtkBddFindCofactor( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int
Cudd_bddIthVar(ddNew, iCof),
fCof1Smaller? bCof1n : Cudd_bddIthVar(ddNew, iFreeVar),
fCof1Smaller? Cudd_bddIthVar(ddNew, iFreeVar) : bCof0n );
- Cudd_Ref( pNodeTop->pData );
+ Cudd_Ref( (DdNode *)pNodeTop->pData );
Cudd_RecursiveDeref( ddNew, fCof1Smaller? bCof1n : bCof0n );
return pNodeTop;
}
@@ -507,7 +510,7 @@ Abc_Obj_t * Abc_NtkBddFindCofactor( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int
Abc_Obj_t * Abc_NtkBddDecompose( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int nLutSize, int fVerbose )
{
Vec_Ptr_t * vCofs, * vUniq;
- DdManager * dd = pNode->pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNode->pNtk->pManFunc;
DdNode * bCof;
Abc_Obj_t * pNodeNew = NULL;
Abc_Obj_t * pCofs[20];
@@ -528,21 +531,21 @@ Abc_Obj_t * Abc_NtkBddDecompose( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int nLu
}
// cofactor w.r.t. the bound set variables
- vCofs = Abc_NtkBddCofactors( dd, pNode->pData, nLutSize );
+ vCofs = Abc_NtkBddCofactors( dd, (DdNode *)pNode->pData, nLutSize );
vUniq = Vec_PtrDup( vCofs );
Vec_PtrUniqify( vUniq, (int (*)())Vec_PtrSortCompare );
// only perform decomposition with it is support reduring with two less vars
if( Vec_PtrSize(vUniq) > (1 << (nLutSize-2)) )
{
Vec_PtrFree( vCofs );
- vCofs = Abc_NtkBddCofactors( dd, pNode->pData, 2 );
+ vCofs = Abc_NtkBddCofactors( dd, (DdNode *)pNode->pData, 2 );
if ( fVerbose )
printf( "Decomposing %d-input node %d using cofactoring with %d cofactors.\n",
Abc_ObjFaninNum(pNode), Abc_ObjId(pNode), Vec_PtrSize(vCofs) );
// implement the cofactors
pCofs[0] = Abc_ObjFanin(pNode, 0)->pCopy;
pCofs[1] = Abc_ObjFanin(pNode, 1)->pCopy;
- Vec_PtrForEachEntry( vCofs, bCof, i )
+ Vec_PtrForEachEntry( DdNode *, vCofs, bCof, i )
pCofs[2+i] = Abc_NtkCreateCofLut( pNtkNew, dd, bCof, pNode, 2 );
if ( nLutSize == 4 )
pNodeNew = Abc_NtkBddMux412( pNtkNew, pCofs );
@@ -582,7 +585,7 @@ void Abc_NtkLutminConstruct( Abc_Ntk_t * pNtkClp, Abc_Ntk_t * pNtkDec, int nLutS
Abc_Obj_t * pNode, * pFanin;
int i, k;
vNodes = Abc_NtkDfs( pNtkClp, 0 );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjFaninNum(pNode) <= nLutSize )
{
@@ -617,7 +620,7 @@ Abc_Ntk_t * Abc_NtkLutminInt( Abc_Ntk_t * pNtk, int nLutSize, int fVerbose )
// decompose one output at a time
pNtkDec = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
// make sure the new manager has enough inputs
- Cudd_bddIthVar( pNtkDec->pManFunc, Abc_NtkGetFaninMax(pNtk) );
+ Cudd_bddIthVar( (DdManager *)pNtkDec->pManFunc, Abc_NtkGetFaninMax(pNtk) );
// put the results into the new network (save new CO drivers in old CO drivers)
Abc_NtkLutminConstruct( pNtk, pNtkDec, nLutSize, fVerbose );
// finalize the new network
@@ -640,7 +643,7 @@ Abc_Ntk_t * Abc_NtkLutminInt( Abc_Ntk_t * pNtk, int nLutSize, int fVerbose )
***********************************************************************/
Abc_Ntk_t * Abc_NtkLutmin( Abc_Ntk_t * pNtkInit, int nLutSize, int fVerbose )
{
- extern bool Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
+ extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
Abc_Ntk_t * pNtkNew, * pTemp;
int i;
if ( nLutSize < 4 )
@@ -695,3 +698,5 @@ Abc_Ntk_t * Abc_NtkLutmin( Abc_Ntk_t * pNtkInit, int nLutSize, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcMap.c b/src/base/abci/abcMap.c
index 0b0294d5..543df7b0 100644
--- a/src/base/abci/abcMap.c
+++ b/src/base/abci/abcMap.c
@@ -23,6 +23,9 @@
#include "mio.h"
#include "mapper.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -76,8 +79,8 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, int
if ( Abc_FrameReadLibSuper() == NULL && Abc_FrameReadLibGen() )
{
printf( "A simple supergate library is derived from gate library \"%s\".\n",
- Mio_LibraryReadName(Abc_FrameReadLibGen()) );
- Map_SuperLibDeriveFromGenlib( Abc_FrameReadLibGen() );
+ Mio_LibraryReadName((Mio_Library_t *)Abc_FrameReadLibGen()) );
+ Map_SuperLibDeriveFromGenlib( (Mio_Library_t *)Abc_FrameReadLibGen() );
}
// print a warning about choice nodes
@@ -175,13 +178,13 @@ Map_Man_t * Abc_NtkToMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, f
// load the AIG into the mapper
vNodes = Abc_AigDfs( pNtk, 0, 0 );
pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
// add the node to the mapper
pNodeMap = Map_NodeAnd( pMan,
- Map_NotCond( Abc_ObjFanin0(pNode)->pCopy, Abc_ObjFaninC0(pNode) ),
- Map_NotCond( Abc_ObjFanin1(pNode)->pCopy, Abc_ObjFaninC1(pNode) ) );
+ Map_NotCond( Abc_ObjFanin0(pNode)->pCopy, (int)Abc_ObjFaninC0(pNode) ),
+ Map_NotCond( Abc_ObjFanin1(pNode)->pCopy, (int)Abc_ObjFaninC1(pNode) ) );
assert( pNode->pCopy == NULL );
// remember the node
pNode->pCopy = (Abc_Obj_t *)pNodeMap;
@@ -189,7 +192,7 @@ Map_Man_t * Abc_NtkToMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, f
Map_NodeSetSwitching( pNodeMap, pSwitching[pNode->Id] );
// set up the choice node
if ( Abc_AigNodeIsChoice( pNode ) )
- for ( pPrev = pNode, pFanin = pNode->pData; pFanin; pPrev = pFanin, pFanin = pFanin->pData )
+ for ( pPrev = pNode, pFanin = (Abc_Obj_t *)pNode->pData; pFanin; pPrev = pFanin, pFanin = (Abc_Obj_t *)pFanin->pData )
{
Map_NodeSetNextE( (Map_Node_t *)pPrev->pCopy, (Map_Node_t *)pFanin->pCopy );
Map_NodeSetRepr( (Map_Node_t *)pFanin->pCopy, (Map_Node_t *)pNode->pCopy );
@@ -200,7 +203,7 @@ Map_Man_t * Abc_NtkToMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, f
// set the primary outputs in the required phase
Abc_NtkForEachCo( pNtk, pNode, i )
- Map_ManReadOutputs(pMan)[i] = Map_NotCond( (Map_Node_t *)Abc_ObjFanin0(pNode)->pCopy, Abc_ObjFaninC0(pNode) );
+ Map_ManReadOutputs(pMan)[i] = Map_NotCond( (Map_Node_t *)Abc_ObjFanin0(pNode)->pCopy, (int)Abc_ObjFaninC0(pNode) );
return pMan;
}
@@ -430,8 +433,8 @@ Abc_Ntk_t * Abc_NtkSuperChoice( Abc_Ntk_t * pNtk )
if ( Abc_FrameReadLibSuper() == NULL && Abc_FrameReadLibGen() )
{
printf( "A simple supergate library is derived from gate library \"%s\".\n",
- Mio_LibraryReadName(Abc_FrameReadLibGen()) );
- Map_SuperLibDeriveFromGenlib( Abc_FrameReadLibGen() );
+ Mio_LibraryReadName((Mio_Library_t *)Abc_FrameReadLibGen()) );
+ Map_SuperLibDeriveFromGenlib( (Mio_Library_t *)Abc_FrameReadLibGen() );
}
// print a warning about choice nodes
@@ -654,7 +657,7 @@ Abc_Obj_t * Abc_NodeFromMapSuperChoice_rec( Abc_Ntk_t * pNtkNew, Map_Super_t * p
pNodeFanin = Abc_NodeFromMapSuperChoice_rec( pNtkNew, ppFanins[i], pNodePis, nNodePis );
Abc_ObjAddFanin( pNodeNew, pNodeFanin );
}
- pNodeNew->pData = Abc_SopRegister( pNtkNew->pManFunc, Mio_GateReadSop(pRoot) );
+ pNodeNew->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtkNew->pManFunc, Mio_GateReadSop(pRoot) );
return pNodeNew;
}
@@ -664,3 +667,5 @@ Abc_Obj_t * Abc_NodeFromMapSuperChoice_rec( Abc_Ntk_t * pNtkNew, Map_Super_t * p
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcMeasure.c b/src/base/abci/abcMeasure.c
index 00d5d971..5352084f 100644
--- a/src/base/abci/abcMeasure.c
+++ b/src/base/abci/abcMeasure.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "kit.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -143,7 +146,7 @@ unsigned Abc_Ntk4VarObj( Vec_Ptr_t * vNodes )
Abc_Obj_t * pObj;
unsigned uTruth0, uTruth1;
int i;
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
uTruth0 = (unsigned)(Abc_ObjFanin0(pObj)->pCopy);
uTruth1 = (unsigned)(Abc_ObjFanin1(pObj)->pCopy);
@@ -151,7 +154,7 @@ unsigned Abc_Ntk4VarObj( Vec_Ptr_t * vNodes )
uTruth0 = ~uTruth0;
if ( Abc_ObjFaninC1(pObj) )
uTruth1 = ~uTruth1;
- pObj->pCopy = (void *)(uTruth0 & uTruth1);
+ pObj->pCopy = (Abc_Obj_t *)(uTruth0 & uTruth1);
}
return uTruth0 & uTruth1;
}
@@ -207,9 +210,9 @@ void Abc_Ntk4VarTable( Abc_Ntk_t * pNtk )
// set elementary truth tables
assert( Abc_NtkPiNum(pNtk) == 4 );
- Abc_AigConst1(pNtk)->pCopy = (void *)0xFFFFFFFF;
+ Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)0xFFFFFFFF;
Abc_NtkForEachPi( pNtk, pObj, i )
- pObj->pCopy = (void *)u4VarTruths[i];
+ pObj->pCopy = (Abc_Obj_t *)u4VarTruths[i];
// create truth tables
Abc_NtkForEachPo( pNtk, pObj, i )
@@ -476,3 +479,5 @@ void Abc_NtkPrintOneDec( unsigned * pTruth, int nVars )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcMerge.c b/src/base/abci/abcMerge.c
index 4997af48..d7abece8 100644
--- a/src/base/abci/abcMerge.c
+++ b/src/base/abci/abcMerge.c
@@ -22,6 +22,9 @@
#include "aig.h"
#include "nwkMerge.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -100,7 +103,7 @@ void Abc_NtkCollectCircle( Vec_Ptr_t * vStart, Vec_Ptr_t * vNext, int nFanMax )
Abc_Obj_t * pObj, * pNext;
int i, k;
Vec_PtrClear( vNext );
- Vec_PtrForEachEntry( vStart, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vStart, pObj, i )
{
Abc_ObjForEachFanin( pObj, pNext, k )
{
@@ -158,7 +161,7 @@ void Abc_NtkCollectNonOverlapCands( Abc_Obj_t * pLut, Vec_Ptr_t * vStart, Vec_Pt
vStart = vNext;
vNext = vTemp;
// collect the nodes in vStart
- Vec_PtrForEachEntry( vStart, pObj, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vStart, pObj, k )
Vec_PtrPush( vCands, pObj );
}
@@ -180,7 +183,7 @@ void Abc_NtkCollectNonOverlapCands( Abc_Obj_t * pLut, Vec_Ptr_t * vStart, Vec_Pt
// - they have no more than the given number of fanins
// - they have no more than the given diff in delay
k = 0;
- Vec_PtrForEachEntry( vCands, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vCands, pObj, i )
{
if ( Abc_NodeIsTravIdCurrent(pObj) )
continue;
@@ -305,9 +308,9 @@ Vec_Int_t * Abc_NtkLutMerge( Abc_Ntk_t * pNtk, Nwk_LMPars_t * pPars )
continue;
nCands += Vec_PtrSize(vCands1) + Vec_PtrSize(vCands2);
// save candidates
- Vec_PtrForEachEntry( vCands1, pCand, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vCands1, pCand, k )
Nwk_ManGraphHashEdge( p, Abc_ObjId(pLut), Abc_ObjId(pCand) );
- Vec_PtrForEachEntry( vCands2, pCand, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vCands2, pCand, k )
Nwk_ManGraphHashEdge( p, Abc_ObjId(pLut), Abc_ObjId(pCand) );
// print statistics about this node
if ( pPars->fVeryVerbose )
@@ -350,3 +353,5 @@ Vec_Int_t * Abc_NtkLutMerge( Abc_Ntk_t * pNtk, Nwk_LMPars_t * pPars )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcMini.c b/src/base/abci/abcMini.c
index 92985423..429c40c6 100644
--- a/src/base/abci/abcMini.c
+++ b/src/base/abci/abcMini.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -135,8 +138,8 @@ Abc_Ntk_t * Abc_NtkFromMini( Abc_Ntk_t * pNtk, Hop_Man_t * pMan )
pObj->pData = Abc_NtkCi(pNtkNew, i);
// rebuild the AIG
vNodes = Hop_ManDfs( pMan );
- Vec_PtrForEachEntry( vNodes, pObj, i )
- pObj->pData = Abc_AigAnd( pNtkNew->pManFunc, (Abc_Obj_t *)Hop_ObjChild0Copy(pObj), (Abc_Obj_t *)Hop_ObjChild1Copy(pObj) );
+ Vec_PtrForEachEntry( Hop_Obj_t *, vNodes, pObj, i )
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Hop_ObjChild0Copy(pObj), (Abc_Obj_t *)Hop_ObjChild1Copy(pObj) );
Vec_PtrFree( vNodes );
// connect the PO nodes
Hop_ManForEachPo( pMan, pObj, i )
@@ -151,3 +154,5 @@ Abc_Ntk_t * Abc_NtkFromMini( Abc_Ntk_t * pNtk, Hop_Man_t * pMan )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcMiter.c b/src/base/abci/abcMiter.c
index 34270fab..dbb27e91 100644
--- a/src/base/abci/abcMiter.c
+++ b/src/base/abci/abcMiter.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -98,7 +101,7 @@ Abc_Ntk_t * Abc_NtkMiterInt( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb, in
Abc_NtkMiterAddOne( pNtk1, pNtkMiter );
Abc_NtkMiterAddOne( pNtk2, pNtkMiter );
Abc_NtkMiterFinalize( pNtk1, pNtk2, pNtkMiter, fComb, nPartSize, fImplic, fMulti );
- Abc_AigCleanup(pNtkMiter->pManFunc);
+ Abc_AigCleanup((Abc_Aig_t *)pNtkMiter->pManFunc);
// make sure that everything is okay
if ( !Abc_NtkCheck( pNtkMiter ) )
@@ -231,7 +234,7 @@ void Abc_NtkMiterAddOne( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkMiter )
int i;
assert( Abc_NtkIsDfsOrdered(pNtk) );
Abc_AigForEachAnd( pNtk, pNode, i )
- pNode->pCopy = Abc_AigAnd( pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
}
/**Function*************************************************************
@@ -254,9 +257,9 @@ void Abc_NtkMiterAddCone( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkMiter, Abc_Obj_t * p
Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkMiter);
// perform strashing
vNodes = Abc_NtkDfsNodes( pNtk, &pRoot, 1 );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
if ( Abc_AigNodeIsAnd(pNode) )
- pNode->pCopy = Abc_AigAnd( pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
Vec_PtrFree( vNodes );
}
@@ -287,7 +290,7 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt
{
if ( fMulti )
{
- pMiter = Abc_AigXor( pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild0Copy(Abc_NtkCo(pNtk2, i)) );
+ pMiter = Abc_AigXor( (Abc_Aig_t *)pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild0Copy(Abc_NtkCo(pNtk2, i)) );
Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,i), pMiter );
}
else
@@ -305,7 +308,7 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt
{
if ( fMulti )
{
- pMiter = Abc_AigXor( pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild0Copy(Abc_NtkCo(pNtk2, i)) );
+ pMiter = Abc_AigXor( (Abc_Aig_t *)pNtkMiter->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild0Copy(Abc_NtkCo(pNtk2, i)) );
Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,i), pMiter );
}
else
@@ -326,7 +329,7 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt
{
if ( !fMulti )
{
- pMiter = Abc_AigMiter( pNtkMiter->pManFunc, vPairs, fImplic );
+ pMiter = Abc_AigMiter( (Abc_Aig_t *)pNtkMiter->pManFunc, vPairs, fImplic );
Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
}
}
@@ -350,7 +353,7 @@ void Abc_NtkMiterFinalize( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Abc_Ntk_t * pNt
Vec_PtrPush( vPairsPart, Vec_PtrEntry(vPairs, 2*iCur ) );
Vec_PtrPush( vPairsPart, Vec_PtrEntry(vPairs, 2*iCur+1) );
}
- pMiter = Abc_AigMiter( pNtkMiter->pManFunc, vPairsPart, fImplic );
+ pMiter = Abc_AigMiter( (Abc_Aig_t *)pNtkMiter->pManFunc, vPairsPart, fImplic );
pNode = Abc_NtkCreatePo( pNtkMiter );
Abc_ObjAddFanin( pNode, pMiter );
// assign the name to the node
@@ -409,13 +412,13 @@ Abc_Ntk_t * Abc_NtkMiterAnd( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fOr, int
pRoot1 = Abc_NtkPo(pNtk1,0);
pRoot2 = Abc_NtkPo(pNtk2,0);
pOutput1 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot1)->pCopy, Abc_ObjFaninC0(pRoot1) );
- pOutput2 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot2)->pCopy, Abc_ObjFaninC0(pRoot2) ^ fCompl2 );
+ pOutput2 = Abc_ObjNotCond( Abc_ObjFanin0(pRoot2)->pCopy, (int)Abc_ObjFaninC0(pRoot2) ^ fCompl2 );
// create the miter of the two outputs
if ( fOr )
- pMiter = Abc_AigOr( pNtkMiter->pManFunc, pOutput1, pOutput2 );
+ pMiter = Abc_AigOr( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
else
- pMiter = Abc_AigAnd( pNtkMiter->pManFunc, pOutput1, pOutput2 );
+ pMiter = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
// make sure that everything is okay
@@ -551,7 +554,7 @@ Abc_Ntk_t * Abc_NtkMiterForCofactors( Abc_Ntk_t * pNtk, int Out, int In1, int In
pOutput2 = Abc_ObjFanin0(pRoot)->pCopy;
// create the miter of the two outputs
- pMiter = Abc_AigXor( pNtkMiter->pManFunc, pOutput1, pOutput2 );
+ pMiter = Abc_AigXor( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
// make sure that everything is okay
@@ -613,9 +616,9 @@ Abc_Ntk_t * Abc_NtkMiterQuantify( Abc_Ntk_t * pNtk, int In, int fExist )
// create the miter of the two outputs
if ( fExist )
- pMiter = Abc_AigOr( pNtkMiter->pManFunc, pOutput1, pOutput2 );
+ pMiter = Abc_AigOr( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
else
- pMiter = Abc_AigAnd( pNtkMiter->pManFunc, pOutput1, pOutput2 );
+ pMiter = Abc_AigAnd( (Abc_Aig_t *)pNtkMiter->pManFunc, pOutput1, pOutput2 );
Abc_ObjAddFanin( Abc_NtkPo(pNtkMiter,0), pMiter );
// make sure that everything is okay
@@ -805,7 +808,7 @@ Abc_Ntk_t * Abc_NtkFrames( Abc_Ntk_t * pNtk, int nFrames, int fInitial, int fVer
pLatchOut->pCopy = Abc_ObjNotCond( Abc_AigConst1(pNtkFrames), Abc_LatchIsInit0(pLatch) );
}
if ( Counter )
- printf( "Warning: %d uninitialized latches are replaced by ABC_FREE PI variables.\n", Counter );
+ printf( "Warning: %d uninitialized latches are replaced by free PI variables.\n", Counter );
}
// create the timeframes
@@ -826,7 +829,7 @@ Abc_Ntk_t * Abc_NtkFrames( Abc_Ntk_t * pNtk, int nFrames, int fInitial, int fVer
}
// remove dangling nodes
- Abc_AigCleanup( pNtkFrames->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkFrames->pManFunc );
// reorder the latches
Abc_NtkOrderCisCos( pNtkFrames );
// make sure that everything is okay
@@ -865,19 +868,13 @@ void Abc_NtkAddFrame( Abc_Ntk_t * pNtkFrames, Abc_Ntk_t * pNtk, int iFrame )
Abc_ObjAssignName( Abc_NtkDupObj(pNtkFrames, pNode, 0), Abc_ObjName(pNode), Buffer );
// add the internal nodes
Abc_AigForEachAnd( pNtk, pNode, i )
- pNode->pCopy = Abc_AigAnd( pNtkFrames->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkFrames->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
// add the new POs
Abc_NtkForEachPo( pNtk, pNode, i )
{
Abc_ObjAssignName( Abc_NtkDupObj(pNtkFrames, pNode, 0), Abc_ObjName(pNode), Buffer );
Abc_ObjAddFanin( pNode->pCopy, Abc_ObjChild0Copy(pNode) );
}
- // add the new asserts
- Abc_NtkForEachAssert( pNtk, pNode, i )
- {
- Abc_ObjAssignName( Abc_NtkDupObj(pNtkFrames, pNode, 0), Abc_ObjName(pNode), Buffer );
- Abc_ObjAddFanin( pNode->pCopy, Abc_ObjChild0Copy(pNode) );
- }
// transfer the implementation of the latch inputs to the latch outputs
Abc_NtkForEachLatch( pNtk, pLatch, i )
pLatch->pCopy = Abc_ObjChild0Copy(Abc_ObjFanin0(pLatch));
@@ -939,7 +936,7 @@ Abc_Ntk_t * Abc_NtkFrames2( Abc_Ntk_t * pNtk, int nFrames, int fInitial, AddFram
if (addFrameMapping) addFrameMapping(pLatch->pCopy, pLatch, 0, arg);
}
if ( Counter )
- printf( "Warning: %d uninitialized latches are replaced by ABC_FREE PI variables.\n", Counter );
+ printf( "Warning: %d uninitialized latches are replaced by free PI variables.\n", Counter );
}
// create the timeframes
@@ -1018,7 +1015,7 @@ void Abc_NtkAddFrame2( Abc_Ntk_t * pNtkFrames, Abc_Ntk_t * pNtk, int iFrame, Vec
if (addFrameMapping) addFrameMapping(pNodeNew, pNode, iFrame, arg);
}
// add the internal nodes
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( pNode == pConst1 )
pNodeNew = pConst1New;
@@ -1113,12 +1110,12 @@ int Abc_NtkDemiter( Abc_Ntk_t * pNtk )
vNodes1 = Abc_NtkDfsNodes( pNtk, &pNodeC, 1 );
vNodes2 = Abc_NtkDfsNodes( pNtk, &pNodeB, 1 );
- Vec_PtrForEachEntry( vNodes1, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes1, pNode, i )
pNode->fMarkA = 1;
nCommon = 0;
- Vec_PtrForEachEntry( vNodes2, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes2, pNode, i )
nCommon += pNode->fMarkA;
- Vec_PtrForEachEntry( vNodes1, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes1, pNode, i )
pNode->fMarkA = 0;
printf( "First cone = %6d. Second cone = %6d. Common = %6d.\n", vNodes1->nSize, vNodes2->nSize, nCommon );
@@ -1160,9 +1157,9 @@ int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd )
// perform operations on the POs
Abc_NtkForEachPo( pNtk, pNode, i )
if ( fAnd )
- pMiter = Abc_AigAnd( pNtk->pManFunc, pMiter, Abc_ObjChild0(pNode) );
+ pMiter = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pMiter, Abc_ObjChild0(pNode) );
else
- pMiter = Abc_AigOr( pNtk->pManFunc, pMiter, Abc_ObjChild0(pNode) );
+ pMiter = Abc_AigOr( (Abc_Aig_t *)pNtk->pManFunc, pMiter, Abc_ObjChild0(pNode) );
// remove the POs and their names
for ( i = Abc_NtkPoNum(pNtk) - 1; i >= 0; i-- )
Abc_NtkDeleteObj( Abc_NtkPo(pNtk, i) );
@@ -1186,3 +1183,5 @@ int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcMulti.c b/src/base/abci/abcMulti.c
index e93360a0..4e962cff 100644
--- a/src/base/abci/abcMulti.c
+++ b/src/base/abci/abcMulti.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -129,7 +132,7 @@ void Abc_NtkMultiInt( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
if ( Abc_ObjFanoutNum(pConst1) > 0 )
{
pNodeNew = Abc_NtkCreateNode( pNtkNew );
- pNodeNew->pData = Cudd_ReadOne( pNtkNew->pManFunc ); Cudd_Ref( pNodeNew->pData );
+ pNodeNew->pData = Cudd_ReadOne( (DdManager *)pNtkNew->pManFunc ); Cudd_Ref( (DdNode *)pNodeNew->pData );
pConst1->pCopy = pNodeNew;
}
@@ -186,11 +189,11 @@ Abc_Obj_t * Abc_NtkMulti_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld )
// create a new node
pNodeNew = Abc_NtkCreateNode( pNtkNew );
for ( i = 0; i < vCone->nSize; i++ )
- Abc_ObjAddFanin( pNodeNew, Abc_NtkMulti_rec(pNtkNew, vCone->pArray[i]) );
+ Abc_ObjAddFanin( pNodeNew, Abc_NtkMulti_rec(pNtkNew, (Abc_Obj_t *)vCone->pArray[i]) );
// derive the function of this node
- pNodeNew->pData = Abc_NtkMultiDeriveBdd( pNtkNew->pManFunc, pNodeOld, vCone );
- Cudd_Ref( pNodeNew->pData );
+ pNodeNew->pData = Abc_NtkMultiDeriveBdd( (DdManager *)pNtkNew->pManFunc, pNodeOld, vCone );
+ Cudd_Ref( (DdNode *)pNodeNew->pData );
Vec_PtrFree( vCone );
// remember the node
@@ -220,8 +223,8 @@ DdNode * Abc_NtkMultiDeriveBdd( DdManager * dd, Abc_Obj_t * pNodeOld, Vec_Ptr_t
// set the elementary BDD variables for the input nodes
for ( i = 0; i < vFaninsOld->nSize; i++ )
{
- pFaninOld = vFaninsOld->pArray[i];
- pFaninOld->pData = Cudd_bddIthVar( dd, i ); Cudd_Ref( pFaninOld->pData );
+ pFaninOld = (Abc_Obj_t *)vFaninsOld->pArray[i];
+ pFaninOld->pData = Cudd_bddIthVar( dd, i ); Cudd_Ref( (DdNode *)pFaninOld->pData );
pFaninOld->fMarkC = 1;
}
// call the recursive BDD computation
@@ -229,8 +232,8 @@ DdNode * Abc_NtkMultiDeriveBdd( DdManager * dd, Abc_Obj_t * pNodeOld, Vec_Ptr_t
// dereference the intermediate nodes
for ( i = 0; i < vFaninsOld->nSize; i++ )
{
- pFaninOld = vFaninsOld->pArray[i];
- Cudd_RecursiveDeref( dd, pFaninOld->pData );
+ pFaninOld = (Abc_Obj_t *)vFaninsOld->pArray[i];
+ Cudd_RecursiveDeref( dd, (DdNode *)pFaninOld->pData );
pFaninOld->fMarkC = 0;
}
Cudd_Deref( bFunc );
@@ -256,7 +259,7 @@ DdNode * Abc_NtkMultiDeriveBdd_rec( DdManager * dd, Abc_Obj_t * pNode, Vec_Ptr_t
if ( pNode->fMarkC )
{
assert( pNode->pData ); // network has a cycle
- return pNode->pData;
+ return (DdNode *)pNode->pData;
}
// mark the node as visited
pNode->fMarkC = 1;
@@ -264,8 +267,8 @@ DdNode * Abc_NtkMultiDeriveBdd_rec( DdManager * dd, Abc_Obj_t * pNode, Vec_Ptr_t
// compute the result for both branches
bFunc0 = Abc_NtkMultiDeriveBdd_rec( dd, Abc_ObjFanin(pNode,0), vFanins ); Cudd_Ref( bFunc0 );
bFunc1 = Abc_NtkMultiDeriveBdd_rec( dd, Abc_ObjFanin(pNode,1), vFanins ); Cudd_Ref( bFunc1 );
- bFunc0 = Cudd_NotCond( bFunc0, Abc_ObjFaninC0(pNode) );
- bFunc1 = Cudd_NotCond( bFunc1, Abc_ObjFaninC1(pNode) );
+ bFunc0 = Cudd_NotCond( bFunc0, (long)Abc_ObjFaninC0(pNode) );
+ bFunc1 = Cudd_NotCond( bFunc1, (long)Abc_ObjFaninC1(pNode) );
// get the final result
bFunc = Cudd_bddAnd( dd, bFunc0, bFunc1 ); Cudd_Ref( bFunc );
Cudd_RecursiveDeref( dd, bFunc0 );
@@ -641,3 +644,5 @@ void Abc_NtkMultiCone( Abc_Obj_t * pNode, Vec_Ptr_t * vCone )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcMv.c b/src/base/abci/abcMv.c
index 8ea3697f..4bfb1a02 100644
--- a/src/base/abci/abcMv.c
+++ b/src/base/abci/abcMv.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -367,3 +370,5 @@ void Abc_MvDecompose( Mv_Man_t * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcNtbdd.c b/src/base/abci/abcNtbdd.c
index 62256997..d27eab82 100644
--- a/src/base/abci/abcNtbdd.c
+++ b/src/base/abci/abcNtbdd.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -81,13 +84,13 @@ Abc_Ntk_t * Abc_NtkDeriveFromBdd( DdManager * dd, DdNode * bFunc, char * pNamePo
pNtk = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_BDD, 1 );
pNtk->pName = Extra_UtilStrsav(pNamePo);
// make sure the new manager has enough inputs
- Cudd_bddIthVar( pNtk->pManFunc, Vec_PtrSize(vNamesPi) );
+ Cudd_bddIthVar( (DdManager *)pNtk->pManFunc, Vec_PtrSize(vNamesPi) );
// add the PIs corresponding to the names
- Vec_PtrForEachEntry( vNamesPi, pName, i )
+ Vec_PtrForEachEntry( char *, vNamesPi, pName, i )
Abc_ObjAssignName( Abc_NtkCreatePi(pNtk), pName, NULL );
// create the node
pNode = Abc_NtkCreateNode( pNtk );
- pNode->pData = Cudd_bddTransfer( dd, pNtk->pManFunc, bFunc ); Cudd_Ref(pNode->pData);
+ pNode->pData = (DdNode *)Cudd_bddTransfer( dd, (DdManager *)pNtk->pManFunc, bFunc ); Cudd_Ref((DdNode *)pNode->pData);
Abc_NtkForEachPi( pNtk, pNodePi, i )
Abc_ObjAddFanin( pNode, pNodePi );
// create the only PO
@@ -154,7 +157,7 @@ void Abc_NtkBddToMuxesPerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
// perform conversion in the topological order
vNodes = Abc_NtkDfs( pNtk, 0 );
pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
// convert one node
@@ -181,8 +184,8 @@ void Abc_NtkBddToMuxesPerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew )
***********************************************************************/
Abc_Obj_t * Abc_NodeBddToMuxes( Abc_Obj_t * pNodeOld, Abc_Ntk_t * pNtkNew )
{
- DdManager * dd = pNodeOld->pNtk->pManFunc;
- DdNode * bFunc = pNodeOld->pData;
+ DdManager * dd = (DdManager *)pNodeOld->pNtk->pManFunc;
+ DdNode * bFunc = (DdNode *)pNodeOld->pData;
Abc_Obj_t * pFaninOld, * pNodeNew;
st_table * tBdd2Node;
int i;
@@ -253,7 +256,7 @@ DdManager * Abc_NtkBuildGlobalBdds( Abc_Ntk_t * pNtk, int nBddSizeMax, int fDrop
int i, k, Counter;
// remove dangling nodes
- Abc_AigCleanup( pNtk->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
// start the manager
assert( Abc_NtkGlobalBdd(pNtk) == NULL );
@@ -305,7 +308,7 @@ DdManager * Abc_NtkBuildGlobalBdds( Abc_Ntk_t * pNtk, int nBddSizeMax, int fDrop
pFanin->vFanouts.nSize++;
return NULL;
}
- bFunc = Cudd_NotCond( bFunc, Abc_ObjFaninC0(pObj) ); Cudd_Ref( bFunc );
+ bFunc = Cudd_NotCond( bFunc, (int)Abc_ObjFaninC0(pObj) ); Cudd_Ref( bFunc );
Abc_ObjSetGlobalBdd( pObj, bFunc );
}
Extra_ProgressBarStop( pProgress );
@@ -409,8 +412,8 @@ DdNode * Abc_NodeGlobalBdds_rec( DdManager * dd, Abc_Obj_t * pNode, int nBddSize
Cudd_Ref( bFunc1 );
// complement the branch BDDs
- bFunc0 = Cudd_NotCond( bFunc0, Abc_ObjIsComplement(pNode0) );
- bFunc1 = Cudd_NotCond( bFunc1, Abc_ObjIsComplement(pNode1) );
+ bFunc0 = Cudd_NotCond( bFunc0, (int)Abc_ObjIsComplement(pNode0) );
+ bFunc1 = Cudd_NotCond( bFunc1, (int)Abc_ObjIsComplement(pNode1) );
// get the final result
bFunc = Cudd_bddIte( dd, bFuncC, bFunc1, bFunc0 ); Cudd_Ref( bFunc );
Cudd_RecursiveDeref( dd, bFunc0 );
@@ -430,8 +433,8 @@ DdNode * Abc_NodeGlobalBdds_rec( DdManager * dd, Abc_Obj_t * pNode, int nBddSize
if ( bFunc1 == NULL )
return NULL;
Cudd_Ref( bFunc1 );
- bFunc0 = Cudd_NotCond( bFunc0, Abc_ObjFaninC0(pNode) );
- bFunc1 = Cudd_NotCond( bFunc1, Abc_ObjFaninC1(pNode) );
+ bFunc0 = Cudd_NotCond( bFunc0, (int)Abc_ObjFaninC0(pNode) );
+ bFunc1 = Cudd_NotCond( bFunc1, (int)Abc_ObjFaninC1(pNode) );
// get the final result
bFunc = Cudd_bddAnd( dd, bFunc0, bFunc1 ); Cudd_Ref( bFunc );
Cudd_RecursiveDeref( dd, bFunc0 );
@@ -470,7 +473,7 @@ DdNode * Abc_NodeGlobalBdds_rec( DdManager * dd, Abc_Obj_t * pNode, int nBddSize
***********************************************************************/
DdManager * Abc_NtkFreeGlobalBdds( Abc_Ntk_t * pNtk, int fFreeMan )
{
- return Abc_NtkAttrFree( pNtk, VEC_ATTR_GLOBAL_BDD, fFreeMan );
+ return (DdManager *)Abc_NtkAttrFree( pNtk, VEC_ATTR_GLOBAL_BDD, fFreeMan );
}
/**Function*************************************************************
@@ -527,7 +530,7 @@ double Abc_NtkSpacePercentage( Abc_Obj_t * pNode )
dd = Cudd_Init( Vec_PtrSize(vNodes), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
// assign elementary BDDs for the CIs
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
pObj->pCopy = (Abc_Obj_t *)dd->vars[i];
// build the BDD of the cone
bFunc = Abc_NodeGlobalBdds_rec( dd, pNodeR, 10000000, 1, NULL, NULL, 1 ); Cudd_Ref( bFunc );
@@ -592,3 +595,5 @@ ABC_PRT( "Time", clock() - clk );
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcOdc.c b/src/base/abci/abcOdc.c
index 67b243b9..5db556b8 100644
--- a/src/base/abci/abcOdc.c
+++ b/src/base/abci/abcOdc.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -39,7 +42,6 @@ struct Odc_Obj_t_
unsigned uMask; // the variable mask
};
-typedef struct Odc_Man_t_ Odc_Man_t;
struct Odc_Man_t_
{
// dont'-care parameters
@@ -132,7 +134,7 @@ static inline void Odc_ObjSetTravIdCurrent( Odc_Man_t * p, Odc_Obj_t *
static inline int Odc_ObjIsTravIdCurrent( Odc_Man_t * p, Odc_Obj_t * pObj ) { return (int )((int)pObj->TravId == p->nTravIds); }
// truth tables
-static inline unsigned * Odc_ObjTruth( Odc_Man_t * p, Odc_Lit_t Lit ) { assert( !(Lit & 1) ); return Vec_PtrEntry(p->vTruths, Lit >> 1); }
+static inline unsigned * Odc_ObjTruth( Odc_Man_t * p, Odc_Lit_t Lit ) { assert( !(Lit & 1) ); return (unsigned *) Vec_PtrEntry(p->vTruths, Lit >> 1); }
// iterators
#define Odc_ForEachPi( p, Lit, i ) \
@@ -140,12 +142,6 @@ static inline unsigned * Odc_ObjTruth( Odc_Man_t * p, Odc_Lit_t Lit ) { ass
#define Odc_ForEachAnd( p, pObj, i ) \
for ( i = 1 + Odc_CiNum(p); (i < Odc_ObjNum(p)) && ((pObj) = (p)->pObjs + i); i++ )
-
-// exported functions
-extern Odc_Man_t * Abc_NtkDontCareAlloc( int nVarsMax, int nLevels, int fVerbose, int fVeryVerbose );
-extern void Abc_NtkDontCareClear( Odc_Man_t * p );
-extern void Abc_NtkDontCareFree( Odc_Man_t * p );
-extern int Abc_NtkDontCareCompute( Odc_Man_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, unsigned * puTruth );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -209,11 +205,11 @@ Odc_Man_t * Abc_NtkDontCareAlloc( int nVarsMax, int nLevels, int fVerbose, int f
p->vTruthsElem = Vec_PtrAllocSimInfo( p->nVarsMax, p->nWords );
// set elementary truth tables
- Abc_InfoFill( Vec_PtrEntry(p->vTruths, 0), p->nWords );
+ Abc_InfoFill( (unsigned *)Vec_PtrEntry(p->vTruths, 0), p->nWords );
for ( k = 0; k < p->nVarsMax; k++ )
{
// pData = Odc_ObjTruth( p, Odc_Var(p, k) );
- pData = Vec_PtrEntry( p->vTruthsElem, k );
+ pData = (unsigned *)Vec_PtrEntry( p->vTruthsElem, k );
Abc_InfoClear( pData, p->nWords );
for ( i = 0; i < p->nBits; i++ )
if ( i & (1 << k) )
@@ -350,7 +346,7 @@ void Abc_NtkDontCareWinSweepLeafTfo( Odc_Man_t * p )
Abc_Obj_t * pObj;
int i;
Abc_NtkIncrementTravId( p->pNode->pNtk );
- Vec_PtrForEachEntry( p->vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i )
Abc_NtkDontCareWinSweepLeafTfo_rec( pObj, p->pNode->Level + p->nLevels, p->pNode );
}
@@ -457,11 +453,11 @@ int Abc_NtkDontCareWinAddMissing( Odc_Man_t * p )
int i;
// set the leaves
Abc_NtkIncrementTravId( p->pNode->pNtk );
- Vec_PtrForEachEntry( p->vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i )
Abc_NodeSetTravIdCurrent( pObj );
// explore from the roots
Vec_PtrClear( p->vBranches );
- Vec_PtrForEachEntry( p->vRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i )
if ( !Abc_NtkDontCareWinAddMissing_rec( p, pObj ) )
return 0;
return 1;
@@ -662,7 +658,7 @@ void * Abc_NtkDontCareTransfer_rec( Odc_Man_t * p, Abc_Obj_t * pNode, Abc_Obj_t
assert( Abc_ObjIsNode(pNode) );
// consider the case when the node is the pivot
if ( pNode == pPivot )
- return pNode->pCopy = (void *)(ABC_PTRUINT_T)((Odc_Const1() << 16) | Odc_Const0());
+ return pNode->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((Odc_Const1() << 16) | Odc_Const0());
// compute the cofactors
uData0 = (unsigned)(ABC_PTRUINT_T)Abc_NtkDontCareTransfer_rec( p, Abc_ObjFanin0(pNode), pPivot );
uData1 = (unsigned)(ABC_PTRUINT_T)Abc_NtkDontCareTransfer_rec( p, Abc_ObjFanin1(pNode), pPivot );
@@ -675,7 +671,7 @@ void * Abc_NtkDontCareTransfer_rec( Odc_Man_t * p, Abc_Obj_t * pNode, Abc_Obj_t
uLit1 = Odc_NotCond( (Odc_Lit_t)(uData1 >> 16), Abc_ObjFaninC1(pNode) );
uRes1 = Odc_And( p, uLit0, uLit1 );
// find the result
- return pNode->pCopy = (void *)(ABC_PTRUINT_T)((uRes1 << 16) | uRes0);
+ return pNode->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((uRes1 << 16) | uRes0);
}
/**Function*************************************************************
@@ -698,22 +694,22 @@ int Abc_NtkDontCareTransfer( Odc_Man_t * p )
int i;
Abc_NtkIncrementTravId( p->pNode->pNtk );
// set elementary variables at the leaves
- Vec_PtrForEachEntry( p->vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i )
{
uLit = Odc_Var( p, i );
- pObj->pCopy = (void *)(ABC_PTRUINT_T)((uLit << 16) | uLit);
+ pObj->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((uLit << 16) | uLit);
Abc_NodeSetTravIdCurrent(pObj);
}
// set elementary variables at the branched
- Vec_PtrForEachEntry( p->vBranches, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vBranches, pObj, i )
{
uLit = Odc_Var( p, i+p->nVarsMax );
- pObj->pCopy = (void *)(ABC_PTRUINT_T)((uLit << 16) | uLit);
+ pObj->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((uLit << 16) | uLit);
Abc_NodeSetTravIdCurrent(pObj);
}
// compute the AIG for the window
p->iRoot = Odc_Const0();
- Vec_PtrForEachEntry( p->vRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i )
{
uData = (unsigned)(ABC_PTRUINT_T)Abc_NtkDontCareTransfer_rec( p, pObj, p->pNode );
// get the cofactors
@@ -851,7 +847,7 @@ void Abc_NtkDontCareSimulateSetElem( Odc_Man_t * p )
for ( k = 0; k < p->nVarsMax; k++ )
{
pData = Odc_ObjTruth( p, Odc_Var(p, k) );
- pData2 = Vec_PtrEntry( p->vTruthsElem, k );
+ pData2 = (unsigned *)Vec_PtrEntry( p->vTruthsElem, k );
Abc_InfoCopy( pData, pData2, p->nWords );
}
}
@@ -1132,3 +1128,5 @@ p->timeTotal += clock() - clkTotal;
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcOrder.c b/src/base/abci/abcOrder.c
index 04417f77..c306d01d 100644
--- a/src/base/abci/abcOrder.c
+++ b/src/base/abci/abcOrder.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -109,10 +112,10 @@ void Abc_NtkChangeCiOrder( Abc_Ntk_t * pNtk, Vec_Ptr_t * vSupp, int fReverse )
assert( Vec_PtrSize(vSupp) == Abc_NtkCiNum(pNtk) );
// order CIs using the array
if ( fReverse )
- Vec_PtrForEachEntry( vSupp, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pObj, i )
Vec_PtrWriteEntry( pNtk->vCis, Vec_PtrSize(vSupp)-1-i, pObj );
else
- Vec_PtrForEachEntry( vSupp, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pObj, i )
Vec_PtrWriteEntry( pNtk->vCis, i, pObj );
// order PIs accordingly
Vec_PtrClear( pNtk->vPis );
@@ -129,3 +132,5 @@ void Abc_NtkChangeCiOrder( Abc_Ntk_t * pNtk, Vec_Ptr_t * vSupp, int fReverse )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcPart.c b/src/base/abci/abcPart.c
index 4c348b16..5df5af62 100644
--- a/src/base/abci/abcPart.c
+++ b/src/base/abci/abcPart.c
@@ -19,6 +19,11 @@
***********************************************************************/
#include "abc.h"
+#include "main.h"
+#include "cmd.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -29,10 +34,10 @@ struct Supp_Man_t_
{
int nChunkSize; // the size of one chunk of memory (~1 Mb)
int nStepSize; // the step size in saving memory (~64 bytes)
- char * pFreeBuf; // the pointer to ABC_FREE memory
- int nFreeSize; // the size of remaining ABC_FREE memory
+ char * pFreeBuf; // the pointer to free memory
+ int nFreeSize; // the size of remaining free memory
Vec_Ptr_t * vMemory; // the memory allocated
- Vec_Ptr_t * vFree; // the vector of ABC_FREE pieces of memory
+ Vec_Ptr_t * vFree; // the vector of free pieces of memory
};
typedef struct Supp_One_t_ Supp_One_t;
@@ -90,7 +95,7 @@ void Supp_ManStop( Supp_Man_t * p )
{
void * pMemory;
int i;
- Vec_PtrForEachEntry( p->vMemory, pMemory, i )
+ Vec_PtrForEachEntry( void *, p->vMemory, pMemory, i )
ABC_FREE( pMemory );
Vec_PtrFree( p->vMemory );
Vec_PtrFree( p->vFree );
@@ -115,7 +120,7 @@ char * Supp_ManFetch( Supp_Man_t * p, int nSize )
assert( nSize > 0 );
Type = Supp_SizeType( nSize, p->nStepSize );
Vec_PtrFillExtra( p->vFree, Type + 1, NULL );
- if ( (pMemory = Vec_PtrEntry( p->vFree, Type )) )
+ if ( (pMemory = (char *)Vec_PtrEntry( p->vFree, Type )) )
{
Vec_PtrWriteEntry( p->vFree, Type, Supp_OneNext(pMemory) );
return pMemory;
@@ -150,7 +155,7 @@ void Supp_ManRecycle( Supp_Man_t * p, char * pMemory, int nSize )
int Type;
Type = Supp_SizeType( nSize, p->nStepSize );
Vec_PtrFillExtra( p->vFree, Type + 1, NULL );
- Supp_OneSetNext( pMemory, Vec_PtrEntry(p->vFree, Type) );
+ Supp_OneSetNext( pMemory, (char *)Vec_PtrEntry(p->vFree, Type) );
Vec_PtrWriteEntry( p->vFree, Type, pMemory );
}
@@ -331,7 +336,7 @@ Vec_Ptr_t * Abc_NtkComputeSupportsSmart( Abc_Ntk_t * pNtk )
Abc_NtkCleanCopy(pNtk);
// order the nodes so that the PIs and POs follow naturally
vNodes = Abc_NtkDfsNatural( pNtk );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
if ( Abc_ObjIsNode(pObj) )
{
@@ -390,7 +395,7 @@ Vec_Ptr_t * Abc_NtkComputeSupportsSmart( Abc_Ntk_t * pNtk )
Abc_NtkForEachCo( pNtk, pObj, i )
pObj->pNext = NULL;
/*
- Vec_PtrForEachEntry( vSupports, vSupp, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vSupports, vSupp, i )
printf( "%d ", Vec_IntSize(vSupp) );
printf( "\n" );
*/
@@ -417,7 +422,7 @@ Vec_Ptr_t * Abc_NtkComputeSupportsNaive( Abc_Ntk_t * pNtk )
int i, k;
// set the PI numbers
Abc_NtkForEachCi( pNtk, pObj, i )
- pObj->pNext = (void *)(ABC_PTRINT_T)i;
+ pObj->pNext = (Abc_Obj_t *)(ABC_PTRINT_T)i;
// save the CI numbers
vSupports = Vec_PtrAlloc( Abc_NtkCoNum(pNtk) );
Abc_NtkForEachCo( pNtk, pObj, i )
@@ -426,7 +431,7 @@ Vec_Ptr_t * Abc_NtkComputeSupportsNaive( Abc_Ntk_t * pNtk )
continue;
vSupp = Abc_NtkNodeSupport( pNtk, &pObj, 1 );
vSuppI = (Vec_Int_t *)vSupp;
- Vec_PtrForEachEntry( vSupp, pTemp, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pTemp, k )
Vec_IntWriteEntry( vSuppI, k, (int)(ABC_PTRINT_T)pTemp->pNext );
Vec_IntSort( vSuppI, 0 );
// append the number of this output
@@ -440,7 +445,7 @@ Vec_Ptr_t * Abc_NtkComputeSupportsNaive( Abc_Ntk_t * pNtk )
// sort supports by size
Vec_VecSort( (Vec_Vec_t *)vSupports, 1 );
/*
- Vec_PtrForEachEntry( vSupports, vSuppI, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vSupports, vSuppI, i )
printf( "%d ", Vec_IntSize(vSuppI) );
printf( "\n" );
*/
@@ -532,7 +537,7 @@ int Abc_NtkPartitionSmartFindPart( Vec_Ptr_t * vPartSuppsAll, Vec_Ptr_t * vParts
int i, nCommon, iBest;
iBest = -1;
CostBest = 0.0;
- Vec_PtrForEachEntry( vPartSuppsAll, vPartSupp, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vPartSupp, i )
{
vPart = Vec_PtrEntry( vPartsAll, i );
if ( nPartSizeLimit > 0 && Vec_IntSize(vPart) >= nPartSizeLimit )
@@ -565,7 +570,7 @@ int Abc_NtkPartitionSmartFindPart( Vec_Ptr_t * vPartSuppsAll, Vec_Ptr_t * vParts
// int nCommon2;
iBest = -1;
ValueBest = 0;
- Vec_PtrForEachEntry( vPartSuppsAll, vPartSupp, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vPartSupp, i )
{
// skip partitions with too many outputs
// vPart = Vec_PtrEntry( vPartsAll, i );
@@ -573,7 +578,7 @@ int Abc_NtkPartitionSmartFindPart( Vec_Ptr_t * vPartSuppsAll, Vec_Ptr_t * vParts
// continue;
// find the number of common variables between this output and the partitions
// nCommon2 = Vec_IntTwoCountCommon( vPartSupp, vOne );
- nCommon = Abc_NtkSuppCharCommon( Vec_PtrEntry(vPartSuppsChar, i), vOne );
+ nCommon = Abc_NtkSuppCharCommon( (unsigned *)Vec_PtrEntry(vPartSuppsChar, i), vOne );
// assert( nCommon2 == nCommon );
// if no common variables, continue searching
if ( nCommon == 0 )
@@ -619,9 +624,9 @@ void Abc_NtkPartitionPrint( Abc_Ntk_t * pNtk, Vec_Ptr_t * vPartsAll, Vec_Ptr_t *
int i, nOutputs, Counter;
Counter = 0;
- Vec_PtrForEachEntry( vPartSuppsAll, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vOne, i )
{
- nOutputs = Vec_IntSize(Vec_PtrEntry(vPartsAll, i));
+ nOutputs = Vec_IntSize((Vec_Int_t *)Vec_PtrEntry(vPartsAll, i));
printf( "%d=(%d,%d) ", i, Vec_IntSize(vOne), nOutputs );
Counter += nOutputs;
if ( i == Vec_PtrSize(vPartsAll) - 1 )
@@ -653,7 +658,7 @@ void Abc_NtkPartitionCompact( Vec_Ptr_t * vPartsAll, Vec_Ptr_t * vPartSuppsAll,
// pack smaller partitions into larger blocks
iPart = 0;
vPart = vPartSupp = NULL;
- Vec_PtrForEachEntry( vPartSuppsAll, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vOne, i )
{
if ( Vec_IntSize(vOne) < nSuppSizeLimit )
{
@@ -661,27 +666,27 @@ void Abc_NtkPartitionCompact( Vec_Ptr_t * vPartsAll, Vec_Ptr_t * vPartSuppsAll,
{
assert( vPart == NULL );
vPartSupp = Vec_IntDup(vOne);
- vPart = Vec_PtrEntry(vPartsAll, i);
+ vPart = (Vec_Int_t *)Vec_PtrEntry(vPartsAll, i);
}
else
{
vPartSupp = Vec_IntTwoMerge( vTemp = vPartSupp, vOne );
Vec_IntFree( vTemp );
- vPart = Vec_IntTwoMerge( vTemp = vPart, Vec_PtrEntry(vPartsAll, i) );
+ vPart = Vec_IntTwoMerge( vTemp = vPart, (Vec_Int_t *)Vec_PtrEntry(vPartsAll, i) );
Vec_IntFree( vTemp );
- Vec_IntFree( Vec_PtrEntry(vPartsAll, i) );
+ Vec_IntFree( (Vec_Int_t *)Vec_PtrEntry(vPartsAll, i) );
}
if ( Vec_IntSize(vPartSupp) < nSuppSizeLimit )
continue;
}
else
- vPart = Vec_PtrEntry(vPartsAll, i);
+ vPart = (Vec_Int_t *)Vec_PtrEntry(vPartsAll, i);
// add the partition
Vec_PtrWriteEntry( vPartsAll, iPart, vPart );
vPart = NULL;
if ( vPartSupp )
{
- Vec_IntFree( Vec_PtrEntry(vPartSuppsAll, iPart) );
+ Vec_IntFree( (Vec_Int_t *)Vec_PtrEntry(vPartSuppsAll, iPart) );
Vec_PtrWriteEntry( vPartSuppsAll, iPart, vPartSupp );
vPartSupp = NULL;
}
@@ -694,7 +699,7 @@ void Abc_NtkPartitionCompact( Vec_Ptr_t * vPartsAll, Vec_Ptr_t * vPartSuppsAll,
vPart = NULL;
assert( vPartSupp != NULL );
- Vec_IntFree( Vec_PtrEntry(vPartSuppsAll, iPart) );
+ Vec_IntFree( (Vec_Int_t *)Vec_PtrEntry(vPartSuppsAll, iPart) );
Vec_PtrWriteEntry( vPartSuppsAll, iPart, vPartSupp );
vPartSupp = NULL;
iPart++;
@@ -738,7 +743,7 @@ clk = clock();
vPartsAll = Vec_PtrAlloc( 256 );
vPartSuppsAll = Vec_PtrAlloc( 256 );
pProgress = Extra_ProgressBarStart( stdout, Vec_PtrSize(vSupps) );
- Vec_PtrForEachEntry( vSupps, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vSupps, vOne, i )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
// if ( i % 1000 == 0 )
@@ -766,22 +771,22 @@ timeFind += clock() - clk2;
else
{
// add output to this partition
- vPart = Vec_PtrEntry( vPartsAll, iPart );
+ vPart = (Vec_Int_t *)Vec_PtrEntry( vPartsAll, iPart );
Vec_IntPush( vPart, iOut );
// merge supports
- vPartSupp = Vec_PtrEntry( vPartSuppsAll, iPart );
+ vPartSupp = (Vec_Int_t *)Vec_PtrEntry( vPartSuppsAll, iPart );
vPartSupp = Vec_IntTwoMerge( vTemp = vPartSupp, vOne );
Vec_IntFree( vTemp );
// reinsert new support
Vec_PtrWriteEntry( vPartSuppsAll, iPart, vPartSupp );
- Abc_NtkSuppCharAdd( Vec_PtrEntry(vPartSuppsChar, iPart), vOne, Abc_NtkCiNum(pNtk) );
+ Abc_NtkSuppCharAdd( (unsigned *)Vec_PtrEntry(vPartSuppsChar, iPart), vOne, Abc_NtkCiNum(pNtk) );
}
}
Extra_ProgressBarStop( pProgress );
// stop char-based support representation
- Vec_PtrForEachEntry( vPartSuppsChar, vTemp, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsChar, vTemp, i )
ABC_FREE( vTemp );
Vec_PtrFree( vPartSuppsChar );
@@ -794,13 +799,13 @@ ABC_PRT( "Parts", clock() - clk );
clk = clock();
// remember number of supports
- Vec_PtrForEachEntry( vPartSuppsAll, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vOne, i )
Vec_IntPush( vOne, i );
// sort the supports in the decreasing order
Vec_VecSort( (Vec_Vec_t *)vPartSuppsAll, 1 );
// reproduce partitions
vPartsAll2 = Vec_PtrAlloc( 256 );
- Vec_PtrForEachEntry( vPartSuppsAll, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vOne, i )
Vec_PtrPush( vPartsAll2, Vec_PtrEntry(vPartsAll, Vec_IntPop(vOne)) );
Vec_PtrFree( vPartsAll );
vPartsAll = vPartsAll2;
@@ -822,7 +827,7 @@ ABC_PRT( "Comps", clock() - clk );
Vec_VecFree( (Vec_Vec_t *)vPartSuppsAll );
/*
// converts from intergers to nodes
- Vec_PtrForEachEntry( vPartsAll, vPart, iPart )
+ Vec_PtrForEachEntry( Vec_Int_t *, vPartsAll, vPart, iPart )
{
vPartPtr = Vec_PtrAlloc( Vec_IntSize(vPart) );
Vec_IntForEachEntry( vPart, iOut, i )
@@ -853,7 +858,7 @@ Vec_Ptr_t * Abc_NtkPartitionNaive( Abc_Ntk_t * pNtk, int nPartSize )
nParts = (Abc_NtkCoNum(pNtk) / nPartSize) + ((Abc_NtkCoNum(pNtk) % nPartSize) > 0);
vParts = (Vec_Ptr_t *)Vec_VecStart( nParts );
Abc_NtkForEachCo( pNtk, pObj, i )
- Vec_IntPush( Vec_PtrEntry(vParts, i / nPartSize), i );
+ Vec_IntPush( (Vec_Int_t *)Vec_PtrEntry(vParts, i / nPartSize), i );
return vParts;
}
@@ -890,7 +895,7 @@ void Abc_NtkConvertCos( Abc_Ntk_t * pNtk, Vec_Int_t * vOuts, Vec_Ptr_t * vOutsPt
Abc_Obj_t * Abc_NtkPartStitchFindRepr_rec( Vec_Ptr_t * vEquiv, Abc_Obj_t * pObj )
{
Abc_Obj_t * pRepr;
- pRepr = Vec_PtrEntry( vEquiv, pObj->Id );
+ pRepr = (Abc_Obj_t *)Vec_PtrEntry( vEquiv, pObj->Id );
if ( pRepr == NULL || pRepr == pObj )
return pObj;
return Abc_NtkPartStitchFindRepr_rec( vEquiv, pRepr );
@@ -911,13 +916,13 @@ static inline Abc_Obj_t * Abc_NtkPartStitchCopy0( Vec_Ptr_t * vEquiv, Abc_Obj_t
{
Abc_Obj_t * pFan = Abc_ObjFanin0( pObj );
Abc_Obj_t * pRepr = Abc_NtkPartStitchFindRepr_rec( vEquiv, pFan );
- return Abc_ObjNotCond( pRepr->pCopy, pRepr->fPhase ^ pFan->fPhase ^ Abc_ObjFaninC1(pObj) );
+ return Abc_ObjNotCond( pRepr->pCopy, pRepr->fPhase ^ pFan->fPhase ^ (int)Abc_ObjFaninC1(pObj) );
}
static inline Abc_Obj_t * Abc_NtkPartStitchCopy1( Vec_Ptr_t * vEquiv, Abc_Obj_t * pObj )
{
Abc_Obj_t * pFan = Abc_ObjFanin1( pObj );
Abc_Obj_t * pRepr = Abc_NtkPartStitchFindRepr_rec( vEquiv, pFan );
- return Abc_ObjNotCond( pRepr->pCopy, pRepr->fPhase ^ pFan->fPhase ^ Abc_ObjFaninC1(pObj) );
+ return Abc_ObjNotCond( pRepr->pCopy, pRepr->fPhase ^ pFan->fPhase ^ (int)Abc_ObjFaninC1(pObj) );
}
/**Function*************************************************************
@@ -1006,7 +1011,7 @@ Abc_Ntk_t * Abc_NtkPartStitchChoices( Abc_Ntk_t * pNtk, Vec_Ptr_t * vParts )
pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
// annotate parts to point to the new network
- Vec_PtrForEachEntry( vParts, pNtkTemp, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vParts, pNtkTemp, i )
{
assert( Abc_NtkIsStrash(pNtkTemp) );
Abc_NtkCleanCopy( pNtkTemp );
@@ -1026,12 +1031,12 @@ Abc_Ntk_t * Abc_NtkPartStitchChoices( Abc_Ntk_t * pNtk, Vec_Ptr_t * vParts )
// add the internal nodes while saving representatives
vNodes = Abc_AigDfs( pNtkTemp, 1, 0 );
- Vec_PtrForEachEntry( vNodes, pObj, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, k )
{
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
assert( !Abc_ObjIsComplement(pObj->pCopy) );
if ( Abc_AigNodeIsChoice(pObj) )
- for ( pFanin = pObj->pData; pFanin; pFanin = pFanin->pData )
+ for ( pFanin = (Abc_Obj_t *)pObj->pData; pFanin; pFanin = (Abc_Obj_t *)pFanin->pData )
pFanin->pCopy->pCopy = pObj->pCopy;
}
Vec_PtrFree( vNodes );
@@ -1092,16 +1097,13 @@ Abc_Ntk_t * Abc_NtkPartStitchChoices( Abc_Ntk_t * pNtk, Vec_Ptr_t * vParts )
***********************************************************************/
Abc_Ntk_t * Abc_NtkFraigPartitioned( Vec_Ptr_t * vStore, void * pParams )
{
- extern int Cmd_CommandExecute( void * pAbc, char * sCommand );
- extern void * Abc_FrameGetGlobalFrame();
-
Vec_Ptr_t * vParts, * vFraigs, * vOnePtr;
Vec_Int_t * vOne;
Abc_Ntk_t * pNtk, * pNtk2, * pNtkAig, * pNtkFraig;
int i, k;
// perform partitioning
- pNtk = Vec_PtrEntry( vStore, 0 );
+ pNtk = (Abc_Ntk_t *)Vec_PtrEntry( vStore, 0 );
assert( Abc_NtkIsStrash(pNtk) );
// vParts = Abc_NtkPartitionNaive( pNtk, 20 );
vParts = Abc_NtkPartitionSmart( pNtk, 300, 0 );
@@ -1111,13 +1113,13 @@ Abc_Ntk_t * Abc_NtkFraigPartitioned( Vec_Ptr_t * vStore, void * pParams )
// fraig each partition
vOnePtr = Vec_PtrAlloc( 1000 );
vFraigs = Vec_PtrAlloc( Vec_PtrSize(vParts) );
- Vec_PtrForEachEntry( vParts, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vParts, vOne, i )
{
// start the partition
Abc_NtkConvertCos( pNtk, vOne, vOnePtr );
pNtkAig = Abc_NtkCreateConeArray( pNtk, vOnePtr, 0 );
// add nodes to the partition
- Vec_PtrForEachEntryStart( vStore, pNtk2, k, 1 )
+ Vec_PtrForEachEntryStart( Abc_Ntk_t *, vStore, pNtk2, k, 1 )
{
Abc_NtkConvertCos( pNtk2, vOne, vOnePtr );
Abc_NtkAppendToCone( pNtkAig, pNtk2, vOnePtr );
@@ -1137,7 +1139,7 @@ Abc_Ntk_t * Abc_NtkFraigPartitioned( Vec_Ptr_t * vStore, void * pParams )
// derive the final network
pNtkFraig = Abc_NtkPartStitchChoices( pNtk, vFraigs );
- Vec_PtrForEachEntry( vFraigs, pNtkAig, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vFraigs, pNtkAig, i )
Abc_NtkDelete( pNtkAig );
Vec_PtrFree( vFraigs );
Vec_PtrFree( vOnePtr );
@@ -1157,9 +1159,6 @@ Abc_Ntk_t * Abc_NtkFraigPartitioned( Vec_Ptr_t * vStore, void * pParams )
***********************************************************************/
void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams )
{
- extern int Cmd_CommandExecute( void * pAbc, char * sCommand );
- extern void * Abc_FrameGetGlobalFrame();
-
Vec_Ptr_t * vParts, * vFraigs, * vOnePtr;
Vec_Int_t * vOne;
Abc_Ntk_t * pNtkAig, * pNtkFraig;
@@ -1176,7 +1175,7 @@ void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams )
// fraig each partition
vOnePtr = Vec_PtrAlloc( 1000 );
vFraigs = Vec_PtrAlloc( Vec_PtrSize(vParts) );
- Vec_PtrForEachEntry( vParts, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vParts, vOne, i )
{
Abc_NtkConvertCos( pNtk, vOne, vOnePtr );
pNtkAig = Abc_NtkCreateConeArray( pNtk, vOnePtr, 0 );
@@ -1191,7 +1190,7 @@ void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams )
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "set progressbar" );
// derive the final network
- Vec_PtrForEachEntry( vFraigs, pNtkAig, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vFraigs, pNtkAig, i )
Abc_NtkDelete( pNtkAig );
Vec_PtrFree( vFraigs );
Vec_PtrFree( vOnePtr );
@@ -1203,3 +1202,5 @@ void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcPlace.c b/src/base/abci/abcPlace.c
index 87c99e99..06c23e65 100644
--- a/src/base/abci/abcPlace.c
+++ b/src/base/abci/abcPlace.c
@@ -23,6 +23,9 @@
// placement includes
#include "place_base.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -102,7 +105,7 @@ float Abc_PlaceEvaluateCut( Abc_Obj_t * pRoot, Vec_Ptr_t * vFanins )
Abc_Obj_t * pObj;
// double x, y;
int i;
- Vec_PtrForEachEntry( vFanins, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFanins, pObj, i )
{
// pObj->Id
}
@@ -131,7 +134,7 @@ void Abc_PlaceUpdate( Vec_Ptr_t * vAddedCells, Vec_Ptr_t * vUpdatedNets )
vNets = Vec_PtrAlloc( 32 );
// go through the new nodes
- Vec_PtrForEachEntry( vAddedCells, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vAddedCells, pObj, i )
{
assert( !Abc_ObjIsComplement(pObj) );
Abc_PlaceCreateCell( pObj, 1 );
@@ -144,7 +147,7 @@ void Abc_PlaceUpdate( Vec_Ptr_t * vAddedCells, Vec_Ptr_t * vUpdatedNets )
}
// go through the modified nets
- Vec_PtrForEachEntry( vUpdatedNets, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vUpdatedNets, pObj, i )
{
assert( !Abc_ObjIsComplement(pObj) );
if ( Abc_ObjType(pObj) == ABC_OBJ_NONE ) // dead node
@@ -253,3 +256,5 @@ void Abc_PlaceEnd( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c
index c9fb2834..9f52d71f 100644
--- a/src/base/abci/abcPrint.c
+++ b/src/base/abci/abcPrint.c
@@ -18,12 +18,16 @@
***********************************************************************/
+#include <math.h>
#include "abc.h"
#include "dec.h"
#include "main.h"
#include "mio.h"
#include "aig.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -126,7 +130,7 @@ float Abc_NtkMfsTotalSwitching( Abc_Ntk_t * pNtk )
// strash the network
pNtkStr = Abc_NtkStrash( pNtk, 0, 1, 0 );
Abc_NtkForEachObj( pNtk, pObjAbc, i )
- if ( Abc_ObjRegular(pObjAbc->pTemp)->Type == ABC_FUNC_NONE )
+ if ( Abc_ObjRegular((Abc_Obj_t *)pObjAbc->pTemp)->Type == ABC_FUNC_NONE )
pObjAbc->pTemp = NULL;
// map network into an AIG
pAig = Abc_NtkToDar( pNtkStr, 0, (int)(Abc_NtkLatchNum(pNtk) > 0) );
@@ -134,7 +138,7 @@ float Abc_NtkMfsTotalSwitching( Abc_Ntk_t * pNtk )
pSwitching = (float *)vSwitching->pArray;
Abc_NtkForEachObj( pNtk, pObjAbc, i )
{
- if ( (pObjAbc2 = Abc_ObjRegular(pObjAbc->pTemp)) && (pObjAig = Aig_Regular(pObjAbc2->pTemp)) )
+ if ( (pObjAbc2 = Abc_ObjRegular((Abc_Obj_t *)pObjAbc->pTemp)) && (pObjAig = Aig_Regular((Aig_Obj_t *)pObjAbc2->pTemp)) )
{
Result += Abc_ObjFanoutNum(pObjAbc) * pSwitching[pObjAig->Id];
// printf( "%d = %.2f\n", i, Abc_ObjFanoutNum(pObjAbc) * pSwitching[pObjAig->Id] );
@@ -157,15 +161,16 @@ float Abc_NtkMfsTotalSwitching( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch )
+void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch )
{
+ FILE * pFile = stdout;
int Num;
if ( fSaveBest )
Abc_NtkCompareAndSaveBest( pNtk );
if ( fDumpResult )
{
char Buffer[1000] = {0};
- char * pNameGen = pNtk->pSpec? Extra_FileNameGeneric( pNtk->pSpec ) : "nameless_";
+ const char * pNameGen = pNtk->pSpec? Extra_FileNameGeneric( pNtk->pSpec ) : "nameless_";
sprintf( Buffer, "%s_dump.blif", pNameGen );
Io_Write( pNtk, Buffer, IO_FILE_BLIF );
if ( pNtk->pSpec ) ABC_FREE( pNameGen );
@@ -175,10 +180,9 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSave
// Abc_AigCountNext( pNtk->pManFunc );
fprintf( pFile, "%-13s:", pNtk->pName );
- if ( Abc_NtkAssertNum(pNtk) )
- fprintf( pFile, " i/o/a =%5d/%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkAssertNum(pNtk) );
- else
- fprintf( pFile, " i/o =%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
+ fprintf( pFile, " i/o =%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
+ if ( Abc_NtkConstrNum(pNtk) )
+ fprintf( pFile, "(c=%d)", Abc_NtkConstrNum(pNtk) );
fprintf( pFile, " lat =%5d", Abc_NtkLatchNum(pNtk) );
if ( Abc_NtkIsNetlist(pNtk) )
{
@@ -282,10 +286,12 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSave
// print the statistic into a file
{
FILE * pTable;
- pTable = fopen( "stats.txt", "a+" );
- fprintf( pTable, "%s ", pNtk->pSpec );
- fprintf( pTable, "%.0f ", Abc_NtkGetMappedArea(pNtk) );
- fprintf( pTable, "%.2f ", Abc_NtkDelayTrace(pNtk) );
+ pTable = fopen( "ucsb/stats.txt", "a+" );
+// fprintf( pTable, "%s ", pNtk->pSpec );
+ fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
+// fprintf( pTable, "%d ", Abc_NtkLevel(pNtk) );
+// fprintf( pTable, "%.0f ", Abc_NtkGetMappedArea(pNtk) );
+// fprintf( pTable, "%.2f ", Abc_NtkDelayTrace(pNtk) );
fprintf( pTable, "\n" );
fclose( pTable );
}
@@ -320,25 +326,6 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSave
extern int timeRetime;
FILE * pTable;
Counter++;
- pTable = fopen( "a/ret__stats.txt", "a+" );
- fprintf( pTable, "%s ", pNtk->pName );
- fprintf( pTable, "%d ", Abc_NtkNodeNum(pNtk) );
- fprintf( pTable, "%d ", Abc_NtkLatchNum(pNtk) );
- fprintf( pTable, "%d ", Abc_NtkLevel(pNtk) );
- fprintf( pTable, "%.2f ", (float)(timeRetime)/(float)(CLOCKS_PER_SEC) );
- if ( Counter % 4 == 0 )
- fprintf( pTable, "\n" );
- fclose( pTable );
- }
-*/
-
-/*
- // print the statistic into a file
- {
- static int Counter = 0;
- extern int timeRetime;
- FILE * pTable;
- Counter++;
pTable = fopen( "d/stats.txt", "a+" );
fprintf( pTable, "%s ", pNtk->pName );
// fprintf( pTable, "%d ", Abc_NtkPiNum(pNtk) );
@@ -349,7 +336,7 @@ void Abc_NtkPrintStats( FILE * pFile, Abc_Ntk_t * pNtk, int fFactored, int fSave
fprintf( pTable, "\n" );
fclose( pTable );
}
-*/
+
/*
s_TotalNodes += Abc_NtkNodeNum(pNtk);
@@ -628,7 +615,7 @@ void Abc_NtkPrintFanioNew( FILE * pFile, Abc_Ntk_t * pNtk )
fprintf( pFile, "%15d : ", k );
else
{
- sprintf( Buffer, "%d - %d", (int)pow(10, k/10) * (k%10), (int)pow(10, k/10) * (k%10+1) - 1 );
+ sprintf( Buffer, "%d - %d", (int)pow((double)10, k/10) * (k%10), (int)pow((double)10, k/10) * (k%10+1) - 1 );
fprintf( pFile, "%15s : ", Buffer );
}
if ( vFanins->pArray[k] == 0 )
@@ -757,7 +744,7 @@ void Abc_NodePrintFactor( FILE * pFile, Abc_Obj_t * pNode, int fUseRealNames )
return;
}
assert( Abc_ObjIsNode(pNode) );
- pGraph = Dec_Factor( pNode->pData );
+ pGraph = Dec_Factor( (char *)pNode->pData );
if ( fUseRealNames )
{
vNamesIn = Abc_NodeGetFaninNames(pNode);
@@ -941,12 +928,12 @@ void Abc_NodePrintKMap( Abc_Obj_t * pNode, int fUseRealNames )
if ( fUseRealNames )
{
vNamesIn = Abc_NodeGetFaninNames(pNode);
- Extra_PrintKMap( stdout, pNode->pNtk->pManFunc, pNode->pData, Cudd_Not(pNode->pData),
+ Extra_PrintKMap( stdout, (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData, Cudd_Not(pNode->pData),
Abc_ObjFaninNum(pNode), NULL, 0, (char **)vNamesIn->pArray );
Abc_NodeFreeNames( vNamesIn );
}
else
- Extra_PrintKMap( stdout, pNode->pNtk->pManFunc, pNode->pData, Cudd_Not(pNode->pData),
+ Extra_PrintKMap( stdout, (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData, Cudd_Not(pNode->pData),
Abc_ObjFaninNum(pNode), NULL, 0, NULL );
}
@@ -976,8 +963,8 @@ void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary )
int Counter, nGates, i;
// clean value of all gates
- nGates = Mio_LibraryReadGateNum( pNtk->pManFunc );
- ppGates = Mio_LibraryReadGatesByName( pNtk->pManFunc );
+ nGates = Mio_LibraryReadGateNum( (Mio_Library_t *)pNtk->pManFunc );
+ ppGates = Mio_LibraryReadGatesByName( (Mio_Library_t *)pNtk->pManFunc );
for ( i = 0; i < nGates; i++ )
Mio_GateSetValue( ppGates[i], 0 );
@@ -986,7 +973,7 @@ void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary )
Abc_NtkForEachNode( pNtk, pObj, i )
{
if ( i == 0 ) continue;
- Mio_GateSetValue( pObj->pData, 1 + Mio_GateReadValue(pObj->pData) );
+ Mio_GateSetValue( (Mio_Gate_t *)pObj->pData, 1 + Mio_GateReadValue((Mio_Gate_t *)pObj->pData) );
CounterTotal++;
}
// print the gates
@@ -1026,9 +1013,9 @@ void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary )
{
if ( i == 0 ) continue;
if ( Abc_NtkHasMapping(pNtk) )
- pSop = Mio_GateReadSop(pObj->pData);
+ pSop = Mio_GateReadSop((Mio_Gate_t *)pObj->pData);
else
- pSop = pObj->pData;
+ pSop = (char *)pObj->pData;
// collect the stats
if ( Abc_SopIsConst0(pSop) || Abc_SopIsConst1(pSop) )
CountConst++;
@@ -1084,7 +1071,7 @@ void Abc_NtkPrintSharing( Abc_Ntk_t * pNtk )
{
vNodes1 = Abc_NtkDfsNodes( pNtk, &pObj1, 1 );
// mark the nodes
- Vec_PtrForEachEntry( vNodes1, pNode1, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes1, pNode1, m )
pNode1->fMarkA = 1;
// go through the second COs
Abc_NtkForEachCo( pNtk, pObj2, k )
@@ -1094,14 +1081,14 @@ void Abc_NtkPrintSharing( Abc_Ntk_t * pNtk )
vNodes2 = Abc_NtkDfsNodes( pNtk, &pObj2, 1 );
// count the number of marked
Counter = 0;
- Vec_PtrForEachEntry( vNodes2, pNode2, n )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes2, pNode2, n )
Counter += pNode2->fMarkA;
// print
printf( "(%d,%d)=%d ", i, k, Counter );
Vec_PtrFree( vNodes2 );
}
// unmark the nodes
- Vec_PtrForEachEntry( vNodes1, pNode1, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes1, pNode1, m )
pNode1->fMarkA = 0;
Vec_PtrFree( vNodes1 );
}
@@ -1332,12 +1319,12 @@ float Abc_NtkMfsTotalGlitching( Abc_Ntk_t * pNtk )
pObj->iTemp = -1;
Abc_NtkForEachCi( pNtk, pObj, i )
pObj->iTemp = Gli_ManCreateCi( p, Abc_ObjFanoutNum(pObj) );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
Vec_IntClear( vFanins );
Abc_ObjForEachFanin( pObj, pFanin, k )
Vec_IntPush( vFanins, pFanin->iTemp );
- puTruth = Hop_ManConvertAigToTruth( pNtk->pManFunc, pObj->pData, Abc_ObjFaninNum(pObj), vTruth, 0 );
+ puTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNtk->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj), vTruth, 0 );
pObj->iTemp = Gli_ManCreateNode( p, vFanins, Abc_ObjFanoutNum(pObj), puTruth );
}
Abc_NtkForEachCo( pNtk, pObj, i )
@@ -1367,3 +1354,5 @@ float Abc_NtkMfsTotalGlitching( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcProve.c b/src/base/abci/abcProve.c
index 5a546ab1..35c1ee29 100644
--- a/src/base/abci/abcProve.c
+++ b/src/base/abci/abcProve.c
@@ -22,11 +22,14 @@
#include "fraig.h"
#include "math.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose );
+extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose );
extern Abc_Ntk_t * Abc_NtkFromFraig( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk );
static Abc_Ntk_t * Abc_NtkMiterFraig( Abc_Ntk_t * pNtk, int nBTLimit, ABC_INT64_T nInspLimit, int * pRetValue, int * pNumFails, ABC_INT64_T * pNumConfs, ABC_INT64_T * pNumInspects );
@@ -53,7 +56,7 @@ static void Abc_NtkMiterPrint( Abc_Ntk_t * pNtk, char * pString, int clk, int fV
***********************************************************************/
int Abc_NtkMiterProve( Abc_Ntk_t ** ppNtk, void * pPars )
{
- Prove_Params_t * pParams = pPars;
+ Prove_Params_t * pParams = (Prove_Params_t *)pPars;
Abc_Ntk_t * pNtk, * pNtkTemp;
int RetValue = -1, nIter, nSatFails, Counter, clk; //, timeStart = clock();
ABC_INT64_T nSatConfs, nSatInspects, nInspectLimit;
@@ -195,7 +198,7 @@ int Abc_NtkMiterProve( Abc_Ntk_t ** ppNtk, void * pPars )
if ( pNtk )
{
Abc_NtkDelete( pNtkTemp );
- RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero(pNtk->pManFunc)) );
+ RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc)) );
}
else
pNtk = pNtkTemp;
@@ -264,7 +267,7 @@ Abc_Ntk_t * Abc_NtkMiterFraig( Abc_Ntk_t * pNtk, int nBTLimit, ABC_INT64_T nInsp
pParams->nInspLimit = nInspLimit;
// transform the target into a fraig
- pMan = Abc_NtkToFraig( pNtk, pParams, 0, 0 );
+ pMan = (Fraig_Man_t *)Abc_NtkToFraig( pNtk, pParams, 0, 0 );
Fraig_ManProveMiter( pMan );
RetValue = Fraig_ManCheckMiter( pMan );
@@ -339,3 +342,5 @@ Abc_Ntk_t * Abc_NtkMiterRwsat( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcQbf.c b/src/base/abci/abcQbf.c
index fe6ef895..d246f039 100644
--- a/src/base/abci/abcQbf.c
+++ b/src/base/abci/abcQbf.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
Implementation of a simple QBF solver along the lines of
A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia,
@@ -258,3 +261,5 @@ void Abc_NtkVectorPrintVars( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues, int nPars
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcQuant.c b/src/base/abci/abcQuant.c
index 6d973a85..957d99b5 100644
--- a/src/base/abci/abcQuant.c
+++ b/src/base/abci/abcQuant.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -94,18 +97,24 @@ int Abc_NtkQuantify( Abc_Ntk_t * pNtk, int fUniv, int iVar, int fVerbose )
pObj->pData = Abc_AigConst1(pNtk);
// quantify the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
for ( pNext = pObj? pObj->pCopy : pObj; pObj; pObj = pNext, pNext = pObj? pObj->pCopy : pObj )
{
pFanin = Abc_ObjFanin0(pObj);
if ( !Abc_NodeIsTravIdCurrent(pFanin) )
- pFanin->pCopy = pFanin->pData = pFanin;
+ {
+ pFanin->pCopy = pFanin;
+ pFanin->pData = pFanin;
+ }
pFanin = Abc_ObjFanin1(pObj);
if ( !Abc_NodeIsTravIdCurrent(pFanin) )
- pFanin->pCopy = pFanin->pData = pFanin;
- pObj->pCopy = Abc_AigAnd( pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
- pObj->pData = Abc_AigAnd( pNtk->pManFunc, Abc_ObjChild0Data(pObj), Abc_ObjChild1Data(pObj) );
+ {
+ pFanin->pCopy = pFanin;
+ pFanin->pData = pFanin;
+ }
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjChild0Data(pObj), Abc_ObjChild1Data(pObj) );
}
}
Vec_PtrFree( vNodes );
@@ -118,9 +127,9 @@ int Abc_NtkQuantify( Abc_Ntk_t * pNtk, int fUniv, int iVar, int fVerbose )
pFanin = Abc_ObjFanin0(pObj);
// get the result of quantification
if ( fUniv )
- pNext = Abc_AigAnd( pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild0Data(pObj) );
+ pNext = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild0Data(pObj) );
else
- pNext = Abc_AigOr( pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild0Data(pObj) );
+ pNext = Abc_AigOr( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild0Data(pObj) );
pNext = Abc_ObjNotCond( pNext, Abc_ObjFaninC0(pObj) );
if ( Abc_ObjRegular(pNext) == pFanin )
continue;
@@ -183,7 +192,7 @@ Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose )
// restrash the nodes (assuming a topological order of the old network)
Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
Abc_NtkForEachNode( pNtk, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// create the function of the primary output
assert( Abc_NtkBoxNum(pNtk) == Abc_NtkLatchNum(pNtk) );
vPairs = Vec_PtrAlloc( 2*nLatches );
@@ -192,7 +201,7 @@ Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose )
Vec_PtrPush( vPairs, Abc_ObjChild0Copy(pObj) );
Vec_PtrPush( vPairs, Abc_NtkPi(pNtkNew, i+nLatches) );
}
- pMiter = Abc_AigMiter( pNtkNew->pManFunc, vPairs, 0 );
+ pMiter = Abc_AigMiter( (Abc_Aig_t *)pNtkNew->pManFunc, vPairs, 0 );
Vec_PtrFree( vPairs );
// add the primary output
Abc_ObjAddFanin( Abc_NtkPo(pNtkNew,0), Abc_ObjNot(pMiter) );
@@ -210,7 +219,7 @@ Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose )
if ( fSynthesis )
{
Abc_NtkCleanData( pNtkNew );
- Abc_AigCleanup( pNtkNew->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkNew->pManFunc );
Abc_NtkSynthesize( &pNtkNew, 1 );
}
// printf( "Var = %3d. Nodes = %6d. ", Abc_NtkPiNum(pNtkNew) - 1 - i, Abc_NtkNodeNum(pNtkNew) );
@@ -218,7 +227,7 @@ Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose )
}
// printf( "\n" );
Abc_NtkCleanData( pNtkNew );
- Abc_AigCleanup( pNtkNew->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkNew->pManFunc );
for ( i = Abc_NtkPiNum(pNtkNew) - 1; i >= 2*nLatches; i-- )
{
pObj = Abc_NtkPi( pNtkNew, i );
@@ -260,7 +269,7 @@ Abc_Ntk_t * Abc_NtkInitialState( Abc_Ntk_t * pNtk )
// compute the all-zero state in terms of the CS variables
pMiter = Abc_AigConst1(pNtkNew);
for ( i = 0; i < nVars; i++ )
- pMiter = Abc_AigAnd( pNtkNew->pManFunc, pMiter, Abc_ObjNot( Abc_NtkPi(pNtkNew, i) ) );
+ pMiter = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, pMiter, Abc_ObjNot( Abc_NtkPi(pNtkNew, i) ) );
// add the PO
Abc_ObjAddFanin( Abc_NtkPo(pNtkNew,0), pMiter );
return pNtkNew;
@@ -296,7 +305,7 @@ Abc_Ntk_t * Abc_NtkSwapVariables( Abc_Ntk_t * pNtk )
}
// restrash
Abc_NtkForEachNode( pNtk, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// add the PO
pMiter = Abc_ObjChild0Copy( Abc_NtkPo(pNtk,0) );
Abc_ObjAddFanin( Abc_NtkPo(pNtkNew,0), pMiter );
@@ -351,12 +360,12 @@ Abc_Ntk_t * Abc_NtkReachability( Abc_Ntk_t * pNtkRel, int nIters, int fVerbose )
if ( fSynthesis && (v % 3 == 2) )
{
Abc_NtkCleanData( pNtkNext );
- Abc_AigCleanup( pNtkNext->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkNext->pManFunc );
Abc_NtkSynthesize( &pNtkNext, fMoreEffort );
}
}
Abc_NtkCleanData( pNtkNext );
- Abc_AigCleanup( pNtkNext->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkNext->pManFunc );
if ( fSynthesis )
Abc_NtkSynthesize( &pNtkNext, 1 );
// map the next states into the current states
@@ -422,3 +431,5 @@ Abc_Ntk_t * Abc_NtkReachability( Abc_Ntk_t * pNtkRel, int nIters, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcReach.c b/src/base/abci/abcReach.c
index e25be81a..6eb7fb06 100644
--- a/src/base/abci/abcReach.c
+++ b/src/base/abci/abcReach.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -312,3 +315,5 @@ void Abc_NtkVerifyUsingBdds( Abc_Ntk_t * pNtk, int nBddMax, int nIterMax, int fP
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcRec.c b/src/base/abci/abcRec.c
index d8884147..47380da1 100644
--- a/src/base/abci/abcRec.c
+++ b/src/base/abci/abcRec.c
@@ -22,6 +22,9 @@
#include "if.h"
#include "kit.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -613,13 +616,13 @@ int Abc_NtkRecCollectNodes( If_Man_t * pIfMan, If_Obj_t * pRoot, If_Cut_t * pCut
}
// clean the mark
- Vec_PtrForEachEntry( vNodes, pLeaf, i )
+ Vec_PtrForEachEntry( If_Obj_t *, vNodes, pLeaf, i )
pLeaf->fMark = 0;
/*
if ( pRoot->Id == 2639 )
{
// print the cut
- Vec_PtrForEachEntry( vNodes, pLeaf, i )
+ Vec_PtrForEachEntry( If_Obj_t *, vNodes, pLeaf, i )
{
if ( If_ObjIsAnd(pLeaf) )
printf( "%4d = %c%4d & %c%4d\n", pLeaf->Id,
@@ -657,7 +660,7 @@ int Abc_NtkRecCutTruth( Vec_Ptr_t * vNodes, int nLeaves, Vec_Ptr_t * vTtTemps, V
assert( Vec_PtrSize(vNodes) > nLeaves );
// set the elementary truth tables and compute the truth tables of the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( If_Obj_t *, vNodes, pObj, i )
{
pObj->pCopy = Vec_PtrEntry(vTtTemps, i);
pSims = (unsigned *)pObj->pCopy;
@@ -683,12 +686,12 @@ int Abc_NtkRecCutTruth( Vec_Ptr_t * vNodes, int nLeaves, Vec_Ptr_t * vTtTemps, V
// make sure none of the nodes has the same simulation info as the output
// check pairwise comparisons
nLimit = Vec_PtrSize(vNodes) - 1;
- Vec_PtrForEachEntryStop( vNodes, pObj, i, nLimit )
+ Vec_PtrForEachEntryStop( If_Obj_t *, vNodes, pObj, i, nLimit )
{
pSims0 = (unsigned *)pObj->pCopy;
if ( Kit_TruthIsEqualWithPhase(pSims, pSims0, nInputs) )
return 0;
- Vec_PtrForEachEntryStop( vNodes, pObj2, k, i )
+ Vec_PtrForEachEntryStop( If_Obj_t *, vNodes, pObj2, k, i )
{
if ( (If_ObjFanin0(pRoot) == pObj && If_ObjFanin1(pRoot) == pObj2) ||
(If_ObjFanin1(pRoot) == pObj && If_ObjFanin0(pRoot) == pObj2) )
@@ -861,7 +864,7 @@ s_pMan->timeCanon += clock() - clk;
// build the node and compute its truth table
nNodesBeg = Abc_NtkObjNumMax( pAig );
- Vec_PtrForEachEntryStart( vNodes, pIfObj, i, nLeaves )
+ Vec_PtrForEachEntryStart( If_Obj_t *, vNodes, pIfObj, i, nLeaves )
{
pFanin0 = Abc_ObjNotCond( If_ObjFanin0(pIfObj)->pCopy, If_ObjFaninC0(pIfObj) );
pFanin1 = Abc_ObjNotCond( If_ObjFanin1(pIfObj)->pCopy, If_ObjFaninC1(pIfObj) );
@@ -1163,3 +1166,5 @@ int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTru
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcReconv.c b/src/base/abci/abcReconv.c
index 1c086fb0..434577ec 100644
--- a/src/base/abci/abcReconv.c
+++ b/src/base/abci/abcReconv.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -62,7 +65,7 @@ static inline void Abc_NodesMark( Vec_Ptr_t * vVisited )
{
Abc_Obj_t * pNode;
int i;
- Vec_PtrForEachEntry( vVisited, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVisited, pNode, i )
pNode->fMarkA = 1;
}
@@ -81,7 +84,7 @@ static inline void Abc_NodesUnmark( Vec_Ptr_t * vVisited )
{
Abc_Obj_t * pNode;
int i;
- Vec_PtrForEachEntry( vVisited, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVisited, pNode, i )
pNode->fMarkA = 0;
}
@@ -100,7 +103,7 @@ static inline void Abc_NodesUnmarkB( Vec_Ptr_t * vVisited )
{
Abc_Obj_t * pNode;
int i;
- Vec_PtrForEachEntry( vVisited, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVisited, pNode, i )
pNode->fMarkB = 0;
}
@@ -246,7 +249,7 @@ static inline int Abc_NodeGetLeafCostTwo( Abc_Obj_t * pNode, int nFaninLimit,
SeeAlso []
***********************************************************************/
-Vec_Ptr_t * Abc_NodeFindCut( Abc_ManCut_t * p, Abc_Obj_t * pRoot, bool fContain )
+Vec_Ptr_t * Abc_NodeFindCut( Abc_ManCut_t * p, Abc_Obj_t * pRoot, int fContain )
{
Abc_Obj_t * pNode;
int i;
@@ -285,7 +288,7 @@ Vec_Ptr_t * Abc_NodeFindCut( Abc_ManCut_t * p, Abc_Obj_t * pRoot, bool fContain
assert( p->nNodeSizeMax < p->nConeSizeMax );
// copy the current boundary
Vec_PtrClear( p->vConeLeaves );
- Vec_PtrForEachEntry( p->vNodeLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vNodeLeaves, pNode, i )
Vec_PtrPush( p->vConeLeaves, pNode );
// compute the containing cut
while ( Abc_NodeBuildCutLevelOne_int( p->vVisited, p->vConeLeaves, p->nConeSizeMax, p->nConeFanStop ) );
@@ -317,7 +320,7 @@ int Abc_NodeBuildCutLevelOne_int( Vec_Ptr_t * vVisited, Vec_Ptr_t * vLeaves, int
CostBest = 100;
pFaninBest = NULL;
//printf( "Evaluating fanins of the cut:\n" );
- Vec_PtrForEachEntry( vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
{
CostCur = Abc_NodeGetLeafCostOne( pNode, nFaninLimit );
//printf( " Fanin %s has cost %d.\n", Abc_ObjName(pNode), CostCur );
@@ -387,7 +390,7 @@ int Abc_NodeBuildCutLevelTwo_int( Vec_Ptr_t * vVisited, Vec_Ptr_t * vLeaves, int
Abc_Obj_t * pNode = NULL, * pLeafToAdd, * pNodeToMark1, * pNodeToMark2;
int CostCur = 0, i;
// find the best fanin
- Vec_PtrForEachEntry( vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
{
CostCur = Abc_NodeGetLeafCostTwo( pNode, nFaninLimit, &pLeafToAdd, &pNodeToMark1, &pNodeToMark2 );
if ( CostCur < 2 )
@@ -444,7 +447,7 @@ void Abc_NodeConeCollect( Abc_Obj_t ** ppRoots, int nRoots, Vec_Ptr_t * vLeaves,
Vec_PtrClear( vVisited );
// add the fanins
if ( fIncludeFanins )
- Vec_PtrForEachEntry( vLeaves, pTemp, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pTemp, i )
Vec_PtrPush( vVisited, pTemp );
// add other nodes
for ( i = 0; i < nRoots; i++ )
@@ -499,21 +502,21 @@ DdNode * Abc_NodeConeBdd( DdManager * dd, DdNode ** pbVars, Abc_Obj_t * pRoot, V
// get the nodes in the cut without fanins in the DFS order
Abc_NodeConeCollect( &pRoot, 1, vLeaves, vVisited, 0 );
// set the elementary BDDs
- Vec_PtrForEachEntry( vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
pNode->pCopy = (Abc_Obj_t *)pbVars[i];
// compute the BDDs for the collected nodes
- Vec_PtrForEachEntry( vVisited, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVisited, pNode, i )
{
assert( !Abc_ObjIsPi(pNode) );
- bFunc0 = Cudd_NotCond( Abc_ObjFanin0(pNode)->pCopy, Abc_ObjFaninC0(pNode) );
- bFunc1 = Cudd_NotCond( Abc_ObjFanin1(pNode)->pCopy, Abc_ObjFaninC1(pNode) );
+ bFunc0 = Cudd_NotCond( Abc_ObjFanin0(pNode)->pCopy, (int)Abc_ObjFaninC0(pNode) );
+ bFunc1 = Cudd_NotCond( Abc_ObjFanin1(pNode)->pCopy, (int)Abc_ObjFaninC1(pNode) );
bFunc = Cudd_bddAnd( dd, bFunc0, bFunc1 ); Cudd_Ref( bFunc );
pNode->pCopy = (Abc_Obj_t *)bFunc;
}
assert(bFunc);
Cudd_Ref( bFunc );
// dereference the intermediate ones
- Vec_PtrForEachEntry( vVisited, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVisited, pNode, i )
Cudd_RecursiveDeref( dd, (DdNode *)pNode->pCopy );
Cudd_Deref( bFunc );
return bFunc;
@@ -538,19 +541,19 @@ DdNode * Abc_NodeConeDcs( DdManager * dd, DdNode ** pbVarsX, DdNode ** pbVarsY,
// get the nodes in the cut without fanins in the DFS order
Abc_NodeConeCollect( (Abc_Obj_t **)vRoots->pArray, vRoots->nSize, vLeaves, vVisited, 0 );
// set the elementary BDDs
- Vec_PtrForEachEntry( vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
pNode->pCopy = (Abc_Obj_t *)pbVarsX[i];
// compute the BDDs for the collected nodes
- Vec_PtrForEachEntry( vVisited, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVisited, pNode, i )
{
- bFunc0 = Cudd_NotCond( Abc_ObjFanin0(pNode)->pCopy, Abc_ObjFaninC0(pNode) );
- bFunc1 = Cudd_NotCond( Abc_ObjFanin1(pNode)->pCopy, Abc_ObjFaninC1(pNode) );
+ bFunc0 = Cudd_NotCond( Abc_ObjFanin0(pNode)->pCopy, (int)Abc_ObjFaninC0(pNode) );
+ bFunc1 = Cudd_NotCond( Abc_ObjFanin1(pNode)->pCopy, (int)Abc_ObjFaninC1(pNode) );
bFunc = Cudd_bddAnd( dd, bFunc0, bFunc1 ); Cudd_Ref( bFunc );
pNode->pCopy = (Abc_Obj_t *)bFunc;
}
// compute the transition relation of the cone
bTrans = b1; Cudd_Ref( bTrans );
- Vec_PtrForEachEntry( vRoots, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pNode, i )
{
bFunc = Cudd_bddXnor( dd, (DdNode *)pNode->pCopy, pbVarsY[i] ); Cudd_Ref( bFunc );
bTrans = Cudd_bddAnd( dd, bTemp = bTrans, bFunc ); Cudd_Ref( bTrans );
@@ -558,7 +561,7 @@ DdNode * Abc_NodeConeDcs( DdManager * dd, DdNode ** pbVarsX, DdNode ** pbVarsY,
Cudd_RecursiveDeref( dd, bFunc );
}
// dereference the intermediate ones
- Vec_PtrForEachEntry( vVisited, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vVisited, pNode, i )
Cudd_RecursiveDeref( dd, (DdNode *)pNode->pCopy );
// compute don't-cares
bCube = Extra_bddComputeRangeCube( dd, vRoots->nSize, vRoots->nSize + vLeaves->nSize ); Cudd_Ref( bCube );
@@ -700,7 +703,7 @@ Vec_Ptr_t * Abc_NodeCollectTfoCands( Abc_ManCut_t * p, Abc_Obj_t * pRoot, Vec_Pt
// put fanins into the structure while labeling them
Abc_NtkIncrementTravId( pNtk );
LevelMin = -1;
- Vec_PtrForEachEntry( vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
{
if ( pNode->Level > (unsigned)LevelMax )
continue;
@@ -717,7 +720,7 @@ Vec_Ptr_t * Abc_NodeCollectTfoCands( Abc_ManCut_t * p, Abc_Obj_t * pRoot, Vec_Pt
// go through the levels up
Vec_PtrClear( p->vNodesTfo );
- Vec_VecForEachEntryStart( p->vLevels, pNode, i, k, LevelMin )
+ Vec_VecForEachEntryStart( Abc_Obj_t *, p->vLevels, pNode, i, k, LevelMin )
{
if ( i > LevelMax )
break;
@@ -761,3 +764,5 @@ Vec_Ptr_t * Abc_NodeCollectTfoCands( Abc_ManCut_t * p, Abc_Obj_t * pRoot, Vec_Pt
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcRefactor.c b/src/base/abci/abcRefactor.c
index 5245bd23..4e922ebd 100644
--- a/src/base/abci/abcRefactor.c
+++ b/src/base/abci/abcRefactor.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "dec.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -58,9 +61,9 @@ struct Abc_ManRef_t_
};
static void Abc_NtkManRefPrintStats( Abc_ManRef_t * p );
-static Abc_ManRef_t * Abc_NtkManRefStart( int nNodeSizeMax, int nConeSizeMax, bool fUseDcs, bool fVerbose );
+static Abc_ManRef_t * Abc_NtkManRefStart( int nNodeSizeMax, int nConeSizeMax, int fUseDcs, int fVerbose );
static void Abc_NtkManRefStop( Abc_ManRef_t * p );
-static Dec_Graph_t * Abc_NodeRefactor( Abc_ManRef_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vFanins, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose );
+static Dec_Graph_t * Abc_NodeRefactor( Abc_ManRef_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vFanins, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -82,9 +85,9 @@ static Dec_Graph_t * Abc_NodeRefactor( Abc_ManRef_t * p, Abc_Obj_t * pNode, Vec
SeeAlso []
***********************************************************************/
-int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose )
+int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose )
{
- extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, bool fUpdateLevel, int nGain );
+ extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int fUpdateLevel, int nGain );
ProgressBar * pProgress;
Abc_ManRef_t * pManRef;
Abc_ManCut_t * pManCut;
@@ -96,7 +99,7 @@ int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, bool
assert( Abc_NtkIsStrash(pNtk) );
// cleanup the AIG
- Abc_AigCleanup(pNtk->pManFunc);
+ Abc_AigCleanup((Abc_Aig_t *)pNtk->pManFunc);
// start the managers
pManCut = Abc_NtkManCutStart( nNodeSizeMax, nConeSizeMax, 2, 1000 );
pManRef = Abc_NtkManRefStart( nNodeSizeMax, nConeSizeMax, fUseDcs, fVerbose );
@@ -182,7 +185,7 @@ pManRef->timeTotal = clock() - clkStart;
SeeAlso []
***********************************************************************/
-Dec_Graph_t * Abc_NodeRefactor( Abc_ManRef_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vFanins, bool fUpdateLevel, bool fUseZeros, bool fUseDcs, bool fVerbose )
+Dec_Graph_t * Abc_NodeRefactor( Abc_ManRef_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vFanins, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose )
{
extern int Dec_GraphToNetworkCount( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int NodeMax, int LevelMax );
int fVeryVerbose = 0;
@@ -250,13 +253,13 @@ p->timeFact += clock() - clk;
// mark the fanin boundary
// (can mark only essential fanins, belonging to bNodeFunc!)
- Vec_PtrForEachEntry( vFanins, pFanin, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFanins, pFanin, i )
pFanin->vFanouts.nSize++;
// label MFFC with current traversal ID
Abc_NtkIncrementTravId( pNode->pNtk );
nNodesSaved = Abc_NodeMffcLabelAig( pNode );
// unmark the fanin boundary and set the fanins as leaves in the form
- Vec_PtrForEachEntry( vFanins, pFanin, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFanins, pFanin, i )
{
pFanin->vFanouts.nSize--;
Dec_GraphNode(pFForm, i)->pFunc = pFanin;
@@ -307,7 +310,7 @@ p->timeEval += clock() - clk;
SeeAlso []
***********************************************************************/
-Abc_ManRef_t * Abc_NtkManRefStart( int nNodeSizeMax, int nConeSizeMax, bool fUseDcs, bool fVerbose )
+Abc_ManRef_t * Abc_NtkManRefStart( int nNodeSizeMax, int nConeSizeMax, int fUseDcs, int fVerbose )
{
Abc_ManRef_t * p;
p = ABC_ALLOC( Abc_ManRef_t, 1 );
@@ -379,3 +382,5 @@ void Abc_NtkManRefPrintStats( Abc_ManRef_t * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcRenode.c b/src/base/abci/abcRenode.c
index f2861204..848021a0 100644
--- a/src/base/abci/abcRenode.c
+++ b/src/base/abci/abcRenode.c
@@ -23,6 +23,9 @@
#include "if.h"
#include "kit.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -310,3 +313,5 @@ int Abc_NtkRenodeEvalMv( If_Cut_t * pCut )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcReorder.c b/src/base/abci/abcReorder.c
index 340e3d17..d2e7dcea 100644
--- a/src/base/abci/abcReorder.c
+++ b/src/base/abci/abcReorder.c
@@ -21,6 +21,8 @@
#include "abc.h"
#include "reo.h"
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -50,8 +52,8 @@ void Abc_NodeBddReorder( reo_man * p, Abc_Obj_t * pNode )
for ( i = 0; i < Abc_ObjFaninNum(pNode); i++ )
pOrder[i] = -1;
// reorder the BDD
- bFunc = Extra_Reorder( p, pNode->pNtk->pManFunc, pNode->pData, pOrder ); Cudd_Ref( bFunc );
- Cudd_RecursiveDeref( pNode->pNtk->pManFunc, pNode->pData );
+ bFunc = Extra_Reorder( p, (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData, pOrder ); Cudd_Ref( bFunc );
+ Cudd_RecursiveDeref( (DdManager *)pNode->pNtk->pManFunc, (DdNode *)pNode->pData );
pNode->pData = bFunc;
// update the fanin order
Abc_ObjForEachFanin( pNode, pFanin, i )
@@ -87,10 +89,10 @@ void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose )
if ( fVerbose )
fprintf( stdout, "%10s: ", Abc_ObjName(pNode) );
if ( fVerbose )
- fprintf( stdout, "Before = %5d BDD nodes. ", Cudd_DagSize(pNode->pData) );
+ fprintf( stdout, "Before = %5d BDD nodes. ", Cudd_DagSize((DdNode *)pNode->pData) );
Abc_NodeBddReorder( p, pNode );
if ( fVerbose )
- fprintf( stdout, "After = %5d BDD nodes.\n", Cudd_DagSize(pNode->pData) );
+ fprintf( stdout, "After = %5d BDD nodes.\n", Cudd_DagSize((DdNode *)pNode->pData) );
}
Extra_ReorderQuit( p );
}
@@ -100,3 +102,5 @@ void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcRestruct.c b/src/base/abci/abcRestruct.c
index 26774620..4a63db67 100644
--- a/src/base/abci/abcRestruct.c
+++ b/src/base/abci/abcRestruct.c
@@ -23,6 +23,9 @@
#include "dsd.h"
#include "cut.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -75,7 +78,7 @@ static Dec_Graph_t * Abc_NodeRestructureCut( Abc_ManRst_t * p, Abc_Obj_t * pNode
static Dec_Graph_t * Abc_NodeEvaluateDsd( Abc_ManRst_t * pManRst, Dsd_Node_t * pNodeDsd, Abc_Obj_t * pRoot, int Required, int nNodesSaved, int * pnNodesAdded );
static Cut_Man_t * Abc_NtkStartCutManForRestruct( Abc_Ntk_t * pNtk, int nCutMax, int fDag );
-static Abc_ManRst_t * Abc_NtkManRstStart( int nCutMax, bool fUpdateLevel, bool fUseZeros, bool fVerbose );
+static Abc_ManRst_t * Abc_NtkManRstStart( int nCutMax, int fUpdateLevel, int fUseZeros, int fVerbose );
static void Abc_NtkManRstStop( Abc_ManRst_t * p );
static void Abc_NtkManRstPrintStats( Abc_ManRst_t * p );
@@ -94,9 +97,9 @@ static void Abc_NtkManRstPrintStats( Abc_ManRst_t * p );
SeeAlso []
***********************************************************************/
-int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutMax, bool fUpdateLevel, bool fUseZeros, bool fVerbose )
+int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutMax, int fUpdateLevel, int fUseZeros, int fVerbose )
{
- extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, bool fUpdateLevel, int nGain );
+ extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int fUpdateLevel, int nGain );
ProgressBar * pProgress;
Abc_ManRst_t * pManRst;
Cut_Man_t * pManCut;
@@ -110,7 +113,7 @@ int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutMax, bool fUpdateLevel, bool f
assert( Abc_NtkIsStrash(pNtk) );
// cleanup the AIG
- Abc_AigCleanup(pNtk->pManFunc);
+ Abc_AigCleanup((Abc_Aig_t *)pNtk->pManFunc);
Abc_NtkCleanCopy(pNtk);
// compute the reverse levels if level update is requested
@@ -149,7 +152,7 @@ pManRst->timeCut += clock() - clk;
break;
// get the cuts for the given node
clk = clock();
- pCutList = Abc_NodeGetCutsRecursive( pManCut, pNode, fMulti, 0 );
+ pCutList = (Cut_Cut_t *)Abc_NodeGetCutsRecursive( pManCut, pNode, fMulti, 0 );
pManRst->timeCut += clock() - clk;
// perform restructuring
@@ -211,14 +214,14 @@ void Abc_RestructNodeDivisors( Abc_ManRst_t * p, Abc_Obj_t * pRoot, int nNodesSa
int i, k;
// start with the leaves
Vec_PtrClear( p->vDecs );
- Vec_PtrForEachEntry( p->vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pNode, i )
{
Vec_PtrPush( p->vDecs, pNode );
assert( pNode->fMarkC == 0 );
pNode->fMarkC = 1;
}
// explore the fanouts
- Vec_PtrForEachEntry( p->vDecs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDecs, pNode, i )
{
// if the fanout has both fanins in the set, add it
Abc_ObjForEachFanout( pNode, pFanout, k )
@@ -233,15 +236,15 @@ void Abc_RestructNodeDivisors( Abc_ManRst_t * p, Abc_Obj_t * pRoot, int nNodesSa
}
}
// unmark the nodes
- Vec_PtrForEachEntry( p->vDecs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDecs, pNode, i )
pNode->fMarkC = 0;
/*
// print the nodes
- Vec_PtrForEachEntryStart( p->vDecs, pNode, i, Vec_PtrSize(p->vLeaves) )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDecs, pNode, i, Vec_PtrSize(p->vLeaves) )
{
printf( "%2d %s = ", i, Abc_NodeIsTravIdCurrent(pNode)? "*" : " " );
// find the first fanin
- Vec_PtrForEachEntry( p->vDecs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDecs, pFanin, k )
if ( Abc_ObjFanin0(pNode) == pFanin )
break;
if ( k < Vec_PtrSize(p->vLeaves) )
@@ -250,7 +253,7 @@ void Abc_RestructNodeDivisors( Abc_ManRst_t * p, Abc_Obj_t * pRoot, int nNodesSa
printf( "%d", k );
printf( "%s ", Abc_ObjFaninC0(pNode)? "\'" : "" );
// find the second fanin
- Vec_PtrForEachEntry( p->vDecs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDecs, pFanin, k )
if ( Abc_ObjFanin1(pNode) == pFanin )
break;
if ( k < Vec_PtrSize(p->vLeaves) )
@@ -383,13 +386,13 @@ p->timeDsd += clock() - clk;
// mark the fanin boundary
// (can mark only essential fanins, belonging to bNodeFunc!)
- Vec_PtrForEachEntry( p->vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pLeaf, i )
pLeaf->vFanouts.nSize++;
// label MFFC with current traversal ID
Abc_NtkIncrementTravId( pRoot->pNtk );
nNodesSaved = Abc_NodeMffcLabelAig( pRoot );
// unmark the fanin boundary and set the fanins as leaves in the form
- Vec_PtrForEachEntry( p->vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pLeaf, i )
pLeaf->vFanouts.nSize--;
/*
if ( nNodesSaved < 3 )
@@ -488,8 +491,8 @@ void Abc_NodeEdgeDsdPermute( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst, Vec_I
// get the two last nodes
eNode1 = Dec_IntToEdge( Vec_IntEntry(vEdges, RightBound + 1) );
eNode2 = Dec_IntToEdge( Vec_IntEntry(vEdges, RightBound ) );
- pNode1 = Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
- pNode2 = Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
+ pNode1 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
+ pNode2 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
pNode1 = !pNode1? NULL : Abc_ObjNotCond( pNode1, eNode1.fCompl );
pNode2 = !pNode2? NULL : Abc_ObjNotCond( pNode2, eNode2.fCompl );
// quit if the last node does not exist
@@ -500,7 +503,7 @@ void Abc_NodeEdgeDsdPermute( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst, Vec_I
{
// get the third node
eNode3 = Dec_IntToEdge( Vec_IntEntry(vEdges, i) );
- pNode3 = Dec_GraphNode( pGraph, eNode3.Node )->pFunc;
+ pNode3 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode3.Node )->pFunc;
pNode3 = !pNode3? NULL : Abc_ObjNotCond( pNode3, eNode3.fCompl );
if ( pNode3 == NULL )
continue;
@@ -509,7 +512,7 @@ void Abc_NodeEdgeDsdPermute( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst, Vec_I
{
if ( pNode1 && pNode3 )
{
- pTemp = Abc_AigXorLookup( pManRst->pNtk->pManFunc, pNode1, pNode3, NULL );
+ pTemp = Abc_AigXorLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, pNode1, pNode3, NULL );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
continue;
@@ -524,7 +527,7 @@ void Abc_NodeEdgeDsdPermute( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst, Vec_I
{
if ( pNode1 && pNode3 )
{
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode3) );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode3) );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
continue;
@@ -634,15 +637,15 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
// get the two last nodes
eNode1 = Dec_IntToEdge( Vec_IntPop(vEdges) );
eNode2 = Dec_IntToEdge( Vec_IntPop(vEdges) );
- pNode1 = Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
- pNode2 = Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
+ pNode1 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
+ pNode2 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
pNode1 = !pNode1? NULL : Abc_ObjNotCond( pNode1, eNode1.fCompl );
pNode2 = !pNode2? NULL : Abc_ObjNotCond( pNode2, eNode2.fCompl );
// check if the new node exists
pNode3 = NULL;
if ( pNode1 && pNode2 )
{
- pNode3 = Abc_AigAndLookup( pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
+ pNode3 = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
pNode3 = !pNode3? NULL : Abc_ObjNot(pNode3);
}
// create the new node
@@ -689,15 +692,15 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
// get the two last nodes
eNode1 = Dec_IntToEdge( Vec_IntPop(vEdges) );
eNode2 = Dec_IntToEdge( Vec_IntPop(vEdges) );
- pNode1 = Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
- pNode2 = Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
+ pNode1 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
+ pNode2 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
pNode1 = !pNode1? NULL : Abc_ObjNotCond( pNode1, eNode1.fCompl );
pNode2 = !pNode2? NULL : Abc_ObjNotCond( pNode2, eNode2.fCompl );
// check if the new node exists
Type = 0;
pNode3 = NULL;
if ( pNode1 && pNode2 )
- pNode3 = Abc_AigXorLookup( pManRst->pNtk->pManFunc, pNode1, pNode2, &Type );
+ pNode3 = Abc_AigXorLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, pNode1, pNode2, &Type );
// create the new node
eNode3 = Dec_GraphAddNodeXor( pGraph, eNode1, eNode2, Type ); // should have the same structure as in AIG
// set level
@@ -718,19 +721,19 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
(*pnNodesAdded) += 2;
else if ( Type == 0 )
{
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, pNode1, Abc_ObjNot(pNode2) );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, pNode1, Abc_ObjNot(pNode2) );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), pNode2 );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), pNode2 );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
}
else
{
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode2) );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, pNode1, pNode2 );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, pNode1, pNode2 );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
}
@@ -799,9 +802,9 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
Cudd_RecursiveDeref( pManRst->dd, bCofT );
// find the ABC nodes
- pNode1 = Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
- pNode2 = Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
- pNode3 = Dec_GraphNode( pGraph, eNode3.Node )->pFunc;
+ pNode1 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode1.Node )->pFunc;
+ pNode2 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode2.Node )->pFunc;
+ pNode3 = (Abc_Obj_t *)Dec_GraphNode( pGraph, eNode3.Node )->pFunc;
pNode1 = !pNode1? NULL : Abc_ObjNotCond( pNode1, eNode1.fCompl );
pNode2 = !pNode2? NULL : Abc_ObjNotCond( pNode2, eNode2.fCompl );
pNode3 = !pNode3? NULL : Abc_ObjNotCond( pNode3, eNode3.fCompl );
@@ -810,7 +813,7 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
Type = 0;
pNode4 = NULL;
if ( pNode1 && pNode2 && pNode3 )
- pNode4 = Abc_AigMuxLookup( pManRst->pNtk->pManFunc, pNode1, pNode2, pNode3, &Type );
+ pNode4 = Abc_AigMuxLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, pNode1, pNode2, pNode3, &Type );
// create the new node
eResult = Dec_GraphAddNodeMux( pGraph, eNode1, eNode2, eNode3, Type ); // should have the same structure as AIG
@@ -836,7 +839,7 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
(*pnNodesAdded)++;
else
{
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, pNode1, pNode2 );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, pNode1, pNode2 );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
}
@@ -844,7 +847,7 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
(*pnNodesAdded)++;
else
{
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), pNode3 );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), pNode3 );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
}
@@ -855,7 +858,7 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
(*pnNodesAdded)++;
else
{
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, pNode1, Abc_ObjNot(pNode2) );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, pNode1, Abc_ObjNot(pNode2) );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
}
@@ -863,7 +866,7 @@ Dec_Edge_t Abc_NodeEvaluateDsd_rec( Dec_Graph_t * pGraph, Abc_ManRst_t * pManRst
(*pnNodesAdded)++;
else
{
- pTemp = Abc_AigAndLookup( pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode3) );
+ pTemp = Abc_AigAndLookup( (Abc_Aig_t *)pManRst->pNtk->pManFunc, Abc_ObjNot(pNode1), Abc_ObjNot(pNode3) );
if ( !pTemp || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pTemp)) )
(*pnNodesAdded)++;
}
@@ -907,7 +910,7 @@ Dec_Graph_t * Abc_NodeEvaluateDsd( Abc_ManRst_t * pManRst, Dsd_Node_t * pNodeDsd
pGraph = Dec_GraphCreate( Vec_PtrSize(pManRst->vLeaves) );
Dec_GraphForEachLeaf( pGraph, pNode, i )
{
- pLeaf = Vec_PtrEntry( pManRst->vLeaves, i );
+ pLeaf = (Abc_Obj_t *)Vec_PtrEntry( pManRst->vLeaves, i );
pNode->pFunc = pLeaf;
pNode->Level = pLeaf->Level;
}
@@ -923,7 +926,7 @@ Dec_Graph_t * Abc_NodeEvaluateDsd( Abc_ManRst_t * pManRst, Dsd_Node_t * pNodeDsd
}
// quit if the root node is the same
- pLeaf = Dec_GraphNode( pGraph, gEdge.Node )->pFunc;
+ pLeaf = (Abc_Obj_t *)Dec_GraphNode( pGraph, gEdge.Node )->pFunc;
if ( Abc_ObjRegular(pLeaf) == pRoot )
{
*pnNodesAdded = -1;
@@ -987,7 +990,7 @@ Cut_Man_t * Abc_NtkStartCutManForRestruct( Abc_Ntk_t * pNtk, int nCutMax, int fD
SeeAlso []
***********************************************************************/
-Abc_ManRst_t * Abc_NtkManRstStart( int nCutMax, bool fUpdateLevel, bool fUseZeros, bool fVerbose )
+Abc_ManRst_t * Abc_NtkManRstStart( int nCutMax, int fUpdateLevel, int fUseZeros, int fVerbose )
{
Abc_ManRst_t * p;
p = ABC_ALLOC( Abc_ManRst_t, 1 );
@@ -1104,7 +1107,7 @@ int Abc_Abc_NodeResubCollectDivs( Abc_ManRst_t * p, Abc_Obj_t * pRoot, Cut_Cut_t
Abc_NodeSetTravIdCurrent( pNode );
}
// explore the fanouts
- Vec_PtrForEachEntry( p->vDecs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDecs, pNode, i )
{
// if the fanout has both fanins in the set, add it
Abc_ObjForEachFanout( pNode, pFanout, k )
@@ -1159,7 +1162,7 @@ int Abc_NodeResubMffc( Abc_ManRst_t * p, Vec_Ptr_t * vDecs, int nLeaves, Abc_Obj
// increment the traversal ID for the leaves
Abc_NtkIncrementTravId( pRoot->pNtk );
// label the leaves
- Vec_PtrForEachEntryStop( vDecs, pObj, i, nLeaves )
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, vDecs, pObj, i, nLeaves )
Abc_NodeSetTravIdCurrent( pObj );
// make sure the node is in the cone and is no one of the leaves
assert( Abc_NodeIsTravIdPrevious(pRoot) );
@@ -1167,13 +1170,13 @@ int Abc_NodeResubMffc( Abc_ManRst_t * p, Vec_Ptr_t * vDecs, int nLeaves, Abc_Obj
// move the labeled nodes to the end
Vec_PtrClear( p->vTemp );
k = 0;
- Vec_PtrForEachEntryStart( vDecs, pObj, i, nLeaves )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, vDecs, pObj, i, nLeaves )
if ( Abc_NodeIsTravIdCurrent(pObj) )
Vec_PtrPush( p->vTemp, pObj );
else
Vec_PtrWriteEntry( vDecs, k++, pObj );
// add the labeled nodes
- Vec_PtrForEachEntry( p->vTemp, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vTemp, pObj, i )
Vec_PtrWriteEntry( vDecs, k++, pObj );
assert( k == Vec_PtrSize(p->vDecs) );
assert( pRoot == Vec_PtrEntryLast(p->vDecs) );
@@ -1198,14 +1201,14 @@ void Abc_NodeMffcSimulate( Vec_Ptr_t * vDecs, int nLeaves, Vec_Int_t * vRands, V
int i;
// initialize random simulation data
Vec_IntClear( vSims );
- Vec_PtrForEachEntryStop( vDecs, pObj, i, nLeaves )
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, vDecs, pObj, i, nLeaves )
{
uData = (unsigned)Vec_IntEntry( vRands, i );
pObj->pData = (void *)(ABC_PTRUINT_T)uData;
Vec_IntPush( vSims, uData );
}
// simulate
- Vec_PtrForEachEntryStart( vDecs, pObj, i, nLeaves )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, vDecs, pObj, i, nLeaves )
{
uData0 = (unsigned)(ABC_PTRUINT_T)Abc_ObjFanin0(pObj)->pData;
uData1 = (unsigned)(ABC_PTRUINT_T)Abc_ObjFanin1(pObj)->pData;
@@ -1491,3 +1494,5 @@ Dec_Graph_t * Abc_NodeResubstitute( Abc_ManRst_t * p, Abc_Obj_t * pNode, Cut_Cut
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcResub.c b/src/base/abci/abcResub.c
index 655f158e..a0a1af91 100644
--- a/src/base/abci/abcResub.c
+++ b/src/base/abci/abcResub.c
@@ -20,6 +20,9 @@
#include "abc.h"
#include "dec.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -93,7 +96,7 @@ struct Abc_ManRes_t_
// external procedures
static Abc_ManRes_t* Abc_ManResubStart( int nLeavesMax, int nDivsMax );
static void Abc_ManResubStop( Abc_ManRes_t * p );
-static Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, bool fUpdateLevel, int fVerbose );
+static Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, int fUpdateLevel, int fVerbose );
static void Abc_ManResubCleanup( Abc_ManRes_t * p );
static void Abc_ManResubPrint( Abc_ManRes_t * p );
@@ -114,12 +117,6 @@ static Dec_Graph_t * Abc_ManResubDivs3( Abc_ManRes_t * p, int Required );
static Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax );
static int Abc_CutVolumeCheck( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves );
-// don't-care manager
-extern void * Abc_NtkDontCareAlloc( int nVarsMax, int nLevels, int fVerbose, int fVeryVerbose );
-extern void Abc_NtkDontCareClear( void * p );
-extern void Abc_NtkDontCareFree( void * p );
-extern int Abc_NtkDontCareCompute( void * p, Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, unsigned * puTruth );
-
extern int s_ResubTime;
////////////////////////////////////////////////////////////////////////
@@ -137,13 +134,13 @@ extern int s_ResubTime;
SeeAlso []
***********************************************************************/
-int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLevelsOdc, bool fUpdateLevel, bool fVerbose, bool fVeryVerbose )
+int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose )
{
- extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, bool fUpdateLevel, int nGain );
+ extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int fUpdateLevel, int nGain );
ProgressBar * pProgress;
Abc_ManRes_t * pManRes;
Abc_ManCut_t * pManCut;
- void * pManOdc = NULL;
+ Odc_Man_t * pManOdc = NULL;
Dec_Graph_t * pFForm;
Vec_Ptr_t * vLeaves;
Abc_Obj_t * pNode;
@@ -153,7 +150,7 @@ int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLeve
assert( Abc_NtkIsStrash(pNtk) );
// cleanup the AIG
- Abc_AigCleanup(pNtk->pManFunc);
+ Abc_AigCleanup((Abc_Aig_t *)pNtk->pManFunc);
// start the managers
pManCut = Abc_NtkManCutStart( nCutMax, 100000, 100000, 100000 );
pManRes = Abc_ManResubStart( nCutMax, ABC_RS_DIV1_MAX );
@@ -166,7 +163,7 @@ int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLeve
if ( Abc_NtkLatchNum(pNtk) ) {
Abc_NtkForEachLatch(pNtk, pNode, i)
- pNode->pNext = pNode->pData;
+ pNode->pNext = (Abc_Obj_t *)pNode->pData;
}
// resynthesize each node once
@@ -312,7 +309,7 @@ Abc_ManRes_t * Abc_ManResubStart( int nLeavesMax, int nDivsMax )
// set elementary truth tables
for ( k = 0; k < p->nLeavesMax; k++ )
{
- pData = p->vSims->pArray[k];
+ pData = (unsigned *)p->vSims->pArray[k];
for ( i = 0; i < p->nBits; i++ )
if ( i & (1 << k) )
pData[i>>5] |= (1 << (i&31));
@@ -445,19 +442,19 @@ int Abc_ManResubCollectDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vL
// add the leaves of the cuts to the divisors
Vec_PtrClear( p->vDivs );
Abc_NtkIncrementTravId( pRoot->pNtk );
- Vec_PtrForEachEntry( vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
{
Vec_PtrPush( p->vDivs, pNode );
Abc_NodeSetTravIdCurrent( pNode );
}
// mark nodes in the MFFC
- Vec_PtrForEachEntry( p->vTemp, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vTemp, pNode, i )
pNode->fMarkA = 1;
// collect the cone (without MFFC)
Abc_ManResubCollectDivs_rec( pRoot, p->vDivs );
// unmark the current MFFC
- Vec_PtrForEachEntry( p->vTemp, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vTemp, pNode, i )
pNode->fMarkA = 0;
// check if the number of divisors is not exceeded
@@ -469,7 +466,7 @@ int Abc_ManResubCollectDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vL
// explore the fanouts, which are not in the MFFC
Counter = 0;
- Vec_PtrForEachEntry( p->vDivs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pNode, i )
{
if ( Abc_ObjFanoutNum(pNode) > 100 )
{
@@ -499,7 +496,7 @@ Quits :
p->nDivs = Vec_PtrSize(p->vDivs);
// add the nodes in the MFFC
- Vec_PtrForEachEntry( p->vTemp, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vTemp, pNode, i )
Vec_PtrPush( p->vDivs, pNode );
assert( pRoot == Vec_PtrEntryLast(p->vDivs) );
@@ -523,7 +520,7 @@ void Abc_ManResubPrintDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLe
Abc_Obj_t * pFanin, * pNode;
int i, k;
// print the nodes
- Vec_PtrForEachEntry( p->vDivs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pNode, i )
{
if ( i < Vec_PtrSize(vLeaves) )
{
@@ -532,7 +529,7 @@ void Abc_ManResubPrintDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLe
}
printf( "%6d : %2d = ", pNode->Id, i );
// find the first fanin
- Vec_PtrForEachEntry( p->vDivs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pFanin, k )
if ( Abc_ObjFanin0(pNode) == pFanin )
break;
if ( k < Vec_PtrSize(vLeaves) )
@@ -541,7 +538,7 @@ void Abc_ManResubPrintDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLe
printf( "%d", k );
printf( "%s ", Abc_ObjFaninC0(pNode)? "\'" : "" );
// find the second fanin
- Vec_PtrForEachEntry( p->vDivs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pFanin, k )
if ( Abc_ObjFanin1(pNode) == pFanin )
break;
if ( k < Vec_PtrSize(vLeaves) )
@@ -575,7 +572,7 @@ void Abc_ManResubSimulate( Vec_Ptr_t * vDivs, int nLeaves, Vec_Ptr_t * vSims, in
int i, k;
assert( Vec_PtrSize(vDivs) - nLeaves <= Vec_PtrSize(vSims) - nLeavesMax );
// simulate
- Vec_PtrForEachEntry( vDivs, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDivs, pObj, i )
{
if ( i < nLeaves )
{ // initialize the leaf
@@ -585,9 +582,9 @@ void Abc_ManResubSimulate( Vec_Ptr_t * vDivs, int nLeaves, Vec_Ptr_t * vSims, in
// set storage for the node's simulation info
pObj->pData = Vec_PtrEntry( vSims, i - nLeaves + nLeavesMax );
// get pointer to the simulation info
- puData = pObj->pData;
- puData0 = Abc_ObjFanin0(pObj)->pData;
- puData1 = Abc_ObjFanin1(pObj)->pData;
+ puData = (unsigned *)pObj->pData;
+ puData0 = (unsigned *)Abc_ObjFanin0(pObj)->pData;
+ puData1 = (unsigned *)Abc_ObjFanin1(pObj)->pData;
// simulate
if ( Abc_ObjFaninC0(pObj) && Abc_ObjFaninC1(pObj) )
for ( k = 0; k < nWords; k++ )
@@ -603,9 +600,9 @@ void Abc_ManResubSimulate( Vec_Ptr_t * vDivs, int nLeaves, Vec_Ptr_t * vSims, in
puData[k] = puData0[k] & puData1[k];
}
// normalize
- Vec_PtrForEachEntry( vDivs, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDivs, pObj, i )
{
- puData = pObj->pData;
+ puData = (unsigned *)pObj->pData;
pObj->fPhase = (puData[0] & 1);
if ( pObj->fPhase )
for ( k = 0; k < nWords; k++ )
@@ -849,13 +846,13 @@ void Abc_ManResubDivsS( Abc_ManRes_t * p, int Required )
Vec_PtrClear( p->vDivs1UP );
Vec_PtrClear( p->vDivs1UN );
Vec_PtrClear( p->vDivs1B );
- puDataR = p->pRoot->pData;
- Vec_PtrForEachEntryStop( p->vDivs, pObj, i, p->nDivs )
+ puDataR = (unsigned *)p->pRoot->pData;
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, p->vDivs, pObj, i, p->nDivs )
{
if ( (int)pObj->Level > Required - 1 )
continue;
- puData = pObj->pData;
+ puData = (unsigned *)pObj->pData;
// check positive containment
for ( w = 0; w < p->nWords; w++ )
// if ( puData[w] & ~puDataR[w] )
@@ -901,19 +898,19 @@ void Abc_ManResubDivsD( Abc_ManRes_t * p, int Required )
Vec_PtrClear( p->vDivs2UP1 );
Vec_PtrClear( p->vDivs2UN0 );
Vec_PtrClear( p->vDivs2UN1 );
- puDataR = p->pRoot->pData;
- Vec_PtrForEachEntry( p->vDivs1B, pObj0, i )
+ puDataR = (unsigned *)p->pRoot->pData;
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1B, pObj0, i )
{
if ( (int)pObj0->Level > Required - 2 )
continue;
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1B, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1B, pObj1, k, i + 1 )
{
if ( (int)pObj1->Level > Required - 2 )
continue;
- puData1 = pObj1->pData;
+ puData1 = (unsigned *)pObj1->pData;
if ( Vec_PtrSize(p->vDivs2UP0) < ABC_RS_DIV2_MAX )
{
@@ -1019,7 +1016,7 @@ Dec_Graph_t * Abc_ManResubQuit( Abc_ManRes_t * p )
Dec_Graph_t * pGraph;
unsigned * upData;
int w;
- upData = p->pRoot->pData;
+ upData = (unsigned *)p->pRoot->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( upData[w] )
if ( upData[w] & p->pCareSet[w] ) // care set
@@ -1050,10 +1047,10 @@ Dec_Graph_t * Abc_ManResubDivs0( Abc_ManRes_t * p )
Abc_Obj_t * pObj;
unsigned * puData, * puDataR;
int i, w;
- puDataR = p->pRoot->pData;
- Vec_PtrForEachEntryStop( p->vDivs, pObj, i, p->nDivs )
+ puDataR = (unsigned *)p->pRoot->pData;
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, p->vDivs, pObj, i, p->nDivs )
{
- puData = pObj->pData;
+ puData = (unsigned *)pObj->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( puData[w] != puDataR[w] )
if ( (puData[w] ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1080,14 +1077,14 @@ Dec_Graph_t * Abc_ManResubDivs1( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1;
unsigned * puData0, * puData1, * puDataR;
int i, k, w;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs1UP, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UP, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UP, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UP, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
+ puData1 = (unsigned *)pObj1->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] | puData1[w]) != puDataR[w] )
if ( ((puData0[w] | puData1[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1100,12 +1097,12 @@ Dec_Graph_t * Abc_ManResubDivs1( Abc_ManRes_t * p, int Required )
}
}
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs1UN, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UN, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UN, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UN, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
+ puData1 = (unsigned *)pObj1->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] & puData1[w]) != puDataR[w] )
if ( ((puData0[w] & puData1[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1136,17 +1133,17 @@ Dec_Graph_t * Abc_ManResubDivs12( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1, * pObj2, * pObjMax, * pObjMin0 = NULL, * pObjMin1 = NULL;
unsigned * puData0, * puData1, * puData2, * puDataR;
int i, k, j, w, LevelMax;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs1UP, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UP, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UP, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UP, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UP, pObj2, j, k + 1 )
+ puData1 = (unsigned *)pObj1->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UP, pObj2, j, k + 1 )
{
- puData2 = pObj2->pData;
+ puData2 = (unsigned *)pObj2->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] | puData1[w] | puData2[w]) != puDataR[w] )
if ( ((puData0[w] | puData1[w] | puData2[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1179,15 +1176,15 @@ Dec_Graph_t * Abc_ManResubDivs12( Abc_ManRes_t * p, int Required )
}
}
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs1UN, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UN, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UN, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UN, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UN, pObj2, j, k + 1 )
+ puData1 = (unsigned *)pObj1->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UN, pObj2, j, k + 1 )
{
- puData2 = pObj2->pData;
+ puData2 = (unsigned *)pObj2->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] & puData1[w] & puData2[w]) != puDataR[w] )
if ( ((puData0[w] & puData1[w] & puData2[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1238,17 +1235,17 @@ Dec_Graph_t * Abc_ManResubDivs2( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1, * pObj2;
unsigned * puData0, * puData1, * puData2, * puDataR;
int i, k, w;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs1UP, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UP, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntry( p->vDivs2UP0, pObj1, k )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UP0, pObj1, k )
{
- pObj2 = Vec_PtrEntry( p->vDivs2UP1, k );
+ pObj2 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UP1, k );
- puData1 = Abc_ObjRegular(pObj1)->pData;
- puData2 = Abc_ObjRegular(pObj2)->pData;
+ puData1 = (unsigned *)Abc_ObjRegular(pObj1)->pData;
+ puData2 = (unsigned *)Abc_ObjRegular(pObj2)->pData;
if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
{
for ( w = 0; w < p->nWords; w++ )
@@ -1285,15 +1282,15 @@ Dec_Graph_t * Abc_ManResubDivs2( Abc_ManRes_t * p, int Required )
}
}
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs1UN, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UN, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntry( p->vDivs2UN0, pObj1, k )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UN0, pObj1, k )
{
- pObj2 = Vec_PtrEntry( p->vDivs2UN1, k );
+ pObj2 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UN1, k );
- puData1 = Abc_ObjRegular(pObj1)->pData;
- puData2 = Abc_ObjRegular(pObj2)->pData;
+ puData1 = (unsigned *)Abc_ObjRegular(pObj1)->pData;
+ puData2 = (unsigned *)Abc_ObjRegular(pObj2)->pData;
if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
{
for ( w = 0; w < p->nWords; w++ )
@@ -1348,22 +1345,22 @@ Dec_Graph_t * Abc_ManResubDivs3( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1, * pObj2, * pObj3;
unsigned * puData0, * puData1, * puData2, * puData3, * puDataR;
int i, k, w = 0, Flag;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs2UP0, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UP0, pObj0, i )
{
- pObj1 = Vec_PtrEntry( p->vDivs2UP1, i );
- puData0 = Abc_ObjRegular(pObj0)->pData;
- puData1 = Abc_ObjRegular(pObj1)->pData;
+ pObj1 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UP1, i );
+ puData0 = (unsigned *)Abc_ObjRegular(pObj0)->pData;
+ puData1 = (unsigned *)Abc_ObjRegular(pObj1)->pData;
Flag = (Abc_ObjIsComplement(pObj0) << 3) | (Abc_ObjIsComplement(pObj1) << 2);
- Vec_PtrForEachEntryStart( p->vDivs2UP0, pObj2, k, i + 1 )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs2UP0, pObj2, k, i + 1 )
{
- pObj3 = Vec_PtrEntry( p->vDivs2UP1, k );
- puData2 = Abc_ObjRegular(pObj2)->pData;
- puData3 = Abc_ObjRegular(pObj3)->pData;
+ pObj3 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UP1, k );
+ puData2 = (unsigned *)Abc_ObjRegular(pObj2)->pData;
+ puData3 = (unsigned *)Abc_ObjRegular(pObj3)->pData;
- Flag = (Flag & 12) | (Abc_ObjIsComplement(pObj2) << 1) | Abc_ObjIsComplement(pObj3);
+ Flag = (Flag & 12) | ((int)Abc_ObjIsComplement(pObj2) << 1) | (int)Abc_ObjIsComplement(pObj3);
assert( Flag < 16 );
switch( Flag )
{
@@ -1477,14 +1474,14 @@ Dec_Graph_t * Abc_ManResubDivs3( Abc_ManRes_t * p, int Required )
}
/*
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs2UN0, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UN0, pObj0, i )
{
pObj1 = Vec_PtrEntry( p->vDivs2UN1, i );
puData0 = Abc_ObjRegular(pObj0)->pData;
puData1 = Abc_ObjRegular(pObj1)->pData;
Flag = (Abc_ObjIsComplement(pObj0) << 3) | (Abc_ObjIsComplement(pObj1) << 2);
- Vec_PtrForEachEntryStart( p->vDivs2UN0, pObj2, k, i + 1 )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs2UN0, pObj2, k, i + 1 )
{
pObj3 = Vec_PtrEntry( p->vDivs2UN1, k );
puData2 = Abc_ObjRegular(pObj2)->pData;
@@ -1605,7 +1602,7 @@ void Abc_ManResubCleanup( Abc_ManRes_t * p )
{
Abc_Obj_t * pObj;
int i;
- Vec_PtrForEachEntry( p->vDivs, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pObj, i )
pObj->pData = NULL;
Vec_PtrClear( p->vDivs );
p->pRoot = NULL;
@@ -1622,7 +1619,7 @@ void Abc_ManResubCleanup( Abc_ManRes_t * p )
SeeAlso []
***********************************************************************/
-Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, bool fUpdateLevel, bool fVerbose )
+Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, int fUpdateLevel, int fVerbose )
{
extern int Abc_NodeMffcInside( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vInside );
Dec_Graph_t * pGraph;
@@ -1780,7 +1777,7 @@ int Abc_CutVolumeCheck( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves )
int i;
// mark the leaves
Abc_NtkIncrementTravId( pNode->pNtk );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
Abc_NodeSetTravIdCurrent( pObj );
// traverse the nodes starting from the given one and count them
return Abc_CutVolumeCheck_rec( pNode );
@@ -1833,7 +1830,7 @@ Vec_Ptr_t * Abc_CutFactor( Abc_Obj_t * pNode )
vLeaves = Vec_PtrAlloc( 10 );
Abc_CutFactor_rec( Abc_ObjFanin0(pNode), vLeaves );
Abc_CutFactor_rec( Abc_ObjFanin1(pNode), vLeaves );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->fMarkA = 0;
return vLeaves;
}
@@ -1874,7 +1871,7 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
// initialize the factor cuts for the leaves
vFactors = Vec_PtrAlloc( nLeavesMax );
Abc_NtkIncrementTravId( pNode->pNtk );
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
Abc_NodeSetTravIdCurrent( pLeaf );
if ( Abc_ObjIsCi(pLeaf) )
@@ -1889,13 +1886,13 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
BestCut = -1, BestShare = -1;
// find the next feasible cut to add
Vec_IntClear( vFeasible );
- Vec_PtrForEachEntry( vFactors, vFact, i )
+ Vec_PtrForEachEntry( Vec_Ptr_t *, vFactors, vFact, i )
{
if ( vFact == NULL )
continue;
// count the number of unmarked leaves of this factor cut
Counter = 0;
- Vec_PtrForEachEntry( vFact, pTemp, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFact, pTemp, k )
Counter += !Abc_NodeIsTravIdCurrent(pTemp);
// if the number of new leaves is smaller than the diff, it is feasible
if ( Counter <= nLeavesMax - Vec_PtrSize(vLeaves) + 1 )
@@ -1913,8 +1910,8 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
// choose the cut that has most sharing with the other cuts
RandLeaf = BestCut;
- pLeaf = Vec_PtrEntry( vLeaves, RandLeaf );
- vNext = Vec_PtrEntry( vFactors, RandLeaf );
+ pLeaf = (Abc_Obj_t *)Vec_PtrEntry( vLeaves, RandLeaf );
+ vNext = (Vec_Ptr_t *)Vec_PtrEntry( vFactors, RandLeaf );
// unmark this leaf
Abc_NodeSetTravIdPrevious( pLeaf );
// remove this cut from the leaves and factor cuts
@@ -1926,7 +1923,7 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
Vec_PtrShrink( vLeaves, Vec_PtrSize(vLeaves) -1 );
Vec_PtrShrink( vFactors, Vec_PtrSize(vFactors)-1 );
// add new leaves, compute their factor cuts
- Vec_PtrForEachEntry( vNext, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNext, pLeaf, i )
{
if ( Abc_NodeIsTravIdCurrent(pLeaf) )
continue;
@@ -1944,7 +1941,7 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
}
// remove temporary storage
- Vec_PtrForEachEntry( vFactors, vFact, i )
+ Vec_PtrForEachEntry( Vec_Ptr_t *, vFactors, vFact, i )
if ( vFact ) Vec_PtrFree( vFact );
Vec_PtrFree( vFactors );
Vec_IntFree( vFeasible );
@@ -1956,3 +1953,5 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcRewrite.c b/src/base/abci/abcRewrite.c
index a119ccd2..f36600fa 100644
--- a/src/base/abci/abcRewrite.c
+++ b/src/base/abci/abcRewrite.c
@@ -22,6 +22,9 @@
#include "rwr.h"
#include "dec.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
The ideas realized in this package are inspired by the paper:
Per Bjesse, Arne Boralv, "DAG-aware circuit compression for
@@ -57,7 +60,7 @@ extern void Abc_PlaceUpdate( Vec_Ptr_t * vAddedCells, Vec_Ptr_t * vUpdatedNets
***********************************************************************/
int Abc_NtkRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable )
{
- extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, bool fUpdateLevel, int nGain );
+ extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int fUpdateLevel, int nGain );
ProgressBar * pProgress;
Cut_Man_t * pManCut;
Rwr_Man_t * pManRwr;
@@ -69,7 +72,7 @@ int Abc_NtkRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeros, int fVerb
assert( Abc_NtkIsStrash(pNtk) );
// cleanup the AIG
- Abc_AigCleanup(pNtk->pManFunc);
+ Abc_AigCleanup((Abc_Aig_t *)pNtk->pManFunc);
/*
{
Vec_Vec_t * vParts;
@@ -125,12 +128,12 @@ Rwr_ManAddTimeCuts( pManRwr, clock() - clk );
// if we end up here, a rewriting step is accepted
// get hold of the new subgraph to be added to the AIG
- pGraph = Rwr_ManReadDecs(pManRwr);
+ pGraph = (Dec_Graph_t *)Rwr_ManReadDecs(pManRwr);
fCompl = Rwr_ManReadCompl(pManRwr);
// reset the array of the changed nodes
if ( fPlaceEnable )
- Abc_AigUpdateReset( pNtk->pManFunc );
+ Abc_AigUpdateReset( (Abc_Aig_t *)pNtk->pManFunc );
// complement the FF if needed
if ( fCompl ) Dec_GraphComplement( pGraph );
@@ -242,7 +245,7 @@ void Abc_NodePrintCuts( Abc_Obj_t * pNode )
printf( "\nNode %s\n", Abc_ObjName(pNode) );
vCuts = (Vec_Ptr_t *)pNode->pCopy;
- Vec_PtrForEachEntry( vCuts, pCut, k )
+ Vec_PtrForEachEntry( Cut_Cut_t *, vCuts, pCut, k )
{
Extra_PrintBinary( stdout, (unsigned *)&pCut->uSign, 16 );
printf( " " );
@@ -267,9 +270,9 @@ void Abc_ManRewritePrintDivs( Vec_Ptr_t * vDivs, int nLeaves )
{
Abc_Obj_t * pFanin, * pNode, * pRoot;
int i, k;
- pRoot = Vec_PtrEntryLast(vDivs);
+ pRoot = (Abc_Obj_t *)Vec_PtrEntryLast(vDivs);
// print the nodes
- Vec_PtrForEachEntry( vDivs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDivs, pNode, i )
{
if ( i < nLeaves )
{
@@ -278,7 +281,7 @@ void Abc_ManRewritePrintDivs( Vec_Ptr_t * vDivs, int nLeaves )
}
printf( "%6d : %2d = ", pNode->Id, i );
// find the first fanin
- Vec_PtrForEachEntry( vDivs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDivs, pFanin, k )
if ( Abc_ObjFanin0(pNode) == pFanin )
break;
if ( k < nLeaves )
@@ -287,7 +290,7 @@ void Abc_ManRewritePrintDivs( Vec_Ptr_t * vDivs, int nLeaves )
printf( "%d", k );
printf( "%s ", Abc_ObjFaninC0(pNode)? "\'" : "" );
// find the second fanin
- Vec_PtrForEachEntry( vDivs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDivs, pFanin, k )
if ( Abc_ObjFanin1(pNode) == pFanin )
break;
if ( k < nLeaves )
@@ -342,7 +345,7 @@ void Abc_ManShowCutCone( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves )
int i;
vDivs = Vec_PtrAlloc( 100 );
Abc_NtkIncrementTravId( pNtk );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
{
Abc_NodeSetTravIdCurrent( Abc_ObjRegular(pObj) );
Vec_PtrPush( vDivs, Abc_ObjRegular(pObj) );
@@ -397,7 +400,7 @@ void Abc_RwrExpWithCut( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves )
Abc_RwrExpWithCut_rec( Abc_ObjFanin0(pNode), vLeaves, 1 );
Abc_RwrExpWithCut_rec( Abc_ObjFanin1(pNode), vLeaves, 0 );
CountA = CountB = 0;
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
{
CountA += Abc_ObjRegular(pObj)->fMarkA;
CountB += Abc_ObjRegular(pObj)->fMarkB;
@@ -413,3 +416,5 @@ void Abc_RwrExpWithCut( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcRr.c b/src/base/abci/abcRr.c
index 9fbad080..12e94478 100644
--- a/src/base/abci/abcRr.c
+++ b/src/base/abci/abcRr.c
@@ -22,6 +22,9 @@
#include "fraig.h"
#include "sim.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -99,7 +102,7 @@ int Abc_NtkRR( Abc_Ntk_t * pNtk, int nFaninLevels, int nFanoutLevels, int fUseFa
Abc_Obj_t * pNode, * pFanin, * pFanout;
int i, k, m, nNodes, RetValue, clk, clkTotal = clock();
// start the manager
- p = Abc_RRManStart( nFaninLevels, nFanoutLevels );
+ p = Abc_RRManStart();
p->pNtk = pNtk;
p->nFaninLevels = nFaninLevels;
p->nFanoutLevels = nFanoutLevels;
@@ -393,17 +396,17 @@ int Abc_NtkRRUpdate( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, Abc_Obj_t * pFanin, Ab
// replace
if ( pFanout == NULL )
{
- Abc_AigReplace( pNtk->pManFunc, pNode, pNodeNew, 1 );
+ Abc_AigReplace( (Abc_Aig_t *)pNtk->pManFunc, pNode, pNodeNew, 1 );
return 1;
}
// find the fanout after redundancy removal
if ( pNode == Abc_ObjFanin0(pFanout) )
- pFanoutNew = Abc_AigAnd( pNtk->pManFunc, Abc_ObjNotCond(pNodeNew,Abc_ObjFaninC0(pFanout)), Abc_ObjChild1(pFanout) );
+ pFanoutNew = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjNotCond(pNodeNew,Abc_ObjFaninC0(pFanout)), Abc_ObjChild1(pFanout) );
else if ( pNode == Abc_ObjFanin1(pFanout) )
- pFanoutNew = Abc_AigAnd( pNtk->pManFunc, Abc_ObjNotCond(pNodeNew,Abc_ObjFaninC1(pFanout)), Abc_ObjChild0(pFanout) );
+ pFanoutNew = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, Abc_ObjNotCond(pNodeNew,Abc_ObjFaninC1(pFanout)), Abc_ObjChild0(pFanout) );
else assert( 0 );
// replace
- Abc_AigReplace( pNtk->pManFunc, pFanout, pFanoutNew, 1 );
+ Abc_AigReplace( (Abc_Aig_t *)pNtk->pManFunc, pFanout, pFanoutNew, 1 );
return 1;
}
@@ -442,7 +445,7 @@ int Abc_NtkRRWindow( Abc_RRMan_t * p )
// mark the leaves with the new TravId
Abc_NtkIncrementTravId( p->pNtk );
- Vec_PtrForEachEntry( p->vFaninLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vFaninLeaves, pObj, i )
Abc_NodeSetTravIdCurrent( pObj );
// traverse the TFO cone of the leaves (while skipping the edge)
// (a) mark the nodes in the cone using the current TravId
@@ -450,12 +453,12 @@ int Abc_NtkRRWindow( Abc_RRMan_t * p )
while ( Abc_NtkRRTfo_int(p->vFaninLeaves, p->vFanoutRoots, LevelMax, pEdgeFanin, pEdgeFanout) );
// mark the fanout roots
- Vec_PtrForEachEntry( p->vFanoutRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vFanoutRoots, pObj, i )
pObj->fMarkA = 1;
// collect roots reachable from the fanout (p->vRoots)
RetValue = Abc_NtkRRTfo_rec( pEdgeFanout, p->vRoots, LevelMax + 1 );
// unmark the fanout roots
- Vec_PtrForEachEntry( p->vFanoutRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vFanoutRoots, pObj, i )
pObj->fMarkA = 0;
// return if the window is infeasible
@@ -465,7 +468,7 @@ int Abc_NtkRRWindow( Abc_RRMan_t * p )
// collect the DFS-ordered new cone (p->vCone) and new leaves (p->vLeaves)
// using the previous marks coming from the TFO cone
Abc_NtkIncrementTravId( p->pNtk );
- Vec_PtrForEachEntry( p->vRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i )
Abc_NtkRRTfi_rec( pObj, p->vLeaves, p->vCone, LevelMin );
// create a new network
@@ -491,7 +494,7 @@ int Abc_NtkRRTfi_int( Vec_Ptr_t * vLeaves, int LevelLimit )
assert( LevelLimit >= 0 );
// find the maximum level of leaves
LevelMax = 0;
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
if ( LevelMax < (int)pObj->Level )
LevelMax = pObj->Level;
// if the nodes are all PIs, LevelMax == 0
@@ -499,7 +502,7 @@ int Abc_NtkRRTfi_int( Vec_Ptr_t * vLeaves, int LevelLimit )
return 0;
// expand the nodes with the minimum level
nSize = Vec_PtrSize(vLeaves);
- Vec_PtrForEachEntryStop( vLeaves, pObj, i, nSize )
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, vLeaves, pObj, i, nSize )
{
if ( LevelMax != (int)pObj->Level )
continue;
@@ -513,7 +516,7 @@ int Abc_NtkRRTfi_int( Vec_Ptr_t * vLeaves, int LevelLimit )
}
// remove old nodes (cannot remove a PI)
k = 0;
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
{
if ( LevelMax == (int)pObj->Level )
continue;
@@ -542,7 +545,7 @@ int Abc_NtkRRTfo_int( Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int LevelLimit, A
int i, k, LevelMin, nSize, fObjIsRoot;
// find the minimum level of leaves
LevelMin = ABC_INFINITY;
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
if ( LevelMin > (int)pObj->Level )
LevelMin = pObj->Level;
// if the minimum level exceed the limit, we are done
@@ -550,7 +553,7 @@ int Abc_NtkRRTfo_int( Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int LevelLimit, A
return 0;
// expand the nodes with the minimum level
nSize = Vec_PtrSize(vLeaves);
- Vec_PtrForEachEntryStop( vLeaves, pObj, i, nSize )
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, vLeaves, pObj, i, nSize )
{
if ( LevelMin != (int)pObj->Level )
continue;
@@ -577,7 +580,7 @@ int Abc_NtkRRTfo_int( Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int LevelLimit, A
}
// remove old nodes
k = 0;
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
{
if ( LevelMin == (int)pObj->Level )
continue;
@@ -682,17 +685,17 @@ Abc_Ntk_t * Abc_NtkWindow( Abc_Ntk_t * pNtk, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vC
// map the constant nodes
Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pNtkNew);
// create and map the PIs
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->pCopy = Abc_NtkCreatePi(pNtkNew);
// copy the AND gates
- Vec_PtrForEachEntry( vCone, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vCone, pObj, i )
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// compare the number of nodes before and after
if ( Vec_PtrSize(vCone) != Abc_NtkNodeNum(pNtkNew) )
printf( "Warning: Structural hashing during windowing reduced %d nodes (this is a bug).\n",
Vec_PtrSize(vCone) - Abc_NtkNodeNum(pNtkNew) );
// create the POs
- Vec_PtrForEachEntry( vRoots, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vRoots, pObj, i )
{
assert( !Abc_ObjIsComplement(pObj->pCopy) );
Abc_ObjAddFanin( Abc_NtkCreatePo(pNtkNew), pObj->pCopy );
@@ -700,7 +703,6 @@ Abc_Ntk_t * Abc_NtkWindow( Abc_Ntk_t * pNtk, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vC
// add the PI/PO names
Abc_NtkAddDummyPiNames( pNtkNew );
Abc_NtkAddDummyPoNames( pNtkNew );
- Abc_NtkAddDummyAssertNames( pNtkNew );
// check
if ( fCheck && !Abc_NtkCheck( pNtkNew ) )
{
@@ -928,19 +930,19 @@ void Sim_SimulateCollected( Vec_Str_t * vTargets, Vec_Ptr_t * vNodes, Vec_Ptr_t
// get simulation info
vSims = Sim_UtilInfoAlloc( Vec_PtrSize(vField), Vec_PtrSize(vNodes), 0 );
// simulate the nodes
- Vec_PtrForEachEntry( vField, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vField, pObj, i )
{
if ( Abc_ObjIsCi(pObj) )
{
- pUnsigned = Vec_PtrEntry( vSims, i );
+ pUnsigned = (unsigned *)Vec_PtrEntry( vSims, i );
for ( k = 0; k < Vec_PtrSize(vNodes); k++ )
pUnsigned[k] = (unsigned)(ABC_PTRUINT_T)pObj->pCopy;
continue;
}
if ( Abc_ObjIsCo(pObj) )
{
- pUnsigned = Vec_PtrEntry( vSims, i );
- pUnsignedF = Vec_PtrEntry( vSims, (int)(ABC_PTRUINT_T)Abc_ObjFanin0(pObj)->pData );
+ pUnsigned = (unsigned *)Vec_PtrEntry( vSims, i );
+ pUnsignedF = (unsigned *)Vec_PtrEntry( vSims, (int)(ABC_PTRUINT_T)Abc_ObjFanin0(pObj)->pData );
if ( Abc_ObjFaninC0(pObj) )
for ( k = 0; k < Vec_PtrSize(vNodes); k++ )
pUnsigned[k] = ~pUnsignedF[k];
@@ -952,7 +954,7 @@ void Sim_SimulateCollected( Vec_Str_t * vTargets, Vec_Ptr_t * vNodes, Vec_Ptr_t
{
if ( pUnsigned[k] == (unsigned)(ABC_PTRUINT_T)pObj->pData )
continue;
- pDisproved = Vec_PtrEntry( vNodes, k );
+ pDisproved = (Abc_Obj_t *)Vec_PtrEntry( vNodes, k );
fCompl = Abc_ObjIsComplement(pDisproved);
pDisproved = Abc_ObjRegular(pDisproved);
Phase = Vec_StrEntry( vTargets, pDisproved->Id );
@@ -997,3 +999,5 @@ void Sim_SimulateCollected( Vec_Str_t * vTargets, Vec_Ptr_t * vNodes, Vec_Ptr_t
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcSat.c b/src/base/abci/abcSat.c
index 5e14116c..30c77e59 100644
--- a/src/base/abci/abcSat.c
+++ b/src/base/abci/abcSat.c
@@ -19,8 +19,13 @@
***********************************************************************/
#include "abc.h"
+#include "main.h"
+#include "cmd.h"
#include "satSolver.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -62,7 +67,7 @@ int Abc_NtkMiterSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsL
// load clauses into the sat_solver
clk = clock();
- pSat = Abc_NtkMiterSatCreate( pNtk, 0 );
+ pSat = (sat_solver *)Abc_NtkMiterSatCreate( pNtk, 0 );
if ( pSat == NULL )
return 1;
//printf( "%d \n", pSat->clauses.size );
@@ -194,7 +199,7 @@ int Abc_NtkClauseTop( sat_solver * pSat, Vec_Ptr_t * vNodes, Vec_Int_t * vVars )
int i;
//printf( "Adding triv %d. %d\n", Abc_ObjRegular(pNode)->Id, (int)pSat->sat_solver_stats.clauses );
vVars->nSize = 0;
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
Vec_IntPush( vVars, toLitCond( (int)(ABC_PTRINT_T)Abc_ObjRegular(pNode)->pCopy, Abc_ObjIsComplement(pNode) ) );
// Vec_IntPush( vVars, toLitCond( (int)Abc_ObjRegular(pNode)->Id, Abc_ObjIsComplement(pNode) ) );
return sat_solver_addclause( pSat, vVars->pArray, vVars->pArray + vVars->nSize );
@@ -228,9 +233,9 @@ int Abc_NtkClauseAnd( sat_solver * pSat, Abc_Obj_t * pNode, Vec_Ptr_t * vSuper,
{
// get the predecessor nodes
// get the complemented attributes of the nodes
- fComp1 = Abc_ObjIsComplement(vSuper->pArray[i]);
+ fComp1 = Abc_ObjIsComplement((Abc_Obj_t *)vSuper->pArray[i]);
// determine the variable numbers
- Var1 = (int)(ABC_PTRINT_T)Abc_ObjRegular(vSuper->pArray[i])->pCopy;
+ Var1 = (int)(ABC_PTRINT_T)Abc_ObjRegular((Abc_Obj_t *)vSuper->pArray[i])->pCopy;
// Var1 = (int)Abc_ObjRegular(vSuper->pArray[i])->Id;
// check that the variables are in the SAT manager
@@ -253,9 +258,9 @@ int Abc_NtkClauseAnd( sat_solver * pSat, Abc_Obj_t * pNode, Vec_Ptr_t * vSuper,
{
// get the predecessor nodes
// get the complemented attributes of the nodes
- fComp1 = Abc_ObjIsComplement(vSuper->pArray[i]);
+ fComp1 = Abc_ObjIsComplement((Abc_Obj_t *)vSuper->pArray[i]);
// determine the variable numbers
- Var1 = (int)(ABC_PTRINT_T)Abc_ObjRegular(vSuper->pArray[i])->pCopy;
+ Var1 = (int)(ABC_PTRINT_T)Abc_ObjRegular((Abc_Obj_t *)vSuper->pArray[i])->pCopy;
// Var1 = (int)Abc_ObjRegular(vSuper->pArray[i])->Id;
// add this variable to the array
Vec_IntPush( vVars, toLitCond(Var1, !fComp1) );
@@ -512,7 +517,7 @@ int Abc_NtkMiterSatCreateInt( sat_solver * pSat, Abc_Ntk_t * pNtk )
// add the clauses
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
assert( !Abc_ObjIsComplement(pNode) );
if ( !Abc_AigNodeIsAnd(pNode) )
@@ -530,7 +535,7 @@ int Abc_NtkMiterSatCreateInt( sat_solver * pSat, Abc_Ntk_t * pNtk )
Vec_PtrPush( vSuper, pNodeT );
Vec_PtrPush( vSuper, pNodeE );
// add the fanin nodes to explore
- Vec_PtrForEachEntry( vSuper, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSuper, pFanin, k )
{
pFanin = Abc_ObjRegular(pFanin);
if ( pFanin->fMarkA == 0 )
@@ -549,7 +554,7 @@ int Abc_NtkMiterSatCreateInt( sat_solver * pSat, Abc_Ntk_t * pNtk )
// get the supergate
Abc_NtkCollectSupergate( pNode, fUseMuxes, vSuper );
// add the fanin nodes to explore
- Vec_PtrForEachEntry( vSuper, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSuper, pFanin, k )
{
pFanin = Abc_ObjRegular(pFanin);
if ( pFanin->fMarkA == 0 )
@@ -673,7 +678,7 @@ int Abc_NodeAddClauses( sat_solver * pSat, char * pSop0, char * pSop1, Abc_Obj_t
assert( nFanins == Abc_SopGetVarNum( pSop0 ) );
// if ( nFanins == 0 )
- if ( Cudd_Regular(pNode->pData) == Cudd_ReadOne(pNode->pNtk->pManFunc) )
+ if ( Cudd_Regular((Abc_Obj_t *)pNode->pData) == Cudd_ReadOne((DdManager *)pNode->pNtk->pManFunc) )
{
vVars->nSize = 0;
// if ( Abc_SopIsConst1(pSop1) )
@@ -840,7 +845,7 @@ sat_solver * Abc_NtkMiterSatCreateLogic( Abc_Ntk_t * pNtk, int fAllPrimes )
// transfer the IDs to the copy field
Abc_NtkForEachPi( pNtk, pNode, i )
- pNode->pCopy = (void *)(ABC_PTRINT_T)pNode->Id;
+ pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)pNode->Id;
// start the data structures
pSat = sat_solver_new();
@@ -897,10 +902,6 @@ finish:
***********************************************************************/
void Abc_NtkWriteSorterCnf( char * pFileName, int nVars, int nQueens )
{
- extern int Cmd_CommandExecute( void * pAbc, char * sCommand );
- extern void * Abc_FrameGetGlobalFrame();
- extern Abc_Ntk_t * Abc_FrameReadNtk( void * p );
-
char Command[100];
void * pAbc;
Abc_Ntk_t * pNtk;
@@ -918,21 +919,21 @@ void Abc_NtkWriteSorterCnf( char * pFileName, int nVars, int nQueens )
pAbc = Abc_FrameGetGlobalFrame();
// generate sorter
sprintf( Command, "gen -s -N %d sorter%d.blif", nVars, nVars );
- if ( Cmd_CommandExecute( pAbc, Command ) )
+ if ( Cmd_CommandExecute( (Abc_Frame_t *)pAbc, Command ) )
{
fprintf( stdout, "Cannot execute command \"%s\".\n", Command );
return;
}
// read the file
sprintf( Command, "read sorter%d.blif; strash", nVars );
- if ( Cmd_CommandExecute( pAbc, Command ) )
+ if ( Cmd_CommandExecute( (Abc_Frame_t *)pAbc, Command ) )
{
fprintf( stdout, "Cannot execute command \"%s\".\n", Command );
return;
}
// get the current network
- pNtk = Abc_FrameReadNtk(pAbc);
+ pNtk = Abc_FrameReadNtk((Abc_Frame_t *)pAbc);
// collect the nodes for the given two primary outputs
ppNodes[0] = Abc_NtkPo( pNtk, nVars - nQueens - 1 );
ppNodes[1] = Abc_NtkPo( pNtk, nVars - nQueens );
@@ -943,11 +944,11 @@ void Abc_NtkWriteSorterCnf( char * pFileName, int nVars, int nQueens )
// assign CNF variables
Counter = 0;
Abc_NtkForEachObj( pNtk, pObj, i )
- pObj->pCopy = (void *)~0;
+ pObj->pCopy = (Abc_Obj_t *)~0;
Abc_NtkForEachPi( pNtk, pObj, i )
- pObj->pCopy = (void *)(ABC_PTRINT_T)Counter++;
- Vec_PtrForEachEntry( vNodes, pObj, i )
- pObj->pCopy = (void *)(ABC_PTRINT_T)Counter++;
+ pObj->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Counter++;
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
+ pObj->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Counter++;
/*
OutVar = pCnf->pVarNums[ pObj->Id ];
@@ -972,7 +973,7 @@ void Abc_NtkWriteSorterCnf( char * pFileName, int nVars, int nQueens )
pFile = fopen( pFileName, "w" );
fprintf( pFile, "c CNF for %d-bit sorter with %d bits set to 1 generated by ABC.\n", nVars, nQueens );
fprintf( pFile, "p cnf %d %d\n", Counter, 3 * Vec_PtrSize(vNodes) + 2 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
// positive phase
fprintf( pFile, "%d %s%d %s%d 0\n", 1+(int)(ABC_PTRINT_T)pObj->pCopy,
@@ -1005,3 +1006,5 @@ void Abc_NtkWriteSorterCnf( char * pFileName, int nVars, int nQueens )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcScorr.c b/src/base/abci/abcScorr.c
new file mode 100644
index 00000000..07e52fa4
--- /dev/null
+++ b/src/base/abci/abcScorr.c
@@ -0,0 +1,454 @@
+/**CFile****************************************************************
+
+ FileName [abcScorr.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [Signal correspondence testing procedures.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: abcScorr.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "ioAbc.h"
+#include "saig.h"
+#include "ssw.h"
+#include "gia.h"
+#include "cec.h"
+#include "giaAig.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+typedef struct Tst_Dat_t_ Tst_Dat_t;
+struct Tst_Dat_t_
+{
+ Abc_Ntk_t * pNetlist;
+ Aig_Man_t * pAig;
+ Gia_Man_t * pGia;
+ Vec_Int_t * vId2Name;
+ char * pFileNameOut;
+ int fFlopOnly;
+ int fFfNdOnly;
+ int fDumpBmc;
+};
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Abc_NtkMapGiaIntoNameId( Abc_Ntk_t * pNetlist, Aig_Man_t * pAig, Gia_Man_t * pGia )
+{
+ Vec_Int_t * vId2Name;
+ Abc_Obj_t * pNet, * pNode, * pAnd;
+ Aig_Obj_t * pObjAig;
+ int i;
+ vId2Name = Vec_IntStart( 0 );
+ Vec_IntFill( vId2Name, pGia ? Gia_ManObjNum(pGia) : Aig_ManObjNumMax(pAig), ~0 );
+ // copy all names
+ Abc_NtkForEachNet( pNetlist, pNet, i )
+ {
+ pNode = Abc_ObjFanin0(pNet)->pCopy;
+ if ( pNode && (pAnd = Abc_ObjRegular(pNode->pCopy)) &&
+ (pObjAig = (Aig_Obj_t *)Abc_ObjRegular(pAnd->pCopy)) &&
+ Aig_ObjType(pObjAig) != AIG_OBJ_NONE )
+ {
+ if ( pGia == NULL )
+ Vec_IntWriteEntry( vId2Name, Aig_ObjId(pObjAig), Abc_ObjId(pNet) );
+ else
+ Vec_IntWriteEntry( vId2Name, Gia_Lit2Var(pObjAig->iData), Abc_ObjId(pNet) );
+ }
+ }
+ // overwrite CO names
+ Abc_NtkForEachCo( pNetlist, pNode, i )
+ {
+ pNet = Abc_ObjFanin0(pNode);
+ pNode = pNode->pCopy;
+ if ( pNode && (pAnd = Abc_ObjRegular(pNode->pCopy)) &&
+ (pObjAig = (Aig_Obj_t *)Abc_ObjRegular(pAnd->pCopy)) &&
+ Aig_ObjType(pObjAig) != AIG_OBJ_NONE )
+ {
+ if ( pGia == NULL )
+ Vec_IntWriteEntry( vId2Name, Aig_ObjId(pObjAig), Abc_ObjId(pNet) );
+ else
+ Vec_IntWriteEntry( vId2Name, Gia_Lit2Var(pObjAig->iData), Abc_ObjId(pNet) );
+ }
+ }
+ // overwrite CI names
+ Abc_NtkForEachCi( pNetlist, pNode, i )
+ {
+ pNet = Abc_ObjFanout0(pNode);
+ pNode = pNode->pCopy;
+ if ( pNode && (pAnd = Abc_ObjRegular(pNode->pCopy)) &&
+ (pObjAig = (Aig_Obj_t *)Abc_ObjRegular(pAnd->pCopy)) &&
+ Aig_ObjType(pObjAig) != AIG_OBJ_NONE )
+ {
+ if ( pGia == NULL )
+ Vec_IntWriteEntry( vId2Name, Aig_ObjId(pObjAig), Abc_ObjId(pNet) );
+ else
+ Vec_IntWriteEntry( vId2Name, Gia_Lit2Var(pObjAig->iData), Abc_ObjId(pNet) );
+ }
+ }
+ return vId2Name;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+char * Abc_NtkTestScorrGetName( Abc_Ntk_t * pNetlist, Vec_Int_t * vId2Name, int Id )
+{
+// Abc_Obj_t * pObj;
+//printf( "trying to get name for %d\n", Id );
+ if ( Vec_IntEntry(vId2Name, Id) == ~0 )
+ return NULL;
+// pObj = Abc_NtkObj( pNetlist, Vec_IntEntry(vId2Name, Id) );
+// pObj = Abc_ObjFanin0(pObj);
+// assert( Abc_ObjIsCi(pObj) );
+ return Nm_ManFindNameById( pNetlist->pManName, Vec_IntEntry(vId2Name, Id) );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkTestScorrWriteEquivPair( Abc_Ntk_t * pNetlist, Vec_Int_t * vId2Name, int Id1, int Id2, FILE * pFile, int fPol )
+{
+ char * pName1 = Abc_NtkTestScorrGetName( pNetlist, vId2Name, Id1 );
+ char * pName2 = Abc_NtkTestScorrGetName( pNetlist, vId2Name, Id2 );
+ if ( pName1 == NULL || pName2 == NULL )
+ return 0;
+ fprintf( pFile, "%s=%s%s\n", pName1, fPol? "~": "", pName2 );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkTestScorrWriteEquivConst( Abc_Ntk_t * pNetlist, Vec_Int_t * vId2Name, int Id1, FILE * pFile, int fPol )
+{
+ char * pName1 = Abc_NtkTestScorrGetName( pNetlist, vId2Name, Id1 );
+ if ( pName1 == NULL )
+ return 0;
+ fprintf( pFile, "%s=%s%s\n", pName1, fPol? "~": "", "const0" );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+char * Abc_NtkBmcFileName( char * pName )
+{
+ static char Buffer[1000];
+ char * pNameGeneric = Extra_FileNameGeneric( pName );
+ sprintf( Buffer, "%s_bmc%s", pNameGeneric, pName + strlen(pNameGeneric) );
+ ABC_FREE( pNameGeneric );
+ return Buffer;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkTestScorrWriteEquivGia( Tst_Dat_t * pData )
+{
+ Abc_Ntk_t * pNetlist = pData->pNetlist;
+ Vec_Int_t * vId2Name = pData->vId2Name;
+ Gia_Man_t * pGia = pData->pGia;
+ char * pFileNameOut = pData->pFileNameOut;
+ FILE * pFile;
+ Gia_Obj_t * pObj, * pRepr;
+ int i, Counter = 0;
+ if ( pData->fDumpBmc )
+ {
+ pData->fDumpBmc = 0;
+ pFileNameOut = Abc_NtkBmcFileName( pFileNameOut );
+ }
+ pFile = fopen( pFileNameOut, "wb" );
+ Gia_ManSetPhase( pGia );
+ Gia_ManForEachObj( pGia, pObj, i )
+ {
+ if ( !Gia_ObjHasRepr(pGia, i) )
+ continue;
+ pRepr = Gia_ManObj( pGia,Gia_ObjRepr(pGia, i) );
+ if ( pData->fFlopOnly )
+ {
+ if ( !Gia_ObjIsRo(pGia, pObj) || !(Gia_ObjIsRo(pGia, pRepr)||Gia_ObjIsConst0(pRepr)) )
+ continue;
+ }
+ else if ( pData->fFfNdOnly )
+ {
+ if ( !Gia_ObjIsRo(pGia, pObj) && !(Gia_ObjIsRo(pGia, pRepr)||Gia_ObjIsConst0(pRepr)) )
+ continue;
+ }
+ if ( Gia_ObjRepr(pGia, i) == 0 )
+ Counter += Abc_NtkTestScorrWriteEquivConst( pNetlist, vId2Name, i, pFile, Gia_ObjPhase(pObj) );
+ else
+ Counter += Abc_NtkTestScorrWriteEquivPair( pNetlist, vId2Name, Gia_ObjRepr(pGia, i), i, pFile,
+ Gia_ObjPhase(pRepr) ^ Gia_ObjPhase(pObj) );
+ }
+ fclose( pFile );
+ printf( "%d pairs of sequentially equivalent nodes are written into file \"%s\".\n", Counter, pFileNameOut );
+ return Counter;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkTestScorrWriteEquivAig( Tst_Dat_t * pData )
+{
+ Abc_Ntk_t * pNetlist = pData->pNetlist;
+ Vec_Int_t * vId2Name = pData->vId2Name;
+ Aig_Man_t * pAig = pData->pAig;
+ char * pFileNameOut = pData->pFileNameOut;
+ FILE * pFile;
+ Aig_Obj_t * pObj, * pRepr;
+ int i, Counter = 0;
+ if ( pData->fDumpBmc )
+ {
+ pData->fDumpBmc = 0;
+ pFileNameOut = Abc_NtkBmcFileName( pFileNameOut );
+ }
+ pFile = fopen( pFileNameOut, "wb" );
+ Aig_ManForEachObj( pAig, pObj, i )
+ {
+ if ( (pRepr = Aig_ObjRepr(pAig, pObj)) == NULL )
+ continue;
+ if ( pData->fFlopOnly )
+ {
+ if ( !Saig_ObjIsLo(pAig, pObj) || !(Saig_ObjIsLo(pAig, pRepr)||pRepr==Aig_ManConst1(pAig)) )
+ continue;
+ }
+ else if ( pData->fFfNdOnly )
+ {
+ if ( !Saig_ObjIsLo(pAig, pObj) && !(Saig_ObjIsLo(pAig, pRepr)||pRepr==Aig_ManConst1(pAig)) )
+ continue;
+ }
+ if ( pRepr == Aig_ManConst1(pAig) )
+ Counter += Abc_NtkTestScorrWriteEquivConst( pNetlist, vId2Name, Aig_ObjId(pObj), pFile, Aig_ObjPhase(pObj) );
+ else
+ Counter += Abc_NtkTestScorrWriteEquivPair( pNetlist, vId2Name, Aig_ObjId(pRepr), Aig_ObjId(pObj), pFile,
+ Aig_ObjPhase(pRepr) ^ Aig_ObjPhase(pObj) );
+ }
+ fclose( pFile );
+ printf( "%d pairs of sequentially equivalent nodes are written into file \"%s\".\n", Counter, pFileNameOut );
+ return Counter;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Abc_Ntk_t * Abc_NtkTestScorr( char * pFileNameIn, char * pFileNameOut, int nStepsMax, int nBTLimit, int fNewAlgo, int fFlopOnly, int fFfNdOnly, int fVerbose )
+{
+ extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
+ extern Abc_Ntk_t * Abc_NtkFromDarSeqSweep( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan );
+
+ FILE * pFile;
+ Tst_Dat_t Data, * pData = &Data;
+ Vec_Int_t * vId2Name;
+ Abc_Ntk_t * pNetlist, * pLogic, * pStrash, * pResult;
+ Aig_Man_t * pAig, * pTempAig;
+ Gia_Man_t * pGia, * pTempGia;
+ int Counter = 0;
+ // check the files
+ pFile = fopen( pFileNameIn, "rb" );
+ if ( pFile == NULL )
+ {
+ printf( "Input file \"%s\" cannot be opened.\n", pFileNameIn );
+ return NULL;
+ }
+ fclose( pFile );
+ // check the files
+ pFile = fopen( pFileNameOut, "wb" );
+ if ( pFile == NULL )
+ {
+ printf( "Output file \"%s\" cannot be opened.\n", pFileNameOut );
+ return NULL;
+ }
+ fclose( pFile );
+ // derive AIG for signal correspondence
+ pNetlist = Io_ReadNetlist( pFileNameIn, Io_ReadFileType(pFileNameIn), 1 );
+ if ( pNetlist == NULL )
+ {
+ printf( "Reading input file \"%s\" has failed.\n", pFileNameIn );
+ return NULL;
+ }
+ pLogic = Abc_NtkToLogic( pNetlist );
+ if ( pLogic == NULL )
+ {
+ Abc_NtkDelete( pNetlist );
+ printf( "Deriving logic network from input file %s has failed.\n", pFileNameIn );
+ return NULL;
+ }
+ if ( Extra_FileIsType( pFileNameIn, ".bench", ".BENCH", NULL ) )
+ {
+ // get the init file name
+ char * pFileNameInit = Extra_FileNameGenericAppend( pLogic->pSpec, ".init" );
+ pFile = fopen( pFileNameInit, "rb" );
+ if ( pFile == NULL )
+ {
+ printf( "Init file \"%s\" cannot be opened.\n", pFileNameInit );
+ return NULL;
+ }
+ Io_ReadBenchInit( pLogic, pFileNameInit );
+ Abc_NtkConvertDcLatches( pLogic );
+ if ( fVerbose )
+ printf( "Initial state was derived from file \"%s\".\n", pFileNameInit );
+ }
+ pStrash = Abc_NtkStrash( pLogic, 0, 1, 0 );
+ if ( pStrash == NULL )
+ {
+ Abc_NtkDelete( pLogic );
+ Abc_NtkDelete( pNetlist );
+ printf( "Deriving strashed network from input file %s has failed.\n", pFileNameIn );
+ return NULL;
+ }
+ pAig = Abc_NtkToDar( pStrash, 0, 1 ); // performs "zero" internally
+ // the newer computation (&scorr)
+ if ( fNewAlgo )
+ {
+ Cec_ParCor_t CorPars, * pCorPars = &CorPars;
+ Cec_ManCorSetDefaultParams( pCorPars );
+ pCorPars->nBTLimit = nBTLimit;
+ pCorPars->nStepsMax = nStepsMax;
+ pCorPars->fVerbose = fVerbose;
+ pCorPars->fUseCSat = 1;
+ pGia = Gia_ManFromAig( pAig );
+ // prepare the data-structure
+ memset( pData, 0, sizeof(Tst_Dat_t) );
+ pData->pNetlist = pNetlist;
+ pData->pAig = NULL;
+ pData->pGia = pGia;
+ pData->vId2Name = vId2Name = Abc_NtkMapGiaIntoNameId( pNetlist, pAig, pGia );
+ pData->pFileNameOut = pFileNameOut;
+ pData->fFlopOnly = fFlopOnly;
+ pData->fFfNdOnly = fFfNdOnly;
+ pData->fDumpBmc = 1;
+ pCorPars->pData = pData;
+ pCorPars->pFunc = (void *)Abc_NtkTestScorrWriteEquivGia;
+ // call signal correspondence
+ pTempGia = Cec_ManLSCorrespondence( pGia, pCorPars );
+ pTempAig = Gia_ManToAigSimple( pTempGia );
+ Gia_ManStop( pTempGia );
+ Gia_ManStop( pGia );
+ }
+ // the older computation (scorr)
+ else
+ {
+ Ssw_Pars_t SswPars, * pSswPars = &SswPars;
+ Ssw_ManSetDefaultParams( pSswPars );
+ pSswPars->nBTLimit = nBTLimit;
+ pSswPars->nStepsMax = nStepsMax;
+ pSswPars->fVerbose = fVerbose;
+ // preSswPare the data-structure
+ memset( pData, 0, sizeof(Tst_Dat_t) );
+ pData->pNetlist = pNetlist;
+ pData->pAig = pAig;
+ pData->pGia = NULL;
+ pData->vId2Name = vId2Name = Abc_NtkMapGiaIntoNameId( pNetlist, pAig, NULL );
+ pData->pFileNameOut = pFileNameOut;
+ pData->fFlopOnly = fFlopOnly;
+ pData->fFfNdOnly = fFfNdOnly;
+ pData->fDumpBmc = 1;
+ pSswPars->pData = pData;
+ pSswPars->pFunc = (void *)Abc_NtkTestScorrWriteEquivAig;
+ // call signal correspondence
+ pTempAig = Ssw_SignalCorrespondence( pAig, pSswPars );
+ }
+ // create the resulting AIG
+ pResult = Abc_NtkFromDarSeqSweep( pStrash, pTempAig );
+ // cleanup
+ Vec_IntFree( vId2Name );
+ Aig_ManStop( pAig );
+ Aig_ManStop( pTempAig );
+ Abc_NtkDelete( pStrash );
+ Abc_NtkDelete( pLogic );
+ Abc_NtkDelete( pNetlist );
+ return pResult;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcSense.c b/src/base/abci/abcSense.c
index 3e68f0fd..cfecfaf3 100644
--- a/src/base/abci/abcSense.c
+++ b/src/base/abci/abcSense.c
@@ -21,6 +21,9 @@
#include "abc.h"
#include "fraig.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -47,7 +50,7 @@ Abc_Obj_t * Abc_NtkSensitivityMiter_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode
return pNode->pCopy;
Abc_NtkSensitivityMiter_rec( pNtkNew, Abc_ObjFanin0(pNode) );
Abc_NtkSensitivityMiter_rec( pNtkNew, Abc_ObjFanin1(pNode) );
- return pNode->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ return pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
}
/**Function*************************************************************
@@ -80,7 +83,10 @@ Abc_Ntk_t * Abc_NtkSensitivityMiter( Abc_Ntk_t * pNtk, int iVar )
Abc_AigConst1(pNtk)->pCopy = Abc_AigConst1(pMiter);
Abc_AigConst1(pNtk)->pData = Abc_AigConst1(pMiter);
Abc_NtkForEachCi( pNtk, pObj, i )
- pObj->pCopy = pObj->pData = Abc_NtkCreatePi( pMiter );
+ {
+ pObj->pCopy = Abc_NtkCreatePi( pMiter );
+ pObj->pData = pObj->pCopy;
+ }
Abc_NtkAddDummyPiNames( pMiter );
// assign the cofactors of the CI node to be constants
@@ -90,7 +96,7 @@ Abc_Ntk_t * Abc_NtkSensitivityMiter( Abc_Ntk_t * pNtk, int iVar )
// collect the internal nodes
vNodes = Abc_NtkDfsReverseNodes( pNtk, &pObj, 1 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
for ( pNext = pObj? pObj->pCopy : pObj; pObj; pObj = pNext, pNext = pObj? pObj->pCopy : pObj )
{
@@ -100,8 +106,8 @@ Abc_Ntk_t * Abc_NtkSensitivityMiter( Abc_Ntk_t * pNtk, int iVar )
pFanin = Abc_ObjFanin1(pObj);
if ( !Abc_NodeIsTravIdCurrent(pFanin) )
pFanin->pData = Abc_NtkSensitivityMiter_rec( pMiter, pFanin );
- pObj->pCopy = Abc_AigAnd( pMiter->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
- pObj->pData = Abc_AigAnd( pMiter->pManFunc, Abc_ObjChild0Data(pObj), Abc_ObjChild1Data(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pMiter->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pMiter->pManFunc, Abc_ObjChild0Data(pObj), Abc_ObjChild1Data(pObj) );
}
}
Vec_PtrFree( vNodes );
@@ -115,13 +121,13 @@ Abc_Ntk_t * Abc_NtkSensitivityMiter( Abc_Ntk_t * pNtk, int iVar )
// get the result of quantification
if ( i == Abc_NtkCoNum(pNtk) - 1 )
{
- pOutput = Abc_AigAnd( pMiter->pManFunc, pOutput, Abc_ObjChild0Data(pObj) );
- pOutput = Abc_AigAnd( pMiter->pManFunc, pOutput, Abc_ObjChild0Copy(pObj) );
+ pOutput = Abc_AigAnd( (Abc_Aig_t *)pMiter->pManFunc, pOutput, Abc_ObjChild0Data(pObj) );
+ pOutput = Abc_AigAnd( (Abc_Aig_t *)pMiter->pManFunc, pOutput, Abc_ObjChild0Copy(pObj) );
}
else
{
- pNext = Abc_AigXor( pMiter->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild0Data(pObj) );
- pOutput = Abc_AigOr( pMiter->pManFunc, pOutput, pNext );
+ pNext = Abc_AigXor( (Abc_Aig_t *)pMiter->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild0Data(pObj) );
+ pOutput = Abc_AigOr( (Abc_Aig_t *)pMiter->pManFunc, pOutput, pNext );
}
}
// add the PO node and name
@@ -206,3 +212,5 @@ Vec_Int_t * Abc_NtkSensitivity( Abc_Ntk_t * pNtk, int nConfLim, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcDelay.c b/src/base/abci/abcSpeedup.c
index 203b076f..779fde62 100644
--- a/src/base/abci/abcDelay.c
+++ b/src/base/abci/abcSpeedup.c
@@ -1,6 +1,6 @@
/**CFile****************************************************************
- FileName [abcDelay.c]
+ FileName [abcSpeedup.c]
SystemName [ABC: Logic synthesis and verification system.]
@@ -14,14 +14,18 @@
Date [Ver. 1.0. Started - June 20, 2005.]
- Revision [$Id: abcDelay.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+ Revision [$Id: abcSpeedup.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "abc.h"
+#include "main.h"
#include "if.h"
#include "aig.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -34,8 +38,6 @@ static inline void Abc_ObjSetArrival( Abc_Obj_t * pNode, float Time ) { pNode-
static inline void Abc_ObjSetRequired( Abc_Obj_t * pNode, float Time ) { pNode->pNtk->pLutTimes[3*pNode->Id+1] = Time; }
static inline void Abc_ObjSetSlack( Abc_Obj_t * pNode, float Time ) { pNode->pNtk->pLutTimes[3*pNode->Id+2] = Time; }
-extern void * Abc_FrameReadLibLut();
-
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
@@ -108,7 +110,7 @@ float Abc_NtkDelayTraceLut( Abc_Ntk_t * pNtk, int fUseLutLib )
assert( Abc_NtkIsLogic(pNtk) );
// get the library
- pLutLib = fUseLutLib? Abc_FrameReadLibLut() : NULL;
+ pLutLib = fUseLutLib? (If_Lib_t *)Abc_FrameReadLibLut() : NULL;
if ( pLutLib && pLutLib->LutMax < Abc_NtkGetFaninMax(pNtk) )
{
printf( "The max LUT size (%d) is less than the max fanin count (%d).\n",
@@ -127,7 +129,7 @@ float Abc_NtkDelayTraceLut( Abc_Ntk_t * pNtk, int fUseLutLib )
// propagate arrival times
vNodes = Abc_NtkDfs( pNtk, 1 );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
tArrival = -ABC_INFINITY;
if ( pLutLib == NULL )
@@ -179,7 +181,7 @@ float Abc_NtkDelayTraceLut( Abc_Ntk_t * pNtk, int fUseLutLib )
// propagate the required times
vNodes = Abc_NtkDfsReverse( pNtk );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( pLutLib == NULL )
{
@@ -246,7 +248,7 @@ void Abc_NtkDelayTracePrint( Abc_Ntk_t * pNtk, int fUseLutLib, int fVerbose )
int i, Nodes, * pCounters;
float tArrival, tDelta, nSteps, Num;
// get the library
- pLutLib = fUseLutLib? Abc_FrameReadLibLut() : NULL;
+ pLutLib = fUseLutLib? (If_Lib_t *)Abc_FrameReadLibLut() : NULL;
if ( pLutLib && pLutLib->LutMax < Abc_NtkGetFaninMax(pNtk) )
{
printf( "The max LUT size (%d) is less than the max fanin count (%d).\n",
@@ -311,7 +313,7 @@ int Abc_AigCheckTfi_rec( Abc_Obj_t * pNode, Abc_Obj_t * pOld )
if ( Abc_AigCheckTfi_rec( Abc_ObjFanin1(pNode), pOld ) )
return 1;
// check equivalent nodes
- return Abc_AigCheckTfi_rec( pNode->pData, pOld );
+ return Abc_AigCheckTfi_rec( (Abc_Obj_t *)pNode->pData, pOld );
}
/**Function*************************************************************
@@ -379,8 +381,8 @@ void Abc_NtkSpeedupNode( Abc_Ntk_t * pNtk, Abc_Ntk_t * pAig, Abc_Obj_t * pNode,
int nCofs, i, k, nSkip;
// quit of regulars are the same
- Vec_PtrForEachEntry( vLeaves, pObj, i )
- Vec_PtrForEachEntry( vLeaves, pObj2, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj2, k )
if ( i != k && Abc_ObjRegular(pObj->pCopy) == Abc_ObjRegular(pObj2->pCopy) )
{
// printf( "Identical after structural hashing!!!\n" );
@@ -391,7 +393,7 @@ void Abc_NtkSpeedupNode( Abc_Ntk_t * pNtk, Abc_Ntk_t * pAig, Abc_Obj_t * pNode,
vNodes = Vec_PtrAlloc( 100 );
Abc_NtkIncrementTravId( pAig );
Abc_NodeSetTravIdCurrent( Abc_AigConst1(pAig) );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
{
pAnd = pObj->pCopy;
Abc_NodeSetTravIdCurrent( Abc_ObjRegular(pAnd) );
@@ -409,18 +411,18 @@ void Abc_NtkSpeedupNode( Abc_Ntk_t * pNtk, Abc_Ntk_t * pAig, Abc_Obj_t * pNode,
nCofs = (1 << Vec_PtrSize(vTimes));
for ( i = 0; i < nCofs; i++ )
{
- Vec_PtrForEachEntry( vLeaves, pObj, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, k )
{
pAnd = pObj->pCopy;
Abc_ObjRegular(pAnd)->pCopy = Abc_ObjRegular(pAnd);
}
- Vec_PtrForEachEntry( vTimes, pObj, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vTimes, pObj, k )
{
pAnd = pObj->pCopy;
Abc_ObjRegular(pAnd)->pCopy = Abc_ObjNotCond( Abc_AigConst1(pAig), ((i & (1<<k)) == 0) );
}
- Vec_PtrForEachEntry( vNodes, pObj, k )
- pObj->pCopy = Abc_AigAnd( pAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, k )
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// save the result
pAnd = pNode->pCopy;
ppCofs[i] = Abc_ObjNotCond( Abc_ObjRegular(pAnd)->pCopy, Abc_ObjIsComplement(pAnd) );
@@ -431,11 +433,11 @@ void Abc_NtkSpeedupNode( Abc_Ntk_t * pNtk, Abc_Ntk_t * pAig, Abc_Obj_t * pNode,
//Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), ppCofs[1] );
// collect the resulting tree
- Vec_PtrForEachEntry( vTimes, pObj, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vTimes, pObj, k )
for ( nSkip = (1<<k), i = 0; i < nCofs; i += 2*nSkip )
{
pAnd = pObj->pCopy;
- ppCofs[i] = Abc_AigMux( pAig->pManFunc, Abc_ObjRegular(pAnd), ppCofs[i+nSkip], ppCofs[i] );
+ ppCofs[i] = Abc_AigMux( (Abc_Aig_t *)pAig->pManFunc, Abc_ObjRegular(pAnd), ppCofs[i+nSkip], ppCofs[i] );
}
//Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), ppCofs[0] );
@@ -470,7 +472,7 @@ unsigned Abc_NtkDelayTraceTCEdges( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, float tD
unsigned uResult = 0;
float tRequired, * pDelays;
int k;
- pLutLib = fUseLutLib? Abc_FrameReadLibLut() : NULL;
+ pLutLib = fUseLutLib? (If_Lib_t *)Abc_FrameReadLibLut() : NULL;
tRequired = Abc_ObjRequired(pNode);
if ( pLutLib == NULL )
{
@@ -606,8 +608,8 @@ Abc_Ntk_t * Abc_NtkSpeedup( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, in
// order the fanins in the increasing order of criticalily
if ( Vec_PtrSize(vTimeCries) > 1 )
{
- pFanin = Vec_PtrEntry( vTimeCries, 0 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 1 );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 0 );
+ pFanin2 = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
if ( Abc_ObjSlack(pFanin) < Abc_ObjSlack(pFanin2) )
{
Vec_PtrWriteEntry( vTimeCries, 0, pFanin2 );
@@ -616,15 +618,15 @@ Abc_Ntk_t * Abc_NtkSpeedup( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, in
}
if ( Vec_PtrSize(vTimeCries) > 2 )
{
- pFanin = Vec_PtrEntry( vTimeCries, 1 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 2 );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
+ pFanin2 = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 2 );
if ( Abc_ObjSlack(pFanin) < Abc_ObjSlack(pFanin2) )
{
Vec_PtrWriteEntry( vTimeCries, 1, pFanin2 );
Vec_PtrWriteEntry( vTimeCries, 2, pFanin );
}
- pFanin = Vec_PtrEntry( vTimeCries, 0 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 1 );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 0 );
+ pFanin2 = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
if ( Abc_ObjSlack(pFanin) < Abc_ObjSlack(pFanin2) )
{
Vec_PtrWriteEntry( vTimeCries, 0, pFanin2 );
@@ -645,7 +647,7 @@ Abc_Ntk_t * Abc_NtkSpeedup( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, in
Abc_AigForEachAnd( pNtkNew, pNode, i )
if ( pNode->pData )
{
- if ( Abc_ObjFanoutNum(pNode->pData) > 0 )
+ if ( Abc_ObjFanoutNum((Abc_Obj_t *)pNode->pData) > 0 )
pNode->pData = NULL;
}
@@ -683,7 +685,7 @@ Vec_Int_t * Abc_NtkPowerEstimate( Abc_Ntk_t * pNtk, int fProbOne )
// strash the network
pNtkStr = Abc_NtkStrash( pNtk, 0, 1, 0 );
Abc_NtkForEachObj( pNtk, pObjAbc, i )
- if ( Abc_ObjRegular(pObjAbc->pTemp)->Type == ABC_FUNC_NONE )
+ if ( Abc_ObjRegular((Abc_Obj_t *)pObjAbc->pTemp)->Type == ABC_FUNC_NONE )
pObjAbc->pTemp = NULL;
// map network into an AIG
pAig = Abc_NtkToDar( pNtkStr, 0, (int)(Abc_NtkLatchNum(pNtk) > 0) );
@@ -691,7 +693,7 @@ Vec_Int_t * Abc_NtkPowerEstimate( Abc_Ntk_t * pNtk, int fProbOne )
pSwitching = (float *)vSwitching->pArray;
Abc_NtkForEachObj( pNtk, pObjAbc, i )
{
- if ( (pObjAbc2 = Abc_ObjRegular(pObjAbc->pTemp)) && (pObjAig = Aig_Regular(pObjAbc2->pTemp)) )
+ if ( (pObjAbc2 = Abc_ObjRegular((Abc_Obj_t *)pObjAbc->pTemp)) && (pObjAig = Aig_Regular((Aig_Obj_t *)pObjAbc2->pTemp)) )
pProbability[pObjAbc->Id] = pSwitching[pObjAig->Id];
}
Vec_IntFree( vSwitching );
@@ -903,8 +905,8 @@ Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage,
// order the fanins in the increasing order of criticalily
if ( Vec_PtrSize(vTimeCries) > 1 )
{
- pFanin = Vec_PtrEntry( vTimeCries, 0 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 1 );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 0 );
+ pFanin2 = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
// if ( Abc_ObjSlack(pFanin) < Abc_ObjSlack(pFanin2) )
if ( pProb[pFanin->Id] > pProb[pFanin2->Id] )
{
@@ -914,16 +916,16 @@ Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage,
}
if ( Vec_PtrSize(vTimeCries) > 2 )
{
- pFanin = Vec_PtrEntry( vTimeCries, 1 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 2 );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
+ pFanin2 = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 2 );
// if ( Abc_ObjSlack(pFanin) < Abc_ObjSlack(pFanin2) )
if ( pProb[pFanin->Id] > pProb[pFanin2->Id] )
{
Vec_PtrWriteEntry( vTimeCries, 1, pFanin2 );
Vec_PtrWriteEntry( vTimeCries, 2, pFanin );
}
- pFanin = Vec_PtrEntry( vTimeCries, 0 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 1 );
+ pFanin = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 0 );
+ pFanin2 = (Abc_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
// if ( Abc_ObjSlack(pFanin) < Abc_ObjSlack(pFanin2) )
if ( pProb[pFanin->Id] > pProb[pFanin2->Id] )
{
@@ -945,7 +947,7 @@ Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage,
Abc_AigForEachAnd( pNtkNew, pNode, i )
if ( pNode->pData )
{
- if ( Abc_ObjFanoutNum(pNode->pData) > 0 )
+ if ( Abc_ObjFanoutNum((Abc_Obj_t *)pNode->pData) > 0 )
pNode->pData = NULL;
}
@@ -959,3 +961,5 @@ Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage,
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcStrash.c b/src/base/abci/abcStrash.c
index bf082456..e08def57 100644
--- a/src/base/abci/abcStrash.c
+++ b/src/base/abci/abcStrash.c
@@ -22,6 +22,9 @@
#include "extra.h"
#include "dec.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -44,7 +47,7 @@ static void Abc_NtkStrashPerform( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkNew, int fAl
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkRestrash( Abc_Ntk_t * pNtk, bool fCleanup )
+Abc_Ntk_t * Abc_NtkRestrash( Abc_Ntk_t * pNtk, int fCleanup )
{
// extern int timeRetime;
Abc_Ntk_t * pNtkAig;
@@ -59,14 +62,14 @@ Abc_Ntk_t * Abc_NtkRestrash( Abc_Ntk_t * pNtk, bool fCleanup )
pNtkAig = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG );
// restrash the nodes (assuming a topological order of the old network)
Abc_NtkForEachNode( pNtk, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// finalize the network
Abc_NtkFinalize( pNtk, pNtkAig );
// print warning about self-feed latches
// if ( Abc_NtkCountSelfFeedLatches(pNtkAig) )
// printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtkAig) );
// perform cleanup if requested
- if ( fCleanup && (nNodes = Abc_AigCleanup(pNtkAig->pManFunc)) )
+ if ( fCleanup && (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
printf( "Abc_NtkRestrash(): AIG cleanup removed %d nodes (this is a bug).\n", nNodes );
// duplicate EXDC
if ( pNtk->pExdc )
@@ -97,7 +100,7 @@ Abc_Ntk_t * Abc_NtkRestrash( Abc_Ntk_t * pNtk, bool fCleanup )
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Abc_NtkRestrashZero( Abc_Ntk_t * pNtk, bool fCleanup )
+Abc_Ntk_t * Abc_NtkRestrashZero( Abc_Ntk_t * pNtk, int fCleanup )
{
// extern int timeRetime;
Abc_Ntk_t * pNtkAig;
@@ -123,7 +126,7 @@ Abc_Ntk_t * Abc_NtkRestrashZero( Abc_Ntk_t * pNtk, bool fCleanup )
printf( "Converting %d flops from don't-care to zero initial value.\n", Counter );
// restrash the nodes (assuming a topological order of the old network)
Abc_NtkForEachNode( pNtk, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// finalize the network
Abc_NtkFinalize( pNtk, pNtkAig );
// complement the 1-valued registers
@@ -146,7 +149,7 @@ Abc_Ntk_t * Abc_NtkRestrashZero( Abc_Ntk_t * pNtk, bool fCleanup )
// if ( Abc_NtkCountSelfFeedLatches(pNtkAig) )
// printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtkAig) );
// perform cleanup if requested
- if ( fCleanup && (nNodes = Abc_AigCleanup(pNtkAig->pManFunc)) )
+ if ( fCleanup && (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
printf( "Abc_NtkRestrash(): AIG cleanup removed %d nodes (this is a bug).\n", nNodes );
// duplicate EXDC
if ( pNtk->pExdc )
@@ -199,7 +202,7 @@ Abc_Ntk_t * Abc_NtkStrash( Abc_Ntk_t * pNtk, int fAllNodes, int fCleanup, int fR
// if ( Abc_NtkCountSelfFeedLatches(pNtkAig) )
// printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtkAig) );
// perform cleanup if requested
- nNodes = fCleanup? Abc_AigCleanup(pNtkAig->pManFunc) : 0;
+ nNodes = fCleanup? Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc) : 0;
// if ( nNodes )
// printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
// duplicate EXDC
@@ -267,7 +270,7 @@ int Abc_NtkAppend( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fAddPos )
Abc_NtkStrashPerform( pNtk2, pNtk1, 1, 0 );
else
Abc_NtkForEachNode( pNtk2, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtk1->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtk1->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
// add the COs of the second network
if ( fAddPos )
{
@@ -293,7 +296,7 @@ int Abc_NtkAppend( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fAddPos )
// derive the new driver
pDriverOld = Abc_ObjChild0( pObjOld );
pDriverNew = Abc_ObjChild0Copy( pObj );
- pDriverNew = Abc_AigOr( pNtk1->pManFunc, pDriverOld, pDriverNew );
+ pDriverNew = Abc_AigOr( (Abc_Aig_t *)pNtk1->pManFunc, pDriverOld, pDriverNew );
if ( Abc_ObjRegular(pDriverOld) == Abc_ObjRegular(pDriverNew) )
continue;
// replace the old driver by the new driver
@@ -334,7 +337,7 @@ void Abc_NtkStrashPerform( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew, int fAllNod
//printf( "Nodes = %d. ", Vec_PtrSize(vNodes) );
//ABC_PRT( "Time", clock() - clk );
// pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
- Vec_PtrForEachEntry( vNodes, pNodeOld, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNodeOld, i )
{
// Extra_ProgressBarUpdate( pProgress, i, NULL );
pNodeOld->pCopy = Abc_NodeStrash( pNtkNew, pNodeOld, fRecord );
@@ -386,8 +389,8 @@ Abc_Obj_t * Abc_NodeStrash( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, int fReco
assert( Abc_ObjIsNode(pNodeOld) );
assert( Abc_NtkHasAig(pNodeOld->pNtk) && !Abc_NtkIsStrash(pNodeOld->pNtk) );
// get the local AIG manager and the local root node
- pMan = pNodeOld->pNtk->pManFunc;
- pRoot = pNodeOld->pData;
+ pMan = (Hop_Man_t *)pNodeOld->pNtk->pManFunc;
+ pRoot = (Hop_Obj_t *)pNodeOld->pData;
// check the constant case
if ( Abc_NodeIsConst(pNodeOld) || Hop_Regular(pRoot) == Hop_ManConst1(pMan) )
return Abc_ObjNotCond( Abc_AigConst1(pNtkNew), Hop_IsComplement(pRoot) );
@@ -411,10 +414,10 @@ Abc_Obj_t * Abc_NodeStrash( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, int fReco
Abc_ObjForEachFanin( pNodeOld, pFanin, i )
Hop_IthVar(pMan, i)->pData = pFanin->pCopy;
// strash the AIG of this node
- Abc_NodeStrash_rec( pNtkNew->pManFunc, Hop_Regular(pRoot) );
+ Abc_NodeStrash_rec( (Abc_Aig_t *)pNtkNew->pManFunc, Hop_Regular(pRoot) );
Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
// return the final node
- return Abc_ObjNotCond( Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
+ return Abc_ObjNotCond( (Abc_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
}
@@ -443,7 +446,7 @@ Abc_Obj_t * Abc_NtkTopmost_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int Leve
return pNode->pCopy = Abc_NtkCreatePi( pNtkNew );
Abc_NtkTopmost_rec( pNtkNew, Abc_ObjFanin0(pNode), LevelCut );
Abc_NtkTopmost_rec( pNtkNew, Abc_ObjFanin1(pNode), LevelCut );
- return pNode->pCopy = Abc_AigAnd( pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
+ return pNode->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, Abc_ObjChild0Copy(pNode), Abc_ObjChild1Copy(pNode) );
}
/**Function*************************************************************
@@ -532,7 +535,7 @@ Vec_Ptr_t * Abc_NodeGetSuper( Abc_Obj_t * pNode )
// explore the frontier
vFront = Vec_PtrAlloc( 100 );
Vec_PtrPush( vFront, pNode );
- Vec_PtrForEachEntry( vFront, pAnd, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFront, pAnd, i )
{
pFanin = Abc_ObjChild0(pAnd);
if ( Abc_ObjIsNode(pFanin) && !Abc_ObjIsComplement(pFanin) && Abc_ObjFanoutNum(pFanin) == 1 )
@@ -549,12 +552,12 @@ Vec_Ptr_t * Abc_NodeGetSuper( Abc_Obj_t * pNode )
Vec_PtrFree( vFront );
// reverse the array of pointers to start with lower IDs
vFront = Vec_PtrAlloc( Vec_PtrSize(vSuper) );
- Vec_PtrForEachEntryReverse( vSuper, pNode, i )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, vSuper, pNode, i )
Vec_PtrPush( vFront, pNode );
Vec_PtrFree( vSuper );
vSuper = vFront;
// uniquify and return the frontier
- Vec_PtrUniqify( vSuper, Vec_CompareNodeIds );
+ Vec_PtrUniqify( vSuper, (int (*)())Vec_CompareNodeIds );
return vSuper;
}
@@ -590,11 +593,11 @@ Abc_Ntk_t * Abc_NtkTopAnd( Abc_Ntk_t * pNtk )
Abc_NtkDupObj( pNtkAig, pObj, 1 );
// restrash the nodes reachable from the roots
vOrder = Abc_NtkDfsIterNodes( pNtk, vNodes );
- Vec_PtrForEachEntry( vOrder, pObj, i )
- pObj->pCopy = Abc_AigAnd( pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vOrder, pObj, i )
+ pObj->pCopy = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, Abc_ObjChild0Copy(pObj), Abc_ObjChild1Copy(pObj) );
Vec_PtrFree( vOrder );
// finalize the network
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
pObjPo = Abc_NtkCreatePo(pNtkAig);
pDriver = Abc_ObjNotCond(Abc_ObjRegular(pObj)->pCopy, Abc_ObjIsComplement(pObj));
@@ -603,7 +606,7 @@ Abc_Ntk_t * Abc_NtkTopAnd( Abc_Ntk_t * pNtk )
}
Vec_PtrFree( vNodes );
// perform cleanup if requested
- if ( (nNodes = Abc_AigCleanup(pNtkAig->pManFunc)) )
+ if ( (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
printf( "Abc_NtkTopAnd(): AIG cleanup removed %d nodes (this is a bug).\n", nNodes );
// make sure everything is okay
if ( !Abc_NtkCheck( pNtkAig ) )
@@ -615,8 +618,85 @@ Abc_Ntk_t * Abc_NtkTopAnd( Abc_Ntk_t * pNtk )
return pNtkAig;
}
+/**Function*************************************************************
+
+ Synopsis [Writes the AIG into a file for parsing.]
+
+ Description [Ordering: c0, pis, ands, pos. ]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkWriteAig( Abc_Ntk_t * pNtk, char * pFileName )
+{
+ FILE * pFile;
+ Vec_Int_t * vId2Num;
+ Abc_Obj_t * pObj;
+ int i, iLit;
+ assert( Abc_NtkIsStrash(pNtk) );
+ assert( Abc_NtkLatchNum(pNtk) == 0 );
+ if ( pFileName == NULL )
+ pFile = stdout;
+ else
+ pFile = fopen( pFileName, "w" );
+ if ( pFile == NULL )
+ {
+ printf( "Cannot open output file.\n" );
+ return;
+ }
+ vId2Num = Vec_IntAlloc( 2*Abc_NtkObjNumMax(pNtk) );
+ Vec_IntFill( vId2Num, 2*Abc_NtkObjNumMax(pNtk), -1 );
+
+ iLit = 0;
+ Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(Abc_AigConst1(pNtk))+1, iLit++ );
+ Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(Abc_AigConst1(pNtk))+0, iLit++ );
+ Abc_NtkForEachPi( pNtk, pObj, i )
+ {
+ Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+0, iLit++ );
+ Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+1, iLit++ );
+ }
+ Abc_AigForEachAnd( pNtk, pObj, i )
+ {
+ Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+0, iLit++ );
+ Vec_IntWriteEntry( vId2Num, 2*Abc_ObjId(pObj)+1, iLit++ );
+ }
+ fprintf( pFile, "{\n" );
+ fprintf( pFile, " \"%s\", ", Abc_NtkName(pNtk) );
+ fprintf( pFile, "// pi=%d po=%d and=%d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkNodeNum(pNtk) );
+ fprintf( pFile, "\n" );
+ fprintf( pFile, " { " );
+ Abc_NtkForEachPi( pNtk, pObj, i )
+ fprintf( pFile, "\"%s\",", Abc_ObjName(pObj) );
+ fprintf( pFile, "NULL },\n" );
+ fprintf( pFile, " { " );
+ Abc_NtkForEachPo( pNtk, pObj, i )
+ fprintf( pFile, "\"%s\",", Abc_ObjName(pObj) );
+ fprintf( pFile, "NULL },\n" );
+ fprintf( pFile, " { " );
+ Abc_AigForEachAnd( pNtk, pObj, i )
+ fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId0(pObj) + Abc_ObjFaninC0(pObj)) );
+ fprintf( pFile, "0 },\n" );
+ fprintf( pFile, " { " );
+ Abc_AigForEachAnd( pNtk, pObj, i )
+ fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId1(pObj) + Abc_ObjFaninC1(pObj)) );
+ fprintf( pFile, "0 },\n" );
+ fprintf( pFile, " { " );
+ Abc_NtkForEachPo( pNtk, pObj, i )
+ fprintf( pFile, "%d,", Vec_IntEntry(vId2Num, 2*Abc_ObjFaninId0(pObj) + Abc_ObjFaninC0(pObj)) );
+ fprintf( pFile, "0 },\n" );
+ fprintf( pFile, "},\n" );
+ if ( pFile != stdout )
+ fclose( pFile );
+ Vec_IntFree( vId2Num );
+}
+
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcSweep.c b/src/base/abci/abcSweep.c
index dfb8137c..57706af0 100644
--- a/src/base/abci/abcSweep.c
+++ b/src/base/abci/abcSweep.c
@@ -19,22 +19,26 @@
***********************************************************************/
#include "abc.h"
+#include "main.h"
#include "fraig.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
static void Abc_NtkFraigSweepUsingExdc( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk );
static stmm_table * Abc_NtkFraigEquiv( Abc_Ntk_t * pNtk, int fUseInv, int fVerbose, int fVeryVerbose );
-static void Abc_NtkFraigTransform( Abc_Ntk_t * pNtk, stmm_table * tEquiv, int fUseInv, bool fVerbose );
+static void Abc_NtkFraigTransform( Abc_Ntk_t * pNtk, stmm_table * tEquiv, int fUseInv, int fVerbose );
static void Abc_NtkFraigMergeClassMapped( Abc_Ntk_t * pNtk, Abc_Obj_t * pChain, int fUseInv, int fVerbose );
static void Abc_NtkFraigMergeClass( Abc_Ntk_t * pNtk, Abc_Obj_t * pChain, int fUseInv, int fVerbose );
static int Abc_NodeDroppingCost( Abc_Obj_t * pNode );
static int Abc_NtkReduceNodes( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes );
static void Abc_NodeSweep( Abc_Obj_t * pNode, int fVerbose );
-static void Abc_NodeConstantInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin, bool fConst0 );
+static void Abc_NodeConstantInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin, int fConst0 );
static void Abc_NodeComplementInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin );
////////////////////////////////////////////////////////////////////////
@@ -54,7 +58,7 @@ static void Abc_NodeComplementInput( Abc_Obj_t * pNode, Abc_Obj_t * pF
SeeAlso []
***********************************************************************/
-bool Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose )
+int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose )
{
Fraig_Params_t Params;
Abc_Ntk_t * pNtkAig;
@@ -71,15 +75,15 @@ bool Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose,
{
fUseTrick = 1;
Abc_NtkForEachNode( pNtk, pObj, i )
- pObj->pNext = pObj->pData;
+ pObj->pNext = (Abc_Obj_t *)pObj->pData;
}
// derive the AIG
pNtkAig = Abc_NtkStrash( pNtk, 0, 1, 0 );
// reconstruct gate assignments
if ( fUseTrick )
{
- extern void * Abc_FrameReadLibGen();
- Hop_ManStop( pNtk->pManFunc );
+// extern void * Abc_FrameReadLibGen();
+ Hop_ManStop( (Hop_Man_t *)pNtk->pManFunc );
pNtk->pManFunc = Abc_FrameReadLibGen();
pNtk->ntkFunc = ABC_FUNC_MAP;
Abc_NtkForEachNode( pNtk, pObj, i )
@@ -89,7 +93,7 @@ bool Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose,
// perform fraiging of the AIG
Fraig_ParamsSetDefault( &Params );
Params.fInternal = 1;
- pMan = Abc_NtkToFraig( pNtkAig, &Params, 0, 0 );
+ pMan = (Fraig_Man_t *)Abc_NtkToFraig( pNtkAig, &Params, 0, 0 );
// cannot use EXDC with FRAIG because it can create classes of equivalent FRAIG nodes
// with representative nodes that do not correspond to the nodes with the current network
@@ -163,11 +167,11 @@ void Abc_NtkFraigSweepUsingExdc( Fraig_Man_t * pMan, Abc_Ntk_t * pNtk )
if ( pNodeAig == NULL )
continue;
// get the FRAIG node
- gNode = Fraig_NotCond( Abc_ObjRegular(pNodeAig)->pCopy, Abc_ObjIsComplement(pNodeAig) );
+ gNode = Fraig_NotCond( Abc_ObjRegular(pNodeAig)->pCopy, (int)Abc_ObjIsComplement(pNodeAig) );
// perform ANDing with EXDC
gNodeRes = Fraig_NodeAnd( pMan, gNode, Fraig_Not(gNodeExdc) );
// write the node back
- Abc_ObjRegular(pNodeAig)->pCopy = (Abc_Obj_t *)Fraig_NotCond( gNodeRes, Abc_ObjIsComplement(pNodeAig) );
+ Abc_ObjRegular(pNodeAig)->pCopy = (Abc_Obj_t *)Fraig_NotCond( gNodeRes, (int)Abc_ObjIsComplement(pNodeAig) );
}
}
@@ -208,7 +212,7 @@ stmm_table * Abc_NtkFraigEquiv( Abc_Ntk_t * pNtk, int fUseInv, int fVerbose, int
if ( Abc_NodeFindCoFanout(pNode) )
continue;
// get the FRAIG node
- gNode = Fraig_NotCond( Abc_ObjRegular(pNodeAig)->pCopy, Abc_ObjIsComplement(pNodeAig) );
+ gNode = Fraig_NotCond( Abc_ObjRegular(pNodeAig)->pCopy, (int)Abc_ObjIsComplement(pNodeAig) );
if ( !stmm_find_or_add( tStrash2Net, (char *)Fraig_Regular(gNode), (char ***)&ppSlot ) )
*ppSlot = NULL;
// add the node to the list
@@ -269,7 +273,7 @@ stmm_table * Abc_NtkFraigEquiv( Abc_Ntk_t * pNtk, int fUseInv, int fVerbose, int
SeeAlso []
***********************************************************************/
-void Abc_NtkFraigTransform( Abc_Ntk_t * pNtk, stmm_table * tEquiv, int fUseInv, bool fVerbose )
+void Abc_NtkFraigTransform( Abc_Ntk_t * pNtk, stmm_table * tEquiv, int fUseInv, int fVerbose )
{
stmm_generator * gen;
Abc_Obj_t * pList;
@@ -501,7 +505,7 @@ int Abc_NtkReduceNodes( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes )
int i, Counter;
assert( Abc_NtkIsLogic(pNtk) );
// mark the nodes reachable from the POs
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
pNode->fMarkA = 1;
// remove the non-marked nodes
Counter = 0;
@@ -512,7 +516,7 @@ int Abc_NtkReduceNodes( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes )
Counter++;
}
// unmark the remaining nodes
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
pNode->fMarkA = 0;
// check
if ( !Abc_NtkCheck( pNtk ) )
@@ -561,7 +565,7 @@ int Abc_NtkSweep( Abc_Ntk_t * pNtk, int fVerbose )
while ( Vec_PtrSize(vNodes) > 0 )
{
// get any sweepable node
- pNode = Vec_PtrPop(vNodes);
+ pNode = (Abc_Obj_t *)Vec_PtrPop(vNodes);
if ( !Abc_ObjIsNode(pNode) )
continue;
// get any non-CO fanout of this node
@@ -629,9 +633,9 @@ int Abc_NtkSweep( Abc_Ntk_t * pNtk, int fVerbose )
SeeAlso []
***********************************************************************/
-void Abc_NodeConstantInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin, bool fConst0 )
+void Abc_NodeConstantInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin, int fConst0 )
{
- DdManager * dd = pNode->pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNode->pNtk->pManFunc;
DdNode * bVar, * bTemp;
int iFanin;
assert( Abc_NtkIsBddLogic(pNode->pNtk) );
@@ -642,7 +646,7 @@ void Abc_NodeConstantInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin, bool fConst0
return;
}
bVar = Cudd_NotCond( Cudd_bddIthVar(dd, iFanin), fConst0 );
- pNode->pData = Cudd_Cofactor( dd, bTemp = pNode->pData, bVar ); Cudd_Ref( pNode->pData );
+ pNode->pData = Cudd_Cofactor( dd, bTemp = (DdNode *)pNode->pData, bVar ); Cudd_Ref( (DdNode *)pNode->pData );
Cudd_RecursiveDeref( dd, bTemp );
}
@@ -659,7 +663,7 @@ void Abc_NodeConstantInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin, bool fConst0
***********************************************************************/
void Abc_NodeComplementInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin )
{
- DdManager * dd = pNode->pNtk->pManFunc;
+ DdManager * dd = (DdManager *)pNode->pNtk->pManFunc;
DdNode * bVar, * bCof0, * bCof1;
int iFanin;
assert( Abc_NtkIsBddLogic(pNode->pNtk) );
@@ -670,10 +674,10 @@ void Abc_NodeComplementInput( Abc_Obj_t * pNode, Abc_Obj_t * pFanin )
return;
}
bVar = Cudd_bddIthVar( dd, iFanin );
- bCof0 = Cudd_Cofactor( dd, pNode->pData, Cudd_Not(bVar) ); Cudd_Ref( bCof0 );
- bCof1 = Cudd_Cofactor( dd, pNode->pData, bVar ); Cudd_Ref( bCof1 );
- Cudd_RecursiveDeref( dd, pNode->pData );
- pNode->pData = Cudd_bddIte( dd, bVar, bCof0, bCof1 ); Cudd_Ref( pNode->pData );
+ bCof0 = Cudd_Cofactor( dd, (DdNode *)pNode->pData, Cudd_Not(bVar) ); Cudd_Ref( bCof0 );
+ bCof1 = Cudd_Cofactor( dd, (DdNode *)pNode->pData, bVar ); Cudd_Ref( bCof1 );
+ Cudd_RecursiveDeref( dd, (DdNode *)pNode->pData );
+ pNode->pData = Cudd_bddIte( dd, bVar, bCof0, bCof1 ); Cudd_Ref( (DdNode *)pNode->pData );
Cudd_RecursiveDeref( dd, bCof0 );
Cudd_RecursiveDeref( dd, bCof1 );
}
@@ -835,7 +839,7 @@ int Abc_NtkLatchSweep( Abc_Ntk_t * pNtk )
/**Function*************************************************************
- Synopsis [Replaces autonumnous logic by ABC_FREE inputs.]
+ Synopsis [Replaces autonumnous logic by free inputs.]
Description [Assumes that non-autonomous logic is marked with
the current ID.]
@@ -874,9 +878,9 @@ int Abc_NtkReplaceAutonomousLogic( Abc_Ntk_t * pNtk )
Vec_PtrPush( vNodes, pFanin );
}
}
- Vec_PtrUniqify( vNodes, Abc_ObjPointerCompare );
+ Vec_PtrUniqify( vNodes, (int (*)(void))Abc_ObjPointerCompare );
// replace these nodes by the PIs
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
pFanin = Abc_NtkCreatePi(pNtk);
Abc_ObjAssignName( pFanin, Abc_ObjName(pFanin), NULL );
@@ -947,3 +951,5 @@ int Abc_NtkCleanupSeq( Abc_Ntk_t * pNtk, int fLatchSweep, int fAutoSweep, int fV
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcSymm.c b/src/base/abci/abcSymm.c
index 73f238f9..4e0a7373 100644
--- a/src/base/abci/abcSymm.c
+++ b/src/base/abci/abcSymm.c
@@ -19,6 +19,10 @@
***********************************************************************/
#include "abc.h"
+#include "sim.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -65,7 +69,7 @@ void Abc_NtkSymmetries( Abc_Ntk_t * pNtk, int fUseBdds, int fNaive, int fReorder
***********************************************************************/
void Abc_NtkSymmetriesUsingSandS( Abc_Ntk_t * pNtk, int fVerbose )
{
- extern int Sim_ComputeTwoVarSymms( Abc_Ntk_t * pNtk, int fVerbose );
+// extern int Sim_ComputeTwoVarSymms( Abc_Ntk_t * pNtk, int fVerbose );
int nSymms = Sim_ComputeTwoVarSymms( pNtk, fVerbose );
printf( "The total number of symmetries is %d.\n", nSymms );
}
@@ -227,3 +231,5 @@ void Ntk_NetworkSymmsPrint( Abc_Ntk_t * pNtk, Extra_SymmInfo_t * pSymms )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcTiming.c b/src/base/abci/abcTiming.c
index 95c7103a..79768645 100644
--- a/src/base/abci/abcTiming.c
+++ b/src/base/abci/abcTiming.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -42,8 +45,8 @@ void Abc_NtkTimePrepare( Abc_Ntk_t * pNtk );
void Abc_NodeDelayTraceArrival( Abc_Obj_t * pNode );
// accessing the arrival and required times of a node
-static inline Abc_Time_t * Abc_NodeArrival( Abc_Obj_t * pNode ) { return pNode->pNtk->pManTime->vArrs->pArray[pNode->Id]; }
-static inline Abc_Time_t * Abc_NodeRequired( Abc_Obj_t * pNode ) { return pNode->pNtk->pManTime->vReqs->pArray[pNode->Id]; }
+static inline Abc_Time_t * Abc_NodeArrival( Abc_Obj_t * pNode ) { return (Abc_Time_t *)pNode->pNtk->pManTime->vArrs->pArray[pNode->Id]; }
+static inline Abc_Time_t * Abc_NodeRequired( Abc_Obj_t * pNode ) { return (Abc_Time_t *)pNode->pNtk->pManTime->vReqs->pArray[pNode->Id]; }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -183,7 +186,7 @@ void Abc_NtkTimeSetArrival( Abc_Ntk_t * pNtk, int ObjId, float Rise, float Fall
Abc_ManTimeExpand( pNtk->pManTime, ObjId + 1, 1 );
// set the arrival time
vTimes = pNtk->pManTime->vArrs;
- pTime = vTimes->pArray[ObjId];
+ pTime = (Abc_Time_t *)vTimes->pArray[ObjId];
pTime->Rise = Rise;
pTime->Fall = Fall;
pTime->Worst = ABC_MAX( Rise, Fall );
@@ -211,7 +214,7 @@ void Abc_NtkTimeSetRequired( Abc_Ntk_t * pNtk, int ObjId, float Rise, float Fall
Abc_ManTimeExpand( pNtk->pManTime, ObjId + 1, 1 );
// set the required time
vTimes = pNtk->pManTime->vReqs;
- pTime = vTimes->pArray[ObjId];
+ pTime = (Abc_Time_t *)vTimes->pArray[ObjId];
pTime->Rise = Rise;
pTime->Fall = Fall;
pTime->Worst = ABC_MAX( Rise, Fall );
@@ -419,13 +422,13 @@ void Abc_ManTimeExpand( Abc_ManTime_t * p, int nSize, int fProgressive )
vTimes = p->vArrs;
Vec_PtrGrow( vTimes, nSizeNew );
vTimes->nSize = nSizeNew;
- ppTimesOld = ( nSizeOld == 0 )? NULL : vTimes->pArray[0];
+ ppTimesOld = ( nSizeOld == 0 )? NULL : (Abc_Time_t *)vTimes->pArray[0];
ppTimes = ABC_REALLOC( Abc_Time_t, ppTimesOld, nSizeNew );
for ( i = 0; i < nSizeNew; i++ )
vTimes->pArray[i] = ppTimes + i;
for ( i = nSizeOld; i < nSizeNew; i++ )
{
- pTime = vTimes->pArray[i];
+ pTime = (Abc_Time_t *)vTimes->pArray[i];
pTime->Rise = -ABC_INFINITY;
pTime->Fall = -ABC_INFINITY;
pTime->Worst = -ABC_INFINITY;
@@ -434,13 +437,13 @@ void Abc_ManTimeExpand( Abc_ManTime_t * p, int nSize, int fProgressive )
vTimes = p->vReqs;
Vec_PtrGrow( vTimes, nSizeNew );
vTimes->nSize = nSizeNew;
- ppTimesOld = ( nSizeOld == 0 )? NULL : vTimes->pArray[0];
+ ppTimesOld = ( nSizeOld == 0 )? NULL : (Abc_Time_t *)vTimes->pArray[0];
ppTimes = ABC_REALLOC( Abc_Time_t, ppTimesOld, nSizeNew );
for ( i = 0; i < nSizeNew; i++ )
vTimes->pArray[i] = ppTimes + i;
for ( i = nSizeOld; i < nSizeNew; i++ )
{
- pTime = vTimes->pArray[i];
+ pTime = (Abc_Time_t *)vTimes->pArray[i];
pTime->Rise = -ABC_INFINITY;
pTime->Fall = -ABC_INFINITY;
pTime->Worst = -ABC_INFINITY;
@@ -470,9 +473,9 @@ void Abc_NtkSetNodeLevelsArrival( Abc_Ntk_t * pNtkOld )
int i;
if ( pNtkOld->pManTime == NULL )
return;
- if ( Mio_LibraryReadNand2(Abc_FrameReadLibGen()) == NULL )
+ if ( Mio_LibraryReadNand2((Mio_Library_t *)Abc_FrameReadLibGen()) == NULL )
return;
- tAndDelay = Mio_LibraryReadDelayNand2Max(Abc_FrameReadLibGen());
+ tAndDelay = Mio_LibraryReadDelayNand2Max((Mio_Library_t *)Abc_FrameReadLibGen());
Abc_NtkForEachPi( pNtkOld, pNodeOld, i )
{
pNodeNew = pNodeOld->pCopy;
@@ -558,7 +561,7 @@ float Abc_NtkDelayTrace( Abc_Ntk_t * pNtk )
Abc_NtkTimePrepare( pNtk );
vNodes = Abc_NtkDfs( pNtk, 1 );
for ( i = 0; i < vNodes->nSize; i++ )
- Abc_NodeDelayTraceArrival( vNodes->pArray[i] );
+ Abc_NodeDelayTraceArrival( (Abc_Obj_t *)vNodes->pArray[i] );
Vec_PtrFree( vNodes );
// get the latest arrival times
@@ -597,7 +600,7 @@ void Abc_NodeDelayTraceArrival( Abc_Obj_t * pNode )
pTimeOut = Abc_NodeArrival(pNode);
pTimeOut->Rise = pTimeOut->Fall = -ABC_INFINITY;
// go through the pins of the gate
- pPin = Mio_GateReadPins(pNode->pData);
+ pPin = Mio_GateReadPins((Mio_Gate_t *)pNode->pData);
Abc_ObjForEachFanin( pNode, pFanin, i )
{
pTimeIn = Abc_NodeArrival(pFanin);
@@ -755,7 +758,7 @@ void Abc_NtkStartReverseLevels( Abc_Ntk_t * pNtk, int nMaxLevelIncrease )
Vec_IntFill( pNtk->vLevelsR, 1 + Abc_NtkObjNumMax(pNtk), 0 );
// compute levels in reverse topological order
vNodes = Abc_NtkDfsReverse( pNtk );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
Abc_ObjSetReverseLevel( pObj, Abc_ObjReverseLevelNew(pObj) );
Vec_PtrFree( vNodes );
}
@@ -807,7 +810,7 @@ void Abc_NtkUpdateLevel( Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels )
Vec_VecPush( vLevels, LevelOld, pObjNew );
pObjNew->fMarkA = 1;
// recursively update level
- Vec_VecForEachEntryStart( vLevels, pTemp, Lev, k, LevelOld )
+ Vec_VecForEachEntryStart( Abc_Obj_t *, vLevels, pTemp, Lev, k, LevelOld )
{
// Counter--;
pTemp->fMarkA = 0;
@@ -858,7 +861,7 @@ void Abc_NtkUpdateReverseLevel( Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels )
Vec_VecPush( vLevels, LevelOld, pObjNew );
pObjNew->fMarkA = 1;
// recursively update level
- Vec_VecForEachEntryStart( vLevels, pTemp, Lev, k, LevelOld )
+ Vec_VecForEachEntryStart( Abc_Obj_t *, vLevels, pTemp, Lev, k, LevelOld )
{
pTemp->fMarkA = 0;
LevelOld = Abc_ObjReverseLevel(pTemp);
@@ -908,3 +911,5 @@ void Abc_NtkUpdate( Abc_Obj_t * pObj, Abc_Obj_t * pObjNew, Vec_Vec_t * vLevels )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcUnate.c b/src/base/abci/abcUnate.c
index f6ee57ca..b77eec63 100644
--- a/src/base/abci/abcUnate.c
+++ b/src/base/abci/abcUnate.c
@@ -20,6 +20,9 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -153,3 +156,5 @@ void Abc_NtkPrintUnateSat( Abc_Ntk_t * pNtk, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcUnreach.c b/src/base/abci/abcUnreach.c
index 251d3953..ae7fbd02 100644
--- a/src/base/abci/abcUnreach.c
+++ b/src/base/abci/abcUnreach.c
@@ -20,13 +20,16 @@
#include "abc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
static DdNode * Abc_NtkTransitionRelation( DdManager * dd, Abc_Ntk_t * pNtk, int fVerbose );
static DdNode * Abc_NtkInitStateAndVarMap( DdManager * dd, Abc_Ntk_t * pNtk, int fVerbose );
-static DdNode * Abc_NtkComputeUnreachable( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bRelation, DdNode * bInitial, bool fVerbose );
+static DdNode * Abc_NtkComputeUnreachable( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bRelation, DdNode * bInitial, int fVerbose );
static Abc_Ntk_t * Abc_NtkConstructExdc ( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bUnreach );
////////////////////////////////////////////////////////////////////////
@@ -44,7 +47,7 @@ static Abc_Ntk_t * Abc_NtkConstructExdc ( DdManager * dd, Abc_Ntk_t * pNtk,
SeeAlso []
***********************************************************************/
-int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNtk, bool fVerbose )
+int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNtk, int fVerbose )
{
int fReorder = 1;
DdManager * dd;
@@ -217,7 +220,7 @@ DdNode * Abc_NtkInitStateAndVarMap( DdManager * dd, Abc_Ntk_t * pNtk, int fVerbo
SeeAlso []
***********************************************************************/
-DdNode * Abc_NtkComputeUnreachable( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bTrans, DdNode * bInitial, bool fVerbose )
+DdNode * Abc_NtkComputeUnreachable( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bTrans, DdNode * bInitial, int fVerbose )
{
DdNode * bRelation, * bReached, * bCubeCs;
DdNode * bCurrent, * bNext, * bTemp;
@@ -308,7 +311,7 @@ Abc_Ntk_t * Abc_NtkConstructExdc( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bUn
Abc_NtkForEachLatch( pNtk, pNode, i )
pPermute[Abc_NtkPiNum(pNtk) + i] = i;
// remap the functions
- pNodeNew->pData = Extra_TransferPermute( dd, pNtkNew->pManFunc, bUnreach, pPermute ); Cudd_Ref( pNodeNew->pData );
+ pNodeNew->pData = Extra_TransferPermute( dd, (DdManager *)pNtkNew->pManFunc, bUnreach, pPermute ); Cudd_Ref( (DdNode *)pNodeNew->pData );
ABC_FREE( pPermute );
Abc_NodeMinimumBase( pNodeNew );
@@ -327,7 +330,7 @@ Abc_Ntk_t * Abc_NtkConstructExdc( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bUn
Abc_ObjAddFanin( pNode->pCopy, pNodeNew );
// remove the extra nodes
- Abc_AigCleanup( pNtkNew->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkNew->pManFunc );
// fix the problem with complemented and duplicated CO edges
Abc_NtkLogicMakeSimpleCos( pNtkNew, 0 );
@@ -347,3 +350,5 @@ Abc_Ntk_t * Abc_NtkConstructExdc( DdManager * dd, Abc_Ntk_t * pNtk, DdNode * bUn
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcVerify.c b/src/base/abci/abcVerify.c
index 424c26ec..58b8fbb8 100644
--- a/src/base/abci/abcVerify.c
+++ b/src/base/abci/abcVerify.c
@@ -19,8 +19,16 @@
***********************************************************************/
#include "abc.h"
+#include "main.h"
+#include "cmd.h"
#include "fraig.h"
#include "sim.h"
+#include "aig.h"
+#include "gia.h"
+#include "ssw.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -151,7 +159,7 @@ void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fV
// Params.fFuncRed = 0;
// Params.nPatsRand = 0;
// Params.nPatsDyna = 0;
- pMan = Abc_NtkToFraig( pMiter, &Params, 0, 0 );
+ pMan = (Fraig_Man_t *)Abc_NtkToFraig( pMiter, &Params, 0, 0 );
Fraig_ManProveMiter( pMan );
// analyze the result
@@ -209,9 +217,6 @@ void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fV
***********************************************************************/
void Abc_NtkCecFraigPart( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nPartSize, int fVerbose )
{
- extern int Cmd_CommandExecute( void * pAbc, char * sCommand );
- extern void * Abc_FrameGetGlobalFrame();
-
Prove_Params_t Params, * pParams = &Params;
Abc_Ntk_t * pMiter, * pMiterPart;
Abc_Obj_t * pObj;
@@ -327,8 +332,6 @@ void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds
extern int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd );
extern Vec_Ptr_t * Abc_NtkPartitionSmart( Abc_Ntk_t * pNtk, int nPartSizeLimit, int fVerbose );
extern void Abc_NtkConvertCos( Abc_Ntk_t * pNtk, Vec_Int_t * vOuts, Vec_Ptr_t * vOnePtr );
- extern int Cmd_CommandExecute( void * pAbc, char * sCommand );
- extern void * Abc_FrameGetGlobalFrame();
Vec_Ptr_t * vParts, * vOnePtr;
Vec_Int_t * vOne;
@@ -375,7 +378,7 @@ void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds
Status = 1;
nOutputs = 0;
vOnePtr = Vec_PtrAlloc( 1000 );
- Vec_PtrForEachEntry( vParts, vOne, i )
+ Vec_PtrForEachEntry( Vec_Int_t *, vParts, vOne, i )
{
// get this part of the miter
Abc_NtkConvertCos( pMiter, vOne, vOnePtr );
@@ -596,7 +599,7 @@ int Abc_NtkSecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nFr
// Params.fFuncRed = 0;
// Params.nPatsRand = 0;
// Params.nPatsDyna = 0;
- pMan = Abc_NtkToFraig( pFrames, &Params, 0, 0 );
+ pMan = (Fraig_Man_t *)Abc_NtkToFraig( pFrames, &Params, 0, 0 );
Fraig_ManProveMiter( pMan );
// analyze the result
@@ -667,20 +670,20 @@ int * Abc_NtkVerifySimulatePattern( Abc_Ntk_t * pNtk, int * pModel )
// increment the trav ID
Abc_NtkIncrementTravId( pNtk );
// set the CI values
- Abc_AigConst1(pNtk)->pCopy = (void *)1;
+ Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)1;
Abc_NtkForEachCi( pNtk, pNode, i )
- pNode->pCopy = (void *)(ABC_PTRINT_T)pModel[i];
+ pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)pModel[i];
// simulate in the topological order
Abc_NtkForEachNode( pNtk, pNode, i )
{
- Value0 = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ Abc_ObjFaninC0(pNode);
- Value1 = ((int)(ABC_PTRINT_T)Abc_ObjFanin1(pNode)->pCopy) ^ Abc_ObjFaninC1(pNode);
- pNode->pCopy = (void *)(ABC_PTRINT_T)(Value0 & Value1);
+ Value0 = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ (int)Abc_ObjFaninC0(pNode);
+ Value1 = ((int)(ABC_PTRINT_T)Abc_ObjFanin1(pNode)->pCopy) ^ (int)Abc_ObjFaninC1(pNode);
+ pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)(Value0 & Value1);
}
// fill the output values
pValues = ABC_ALLOC( int, Abc_NtkCoNum(pNtk) );
Abc_NtkForEachCo( pNtk, pNode, i )
- pValues[i] = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ Abc_ObjFaninC0(pNode);
+ pValues[i] = ((int)(ABC_PTRINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ (int)Abc_ObjFaninC0(pNode);
if ( fStrashed )
Abc_NtkDelete( pNtk );
return pValues;
@@ -740,12 +743,12 @@ void Abc_NtkVerifyReportError( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pMode
vNodes = Abc_NtkNodeSupport( pNtk1, &pNode, 1 );
// set the PI numbers
Abc_NtkForEachCi( pNtk1, pNode, i )
- pNode->pCopy = (void*)(ABC_PTRINT_T)i;
+ pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)i;
// print the model
- pNode = Vec_PtrEntry( vNodes, 0 );
+ pNode = (Abc_Obj_t *)Vec_PtrEntry( vNodes, 0 );
if ( Abc_ObjIsCi(pNode) )
{
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
assert( Abc_ObjIsCi(pNode) );
printf( " %s=%d", Abc_ObjName(pNode), pModel[(int)(ABC_PTRINT_T)pNode->pCopy] );
@@ -787,18 +790,18 @@ void Abc_NtkGetSeqPoSupp( Abc_Ntk_t * pNtk, int iFrame, int iNumPo )
// mark the support of the frames
Abc_NtkForEachCi( pFrames, pObj, i )
pObj->pCopy = NULL;
- Vec_PtrForEachEntry( vSupp, pObj, i )
- pObj->pCopy = (void *)1;
+ Vec_PtrForEachEntry( Abc_Obj_t *, vSupp, pObj, i )
+ pObj->pCopy = (Abc_Obj_t *)1;
// mark the support of the network if the support of the timeframes is marked
Abc_NtkForEachCi( pNtk, pObj, i )
pObj->pCopy = NULL;
Abc_NtkForEachLatch( pNtk, pObj, i )
if ( Abc_NtkBox(pFrames, i)->pCopy )
- pObj->pCopy = (void *)1;
+ pObj->pCopy = (Abc_Obj_t *)1;
Abc_NtkForEachPi( pNtk, pObj, i )
for ( k = 0; k <= iFrame; k++ )
if ( Abc_NtkPi(pFrames, k*Abc_NtkPiNum(pNtk) + i)->pCopy )
- pObj->pCopy = (void *)1;
+ pObj->pCopy = (Abc_Obj_t *)1;
// free stuff
Vec_PtrFree( vSupp );
Abc_NtkDelete( pFrames );
@@ -1012,8 +1015,60 @@ void Abc_NtkSimulteBuggyMiter( Abc_Ntk_t * pNtk )
}
+/**Function*************************************************************
+
+ Synopsis [Returns the PO values under the given input pattern.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkIsTrueCex( Abc_Ntk_t * pNtk, Abc_Cex_t * pCex )
+{
+ extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
+// extern int Ssw_SmlRunCounterExample( Aig_Man_t * pAig, Abc_Cex_t * p );
+ Aig_Man_t * pMan;
+ int status, fStrashed = 0;
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ pNtk = Abc_NtkStrash(pNtk, 0, 0, 0);
+ fStrashed = 1;
+ }
+ pMan = Abc_NtkToDar( pNtk, 0, 1 );
+ if ( pMan )
+ {
+ status = Ssw_SmlRunCounterExample( pMan, pCex );
+ Aig_ManStop( pMan );
+ }
+ if ( fStrashed )
+ Abc_NtkDelete( pNtk );
+ return status;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Returns 1 if the number of PIs matches.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkIsValidCex( Abc_Ntk_t * pNtk, Abc_Cex_t * pCex )
+{
+ return Abc_NtkPiNum(pNtk) == pCex->nPis;
+}
+
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/abcXsim.c b/src/base/abci/abcXsim.c
index b77f9d77..12ad0e68 100644
--- a/src/base/abci/abcXsim.c
+++ b/src/base/abci/abcXsim.c
@@ -19,8 +19,9 @@
***********************************************************************/
#include "abc.h"
+#include "gia.h"
-extern unsigned Gia_ManRandom( int fReset );
+ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -30,8 +31,8 @@ extern unsigned Gia_ManRandom( int fReset );
#define XVS1 ABC_INIT_ONE
#define XVSX ABC_INIT_DC
-static inline void Abc_ObjSetXsim( Abc_Obj_t * pObj, int Value ) { pObj->pCopy = (void *)(ABC_PTRINT_T)Value; }
-static inline int Abc_ObjGetXsim( Abc_Obj_t * pObj ) { return (int)(ABC_PTRINT_T)pObj->pCopy; }
+static inline void Abc_ObjSetXsim( Abc_Obj_t * pObj, int Value ) { pObj->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Value; }
+static inline int Abc_ObjGetXsim( Abc_Obj_t * pObj ) { return (int)(ABC_PTRINT_T)pObj->pCopy; }
static inline int Abc_XsimInv( int Value )
{
if ( Value == XVS0 )
@@ -158,12 +159,6 @@ void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXS
fprintf( stdout, " : " );
Abc_NtkForEachPo( pNtk, pObj, i )
Abc_XsimPrint( stdout, Abc_ObjGetXsim(pObj) );
- if ( Abc_NtkAssertNum(pNtk) )
- {
- fprintf( stdout, " : " );
- Abc_NtkForEachAssert( pNtk, pObj, i )
- Abc_XsimPrint( stdout, Abc_ObjGetXsim(pObj) );
- }
fprintf( stdout, "\n" );
// assign input values
if ( fXInputs )
@@ -232,3 +227,5 @@ void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVe
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/fahout cut.c b/src/base/abci/fahout cut.c
new file mode 100644
index 00000000..980b0047
--- /dev/null
+++ b/src/base/abci/fahout cut.c
@@ -0,0 +1,357 @@
+/**CFile****************************************************************
+
+ FileName [abcMerge.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Network and node package.]
+
+ Synopsis [LUT merging algorithm.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: abcMerge.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "aig.h"
+#include "nwkMerge.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Marks the fanins of the node with the current trav ID.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkMarkFanins_rec( Abc_Obj_t * pLut, int nLevMin )
+{
+ Abc_Obj_t * pNext;
+ int i;
+ if ( !Abc_ObjIsNode(pLut) )
+ return;
+ if ( Abc_NodeIsTravIdCurrent( pLut ) )
+ return;
+ Abc_NodeSetTravIdCurrent( pLut );
+ if ( Abc_ObjLevel(pLut) < nLevMin )
+ return;
+ Abc_ObjForEachFanin( pLut, pNext, i )
+ Abc_NtkMarkFanins_rec( pNext, nLevMin );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Marks the fanouts of the node with the current trav ID.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkMarkFanouts_rec( Abc_Obj_t * pLut, int nLevMax, int nFanMax )
+{
+ Abc_Obj_t * pNext;
+ int i;
+ if ( !Abc_ObjIsNode(pLut) )
+ return;
+ if ( Abc_NodeIsTravIdCurrent( pLut ) )
+ return;
+ Abc_NodeSetTravIdCurrent( pLut );
+ if ( Abc_ObjLevel(pLut) > nLevMax )
+ return;
+ if ( Abc_ObjFanoutNum(pLut) > nFanMax )
+ return;
+ Abc_ObjForEachFanout( pLut, pNext, i )
+ Abc_NtkMarkFanouts_rec( pNext, nLevMax, nFanMax );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Collects the circle of nodes around the given set.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkCollectCircle( Vec_Ptr_t * vStart, Vec_Ptr_t * vNext, int nFanMax )
+{
+ Abc_Obj_t * pObj, * pNext;
+ int i, k;
+ Vec_PtrClear( vNext );
+ Vec_PtrForEachEntry( Vec_Int_t *, vStart, pObj, i )
+ {
+ Abc_ObjForEachFanin( pObj, pNext, k )
+ {
+ if ( !Abc_ObjIsNode(pNext) )
+ continue;
+ if ( Abc_NodeIsTravIdCurrent( pNext ) )
+ continue;
+ Abc_NodeSetTravIdCurrent( pNext );
+ Vec_PtrPush( vNext, pNext );
+ }
+ Abc_ObjForEachFanout( pObj, pNext, k )
+ {
+ if ( !Abc_ObjIsNode(pNext) )
+ continue;
+ if ( Abc_NodeIsTravIdCurrent( pNext ) )
+ continue;
+ Abc_NodeSetTravIdCurrent( pNext );
+ if ( Abc_ObjFanoutNum(pNext) > nFanMax )
+ continue;
+ Vec_PtrPush( vNext, pNext );
+ }
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Collects the circle of nodes removes from the given one.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkCollectNonOverlapCands( Abc_Obj_t * pLut, Vec_Ptr_t * vStart, Vec_Ptr_t * vNext, Vec_Ptr_t * vCands, Nwk_LMPars_t * pPars )
+{
+ Vec_Ptr_t * vTemp;
+ Abc_Obj_t * pObj;
+ int i, k;
+ Vec_PtrClear( vCands );
+ if ( pPars->nMaxSuppSize - Abc_ObjFaninNum(pLut) <= 1 )
+ return;
+
+ // collect nodes removed by this distance
+ assert( pPars->nMaxDistance > 0 );
+ Vec_PtrClear( vStart );
+ Vec_PtrPush( vStart, pLut );
+ Abc_NtkIncrementTravId( pLut->pNtk );
+ Abc_NodeSetTravIdCurrent( pLut );
+ for ( i = 1; i <= pPars->nMaxDistance; i++ )
+ {
+ Abc_NtkCollectCircle( vStart, vNext, pPars->nMaxFanout );
+ vTemp = vStart;
+ vStart = vNext;
+ vNext = vTemp;
+ // collect the nodes in vStart
+ Vec_PtrForEachEntry( Vec_Int_t *, vStart, pObj, k )
+ Vec_PtrPush( vCands, pObj );
+ }
+
+ // mark the TFI/TFO nodes
+ Abc_NtkIncrementTravId( pLut->pNtk );
+ if ( pPars->fUseTfiTfo )
+ Abc_NodeSetTravIdCurrent( pLut );
+ else
+ {
+ Abc_NodeSetTravIdPrevious( pLut );
+ Abc_NtkMarkFanins_rec( pLut, Abc_ObjLevel(pLut) - pPars->nMaxDistance );
+ Abc_NodeSetTravIdPrevious( pLut );
+ Abc_NtkMarkFanouts_rec( pLut, Abc_ObjLevel(pLut) + pPars->nMaxDistance, pPars->nMaxFanout );
+ }
+
+ // collect nodes satisfying the following conditions:
+ // - they are close enough in terms of distance
+ // - they are not in the TFI/TFO of the LUT
+ // - they have no more than the given number of fanins
+ // - they have no more than the given diff in delay
+ k = 0;
+ Vec_PtrForEachEntry( Vec_Int_t *, vCands, pObj, i )
+ {
+ if ( Abc_NodeIsTravIdCurrent(pObj) )
+ continue;
+ if ( Abc_ObjFaninNum(pLut) + Abc_ObjFaninNum(pObj) > pPars->nMaxSuppSize )
+ continue;
+ if ( Abc_ObjLevel(pLut) - Abc_ObjLevel(pObj) > pPars->nMaxLevelDiff ||
+ Abc_ObjLevel(pObj) - Abc_ObjLevel(pLut) > pPars->nMaxLevelDiff )
+ continue;
+ Vec_PtrWriteEntry( vCands, k++, pObj );
+ }
+ Vec_PtrShrink( vCands, k );
+}
+
+
+/**Function*************************************************************
+
+ Synopsis [Count the total number of fanins.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkCountTotalFanins( Abc_Obj_t * pLut, Abc_Obj_t * pCand )
+{
+ Abc_Obj_t * pFanin;
+ int i, nCounter = Abc_ObjFaninNum(pLut);
+ Abc_ObjForEachFanin( pCand, pFanin, i )
+ nCounter += !pFanin->fMarkC;
+ return nCounter;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Collects overlapping candidates.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkCollectOverlapCands( Abc_Obj_t * pLut, Vec_Ptr_t * vCands, Nwk_LMPars_t * pPars )
+{
+ Abc_Obj_t * pFanin, * pObj;
+ int i, k;
+ // mark fanins of pLut
+ Abc_ObjForEachFanin( pLut, pFanin, i )
+ pFanin->fMarkC = 1;
+ // collect the matching fanouts of each fanin of the node
+ Vec_PtrClear( vCands );
+ Abc_NtkIncrementTravId( pLut->pNtk );
+ Abc_NodeSetTravIdCurrent( pLut );
+ Abc_ObjForEachFanin( pLut, pFanin, i )
+ {
+ if ( !Abc_ObjIsNode(pFanin) )
+ continue;
+ if ( Abc_ObjFanoutNum(pFanin) > pPars->nMaxFanout )
+ continue;
+ Abc_ObjForEachFanout( pFanin, pObj, k )
+ {
+ if ( !Abc_ObjIsNode(pObj) )
+ continue;
+ if ( Abc_NodeIsTravIdCurrent( pObj ) )
+ continue;
+ Abc_NodeSetTravIdCurrent( pObj );
+ // check the difference in delay
+ if ( Abc_ObjLevel(pLut) - Abc_ObjLevel(pObj) > pPars->nMaxLevelDiff ||
+ Abc_ObjLevel(pObj) - Abc_ObjLevel(pLut) > pPars->nMaxLevelDiff )
+ continue;
+ // check the total number of fanins of the node
+ if ( Abc_NtkCountTotalFanins(pLut, pObj) > pPars->nMaxSuppSize )
+ continue;
+ Vec_PtrPush( vCands, pObj );
+ }
+ }
+ // unmark fanins of pLut
+ Abc_ObjForEachFanin( pLut, pFanin, i )
+ pFanin->fMarkC = 0;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs LUT merging with parameters.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Abc_NtkLutMerge( Abc_Ntk_t * pNtk, Nwk_LMPars_t * pPars )
+{
+ Nwk_Grf_t * p;
+ Vec_Int_t * vResult;
+ Vec_Ptr_t * vStart, * vNext, * vCands1, * vCands2;
+ Abc_Obj_t * pLut, * pCand;
+ int i, k, nVertsMax, nCands, clk = clock();
+ // count the number of vertices
+ nVertsMax = 0;
+ Abc_NtkForEachNode( pNtk, pLut, i )
+ nVertsMax += (int)(Abc_ObjFaninNum(pLut) <= pPars->nMaxLutSize);
+ p = Nwk_ManGraphAlloc( nVertsMax );
+ // create graph
+ vStart = Vec_PtrAlloc( 1000 );
+ vNext = Vec_PtrAlloc( 1000 );
+ vCands1 = Vec_PtrAlloc( 1000 );
+ vCands2 = Vec_PtrAlloc( 1000 );
+ nCands = 0;
+ Abc_NtkForEachNode( pNtk, pLut, i )
+ {
+ if ( Abc_ObjFaninNum(pLut) > pPars->nMaxLutSize )
+ continue;
+ Abc_NtkCollectOverlapCands( pLut, vCands1, pPars );
+ if ( pPars->fUseDiffSupp )
+ Abc_NtkCollectNonOverlapCands( pLut, vStart, vNext, vCands2, pPars );
+ if ( Vec_PtrSize(vCands1) == 0 && Vec_PtrSize(vCands2) == 0 )
+ continue;
+ nCands += Vec_PtrSize(vCands1) + Vec_PtrSize(vCands2);
+ // save candidates
+ Vec_PtrForEachEntry( Vec_Int_t *, vCands1, pCand, k )
+ Nwk_ManGraphHashEdge( p, Abc_ObjId(pLut), Abc_ObjId(pCand) );
+ Vec_PtrForEachEntry( Vec_Int_t *, vCands2, pCand, k )
+ Nwk_ManGraphHashEdge( p, Abc_ObjId(pLut), Abc_ObjId(pCand) );
+ // print statistics about this node
+ if ( pPars->fVeryVerbose )
+ printf( "Node %6d : Fanins = %d. Fanouts = %3d. Cand1 = %3d. Cand2 = %3d.\n",
+ Abc_ObjId(pLut), Abc_ObjFaninNum(pLut), Abc_ObjFaninNum(pLut),
+ Vec_PtrSize(vCands1), Vec_PtrSize(vCands2) );
+ }
+ Vec_PtrFree( vStart );
+ Vec_PtrFree( vNext );
+ Vec_PtrFree( vCands1 );
+ Vec_PtrFree( vCands2 );
+ if ( pPars->fVerbose )
+ {
+ printf( "Mergable LUTs = %6d. Total cands = %6d. ", p->nVertsMax, nCands );
+ ABC_PRT( "Deriving graph", clock() - clk );
+ }
+ // solve the graph problem
+ clk = clock();
+ Nwk_ManGraphSolve( p );
+ if ( pPars->fVerbose )
+ {
+ printf( "GRAPH: Nodes = %6d. Edges = %6d. Pairs = %6d. ",
+ p->nVerts, p->nEdges, Vec_IntSize(p->vPairs)/2 );
+ ABC_PRT( "Solving", clock() - clk );
+ Nwk_ManGraphReportMemoryUsage( p );
+ }
+ vResult = p->vPairs; p->vPairs = NULL;
+/*
+ for ( i = 0; i < vResult->nSize; i += 2 )
+ printf( "(%d,%d) ", vResult->pArray[i], vResult->pArray[i+1] );
+ printf( "\n" );
+*/
+ Nwk_ManGraphFree( p );
+ return vResult;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/abci/module.make b/src/base/abci/module.make
index aaea7312..b9342881 100644
--- a/src/base/abci/module.make
+++ b/src/base/abci/module.make
@@ -4,16 +4,16 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcAuto.c \
src/base/abci/abcBalance.c \
src/base/abci/abcBidec.c \
+ src/base/abci/abcBm.c \
src/base/abci/abcBmc.c \
src/base/abci/abcCas.c \
- src/base/abci/abcClpBdd.c \
- src/base/abci/abcClpSop.c \
+ src/base/abci/abcCascade.c \
+ src/base/abci/abcCollapse.c \
src/base/abci/abcCut.c \
src/base/abci/abcDar.c \
src/base/abci/abcDebug.c \
- src/base/abci/abcDelay.c \
- src/base/abci/abcDprove2.c \
src/base/abci/abcDress.c \
+ src/base/abci/abcDress2.c \
src/base/abci/abcDsd.c \
src/base/abci/abcExtract.c \
src/base/abci/abcFpga.c \
@@ -23,7 +23,9 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcGen.c \
src/base/abci/abcHaig.c \
src/base/abci/abcIf.c \
+ src/base/abci/abcIfMux.c \
src/base/abci/abcIvy.c \
+ src/base/abci/abcLog.c \
src/base/abci/abcLut.c \
src/base/abci/abcLutmin.c \
src/base/abci/abcMap.c \
@@ -49,7 +51,9 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcRewrite.c \
src/base/abci/abcRr.c \
src/base/abci/abcSat.c \
+ src/base/abci/abcScorr.c \
src/base/abci/abcSense.c \
+ src/base/abci/abcSpeedup.c \
src/base/abci/abcStrash.c \
src/base/abci/abcSweep.c \
src/base/abci/abcSymm.c \
diff --git a/src/base/cmd/cmd.c b/src/base/cmd/cmd.c
index 398415ae..47b031bc 100644
--- a/src/base/cmd/cmd.c
+++ b/src/base/cmd/cmd.c
@@ -24,9 +24,11 @@
#include <unistd.h>
#endif
+#include "abc.h"
#include "mainInt.h"
#include "cmdInt.h"
-#include "abc.h"
+
+ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -46,7 +48,7 @@ static int CmdCommandUnsetVariable ( Abc_Frame_t * pAbc, int argc, char ** argv
static int CmdCommandUndo ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int CmdCommandRecall ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int CmdCommandEmpty ( Abc_Frame_t * pAbc, int argc, char ** argv );
-#ifdef WIN32
+#if defined(WIN32) && !defined(__cplusplus)
static int CmdCommandLs ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int CmdCommandScrGen ( Abc_Frame_t * pAbc, int argc, char ** argv );
#endif
@@ -55,6 +57,8 @@ static int CmdCommandSis ( Abc_Frame_t * pAbc, int argc, char ** argv
static int CmdCommandMvsis ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int CmdCommandCapo ( Abc_Frame_t * pAbc, int argc, char ** argv );
+extern int Cmd_CommandAbcLoadPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv );
+
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
@@ -75,28 +79,30 @@ void Cmd_Init( Abc_Frame_t * pAbc )
pAbc->tFlags = st_init_table(strcmp, st_strhash);
pAbc->aHistory = Vec_PtrAlloc( 100 );
- Cmd_CommandAdd( pAbc, "Basic", "time", CmdCommandTime, 0);
- Cmd_CommandAdd( pAbc, "Basic", "echo", CmdCommandEcho, 0);
- Cmd_CommandAdd( pAbc, "Basic", "quit", CmdCommandQuit, 0);
- Cmd_CommandAdd( pAbc, "Basic", "history", CmdCommandHistory, 0);
- Cmd_CommandAdd( pAbc, "Basic", "alias", CmdCommandAlias, 0);
- Cmd_CommandAdd( pAbc, "Basic", "unalias", CmdCommandUnalias, 0);
- Cmd_CommandAdd( pAbc, "Basic", "help", CmdCommandHelp, 0);
- Cmd_CommandAdd( pAbc, "Basic", "source", CmdCommandSource, 0);
- Cmd_CommandAdd( pAbc, "Basic", "set", CmdCommandSetVariable, 0);
- Cmd_CommandAdd( pAbc, "Basic", "unset", CmdCommandUnsetVariable, 0);
- Cmd_CommandAdd( pAbc, "Basic", "undo", CmdCommandUndo, 0);
- Cmd_CommandAdd( pAbc, "Basic", "recall", CmdCommandRecall, 0);
- Cmd_CommandAdd( pAbc, "Basic", "empty", CmdCommandEmpty, 0);
-#ifdef WIN32
- Cmd_CommandAdd( pAbc, "Basic", "ls", CmdCommandLs, 0 );
- Cmd_CommandAdd( pAbc, "Basic", "scrgen", CmdCommandScrGen, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "time", CmdCommandTime, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "echo", CmdCommandEcho, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "quit", CmdCommandQuit, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "history", CmdCommandHistory, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "alias", CmdCommandAlias, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "unalias", CmdCommandUnalias, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "help", CmdCommandHelp, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "source", CmdCommandSource, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "set", CmdCommandSetVariable, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "unset", CmdCommandUnsetVariable, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "undo", CmdCommandUndo, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "recall", CmdCommandRecall, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "empty", CmdCommandEmpty, 0 );
+#if defined(WIN32) && !defined(__cplusplus)
+ Cmd_CommandAdd( pAbc, "Basic", "ls", CmdCommandLs, 0 );
+ Cmd_CommandAdd( pAbc, "Basic", "scrgen", CmdCommandScrGen, 0 );
#endif
- Cmd_CommandAdd( pAbc, "Basic", "version", CmdCommandVersion, 0);
+ Cmd_CommandAdd( pAbc, "Basic", "version", CmdCommandVersion, 0 );
+
+ Cmd_CommandAdd( pAbc, "Various", "sis", CmdCommandSis, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "mvsis", CmdCommandMvsis, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "capo", CmdCommandCapo, 0 );
- Cmd_CommandAdd( pAbc, "Various", "sis", CmdCommandSis, 1);
- Cmd_CommandAdd( pAbc, "Various", "mvsis", CmdCommandMvsis, 1);
- Cmd_CommandAdd( pAbc, "Various", "capo", CmdCommandCapo, 0);
+ Cmd_CommandAdd( pAbc, "Various", "load_plugin", Cmd_CommandAbcLoadPlugIn, 0 );
}
/**Function********************************************************************
@@ -118,17 +124,17 @@ void Cmd_End( Abc_Frame_t * pAbc )
// st_free_table( pAbc->tCommands, (void (*)()) 0, CmdCommandFree );
// st_free_table( pAbc->tAliases, (void (*)()) 0, CmdCommandAliasFree );
-// st_free_table( pAbc->tFlags, ABC_FREE, ABC_FREE );
+// st_free_table( pAbc->tFlags, free, free );
- st_foreach_item( pAbc->tCommands, gen, (char **)&pKey, (char **)&pValue )
+ st_foreach_item( pAbc->tCommands, gen, (const char **)&pKey, (char **)&pValue )
CmdCommandFree( (Abc_Command *)pValue );
st_free_table( pAbc->tCommands );
- st_foreach_item( pAbc->tAliases, gen, (char **)&pKey, (char **)&pValue )
+ st_foreach_item( pAbc->tAliases, gen, (const char **)&pKey, (char **)&pValue )
CmdCommandAliasFree( (Abc_Alias *)pValue );
st_free_table( pAbc->tAliases );
- st_foreach_item( pAbc->tFlags, gen, (char **)&pKey, (char **)&pValue )
+ st_foreach_item( pAbc->tFlags, gen, (const char **)&pKey, (char **)&pValue )
ABC_FREE( pKey ), ABC_FREE( pValue );
st_free_table( pAbc->tFlags );
@@ -374,7 +380,8 @@ usage:
******************************************************************************/
int CmdCommandAlias( Abc_Frame_t * pAbc, int argc, char **argv )
{
- char *key, *value;
+ const char *key;
+ char *value;
int c;
Extra_UtilGetoptReset();
@@ -431,7 +438,8 @@ usage:
int CmdCommandUnalias( Abc_Frame_t * pAbc, int argc, char **argv )
{
int i;
- char *key, *value;
+ const char *key;
+ char *value;
int c;
Extra_UtilGetoptReset();
@@ -481,7 +489,7 @@ int CmdCommandUnalias( Abc_Frame_t * pAbc, int argc, char **argv )
******************************************************************************/
int CmdCommandHelp( Abc_Frame_t * pAbc, int argc, char **argv )
{
- bool fPrintAll;
+ int fPrintAll;
int c;
fPrintAll = 0;
@@ -714,7 +722,8 @@ int CmdCommandSource( Abc_Frame_t * pAbc, int argc, char **argv )
******************************************************************************/
int CmdCommandSetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
{
- char *flag_value, *key, *value;
+ char *flag_value, *value;
+ const char* key;
int c;
Extra_UtilGetoptReset();
@@ -814,7 +823,8 @@ int CmdCommandSetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
int CmdCommandUnsetVariable( Abc_Frame_t * pAbc, int argc, char **argv )
{
int i;
- char *key, *value;
+ const char *key;
+ char *value;
int c;
Extra_UtilGetoptReset();
@@ -1097,7 +1107,7 @@ usage:
#endif
-#ifdef WIN32
+#if defined(WIN32) && !defined(__cplusplus)
#include <direct.h>
// these structures are defined in <io.h> but are for some reason invisible
@@ -1117,7 +1127,7 @@ extern int _findnext( long handle, struct _finddata_t *fileinfo );
extern int _findclose( long handle );
//extern char * _getcwd( char * buffer, int maxlen );
-extern int _chdir( const char *dirname );
+//extern int _chdir( const char *dirname );
/**Function*************************************************************
@@ -1529,7 +1539,7 @@ int CmdCommandSis( Abc_Frame_t * pAbc, int argc, char **argv )
fprintf( pErr, "Cannot produce the intermediate network.\n" );
goto usage;
}
- Io_WriteBlif( pNetlist, "_sis_in.blif", 1 );
+ Io_WriteBlif( pNetlist, "_sis_in.blif", 1, 0, 0 );
Abc_NtkDelete( pNetlist );
// create the file for sis
@@ -1672,7 +1682,7 @@ int CmdCommandMvsis( Abc_Frame_t * pAbc, int argc, char **argv )
fprintf( pErr, "Cannot produce the intermediate network.\n" );
goto usage;
}
- Io_WriteBlif( pNetlist, "_mvsis_in.blif", 1 );
+ Io_WriteBlif( pNetlist, "_mvsis_in.blif", 1, 0, 0 );
Abc_NtkDelete( pNetlist );
// create the file for MVSIS
@@ -1767,10 +1777,10 @@ void Gia_ManGnuplotShow( char * pPlotFileName )
pAbc = Abc_FrameGetGlobalFrame();
// get the names from the plotting software
- if ( Cmd_FlagReadByName(pAbc, "gnuplotwin") )
- pProgNameGnuplotWin = Cmd_FlagReadByName(pAbc, "gnuplotwin");
- if ( Cmd_FlagReadByName(pAbc, "gnuplotunix") )
- pProgNameGnuplotUnix = Cmd_FlagReadByName(pAbc, "gnuplotunix");
+ if ( Cmd_FlagReadByName((Abc_Frame_t *)pAbc, "gnuplotwin") )
+ pProgNameGnuplotWin = Cmd_FlagReadByName((Abc_Frame_t *)pAbc, "gnuplotwin");
+ if ( Cmd_FlagReadByName((Abc_Frame_t *)pAbc, "gnuplotunix") )
+ pProgNameGnuplotUnix = Cmd_FlagReadByName((Abc_Frame_t *)pAbc, "gnuplotunix");
// check if Gnuplot is available
if ( (pFile = fopen( pProgNameGnuplotWin, "r" )) )
@@ -1887,7 +1897,7 @@ int CmdCommandCapo( Abc_Frame_t * pAbc, int argc, char **argv )
fprintf( pErr, "Cannot produce the intermediate network.\n" );
goto usage;
}
- Io_WriteBlif( pNetlist, "_capo_in.blif", 1 );
+ Io_WriteBlif( pNetlist, "_capo_in.blif", 1, 0, 0 );
Abc_NtkDelete( pNetlist );
// create the file for Capo
@@ -2011,3 +2021,5 @@ int CmdCommandVersion( Abc_Frame_t * pAbc, int argc, char **argv )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/cmd.h b/src/base/cmd/cmd.h
index 61c7264b..787e52b9 100644
--- a/src/base/cmd/cmd.h
+++ b/src/base/cmd/cmd.h
@@ -21,18 +21,17 @@
#ifndef __CMD_H__
#define __CMD_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_HEADER_START
+
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
-
////////////////////////////////////////////////////////////////////////
/// STRUCTURE DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
@@ -49,21 +48,24 @@ typedef struct MvAlias Abc_Alias; // one alias
////////////////////////////////////////////////////////////////////////
/*=== cmd.c ===========================================================*/
-extern void Cmd_Init();
-extern void Cmd_End();
+extern void Cmd_Init( Abc_Frame_t * pAbc );
+extern void Cmd_End( Abc_Frame_t * pAbc );
/*=== cmdApi.c ========================================================*/
-extern void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFunc, int fChanges );
-extern ABC_DLL int Cmd_CommandExecute( Abc_Frame_t * pAbc, char * sCommand );
+typedef int (*Cmd_CommandFuncType)(Abc_Frame_t*, int, char**);
+extern void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName, Cmd_CommandFuncType pFunc, int fChanges );
+extern ABC_DLL int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * sCommand );
/*=== cmdFlag.c ========================================================*/
extern char * Cmd_FlagReadByName( Abc_Frame_t * pAbc, char * flag );
-extern void Cmd_FlagDeleteByName( Abc_Frame_t * pAbc, char * key );
-extern void Cmd_FlagUpdateValue( Abc_Frame_t * pAbc, char * key, char * value );
+extern void Cmd_FlagDeleteByName( Abc_Frame_t * pAbc, const char * key );
+extern void Cmd_FlagUpdateValue( Abc_Frame_t * pAbc, const char * key, char * value );
/*=== cmdHist.c ========================================================*/
-extern void Cmd_HistoryAddCommand( Abc_Frame_t * pAbc, char * command );
+extern void Cmd_HistoryAddCommand( Abc_Frame_t * pAbc, const char * command );
+
+
+
+ABC_NAMESPACE_HEADER_END
+
-#ifdef __cplusplus
-}
-#endif
#endif
diff --git a/src/base/cmd/cmdAlias.c b/src/base/cmd/cmdAlias.c
index 20ee0694..6078927d 100644
--- a/src/base/cmd/cmdAlias.c
+++ b/src/base/cmd/cmdAlias.c
@@ -18,8 +18,12 @@
***********************************************************************/
+#include "abc.h"
#include "cmdInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -118,3 +122,5 @@ void CmdCommandAliasFree( Abc_Alias * pAlias )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/cmdApi.c b/src/base/cmd/cmdApi.c
index ae1949a6..40c1dbf9 100644
--- a/src/base/cmd/cmdApi.c
+++ b/src/base/cmd/cmdApi.c
@@ -18,9 +18,12 @@
***********************************************************************/
+#include "abc.h"
#include "mainInt.h"
#include "cmdInt.h"
-#include "abc.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -41,9 +44,10 @@
SeeAlso []
***********************************************************************/
-void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFunc, int fChanges )
+void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName, Cmd_CommandFuncType pFunc, int fChanges )
{
- char * key, * value;
+ const char * key;
+ char * value;
Abc_Command * pCommand;
int fStatus;
@@ -61,7 +65,7 @@ void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFu
pCommand->sGroup = Extra_UtilStrsav( sGroup );
pCommand->pFunc = pFunc;
pCommand->fChange = fChanges;
- fStatus = st_insert( pAbc->tCommands, sName, (char *)pCommand );
+ fStatus = st_insert( pAbc->tCommands, pCommand->sName, (char *)pCommand );
assert( !fStatus ); // the command should not be in the table
}
@@ -76,10 +80,11 @@ void Cmd_CommandAdd( Abc_Frame_t * pAbc, char * sGroup, char * sName, void * pFu
SeeAlso []
***********************************************************************/
-int Cmd_CommandExecute( Abc_Frame_t * pAbc, char * sCommand )
+int Cmd_CommandExecute( Abc_Frame_t * pAbc, const char * sCommand )
{
int fStatus = 0, argc, loop;
- char * sCommandNext, **argv;
+ const char * sCommandNext;
+ char **argv;
if ( !pAbc->fAutoexac )
Cmd_HistoryAddCommand(pAbc, sCommand);
@@ -102,3 +107,5 @@ int Cmd_CommandExecute( Abc_Frame_t * pAbc, char * sCommand )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/cmdFlag.c b/src/base/cmd/cmdFlag.c
index d25861c0..a220042b 100644
--- a/src/base/cmd/cmdFlag.c
+++ b/src/base/cmd/cmdFlag.c
@@ -18,8 +18,12 @@
***********************************************************************/
+#include "abc.h"
#include "mainInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -58,7 +62,7 @@ char * Cmd_FlagReadByName( Abc_Frame_t * pAbc, char * flag )
SideEffects []
******************************************************************************/
-void Cmd_FlagUpdateValue( Abc_Frame_t * pAbc, char * key, char * value )
+void Cmd_FlagUpdateValue( Abc_Frame_t * pAbc, const char * key, char * value )
{
char * oldValue, * newValue;
if ( !key )
@@ -83,7 +87,7 @@ void Cmd_FlagUpdateValue( Abc_Frame_t * pAbc, char * key, char * value )
SideEffects []
******************************************************************************/
-void Cmd_FlagDeleteByName( Abc_Frame_t * pAbc, char * key )
+void Cmd_FlagDeleteByName( Abc_Frame_t * pAbc, const char * key )
{
char *value;
if ( !key )
@@ -102,3 +106,5 @@ void Cmd_FlagDeleteByName( Abc_Frame_t * pAbc, char * key )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/cmdHist.c b/src/base/cmd/cmdHist.c
index fae9382d..a2f64027 100644
--- a/src/base/cmd/cmdHist.c
+++ b/src/base/cmd/cmdHist.c
@@ -18,10 +18,14 @@
***********************************************************************/
+#include "abc.h"
#include "mainInt.h"
#include "cmd.h"
#include "cmdInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -41,7 +45,7 @@
SeeAlso []
***********************************************************************/
-void Cmd_HistoryAddCommand( Abc_Frame_t * p, char * command )
+void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command )
{
static char Buffer[MAX_STR];
strcpy( Buffer, command );
@@ -53,3 +57,5 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, char * command )
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/cmdInt.h b/src/base/cmd/cmdInt.h
index 3a6a2803..0ea9b364 100644
--- a/src/base/cmd/cmdInt.h
+++ b/src/base/cmd/cmdInt.h
@@ -21,6 +21,7 @@
#ifndef __CMD_INT_H__
#define __CMD_INT_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -28,6 +29,9 @@
#include "mainInt.h"
#include "cmd.h"
+ABC_NAMESPACE_HEADER_START
+
+
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
@@ -40,7 +44,7 @@ struct MvCommand
{
char * sName; // the command name
char * sGroup; // the group name
- void * pFunc; // the function to execute the command
+ Cmd_CommandFuncType pFunc; // the function to execute the command
int fChange; // set to 1 to mark that the network is changed
};
@@ -66,19 +70,23 @@ extern char * CmdCommandAliasLookup( Abc_Frame_t * pAbc, char * sCommand );
extern void CmdCommandAliasFree( Abc_Alias * p );
/*=== cmdUtils.c =======================================================*/
extern int CmdCommandDispatch( Abc_Frame_t * pAbc, int * argc, char *** argv );
-extern char * CmdSplitLine( Abc_Frame_t * pAbc, char * sCommand, int * argc, char *** argv );
+extern const char * CmdSplitLine( Abc_Frame_t * pAbc, const char * sCommand, int * argc, char *** argv );
extern int CmdApplyAlias( Abc_Frame_t * pAbc, int * argc, char *** argv, int * loop );
extern char * CmdHistorySubstitution( Abc_Frame_t * pAbc, char * line, int * changed );
extern FILE * CmdFileOpen( Abc_Frame_t * pAbc, char * sFileName, char * sMode, char ** pFileNameReal, int silent );
extern void CmdFreeArgv( int argc, char ** argv );
extern char ** CmdAddToArgv( int argc, char ** argv );
extern void CmdCommandFree( Abc_Command * pCommand );
-extern void CmdCommandPrint( Abc_Frame_t * pAbc, bool fPrintAll );
+extern void CmdCommandPrint( Abc_Frame_t * pAbc, int fPrintAll );
extern void CmdPrintTable( st_table * tTable, int fAliases );
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_HEADER_END
+
#endif
diff --git a/src/base/cmd/cmdLoad.c b/src/base/cmd/cmdLoad.c
new file mode 100644
index 00000000..7a83385c
--- /dev/null
+++ b/src/base/cmd/cmdLoad.c
@@ -0,0 +1,226 @@
+/**CFile****************************************************************
+
+ FileName [cmdApi.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Command processing package.]
+
+ Synopsis [External procedures of the command package.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: cmdApi.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "mainInt.h"
+#include "cmd.h"
+#include "cmdInt.h"
+
+ABC_NAMESPACE_IMPL_START
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+static int CmdCommandLoad ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function********************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+******************************************************************************/
+int CmdCommandLoad( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Vec_Str_t * vCommand;
+ FILE * pFile;
+ int i;
+ vCommand = Vec_StrAlloc( 100 );
+ Vec_StrAppend( vCommand, "abccmd_" );
+ Vec_StrAppend( vCommand, argv[0] );
+ Vec_StrAppend( vCommand, ".exe" );
+ Vec_StrPush( vCommand, 0 );
+ // check if there is the binary
+ if ( (pFile = fopen( Vec_StrArray(vCommand), "r" )) == NULL )
+ {
+ Abc_Print( -1, "Cannot run the binary \"%s\".\n\n", Vec_StrArray(vCommand) );
+ return 1;
+ }
+ fclose( pFile );
+ Vec_StrPop( vCommand );
+ // add other arguments
+ for ( i = 1; i < argc; i++ )
+ {
+ Vec_StrAppend( vCommand, " " );
+ Vec_StrAppend( vCommand, argv[i] );
+ }
+ Vec_StrPush( vCommand, 0 );
+ // run the command line
+ if ( system( Vec_StrArray(vCommand) ) )
+ {
+ Abc_Print( -1, "The following command has returned non-zero exit status:\n" );
+ Abc_Print( -1, "\"%s\"\n", Vec_StrArray(vCommand) );
+ return 1;
+ }
+ return 0;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+#if defined(WIN32) && !defined(__cplusplus)
+
+#include <direct.h>
+
+
+// these structures are defined in <io.h> but are for some reason invisible
+typedef unsigned long _fsize_t; // Could be 64 bits for Win32
+
+struct _finddata_t {
+ unsigned attrib;
+ time_t time_create; // -1 for FAT file systems
+ time_t time_access; // -1 for FAT file systems
+ time_t time_write;
+ _fsize_t size;
+ char name[260];
+};
+
+extern long _findfirst( char *filespec, struct _finddata_t *fileinfo );
+extern int _findnext( long handle, struct _finddata_t *fileinfo );
+extern int _findclose( long handle );
+
+//extern char * _getcwd( char * buffer, int maxlen );
+//extern int _chdir( const char *dirname );
+
+/**Function*************************************************************
+
+ Synopsis [Collect file names ending with .exe]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t * CmdCollectFileNames()
+{
+ Vec_Ptr_t * vFileNames;
+ struct _finddata_t c_file;
+ long hFile;
+ if( (hFile = _findfirst( "*.exe", &c_file )) == -1L )
+ {
+// Abc_Print( 0, "No files with extention \"%s\" in the current directory.\n", "exe" );
+ return NULL;
+ }
+ vFileNames = Vec_PtrAlloc( 100 );
+ do {
+ Vec_PtrPush( vFileNames, Extra_UtilStrsav( c_file.name ) );
+ } while( _findnext( hFile, &c_file ) == 0 );
+ _findclose( hFile );
+ return vFileNames;
+}
+
+#else
+
+/**Function*************************************************************
+
+ Synopsis [Collect file names ending with .exe]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t * CmdCollectFileNames()
+{
+ return NULL;
+}
+
+#endif
+
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Load_Init( Abc_Frame_t * pAbc )
+{
+ Vec_Ptr_t * vFileNames;
+ char * pName, * pStop;
+ int i;
+ vFileNames = CmdCollectFileNames();
+ if ( vFileNames == NULL )
+ return;
+ Vec_PtrForEachEntry( char *, vFileNames, pName, i )
+ {
+ if ( strncmp( pName, "abccmd_", 7 ) )
+ continue;
+ // get the command name
+// pName[6] = '!';
+ pStop = strstr( pName + 7, "." );
+ if ( pStop )
+ *pStop = 0;
+ // add the command
+ Cmd_CommandAdd( pAbc, "ZZ", pName+7, CmdCommandLoad, 0 );
+// printf( "Loaded command \"%s\"\n", pName+7 );
+ }
+ Vec_PtrFreeFree( vFileNames );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Load_End( Abc_Frame_t * pAbc )
+{
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/cmdPlugin.c b/src/base/cmd/cmdPlugin.c
new file mode 100644
index 00000000..be7a9245
--- /dev/null
+++ b/src/base/cmd/cmdPlugin.c
@@ -0,0 +1,629 @@
+/**CFile****************************************************************
+
+ FileName [cmdPlugin.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Command processing package.]
+
+ Synopsis [Integrating external binary.]
+
+ Author [Alan Mishchenko, Niklas Een]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - September 29, 2010.]
+
+ Revision [$Id: cmdPlugin.c,v 1.00 2010/09/29 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#ifdef WIN32
+#include <io.h>
+#include <process.h>
+#else
+#include <unistd.h>
+#endif
+
+#include "abc.h"
+#include "mainInt.h"
+#include "cmd.h"
+#include "cmdInt.h"
+
+ABC_NAMESPACE_IMPL_START
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/*
+
+-------- Original Message --------
+Subject: ABC/ZZ integration
+Date: Wed, 29 Sep 2010 00:34:32 -0700
+From: Niklas Een <niklas@een.se>
+To: Alan Mishchenko <alanmi@EECS.Berkeley.EDU>
+
+Hi Alan,
+
+Since the interface is file-based, it is important that we generate
+good, unique filenames (we may run multiple instances of ABC in the
+same directory), so I have attached some portable code for doing that
+(tmpFile.c). You can integrate it appropriately.
+
+This is how my interface is meant to work:
+
+(1) As part of your call to Bip, give it first argument "-abc".
+ This will alter Bip's behavior slightly.
+
+(2) To list the commands, call 'bip -list-commands'.
+ My commands begin with a comma (so that's my prefix).
+
+(3) All commands expect an input file and an output file.
+ The input file should be in AIGER format.
+ The output will be a text file.
+ Example:
+ bip -input=tmp.aig -output=tmp.out ,pdr -check -prop=5
+
+ So you just auto-generate the two temporary files (output file is
+ closed and left empty) and stitch the ABC command line at the end.
+ All you need to check for is if the ABC line begins with a comma.
+
+(4) The result written to the output file will contain a number
+ of object. Each object is on a separate line of the form:
+
+ <object name>: <object data>
+
+That is: name, colon, space, data, newline. If you see a name you don't
+recognize, just skip that line (so you will ignore future extensions by me).
+I currently define the following objects:
+
+ result:
+ counter-example:
+ proof-invariant:
+ bug-free-depth:
+ abstraction:
+
+"result:" is one of "proved", "failed", "undetermined" (=reached resource limit), "error"
+(only used by the abstraction command, and only if resource limit was so tight that the
+abstraction was still empty -- no abstraction is returned in this special case).
+
+"counter-example:" -- same format as before
+
+"proof-invariant:" contains an text-encoded single-output AIG. If you want
+you can parse it and validate the invariant.
+
+"bug-free-depth:" the depth up to which the procedure has checked for counter-example.
+Starts at -1 (not even the initial states have been verified).
+
+"abstraction:" -- same format as before
+
+(5) I propose that you add a command "load_plugin <path/binary>". That way Bob can put
+Bip where ever he likes and just modify his abc_rc file.
+
+The intention is that ABC can read this file and act on it without knowing what
+particular command was used. If there is an abstraction, you will always apply it.
+If there is a "bug-free-depth" you will store that data somewhere so that Bob can query
+it through the Python interface, and so on. If we need different actions for different
+command, then we add a new object for the new action.
+
+// N.
+
+*/
+
+extern int tmpFile(const char* prefix, const char* suffix, char** out_name);
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+char * Abc_GetBinaryName( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ char * pTemp;
+ int i;
+ Vec_PtrForEachEntry( char *, pAbc->vPlugInComBinPairs, pTemp, i )
+ {
+ i++;
+ if ( strcmp( pTemp, argv[0] ) == 0 )
+ return Vec_PtrEntry( pAbc->vPlugInComBinPairs, i );
+ }
+ assert( 0 );
+ return NULL;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Read flop map.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Str_t * Abc_ManReadFile( char * pFileName )
+{
+ FILE * pFile;
+ Vec_Str_t * vStr;
+ int c;
+ pFile = fopen( pFileName, "r" );
+ if ( pFile == NULL )
+ {
+ printf( "Cannot open file \"%s\".\n", pFileName );
+ return NULL;
+ }
+ vStr = Vec_StrAlloc( 100 );
+ while ( (c = fgetc(pFile)) != EOF )
+ Vec_StrPush( vStr, (char)c );
+ Vec_StrPush( vStr, '\0' );
+ fclose( pFile );
+ return vStr;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Read flop map.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Abc_ManReadBinary( char * pFileName, char * pToken )
+{
+ Vec_Int_t * vMap = NULL;
+ Vec_Str_t * vStr;
+ char * pStr;
+ int i, Length;
+ vStr = Abc_ManReadFile( pFileName );
+ if ( vStr == NULL )
+ return NULL;
+ pStr = Vec_StrArray( vStr );
+ pStr = strstr( pStr, pToken );
+ if ( pStr != NULL )
+ {
+ pStr += strlen( pToken );
+ vMap = Vec_IntAlloc( 100 );
+ Length = strlen( pStr );
+ for ( i = 0; i < Length; i++ )
+ {
+ if ( pStr[i] == '0' || pStr[i] == '?' )
+ Vec_IntPush( vMap, 0 );
+ else if ( pStr[i] == '1' )
+ Vec_IntPush( vMap, 1 );
+ if ( ('a' <= pStr[i] && pStr[i] <= 'z') ||
+ ('A' <= pStr[i] && pStr[i] <= 'Z') )
+ break;
+ }
+ }
+ Vec_StrFree( vStr );
+ return vMap;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Read flop map.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_ManReadInteger( char * pFileName, char * pToken )
+{
+ int Result = -1;
+ Vec_Str_t * vStr;
+ char * pStr;
+ vStr = Abc_ManReadFile( pFileName );
+ if ( vStr == NULL )
+ return -1;
+ pStr = Vec_StrArray( vStr );
+ pStr = strstr( pStr, pToken );
+ if ( pStr != NULL )
+ Result = atoi( pStr + strlen(pToken) );
+ Vec_StrFree( vStr );
+ return Result;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Read flop map.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_ManReadStatus( char * pFileName, char * pToken )
+{
+ int Result = -1;
+ Vec_Str_t * vStr;
+ char * pStr;
+ vStr = Abc_ManReadFile( pFileName );
+ if ( vStr == NULL )
+ return -1;
+ pStr = Vec_StrArray( vStr );
+ pStr = strstr( pStr, pToken );
+ if ( pStr != NULL )
+ {
+ if ( strncmp(pStr+8, "proved", 6) == 0 )
+ Result = 1;
+ else if ( strncmp(pStr+8, "failed", 6) == 0 )
+ Result = 0;
+ }
+ Vec_StrFree( vStr );
+ return Result;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Work-around to insert 0s for PIs without fanout.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Abc_ManExpandCex( Gia_Man_t * pGia, Vec_Int_t * vCex )
+{
+ Vec_Int_t * vCexNew;
+ Gia_Obj_t * pObj;
+ int i, k;
+
+ // start with register outputs
+ vCexNew = Vec_IntAlloc( Vec_IntSize(vCex) );
+ Gia_ManForEachRo( pGia, pObj, i )
+ Vec_IntPush( vCexNew, 0 );
+
+ ABC_FREE( pGia->pRefs );
+ Gia_ManCreateRefs( pGia );
+ k = Gia_ManRegNum( pGia );
+ while ( 1 )
+ {
+ Gia_ManForEachPi( pGia, pObj, i )
+ {
+ if ( Gia_ObjRefs(pGia, pObj) == 0 )
+ Vec_IntPush( vCexNew, 0 );
+ else
+ {
+ if ( k == Vec_IntSize(vCex) )
+ break;
+ Vec_IntPush( vCexNew, Vec_IntEntry(vCex, k++) );
+ }
+ }
+ if ( k == Vec_IntSize(vCex) )
+ break;
+ }
+ return vCexNew;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ char * pFileIn, * pFileOut;
+ char * pFileNameBinary;
+ Vec_Str_t * vCommand;
+ Vec_Int_t * vCex;
+ FILE * pFile;
+ int i, fd, clk;
+ int fLeaveFiles;
+/*
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ if ( pNtk == NULL )
+ {
+ Abc_Print( -1, "Current network does not exist\n" );
+ return 1;
+ }
+ if ( !Abc_NtkIsStrash( pNtk) )
+ {
+ Abc_Print( -1, "The current network is not an AIG. Cannot continue.\n" );
+ return 1;
+ }
+*/
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Current AIG does not exist (try command &ps).\n" );
+ return 1;
+ }
+
+ // check if there is the binary
+ pFileNameBinary = Abc_GetBinaryName( pAbc, argc, argv );
+ if ( (pFile = fopen( pFileNameBinary, "r" )) == NULL )
+ {
+ Abc_Print( -1, "Cannot run the binary \"%s\".\n\n", pFileNameBinary );
+ return 1;
+ }
+ fclose( pFile );
+
+ // create temp file
+ fd = tmpFile( "__abctmp_", ".aig", &pFileIn );
+ if ( fd == -1 )
+ {
+ Abc_Print( -1, "Cannot create a temporary file.\n" );
+ return 1;
+ }
+#ifdef WIN32
+ _close( fd );
+#else
+ close( fd );
+#endif
+
+ // create temp file
+ fd = tmpFile( "__abctmp_", ".out", &pFileOut );
+ if ( fd == -1 )
+ {
+ ABC_FREE( pFileIn );
+ Abc_Print( -1, "Cannot create a temporary file.\n" );
+ return 1;
+ }
+#ifdef WIN32
+ _close( fd );
+#else
+ close( fd );
+#endif
+
+
+ // write current network into a file
+/*
+ {
+ extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
+ Aig_Man_t * pAig;
+ pAig = Abc_NtkToDar( pNtk, 0, 1 );
+ Ioa_WriteAiger( pAig, pFileIn, 0, 0 );
+ Aig_ManStop( pAig );
+ }
+*/
+ // check what to do with the files
+ fLeaveFiles = 0;
+ if ( strcmp( argv[argc-1], "!" ) == 0 )
+ {
+ Abc_Print( 0, "Input file \"%s\" and output file \"%s\" are not deleted.\n", pFileIn, pFileOut );
+ fLeaveFiles = 1;
+ argc--;
+ }
+
+ // create input file
+ Gia_WriteAiger( pAbc->pGia, pFileIn, 0, 0 );
+
+ // create command line
+ vCommand = Vec_StrAlloc( 100 );
+ Vec_StrAppend( vCommand, pFileNameBinary );
+ // add input/output file
+ Vec_StrAppend( vCommand, " -abc" );
+// Vec_StrAppend( vCommand, " -input=C:/_projects/abc/_TEST/hwmcc/139442p0.aig" );
+ Vec_StrAppend( vCommand, " -input=" );
+ Vec_StrAppend( vCommand, pFileIn );
+ Vec_StrAppend( vCommand, " -output=" );
+ Vec_StrAppend( vCommand, pFileOut );
+ // add other arguments
+ for ( i = 0; i < argc; i++ )
+ {
+ Vec_StrAppend( vCommand, " " );
+ Vec_StrAppend( vCommand, argv[i] );
+ }
+ Vec_StrPush( vCommand, 0 );
+
+ // run the command line
+//printf( "Running command line: %s\n", Vec_StrArray(vCommand) );
+
+ clk = clock();
+ if ( system( Vec_StrArray(vCommand) ) )
+ {
+ Abc_Print( -1, "The following command has returned non-zero exit status:\n" );
+ Abc_Print( -1, "\"%s\"\n", Vec_StrArray(vCommand) );
+ return 1;
+ }
+ clk = clock() - clk;
+ Vec_StrFree( vCommand );
+
+ // check if the output file exists
+ if ( (pFile = fopen( pFileOut, "r" )) == NULL )
+ {
+ Abc_Print( -1, "There is no output file \"%s\".\n", pFileOut );
+ return 1;
+ }
+ fclose( pFile );
+
+ // process the output
+ if ( Extra_FileSize(pFileOut) > 0 )
+ {
+ // read program arguments
+ pAbc->Status = Abc_ManReadStatus( pFileOut, "result:" );
+ pAbc->nFrames = Abc_ManReadInteger( pFileOut, "bug-free-depth:" );
+ if ( pAbc->nFrames == -1 )
+ printf( "Gia_ManCexAbstractionStartNew(): Cannot read the number of frames covered by BMC.\n" );
+ pAbc->pGia->vFlopClasses = Abc_ManReadBinary( pFileOut, "abstraction:" );
+ vCex = Abc_ManReadBinary( pFileOut, "counter-example:" );
+ if ( vCex )
+ {
+ int nFrames, nRemain;
+
+ nFrames = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) / Gia_ManPiNum(pAbc->pGia);
+ nRemain = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) % Gia_ManPiNum(pAbc->pGia);
+ if ( nRemain != 0 )
+ {
+ Vec_Int_t * vTemp;
+ Abc_Print( 1, "Adjusting counter-example by adding zeros for PIs without fanout.\n" );
+ // expand the counter-example to include PIs without fanout
+ vCex = Abc_ManExpandCex( pAbc->pGia, vTemp = vCex );
+ Vec_IntFree( vTemp );
+ }
+
+ nFrames = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) / Gia_ManPiNum(pAbc->pGia);
+ nRemain = (Vec_IntSize(vCex) - Gia_ManRegNum(pAbc->pGia)) % Gia_ManPiNum(pAbc->pGia);
+ if ( nRemain != 0 )
+ Abc_Print( 1, "Counter example has a wrong length.\n" );
+ else
+ {
+ extern int Gia_ManVerifyCounterExampleAllOuts( Gia_Man_t * pAig, Abc_Cex_t * p );
+
+ Abc_Print( 1, "Problem is satisfiable. Found counter-example in frame %d. ", nFrames-1 );
+ Abc_PrintTime( 1, "Time", clk );
+ ABC_FREE( pAbc->pCex );
+ pAbc->pCex = Gia_ManDeriveCexFromArray( pAbc->pGia, vCex, 0, nFrames-1 );
+
+// Gia_ManPrintCex( pAbc->pCex );
+
+// if ( !Gia_ManVerifyCounterExample( pAbc->pGia, pAbc->pCex, 0 ) )
+// Abc_Print( 1, "Generated counter-example is INVALID.\n" );
+
+ // remporary work-around to detect the output number - October 18, 2010
+ pAbc->pCex->iPo = Gia_ManVerifyCounterExampleAllOuts( pAbc->pGia, pAbc->pCex );
+ if ( pAbc->pCex->iPo == -1 )
+ {
+ Abc_Print( 1, "Generated counter-example is INVALID.\n" );
+ ABC_FREE( pAbc->pCex );
+ }
+ else
+ {
+ Abc_Print( 1, "Returned counter-example successfully verified in ABC.\n" );
+ }
+ }
+ Vec_IntFreeP( &vCex );
+ }
+ }
+
+
+
+ // clean up
+ if ( !fLeaveFiles )
+ {
+ remove( pFileIn );
+ remove( pFileOut );
+ }
+ ABC_FREE( pFileIn );
+ ABC_FREE( pFileOut );
+ return 0;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Cmd_CommandAbcLoadPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ FILE * pFile;
+ char pBuffer[1000];
+ char * pCommandLine;
+ char * pTempFile;
+ char * pStrDirBin, * pStrSection;
+ int fd, RetValue;
+
+ if ( argc != 3 )
+ {
+ Abc_Print( -1, "Wrong number of arguments.\n" );
+ goto usage;
+ }
+ // collect arguments
+ pStrDirBin = argv[argc-2];
+ pStrSection = argv[argc-1];
+
+ // check if the file exists
+ if ( (pFile = fopen( pStrDirBin, "r" )) == NULL )
+ {
+// Abc_Print( -1, "Cannot run the binary \"%s\".\n", pStrDirBin );
+// goto usage;
+ return 0;
+ }
+ fclose( pFile );
+
+ // create temp file
+ fd = tmpFile( "__abctmp_", ".txt", &pTempFile );
+ if ( fd == -1 )
+ {
+ Abc_Print( -1, "Cannot create a temporary file.\n" );
+ goto usage;
+ }
+#ifdef WIN32
+ _close( fd );
+#else
+ close( fd );
+#endif
+
+ // get command list
+ pCommandLine = ABC_ALLOC( char, 100 + strlen(pStrDirBin) + strlen(pTempFile) );
+// sprintf( pCommandLine, "%s -abc -list-commands > %s", pStrDirBin, pTempFile );
+ sprintf( pCommandLine, "%s -abc -list-commands > %s", pStrDirBin, pTempFile );
+ RetValue = system( pCommandLine );
+ if ( RetValue == -1 )
+ {
+ Abc_Print( -1, "Command \"%s\" did not succeed.\n", pCommandLine );
+ ABC_FREE( pCommandLine );
+ ABC_FREE( pTempFile );
+ goto usage;
+ }
+ ABC_FREE( pCommandLine );
+
+ // create commands
+ pFile = fopen( pTempFile, "r" );
+ if ( pFile == NULL )
+ {
+ Abc_Print( -1, "Cannot open file with the list of commands.\n" );
+ ABC_FREE( pTempFile );
+ goto usage;
+ }
+ while ( fgets( pBuffer, 1000, pFile ) != NULL )
+ {
+ if ( pBuffer[strlen(pBuffer)-1] == '\n' )
+ pBuffer[strlen(pBuffer)-1] = 0;
+ Cmd_CommandAdd( pAbc, pStrSection, pBuffer, Cmd_CommandAbcPlugIn, 1 );
+// plugin_commands.push(Pair(cmd_name, binary_name));
+ Vec_PtrPush( pAbc->vPlugInComBinPairs, strdup(pBuffer) );
+ Vec_PtrPush( pAbc->vPlugInComBinPairs, strdup(pStrDirBin) );
+ printf( "Creating command %s with binary %s\n", pBuffer, pStrDirBin );
+ }
+ fclose( pFile );
+ remove( pTempFile );
+ ABC_FREE( pTempFile );
+ return 0;
+usage:
+ Abc_Print( -2, "usage: load_plugin <plugin_dir\\binary_name> <section_name>\n" );
+ Abc_Print( -2, "\t loads external binary as a plugin\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c
index 1e4c7700..5fc663fc 100644
--- a/src/base/cmd/cmdUtils.c
+++ b/src/base/cmd/cmdUtils.c
@@ -18,10 +18,13 @@
***********************************************************************/
-#include "mainInt.h"
#include "abc.h"
+#include "mainInt.h"
#include "cmdInt.h"
-#include <ctype.h> // proper declaration of isspace
+#include <ctype.h>
+
+ABC_NAMESPACE_IMPL_START
+ // proper declaration of isspace
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -107,17 +110,24 @@ int CmdCommandDispatch( Abc_Frame_t * pAbc, int * pargc, char *** pargv )
// get the command
if ( !st_lookup( pAbc->tCommands, argv[0], (char **)&pCommand ) )
{ // the command is not in the table
-// fprintf( pAbc->Err, "** cmd error: unknown command '%s'\n", argv[0] );
-// return 1;
- // add command 'read' assuming that this is the file name
- argv2 = CmdAddToArgv( argc, argv );
- CmdFreeArgv( argc, argv );
- argc = argc+1;
- argv = argv2;
- *pargc = argc;
- *pargv = argv;
- if ( !st_lookup( pAbc->tCommands, argv[0], (char **)&pCommand ) )
- assert( 0 );
+ // if there is only one word with an extension, assume this is file to be read
+ if ( argc == 1 && strstr( argv[0], "." ) )
+ {
+ // add command 'read' assuming that this is the file name
+ argv2 = CmdAddToArgv( argc, argv );
+ CmdFreeArgv( argc, argv );
+ argc = argc+1;
+ argv = argv2;
+ *pargc = argc;
+ *pargv = argv;
+ if ( !st_lookup( pAbc->tCommands, argv[0], (char **)&pCommand ) )
+ assert( 0 );
+ }
+ else
+ {
+ fprintf( pAbc->Err, "** cmd error: unknown command '%s'\n", argv[0] );
+ return 1;
+ }
}
// get the backup network if the command is going to change the network
@@ -164,9 +174,10 @@ int CmdCommandDispatch( Abc_Frame_t * pAbc, int * pargc, char *** pargv )
SeeAlso []
***********************************************************************/
-char * CmdSplitLine( Abc_Frame_t * pAbc, char *sCommand, int *argc, char ***argv )
+const char * CmdSplitLine( Abc_Frame_t * pAbc, const char *sCommand, int *argc, char ***argv )
{
- char *p, *start, c;
+ const char *p, *start;
+ char c;
int i, j;
char *new_arg;
Vec_Ptr_t * vArgs;
@@ -252,7 +263,8 @@ char * CmdSplitLine( Abc_Frame_t * pAbc, char *sCommand, int *argc, char ***argv
int CmdApplyAlias( Abc_Frame_t * pAbc, int *argcp, char ***argvp, int *loop )
{
int i, argc, stopit, added, offset, did_subst, subst, fError, newc, j;
- char *arg, **argv, **newv;
+ const char *arg;
+ char **argv, **newv;
Abc_Alias *alias;
argc = *argcp;
@@ -519,9 +531,10 @@ void CmdCommandFree( Abc_Command * pCommand )
SeeAlso []
***********************************************************************/
-void CmdCommandPrint( Abc_Frame_t * pAbc, bool fPrintAll )
+void CmdCommandPrint( Abc_Frame_t * pAbc, int fPrintAll )
{
- char *key, *value;
+ const char *key;
+ char *value;
st_generator * gen;
Abc_Command ** ppCommands;
Abc_Command * pCommands;
@@ -555,7 +568,7 @@ void CmdCommandPrint( Abc_Frame_t * pAbc, bool fPrintAll )
nColumns = 79 / (LenghtMax + 2);
// print the starting message
- fprintf( pAbc->Out, " Welcome to ABC!" );
+ fprintf( pAbc->Out, " Welcome to ABC compiled on %s %s!", __DATE__, __TIME__ );
// print the command by group
sGroupCur = NULL;
@@ -654,12 +667,13 @@ int CmdNamePrintCompare( char ** ppC1, char ** ppC2 )
void CmdPrintTable( st_table * tTable, int fAliases )
{
st_generator * gen;
- char ** ppNames;
- char * key, * value;
+ const char ** ppNames;
+ const char * key;
+ char* value;
int nNames, i;
// collect keys in the array
- ppNames = ABC_ALLOC( char *, st_count(tTable) );
+ ppNames = ABC_ALLOC( const char *, st_count(tTable) );
nNames = 0;
st_foreach_item( tTable, gen, &key, &value )
ppNames[nNames++] = key;
@@ -683,3 +697,5 @@ void CmdPrintTable( st_table * tTable, int fAliases )
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/cmd/module.make b/src/base/cmd/module.make
index 1eca3f65..0277c760 100644
--- a/src/base/cmd/module.make
+++ b/src/base/cmd/module.make
@@ -3,4 +3,6 @@ SRC += src/base/cmd/cmd.c \
src/base/cmd/cmdApi.c \
src/base/cmd/cmdFlag.c \
src/base/cmd/cmdHist.c \
+ src/base/cmd/cmdLoad.c \
+ src/base/cmd/cmdPlugin.c \
src/base/cmd/cmdUtils.c
diff --git a/src/base/io/io.c b/src/base/io/io.c
index ecc6302f..eab865d8 100644
--- a/src/base/io/io.c
+++ b/src/base/io/io.c
@@ -21,6 +21,8 @@
#include "ioAbc.h"
#include "mainInt.h"
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -41,6 +43,7 @@ static int IoCommandReadTruth ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadVerilog ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadVer ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandReadVerLib ( Abc_Frame_t * pAbc, int argc, char **argv );
+static int IoCommandReadStatus ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandWrite ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandWriteHie ( Abc_Frame_t * pAbc, int argc, char **argv );
@@ -63,6 +66,10 @@ static int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandWriteVerLib ( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandWriteSortCnf( Abc_Frame_t * pAbc, int argc, char **argv );
static int IoCommandWriteTruth ( Abc_Frame_t * pAbc, int argc, char **argv );
+static int IoCommandWriteStatus ( Abc_Frame_t * pAbc, int argc, char **argv );
+static int IoCommandWriteSmv ( Abc_Frame_t * pAbc, int argc, char **argv );
+
+extern void Abc_FrameCopyLTLDataBase( Abc_Frame_t *pAbc, Abc_Ntk_t * pNtk );
extern int glo_fMapped;
@@ -99,6 +106,7 @@ void Io_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "I/O", "read_verilog", IoCommandReadVerilog, 1 );
// Cmd_CommandAdd( pAbc, "I/O", "read_ver", IoCommandReadVer, 1 );
// Cmd_CommandAdd( pAbc, "I/O", "read_verlib", IoCommandReadVerLib, 0 );
+ Cmd_CommandAdd( pAbc, "I/O", "read_status", IoCommandReadStatus, 0 );
Cmd_CommandAdd( pAbc, "I/O", "write", IoCommandWrite, 0 );
Cmd_CommandAdd( pAbc, "I/O", "write_hie", IoCommandWriteHie, 0 );
@@ -121,6 +129,8 @@ void Io_Init( Abc_Frame_t * pAbc )
// Cmd_CommandAdd( pAbc, "I/O", "write_verlib", IoCommandWriteVerLib, 0 );
Cmd_CommandAdd( pAbc, "I/O", "write_sorter_cnf", IoCommandWriteSortCnf, 0 );
Cmd_CommandAdd( pAbc, "I/O", "write_truth", IoCommandWriteTruth, 0 );
+ Cmd_CommandAdd( pAbc, "I/O", "write_status", IoCommandWriteStatus, 0 );
+ Cmd_CommandAdd( pAbc, "I/O", "write_smv", IoCommandWriteSmv, 0 );
}
/**Function*************************************************************
@@ -134,7 +144,7 @@ void Io_Init( Abc_Frame_t * pAbc )
SeeAlso []
***********************************************************************/
-void Io_End()
+void Io_End( Abc_Frame_t * pAbc )
{
}
@@ -189,6 +199,8 @@ int IoCommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameCopyLTLDataBase( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
@@ -246,11 +258,12 @@ int IoCommandReadAiger( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_aiger [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
+ fprintf( pAbc->Err, "\t reads the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -300,11 +313,12 @@ int IoCommandReadBaf( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_baf [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in Binary Aig Format (BAF)\n" );
+ fprintf( pAbc->Err, "\t reads the network in Binary Aig Format (BAF)\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -354,11 +368,12 @@ int IoCommandReadBblif( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_bblif [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in a binary BLIF format\n" );
+ fprintf( pAbc->Err, "\t reads the network in a binary BLIF format\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -382,16 +397,21 @@ int IoCommandReadBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
char * pFileName;
int fReadAsAig;
int fCheck;
+ int fUseNewParser;
int c;
extern Abc_Ntk_t * Io_ReadBlifAsAig( char * pFileName, int fCheck );
fCheck = 1;
fReadAsAig = 0;
+ fUseNewParser = 1;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "ach" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "nach" ) ) != EOF )
{
switch ( c )
{
+ case 'n':
+ fUseNewParser ^= 1;
+ break;
case 'a':
fReadAsAig ^= 1;
break;
@@ -411,8 +431,9 @@ int IoCommandReadBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
// read the file using the corresponding file reader
if ( fReadAsAig )
pNtk = Io_ReadBlifAsAig( pFileName, fCheck );
+ else if ( fUseNewParser )
+ pNtk = Io_Read( pFileName, IO_FILE_BLIF, fCheck );
else
-// pNtk = Io_Read( pFileName, IO_FILE_BLIF, fCheck );
{
Abc_Ntk_t * pTemp;
pNtk = Io_ReadBlif( pFileName, fCheck );
@@ -426,11 +447,14 @@ int IoCommandReadBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
- fprintf( pAbc->Err, "usage: read_blif [-ach] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in binary BLIF format\n" );
+ fprintf( pAbc->Err, "usage: read_blif [-nach] <file>\n" );
+ fprintf( pAbc->Err, "\t reads the network in binary BLIF format\n" );
+ fprintf( pAbc->Err, "\t (if this command does not work, try \"read\")\n" );
+ fprintf( pAbc->Err, "\t-n : toggle using old BLIF parser without hierarchy support [default = %s]\n", !fUseNewParser? "yes":"no" );
fprintf( pAbc->Err, "\t-a : toggle creating AIG while reading the file [default = %s]\n", fReadAsAig? "yes":"no" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
@@ -481,11 +505,13 @@ int IoCommandReadBlifMv( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_blif_mv [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in BLIF-MV format\n" );
+ fprintf( pAbc->Err, "\t reads the network in BLIF-MV format\n" );
+ fprintf( pAbc->Err, "\t (if this command does not work, try \"read\")\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -535,11 +561,12 @@ int IoCommandReadBench( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_bench [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in BENCH format\n" );
+ fprintf( pAbc->Err, "\t reads the network in BENCH format\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -590,6 +617,7 @@ int IoCommandReadDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
@@ -650,11 +678,12 @@ int IoCommandReadEdif( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_edif [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in EDIF (works only for ISCAS benchmarks)\n" );
+ fprintf( pAbc->Err, "\t reads the network in EDIF (works only for ISCAS benchmarks)\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -704,11 +733,12 @@ int IoCommandReadEqn( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_eqn [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in equation format\n" );
+ fprintf( pAbc->Err, "\t reads the network in equation format\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -732,7 +762,6 @@ int IoCommandReadInit( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t * pNtk;
char * pFileName;
int c;
- extern void Io_ReadBenchInit( Abc_Ntk_t * pNtk, char * pFileName );
pNtk = Abc_FrameReadNtk(pAbc);
pOut = Abc_FrameReadOut(pAbc);
@@ -773,6 +802,7 @@ int IoCommandReadInit( Abc_Frame_t * pAbc, int argc, char ** argv )
Io_ReadBenchInit( pNtk, pFileName );
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
@@ -844,11 +874,12 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_pla [-zch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in PLA\n" );
+ fprintf( pAbc->Err, "\t reads the network in PLA\n" );
fprintf( pAbc->Err, "\t-z : toggle reading on-set and off-set [default = %s]\n", fZeros? "off-set":"on-set" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
@@ -915,6 +946,7 @@ int IoCommandReadTruth( Abc_Frame_t * pAbc, int argc, char ** argv )
}
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
@@ -973,11 +1005,12 @@ int IoCommandReadVerilog( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_verilog [-mch] <file>\n" );
- fprintf( pAbc->Err, "\t read the network in Verilog (IWLS 2002/2005 subset)\n" );
+ fprintf( pAbc->Err, "\t reads the network in Verilog (IWLS 2002/2005 subset)\n" );
fprintf( pAbc->Err, "\t-m : toggle reading mapped Verilog [default = %s]\n", glo_fMapped? "yes":"no" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
@@ -1044,7 +1077,7 @@ int IoCommandReadVer( Abc_Frame_t * pAbc, int argc, char ** argv )
fclose( pFile );
// set the new network
- pDesign = Ver_ParseFile( pFileName, Abc_FrameReadLibVer(), fCheck, 1 );
+ pDesign = Ver_ParseFile( pFileName, (Abc_Lib_t *)Abc_FrameReadLibVer(), fCheck, 1 );
if ( pDesign == NULL )
{
fprintf( pAbc->Err, "Reading network from the verilog file has failed.\n" );
@@ -1061,7 +1094,7 @@ int IoCommandReadVer( Abc_Frame_t * pAbc, int argc, char ** argv )
}
// derive the AIG network from this design
- pNtkNew = Abc_LibDeriveAig( pNtk, Abc_FrameReadLibVer() );
+ pNtkNew = Abc_LibDeriveAig( pNtk, (Abc_Lib_t *)Abc_FrameReadLibVer() );
Abc_NtkDelete( pNtk );
if ( pNtkNew == NULL )
{
@@ -1070,11 +1103,12 @@ int IoCommandReadVer( Abc_Frame_t * pAbc, int argc, char ** argv )
}
// replace the current network
Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_ver [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read a network in structural verilog (using current library)\n" );
+ fprintf( pAbc->Err, "\t reads a network in structural verilog (using current library)\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -1144,14 +1178,15 @@ int IoCommandReadVerLib( Abc_Frame_t * pAbc, int argc, char ** argv )
printf( "The library contains %d gates.\n", st_count(pLibrary->tModules) );
// free old library
if ( Abc_FrameReadLibVer() )
- Abc_LibFree( Abc_FrameReadLibVer(), NULL );
+ Abc_LibFree( (Abc_Lib_t *)Abc_FrameReadLibVer(), NULL );
// read new library
Abc_FrameSetLibVer( pLibrary );
+ Abc_FrameClearVerifStatus( pAbc );
return 0;
usage:
fprintf( pAbc->Err, "usage: read_verlib [-ch] <file>\n" );
- fprintf( pAbc->Err, "\t read a gate library in structural verilog\n" );
+ fprintf( pAbc->Err, "\t reads a gate library in structural verilog\n" );
fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" );
fprintf( pAbc->Err, "\t-h : prints the command summary\n" );
fprintf( pAbc->Err, "\tfile : the name of a file to read\n" );
@@ -1170,6 +1205,65 @@ usage:
SeeAlso []
***********************************************************************/
+int IoCommandReadStatus( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ char * pFileName;
+ FILE * pFile;
+ int c;
+ extern int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex );
+
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( argc != globalUtilOptind + 1 )
+ {
+ goto usage;
+ }
+
+ // get the input file name
+ pFileName = argv[globalUtilOptind];
+ if ( (pFile = fopen( pFileName, "r" )) == NULL )
+ {
+ fprintf( pAbc->Err, "Cannot open input file \"%s\". \n", pFileName );
+ return 1;
+ }
+ fclose( pFile );
+
+ // set the new network
+ Abc_FrameClearVerifStatus( pAbc );
+ pAbc->Status = Abc_NtkReadLogFile( pFileName, &pAbc->pCex );
+ if ( pAbc->pCex )
+ pAbc->nFrames = pAbc->pCex->iFrame;
+ return 0;
+
+usage:
+ fprintf( pAbc->Err, "usage: read_status [-ch] <file>\n" );
+ fprintf( pAbc->Err, "\t reads verification log file\n" );
+ 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 IoCommandWrite( Abc_Frame_t * pAbc, int argc, char **argv )
{
char * pFileName;
@@ -1322,7 +1416,7 @@ int IoCommandWriteAiger( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_aiger [-sch] <file>\n" );
- fprintf( pAbc->Err, "\t write the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
+ fprintf( pAbc->Err, "\t writes the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
fprintf( pAbc->Err, "\t-s : toggle saving I/O names [default = %s]\n", fWriteSymbols? "yes" : "no" );
fprintf( pAbc->Err, "\t-c : toggle writing more compactly [default = %s]\n", fCompact? "yes" : "no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
@@ -1372,7 +1466,7 @@ int IoCommandWriteBaf( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_baf [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the network into a BLIF file\n" );
+ fprintf( pAbc->Err, "\t writes the network into a BLIF file\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .baf)\n" );
return 1;
@@ -1420,7 +1514,7 @@ int IoCommandWriteBblif( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_bblif [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the network into a binary BLIF file\n" );
+ fprintf( pAbc->Err, "\t writes the network into a binary BLIF file\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .bblif)\n" );
return 1;
@@ -1468,7 +1562,7 @@ int IoCommandWriteBlif( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_blif [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the network into a BLIF file\n" );
+ fprintf( pAbc->Err, "\t writes the network into a BLIF file\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .blif)\n" );
return 1;
@@ -1516,7 +1610,7 @@ int IoCommandWriteBlifMv( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_blif_mv [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the network into a BLIF-MV file\n" );
+ fprintf( pAbc->Err, "\t writes the network into a BLIF-MV file\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .mv)\n" );
return 1;
@@ -1580,7 +1674,7 @@ int IoCommandWriteBench( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_bench [-lh] <file>\n" );
- fprintf( pAbc->Err, "\t write the network in BENCH format\n" );
+ fprintf( pAbc->Err, "\t writes the network in BENCH format\n" );
fprintf( pAbc->Err, "\t-l : toggle using LUTs in the output [default = %s]\n", fUseLuts? "yes" : "no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .bench)\n" );
@@ -1623,7 +1717,7 @@ int IoCommandWriteBook( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_book [-h] <file> [-options]\n" );
- fprintf( pAbc->Err, "\t-h : print the help massage\n" );
+ fprintf( pAbc->Err, "\t-h : prints the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .aux, .nodes, .nets)\n" );
fprintf( pAbc->Err, "\t\n" );
fprintf( pAbc->Err, "\tThis command is developed by Myungchul Kim (University of Michigan).\n" );
@@ -1680,7 +1774,7 @@ int IoCommandWriteCellNet( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_cellnet [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the network is the cellnet format\n" );
+ fprintf( pAbc->Err, "\t writes the network is the cellnet format\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
@@ -1750,7 +1844,7 @@ int IoCommandWriteCnf( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_cnf [-nph] <file>\n" );
- fprintf( pAbc->Err, "\t write the miter cone into a CNF file\n" );
+ fprintf( pAbc->Err, "\t writes the miter cone into a CNF file\n" );
fprintf( pAbc->Err, "\t-n : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes" : "no" );
fprintf( pAbc->Err, "\t-p : toggle using all primes to enhance implicativity [default = %s]\n", fAllPrimes? "yes" : "no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
@@ -1800,14 +1894,19 @@ int IoCommandWriteDot( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_dot [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the current network into a DOT file\n" );
+ fprintf( pAbc->Err, "\t writes the current network into a DOT file\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
}
+ABC_NAMESPACE_IMPL_END
+
#include "fra.h"
+ABC_NAMESPACE_IMPL_START
+
+
/**Function*************************************************************
Synopsis []
@@ -1862,16 +1961,16 @@ int IoCommandWriteCounter( Abc_Frame_t * pAbc, int argc, char **argv )
// get the input file name
pFileName = argv[globalUtilOptind];
- if ( pNtk->pModel == NULL && pNtk->pSeqModel == NULL )
+ if ( pNtk->pModel == NULL && pAbc->pCex == NULL )
{
fprintf( pAbc->Out, "Counter-example is not available.\n" );
return 0;
}
// write the counter-example into the file
- if ( pNtk->pSeqModel )
+ if ( pAbc->pCex )
{
- Fra_Cex_t * pCex = pNtk->pSeqModel;
+ Abc_Cex_t * pCex = pAbc->pCex;
Abc_Obj_t * pObj;
FILE * pFile;
int i, f;
@@ -1919,7 +2018,7 @@ int IoCommandWriteCounter( Abc_Frame_t * pAbc, int argc, char **argv )
}
if ( fNames )
{
- char *cycle_ctr = forceSeq?"@0":"";
+ const char *cycle_ctr = forceSeq?"@0":"";
Abc_NtkForEachPi( pNtk, pObj, i )
// fprintf( pFile, "%s=%c\n", Abc_ObjName(pObj), '0'+(pNtk->pModel[i]==1) );
fprintf( pFile, "%s%s=%c\n", Abc_ObjName(pObj), cycle_ctr, '0'+(pNtk->pModel[i]==1) );
@@ -1989,7 +2088,7 @@ int IoCommandWriteEqn( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_eqn [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the current network in the equation format\n" );
+ fprintf( pAbc->Err, "\t writes the current network in the equation format\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
@@ -2037,7 +2136,7 @@ int IoCommandWriteGml( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_gml [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write network using graph representation formal GML\n" );
+ fprintf( pAbc->Err, "\t writes network using graph representation formal GML\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
@@ -2100,7 +2199,7 @@ int IoCommandWriteList( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_list [-nh] <file>\n" );
- fprintf( pAbc->Err, "\t write network using graph representation formal GML\n" );
+ fprintf( pAbc->Err, "\t writes network using graph representation formal GML\n" );
fprintf( pAbc->Err, "\t-n : toggle writing host node [default = %s]\n", fUseHost? "yes":"no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
@@ -2149,7 +2248,7 @@ int IoCommandWritePla( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_pla [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the collapsed network into a PLA file\n" );
+ fprintf( pAbc->Err, "\t writes the collapsed network into a PLA file\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
@@ -2197,7 +2296,7 @@ int IoCommandWriteVerilog( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_verilog [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the current network in Verilog format\n" );
+ fprintf( pAbc->Err, "\t writes the current network in Verilog format\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
@@ -2237,7 +2336,7 @@ int IoCommandWriteVerLib( Abc_Frame_t * pAbc, int argc, char **argv )
// get the input file name
pFileName = argv[globalUtilOptind];
// derive the netlist
- pLibrary = Abc_FrameReadLibVer();
+ pLibrary = (Abc_Lib_t *)Abc_FrameReadLibVer();
if ( pLibrary == NULL )
{
fprintf( pAbc->Out, "Verilog library is not specified.\n" );
@@ -2248,7 +2347,7 @@ int IoCommandWriteVerLib( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_verlib [-h] <file>\n" );
- fprintf( pAbc->Err, "\t write the current verilog library\n" );
+ fprintf( pAbc->Err, "\t writes the current verilog library\n" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;
@@ -2316,7 +2415,7 @@ int IoCommandWriteSortCnf( Abc_Frame_t * pAbc, int argc, char **argv )
usage:
fprintf( pAbc->Err, "usage: write_sorter_cnf [-N <num>] [-Q <num>] <file>\n" );
- fprintf( pAbc->Err, "\t write CNF for the sorter\n" );
+ fprintf( pAbc->Err, "\t writes CNF for the sorter\n" );
fprintf( pAbc->Err, "\t-N num : the number of sorter bits [default = %d]\n", nVars );
fprintf( pAbc->Err, "\t-Q num : the number of bits to be asserted to 1 [default = %d]\n", nQueens );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
@@ -2398,7 +2497,7 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
// convert to logic
Abc_NtkToAig( pNtk );
vTruth = Vec_IntAlloc( 0 );
- pTruth = Hop_ManConvertAigToTruth( pNtk->pManFunc, pNode->pData, Abc_ObjFaninNum(pNode), vTruth, fReverse );
+ pTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNtk->pManFunc, (Hop_Obj_t *)pNode->pData, Abc_ObjFaninNum(pNode), vTruth, fReverse );
pFile = fopen( pFileName, "w" );
if ( pFile == NULL )
{
@@ -2420,8 +2519,102 @@ usage:
return 1;
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int IoCommandWriteStatus( Abc_Frame_t * pAbc, int argc, char **argv )
+{
+ char * pFileName;
+ int c;
+ extern void Abc_NtkWriteLogFile( char * pFileName, Abc_Cex_t * pCex, int Status, char * pCommand );
+
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( argc != globalUtilOptind + 1 )
+ goto usage;
+ // get the input file name
+ pFileName = argv[globalUtilOptind];
+ Abc_NtkWriteLogFile( pFileName, pAbc->pCex, pAbc->Status, NULL );
+ return 0;
+
+usage:
+ fprintf( pAbc->Err, "usage: write_status [-h] <file>\n" );
+ fprintf( pAbc->Err, "\t writes verification log file\n" );
+ fprintf( pAbc->Err, "\t-h : print the help massage\n" );
+ fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int IoCommandWriteSmv( Abc_Frame_t * pAbc, int argc, char **argv )
+{
+ char * pFileName;
+ int fUseLuts;
+ int c;
+
+ fUseLuts = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pNtkCur == NULL )
+ {
+ fprintf( pAbc->Out, "Empty network.\n" );
+ return 0;
+ }
+ if ( argc != globalUtilOptind + 1 )
+ goto usage;
+ // get the output file name
+ pFileName = argv[globalUtilOptind];
+ // call the corresponding file writer
+ Io_Write( pAbc->pNtkCur, pFileName, IO_FILE_SMV );
+ return 0;
+
+usage:
+ fprintf( pAbc->Err, "usage: write_smv [-h] <file>\n" );
+ fprintf( pAbc->Err, "\t write the network in SMV format\n" );
+ fprintf( pAbc->Err, "\t-h : print the help message\n" );
+ fprintf( pAbc->Err, "\tfile : the name of the file to write (extension .smv)\n" );
+ return 1;
+}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioAbc.h b/src/base/io/ioAbc.h
index bade17df..b1835dbf 100644
--- a/src/base/io/ioAbc.h
+++ b/src/base/io/ioAbc.h
@@ -21,6 +21,7 @@
#ifndef __IO_H__
#define __IO_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -31,9 +32,10 @@
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+
+ABC_NAMESPACE_HEADER_START
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
@@ -56,6 +58,7 @@ typedef enum {
IO_FILE_GML,
IO_FILE_LIST,
IO_FILE_PLA,
+ IO_FILE_SMV,
IO_FILE_VERILOG,
IO_FILE_UNKNOWN
} Io_FileType_t;
@@ -82,6 +85,7 @@ extern Abc_Ntk_t * Io_ReadBlif( char * pFileName, int fCheck );
extern Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck );
/*=== abcReadBench.c ==========================================================*/
extern Abc_Ntk_t * Io_ReadBench( char * pFileName, int fCheck );
+extern void Io_ReadBenchInit( Abc_Ntk_t * pNtk, char * pFileName );
/*=== abcReadEdif.c ===========================================================*/
extern Abc_Ntk_t * Io_ReadEdif( char * pFileName, int fCheck );
/*=== abcReadEqn.c ============================================================*/
@@ -98,12 +102,12 @@ extern void Io_WriteBaf( Abc_Ntk_t * pNtk, char * pFileName );
extern void Io_WriteBblif( Abc_Ntk_t * pNtk, char * pFileName );
/*=== abcWriteBlif.c ==========================================================*/
extern void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches );
-extern void Io_WriteBlif( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches );
+extern void Io_WriteBlif( Abc_Ntk_t * pNtk, char * pFileName, int fWriteLatches, int fBb2Wb, int fSeq );
extern void Io_WriteTimingInfo( FILE * pFile, Abc_Ntk_t * pNtk );
/*=== abcWriteBlifMv.c ==========================================================*/
extern void Io_WriteBlifMv( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcWriteBench.c =========================================================*/
-extern int Io_WriteBench( Abc_Ntk_t * pNtk, char * FileName );
+extern int Io_WriteBench( Abc_Ntk_t * pNtk, const char * FileName );
extern int Io_WriteBenchLut( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcWriteBook.c =========================================================*/
extern void Io_WriteBook( Abc_Ntk_t * pNtk, char * FileName );
@@ -121,6 +125,8 @@ extern void Io_WriteGml( Abc_Ntk_t * pNtk, char * pFileName );
extern void Io_WriteList( Abc_Ntk_t * pNtk, char * pFileName, int fUseHost );
/*=== abcWritePla.c ===========================================================*/
extern int Io_WritePla( Abc_Ntk_t * pNtk, char * FileName );
+/*=== abcWriteSmv.c ===========================================================*/
+extern int Io_WriteSmv( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcWriteVerilog.c =======================================================*/
extern void Io_WriteVerilog( Abc_Ntk_t * pNtk, char * FileName );
/*=== abcUtil.c ===============================================================*/
@@ -136,15 +142,17 @@ extern Abc_Obj_t * Io_ReadCreateLatch( Abc_Ntk_t * pNtk, char * pNetLI, c
extern Abc_Obj_t * Io_ReadCreateResetLatch( Abc_Ntk_t * pNtk, int fBlifMv );
extern Abc_Obj_t * Io_ReadCreateResetMux( Abc_Ntk_t * pNtk, char * pResetLO, char * pDataLI, int fBlifMv );
extern Abc_Obj_t * Io_ReadCreateNode( Abc_Ntk_t * pNtk, char * pNameOut, char * pNamesIn[], int nInputs );
-extern Abc_Obj_t * Io_ReadCreateConst( Abc_Ntk_t * pNtk, char * pName, bool fConst1 );
+extern Abc_Obj_t * Io_ReadCreateConst( Abc_Ntk_t * pNtk, char * pName, int fConst1 );
extern Abc_Obj_t * Io_ReadCreateInv( Abc_Ntk_t * pNtk, char * pNameIn, char * pNameOut );
extern Abc_Obj_t * Io_ReadCreateBuf( Abc_Ntk_t * pNtk, char * pNameIn, char * pNameOut );
extern FILE * Io_FileOpen( const char * FileName, const char * PathVar, const char * Mode, int fVerbose );
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif
diff --git a/src/base/io/ioInt.h b/src/base/io/ioInt.h
index 3daf3c75..9ded63e4 100644
--- a/src/base/io/ioInt.h
+++ b/src/base/io/ioInt.h
@@ -21,6 +21,10 @@
#ifndef __IO_INT_H__
#define __IO_INT_H__
+
+ABC_NAMESPACE_HEADER_START
+
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -41,6 +45,10 @@
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_HEADER_END
+
#endif
////////////////////////////////////////////////////////////////////////
diff --git a/src/base/io/ioReadAiger.c b/src/base/io/ioReadAiger.c
index 85475204..61d2967b 100644
--- a/src/base/io/ioReadAiger.c
+++ b/src/base/io/ioReadAiger.c
@@ -21,10 +21,13 @@
// The code in this file is developed in collaboration with Mark Jarvin of Toronto.
-#include "ioAbc.h"
#include "bzlib.h"
+#include "ioAbc.h"
#include "zlib.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -190,7 +193,7 @@ static char * Ioa_ReadLoadFileBz2Aig( char * pFileName, int * pFileSize )
static char * Ioa_ReadLoadFileGzAig( char * pFileName, int * pFileSize )
{
const int READ_BLOCK_SIZE = 100000;
- FILE * pFile;
+ gzFile pFile;
char * pContents;
int amtRead, readBlock, nFileSize = READ_BLOCK_SIZE;
pFile = gzopen( pFileName, "rb" ); // if pFileName doesn't end in ".gz" then this acts as a passthrough to fopen
@@ -340,10 +343,10 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck )
uLit1 = uLit - Io_ReadAigerDecode( &pCur );
uLit0 = uLit1 - Io_ReadAigerDecode( &pCur );
// assert( uLit1 > uLit0 );
- pNode0 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, uLit0 >> 1), uLit0 & 1 );
- pNode1 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, uLit1 >> 1), uLit1 & 1 );
+ pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, uLit0 >> 1), uLit0 & 1 );
+ pNode1 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, uLit1 >> 1), uLit1 & 1 );
assert( Vec_PtrSize(vNodes) == i + 1 + nInputs + nLatches );
- Vec_PtrPush( vNodes, Abc_AigAnd(pNtkNew->pManFunc, pNode0, pNode1) );
+ Vec_PtrPush( vNodes, Abc_AigAnd((Abc_Aig_t *)pNtkNew->pManFunc, pNode0, pNode1) );
}
Extra_ProgressBarStop( pProgress );
@@ -357,14 +360,14 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck )
Abc_NtkForEachLatchInput( pNtkNew, pObj, i )
{
uLit0 = atoi( pCur ); while ( *pCur++ != '\n' );
- pNode0 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );//^ (uLit0 < 2) );
+ pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );//^ (uLit0 < 2) );
Abc_ObjAddFanin( pObj, pNode0 );
}
// read the PO driver literals
Abc_NtkForEachPo( pNtkNew, pObj, i )
{
uLit0 = atoi( pCur ); while ( *pCur++ != '\n' );
- pNode0 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );//^ (uLit0 < 2) );
+ pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );//^ (uLit0 < 2) );
Abc_ObjAddFanin( pObj, pNode0 );
}
}
@@ -374,14 +377,14 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck )
Abc_NtkForEachLatchInput( pNtkNew, pObj, i )
{
uLit0 = Vec_IntEntry( vLits, i );
- pNode0 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );
+ pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );
Abc_ObjAddFanin( pObj, pNode0 );
}
// read the PO driver literals
Abc_NtkForEachPo( pNtkNew, pObj, i )
{
uLit0 = Vec_IntEntry( vLits, i+Abc_NtkLatchNum(pNtkNew) );
- pNode0 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );
+ pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, uLit0 >> 1), (uLit0 & 1) );
Abc_ObjAddFanin( pObj, pNode0 );
}
Vec_IntFree( vLits );
@@ -415,7 +418,7 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck )
fprintf( stdout, "The number of terminal is out of bound.\n" );
return NULL;
}
- pObj = Vec_PtrEntry( vTerms, iTerm );
+ pObj = (Abc_Obj_t *)Vec_PtrEntry( vTerms, iTerm );
if ( *pType == 'l' )
pObj = Abc_ObjFanout0(pObj);
// assign the name
@@ -481,7 +484,7 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck )
Vec_PtrFree( vNodes );
// remove the extra nodes
- Abc_AigCleanup( pNtkNew->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtkNew->pManFunc );
// check the result
if ( fCheck && !Abc_NtkCheckRead( pNtkNew ) )
@@ -500,3 +503,5 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadBaf.c b/src/base/io/ioReadBaf.c
index 495f122b..95c63539 100644
--- a/src/base/io/ioReadBaf.c
+++ b/src/base/io/ioReadBaf.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -128,9 +131,9 @@ Abc_Ntk_t * Io_ReadBaf( char * pFileName, int fCheck )
for ( i = 0; i < nAnds; i++ )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
- pNode0 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, pBufferNode[2*i+0] >> 1), pBufferNode[2*i+0] & 1 );
- pNode1 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, pBufferNode[2*i+1] >> 1), pBufferNode[2*i+1] & 1 );
- Vec_PtrPush( vNodes, Abc_AigAnd(pNtkNew->pManFunc, pNode0, pNode1) );
+ pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, pBufferNode[2*i+0] >> 1), pBufferNode[2*i+0] & 1 );
+ pNode1 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, pBufferNode[2*i+1] >> 1), pBufferNode[2*i+1] & 1 );
+ Vec_PtrPush( vNodes, Abc_AigAnd((Abc_Aig_t *)pNtkNew->pManFunc, pNode0, pNode1) );
}
Extra_ProgressBarStop( pProgress );
@@ -143,14 +146,14 @@ Abc_Ntk_t * Io_ReadBaf( char * pFileName, int fCheck )
Abc_ObjSetData( Abc_ObjFanout0(pObj), (void *)(ABC_PTRINT_T)(Num & 3) );
Num >>= 2;
}
- pNode0 = Abc_ObjNotCond( Vec_PtrEntry(vNodes, Num >> 1), Num & 1 );
+ pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, Num >> 1), Num & 1 );
Abc_ObjAddFanin( pObj, pNode0 );
}
ABC_FREE( pContents );
Vec_PtrFree( vNodes );
// remove the extra nodes
-// Abc_AigCleanup( pNtkNew->pManFunc );
+// Abc_AigCleanup( (Abc_Aig_t *)pNtkNew->pManFunc );
// check the result
if ( fCheck && !Abc_NtkCheckRead( pNtkNew ) )
@@ -169,3 +172,5 @@ Abc_Ntk_t * Io_ReadBaf( char * pFileName, int fCheck )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadBblif.c b/src/base/io/ioReadBblif.c
index 84ef1e29..e2fcca43 100644
--- a/src/base/io/ioReadBblif.c
+++ b/src/base/io/ioReadBblif.c
@@ -22,6 +22,9 @@
#include "dec.h"
#include "bblif.h"
+ABC_NAMESPACE_IMPL_START
+
+
// For description of Binary BLIF format, refer to "abc/src/aig/bbl/bblif.h"
////////////////////////////////////////////////////////////////////////
@@ -70,13 +73,13 @@ Abc_Ntk_t * Bbl_ManToAbc( Bbl_Man_t * p )
pObjNew = Abc_NtkCreateNode( pNtk );
else assert( 0 );
if ( Bbl_ObjIsLut(pObj) )
- pObjNew->pData = Abc_SopRegister( pNtk->pManFunc, Bbl_ObjSop(p, pObj) );
+ pObjNew->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, Bbl_ObjSop(p, pObj) );
Vec_PtrSetEntry( vCopy, Bbl_ObjId(pObj), pObjNew );
}
// connect objects
Bbl_ManForEachObj( p, pObj )
Bbl_ObjForEachFanin( pObj, pFanin )
- Abc_ObjAddFanin( Vec_PtrEntry(vCopy, Bbl_ObjId(pObj)), Vec_PtrEntry(vCopy, Bbl_ObjId(pFanin)) );
+ Abc_ObjAddFanin( (Abc_Obj_t *)Vec_PtrEntry(vCopy, Bbl_ObjId(pObj)), (Abc_Obj_t *)Vec_PtrEntry(vCopy, Bbl_ObjId(pFanin)) );
// finalize
Vec_PtrFree( vCopy );
Abc_NtkAddDummyPiNames( pNtk );
@@ -185,7 +188,7 @@ clk = clock();
// create internal nodes
vNodes = Bbl_ManDfs( p );
vFaninAigs = Vec_PtrAlloc( 100 );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Bbl_Obj_t *, vNodes, pObj, i )
{
// collect fanin AIGs
Vec_PtrClear( vFaninAigs );
@@ -204,10 +207,10 @@ ABC_PRT( "AIG", clock() - clk );
{
if ( !Bbl_ObjIsOutput(pObj) )
continue;
- pObjNew = Vec_PtrEntry( vCopy, Bbl_ObjId(Bbl_ObjFaninFirst(pObj)) );
+ pObjNew = (Abc_Obj_t *)Vec_PtrEntry( vCopy, Bbl_ObjId(Bbl_ObjFaninFirst(pObj)) );
Abc_ObjAddFanin( Abc_NtkCreatePo(pNtk), pObjNew );
}
- Abc_AigCleanup( pNtk->pManFunc );
+ Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
// clear factored forms
for ( i = Bbl_ManFncSize(p) - 1; i >= 0; i-- )
if ( pFForms[i] )
@@ -340,3 +343,5 @@ Abc_Ntk_t * Io_ReadBblif( char * pFileName, int fCheck )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadBench.c b/src/base/io/ioReadBench.c
index e7a2d2fe..681a4e36 100644
--- a/src/base/io/ioReadBench.c
+++ b/src/base/io/ioReadBench.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -95,7 +98,7 @@ Abc_Ntk_t * Io_ReadBenchNetwork( Extra_FileReader_t * p )
// go through the lines of the file
vString = Vec_StrAlloc( 100 );
pProgress = Extra_ProgressBarStart( stdout, Extra_FileReaderGetFileSize(p) );
- for ( iLine = 0; (vTokens = Extra_FileReaderGetTokens(p)); iLine++ )
+ for ( iLine = 0; (vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p)); iLine++ )
{
Extra_ProgressBarUpdate( pProgress, Extra_FileReaderGetCurPosition(p), NULL );
@@ -108,17 +111,17 @@ Abc_Ntk_t * Io_ReadBenchNetwork( Extra_FileReader_t * p )
}
// get the type of the line
- if ( strncmp( vTokens->pArray[0], "INPUT", 5 ) == 0 )
- Io_ReadCreatePi( pNtk, vTokens->pArray[1] );
- else if ( strncmp( vTokens->pArray[0], "OUTPUT", 5 ) == 0 )
- Io_ReadCreatePo( pNtk, vTokens->pArray[1] );
+ if ( strncmp( (char *)vTokens->pArray[0], "INPUT", 5 ) == 0 )
+ Io_ReadCreatePi( pNtk, (char *)vTokens->pArray[1] );
+ else if ( strncmp( (char *)vTokens->pArray[0], "OUTPUT", 5 ) == 0 )
+ Io_ReadCreatePo( pNtk, (char *)vTokens->pArray[1] );
else
{
// get the node name and the node type
- pType = vTokens->pArray[1];
+ pType = (char *)vTokens->pArray[1];
if ( strncmp(pType, "DFF", 3) == 0 ) // works for both DFF and DFFRSE
{
- pNode = Io_ReadCreateLatch( pNtk, vTokens->pArray[2], vTokens->pArray[0] );
+ pNode = Io_ReadCreateLatch( pNtk, (char *)vTokens->pArray[2], (char *)vTokens->pArray[0] );
// Abc_LatchSetInit0( pNode );
if ( pType[3] == '0' )
Abc_LatchSetInit0( pNode );
@@ -141,7 +144,7 @@ Abc_Ntk_t * Io_ReadBenchNetwork( Extra_FileReader_t * p )
return NULL;
}
// get the hex string
- pString = vTokens->pArray[2];
+ pString = (char *)vTokens->pArray[2];
if ( strncmp( pString, "0x", 2 ) )
{
printf( "%s: The LUT signature (%s) does not look like a hexadecimal beginning with \"0x\".\n", Extra_FileReaderGetFileName(p), pString );
@@ -172,25 +175,25 @@ Abc_Ntk_t * Io_ReadBenchNetwork( Extra_FileReader_t * p )
// check if the node is a constant node
if ( Extra_TruthIsConst0(uTruth, nNames) )
{
- pNode = Io_ReadCreateNode( pNtk, vTokens->pArray[0], ppNames, 0 );
- Abc_ObjSetData( pNode, Abc_SopRegister( pNtk->pManFunc, " 0\n" ) );
+ pNode = Io_ReadCreateNode( pNtk, (char *)vTokens->pArray[0], ppNames, 0 );
+ Abc_ObjSetData( pNode, Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, " 0\n" ) );
}
else if ( Extra_TruthIsConst1(uTruth, nNames) )
{
- pNode = Io_ReadCreateNode( pNtk, vTokens->pArray[0], ppNames, 0 );
- Abc_ObjSetData( pNode, Abc_SopRegister( pNtk->pManFunc, " 1\n" ) );
+ pNode = Io_ReadCreateNode( pNtk, (char *)vTokens->pArray[0], ppNames, 0 );
+ Abc_ObjSetData( pNode, Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, " 1\n" ) );
}
else
{
// create the node
- pNode = Io_ReadCreateNode( pNtk, vTokens->pArray[0], ppNames, nNames );
+ pNode = Io_ReadCreateNode( pNtk, (char *)vTokens->pArray[0], ppNames, nNames );
assert( nNames > 0 );
if ( nNames > 1 )
- Abc_ObjSetData( pNode, Abc_SopCreateFromTruth(pNtk->pManFunc, nNames, uTruth) );
+ Abc_ObjSetData( pNode, Abc_SopCreateFromTruth((Extra_MmFlex_t *)pNtk->pManFunc, nNames, uTruth) );
else if ( pString[0] == '2' )
- Abc_ObjSetData( pNode, Abc_SopCreateBuf(pNtk->pManFunc) );
+ Abc_ObjSetData( pNode, Abc_SopCreateBuf((Extra_MmFlex_t *)pNtk->pManFunc) );
else if ( pString[0] == '1' )
- Abc_ObjSetData( pNode, Abc_SopCreateInv(pNtk->pManFunc) );
+ Abc_ObjSetData( pNode, Abc_SopCreateInv((Extra_MmFlex_t *)pNtk->pManFunc) );
else
{
printf( "%s: Reading truth table (%s) of single-input node has failed.\n", Extra_FileReaderGetFileName(p), pString );
@@ -205,31 +208,31 @@ Abc_Ntk_t * Io_ReadBenchNetwork( Extra_FileReader_t * p )
// create a new node and add it to the network
ppNames = (char **)vTokens->pArray + 2;
nNames = vTokens->nSize - 2;
- pNode = Io_ReadCreateNode( pNtk, vTokens->pArray[0], ppNames, nNames );
+ pNode = Io_ReadCreateNode( pNtk, (char *)vTokens->pArray[0], ppNames, nNames );
// assign the cover
if ( strcmp(pType, "AND") == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateAnd(pNtk->pManFunc, nNames, NULL) );
+ Abc_ObjSetData( pNode, Abc_SopCreateAnd((Extra_MmFlex_t *)pNtk->pManFunc, nNames, NULL) );
else if ( strcmp(pType, "OR") == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateOr(pNtk->pManFunc, nNames, NULL) );
+ Abc_ObjSetData( pNode, Abc_SopCreateOr((Extra_MmFlex_t *)pNtk->pManFunc, nNames, NULL) );
else if ( strcmp(pType, "NAND") == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateNand(pNtk->pManFunc, nNames) );
+ Abc_ObjSetData( pNode, Abc_SopCreateNand((Extra_MmFlex_t *)pNtk->pManFunc, nNames) );
else if ( strcmp(pType, "NOR") == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateNor(pNtk->pManFunc, nNames) );
+ Abc_ObjSetData( pNode, Abc_SopCreateNor((Extra_MmFlex_t *)pNtk->pManFunc, nNames) );
else if ( strcmp(pType, "XOR") == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateXor(pNtk->pManFunc, nNames) );
+ Abc_ObjSetData( pNode, Abc_SopCreateXor((Extra_MmFlex_t *)pNtk->pManFunc, nNames) );
else if ( strcmp(pType, "NXOR") == 0 || strcmp(pType, "XNOR") == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateNxor(pNtk->pManFunc, nNames) );
+ Abc_ObjSetData( pNode, Abc_SopCreateNxor((Extra_MmFlex_t *)pNtk->pManFunc, nNames) );
else if ( strncmp(pType, "BUF", 3) == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateBuf(pNtk->pManFunc) );
+ Abc_ObjSetData( pNode, Abc_SopCreateBuf((Extra_MmFlex_t *)pNtk->pManFunc) );
else if ( strcmp(pType, "NOT") == 0 )
- Abc_ObjSetData( pNode, Abc_SopCreateInv(pNtk->pManFunc) );
+ Abc_ObjSetData( pNode, Abc_SopCreateInv((Extra_MmFlex_t *)pNtk->pManFunc) );
else if ( strncmp(pType, "MUX", 3) == 0 )
// Abc_ObjSetData( pNode, Abc_SopRegister(pNtk->pManFunc, "1-0 1\n-11 1\n") );
- Abc_ObjSetData( pNode, Abc_SopRegister(pNtk->pManFunc, "0-1 1\n11- 1\n") );
+ Abc_ObjSetData( pNode, Abc_SopRegister((Extra_MmFlex_t *)pNtk->pManFunc, "0-1 1\n11- 1\n") );
else if ( strncmp(pType, "gnd", 3) == 0 )
- Abc_ObjSetData( pNode, Abc_SopRegister( pNtk->pManFunc, " 0\n" ) );
+ Abc_ObjSetData( pNode, Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, " 0\n" ) );
else if ( strncmp(pType, "vdd", 3) == 0 )
- Abc_ObjSetData( pNode, Abc_SopRegister( pNtk->pManFunc, " 1\n" ) );
+ Abc_ObjSetData( pNode, Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, " 1\n" ) );
else
{
printf( "Io_ReadBenchNetwork(): Cannot determine gate type \"%s\" in line %d.\n", pType, Extra_FileReaderGetLineNumber(p, 0) );
@@ -359,3 +362,5 @@ void Io_ReadBenchInit( Abc_Ntk_t * pNtk, char * pFileName )
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadBlif.c b/src/base/io/ioReadBlif.c
index f2c3e8c2..06920afe 100644
--- a/src/base/io/ioReadBlif.c
+++ b/src/base/io/ioReadBlif.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -128,7 +131,7 @@ Abc_Ntk_t * Io_ReadBlifNetwork( Io_ReadBlif_t * p )
// read the name of the master network
p->vTokens = Io_ReadBlifGetTokens(p);
- if ( p->vTokens == NULL || strcmp( p->vTokens->pArray[0], ".model" ) )
+ if ( p->vTokens == NULL || strcmp( (char *)p->vTokens->pArray[0], ".model" ) )
{
p->LineCur = 0;
sprintf( p->sError, "Wrong input file format." );
@@ -144,7 +147,7 @@ Abc_Ntk_t * Io_ReadBlifNetwork( Io_ReadBlif_t * p )
pNtk = Io_ReadBlifNetworkOne( p );
if ( pNtk == NULL )
break;
- if ( p->vTokens && strcmp(p->vTokens->pArray[0], ".exdc") == 0 )
+ if ( p->vTokens && strcmp((char *)p->vTokens->pArray[0], ".exdc") == 0 )
{
pNtk->pExdc = Io_ReadBlifNetworkOne( p );
Abc_NtkFinalizeRead( pNtk->pExdc );
@@ -171,7 +174,7 @@ Abc_Ntk_t * Io_ReadBlifNetwork( Io_ReadBlif_t * p )
}
// add the network to the hierarchy
if ( pNtkMaster->tName2Model == NULL )
- pNtkMaster->tName2Model = stmm_init_table(strcmp, stmm_strhash);
+ pNtkMaster->tName2Model = stmm_init_table((int (*)(void))strcmp, (int (*)(void))stmm_strhash);
stmm_insert( pNtkMaster->tName2Model, pNtk->pName, (char *)pNtk );
*/
}
@@ -217,7 +220,7 @@ Abc_Ntk_t * Io_ReadBlifNetworkOne( Io_ReadBlif_t * p )
// create the new network
p->pNtkCur = pNtk = Abc_NtkAlloc( ABC_NTK_NETLIST, ABC_FUNC_SOP, 1 );
// read the model name
- if ( strcmp( p->vTokens->pArray[0], ".model" ) == 0 )
+ if ( strcmp( (char *)p->vTokens->pArray[0], ".model" ) == 0 )
{
char * pToken, * pPivot;
if ( Vec_PtrSize(p->vTokens) != 2 )
@@ -227,12 +230,12 @@ Abc_Ntk_t * Io_ReadBlifNetworkOne( Io_ReadBlif_t * p )
Io_ReadBlifPrintErrorMessage( p );
return NULL;
}
- for ( pPivot = pToken = Vec_PtrEntry(p->vTokens, 1); *pToken; pToken++ )
+ for ( pPivot = pToken = (char *)Vec_PtrEntry(p->vTokens, 1); *pToken; pToken++ )
if ( *pToken == '/' || *pToken == '\\' )
pPivot = pToken+1;
pNtk->pName = Extra_UtilStrsav( pPivot );
}
- else if ( strcmp( p->vTokens->pArray[0], ".exdc" ) != 0 )
+ else if ( strcmp( (char *)p->vTokens->pArray[0], ".exdc" ) != 0 )
{
printf( "%s: File parsing skipped after line %d (\"%s\").\n", p->pFileName,
Extra_FileReaderGetLineNumber(p->pReader, 0), (char*)p->vTokens->pArray[0] );
@@ -252,7 +255,7 @@ Abc_Ntk_t * Io_ReadBlifNetworkOne( Io_ReadBlif_t * p )
// consider different line types
fTokensReady = 0;
- pDirective = p->vTokens->pArray[0];
+ pDirective = (char *)p->vTokens->pArray[0];
if ( !strcmp( pDirective, ".names" ) )
{ fStatus = Io_ReadBlifNetworkNames( p, &p->vTokens ); fTokensReady = 1; }
else if ( !strcmp( pDirective, ".gate" ) )
@@ -282,7 +285,7 @@ Abc_Ntk_t * Io_ReadBlifNetworkOne( Io_ReadBlif_t * p )
{
pNtk->ntkType = ABC_NTK_NETLIST;
pNtk->ntkFunc = ABC_FUNC_BLACKBOX;
- Extra_MmFlexStop( pNtk->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)pNtk->pManFunc );
pNtk->pManFunc = NULL;
}
else
@@ -317,7 +320,7 @@ int Io_ReadBlifNetworkInputs( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
{
int i;
for ( i = 1; i < vTokens->nSize; i++ )
- Io_ReadCreatePi( p->pNtkCur, vTokens->pArray[i] );
+ Io_ReadCreatePi( p->pNtkCur, (char *)vTokens->pArray[i] );
return 0;
}
@@ -336,7 +339,7 @@ int Io_ReadBlifNetworkOutputs( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
{
int i;
for ( i = 1; i < vTokens->nSize; i++ )
- Io_ReadCreatePo( p->pNtkCur, vTokens->pArray[i] );
+ Io_ReadCreatePo( p->pNtkCur, (char *)vTokens->pArray[i] );
return 0;
}
@@ -355,7 +358,7 @@ int Io_ReadBlifNetworkAsserts( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
{
int i;
for ( i = 1; i < vTokens->nSize; i++ )
- Io_ReadCreateAssert( p->pNtkCur, vTokens->pArray[i] );
+ Io_ReadCreateAssert( p->pNtkCur, (char *)vTokens->pArray[i] );
return 0;
}
@@ -383,13 +386,13 @@ int Io_ReadBlifNetworkLatch( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
return 1;
}
// create the latch
- pLatch = Io_ReadCreateLatch( pNtk, vTokens->pArray[1], vTokens->pArray[2] );
+ pLatch = Io_ReadCreateLatch( pNtk, (char *)vTokens->pArray[1], (char *)vTokens->pArray[2] );
// get the latch reset value
if ( vTokens->nSize == 3 )
Abc_LatchSetInitDc( pLatch );
else
{
- ResetValue = atoi(vTokens->pArray[vTokens->nSize-1]);
+ ResetValue = atoi((char *)vTokens->pArray[vTokens->nSize-1]);
if ( ResetValue != 0 && ResetValue != 1 && ResetValue != 2 )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -447,7 +450,7 @@ int Io_ReadBlifNetworkNames( Io_ReadBlif_t * p, Vec_Ptr_t ** pvTokens )
{
while ( (vTokens = Io_ReadBlifGetTokens(p)) )
{
- pToken = vTokens->pArray[0];
+ pToken = (char *)vTokens->pArray[0];
if ( pToken[0] == '.' )
break;
// read the cube
@@ -469,7 +472,7 @@ int Io_ReadBlifNetworkNames( Io_ReadBlif_t * p, Vec_Ptr_t ** pvTokens )
{
while ( (vTokens = Io_ReadBlifGetTokens(p)) )
{
- pToken = vTokens->pArray[0];
+ pToken = (char *)vTokens->pArray[0];
if ( pToken[0] == '.' )
break;
// read the cube
@@ -481,7 +484,7 @@ int Io_ReadBlifNetworkNames( Io_ReadBlif_t * p, Vec_Ptr_t ** pvTokens )
return 1;
}
// create the cube
- Vec_StrAppend( p->vCubes, vTokens->pArray[0] );
+ Vec_StrPrintStr( p->vCubes, (char *)vTokens->pArray[0] );
// check the char
Char = ((char *)vTokens->pArray[1])[0];
if ( Char != '0' && Char != '1' && Char != 'x' && Char != 'n' )
@@ -507,14 +510,14 @@ int Io_ReadBlifNetworkNames( Io_ReadBlif_t * p, Vec_Ptr_t ** pvTokens )
Vec_StrPush( p->vCubes, 0 );
// set the pointer to the functionality of the node
- Abc_ObjSetData( pNode, Abc_SopRegister(pNtk->pManFunc, p->vCubes->pArray) );
+ Abc_ObjSetData( pNode, Abc_SopRegister((Extra_MmFlex_t *)pNtk->pManFunc, p->vCubes->pArray) );
// check the size
- if ( Abc_ObjFaninNum(pNode) != Abc_SopGetVarNum(Abc_ObjData(pNode)) )
+ if ( Abc_ObjFaninNum(pNode) != Abc_SopGetVarNum((char *)Abc_ObjData(pNode)) )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
sprintf( p->sError, "The number of fanins (%d) of node %s is different from SOP size (%d).",
- Abc_ObjFaninNum(pNode), Abc_ObjName(Abc_ObjFanout(pNode,0)), Abc_SopGetVarNum(Abc_ObjData(pNode)) );
+ Abc_ObjFaninNum(pNode), Abc_ObjName(Abc_ObjFanout(pNode,0)), Abc_SopGetVarNum((char *)Abc_ObjData(pNode)) );
Io_ReadBlifPrintErrorMessage( p );
return 1;
}
@@ -548,7 +551,7 @@ int Io_ReadBlifReorderFormalNames( Vec_Ptr_t * vTokens, Mio_Gate_t * pGate )
{
pNamePin = Mio_PinReadName(pGatePin);
Length = strlen(pNamePin);
- pName = Vec_PtrEntry(vTokens, i+2);
+ pName = (char *)Vec_PtrEntry(vTokens, i+2);
if ( !strncmp( pNamePin, pName, Length ) && pName[Length] == '=' )
continue;
break;
@@ -562,7 +565,7 @@ int Io_ReadBlifReorderFormalNames( Vec_Ptr_t * vTokens, Mio_Gate_t * pGate )
Length = strlen(pNamePin);
for ( k = 2; k < nSize; k++ )
{
- pName = Vec_PtrEntry(vTokens, k);
+ pName = (char *)Vec_PtrEntry(vTokens, k);
if ( !strncmp( pNamePin, pName, Length ) && pName[Length] == '=' )
{
Vec_PtrPush( vTokens, pName );
@@ -574,7 +577,7 @@ int Io_ReadBlifReorderFormalNames( Vec_Ptr_t * vTokens, Mio_Gate_t * pGate )
Length = strlen(pNamePin);
for ( k = 2; k < nSize; k++ )
{
- pName = Vec_PtrEntry(vTokens, k);
+ pName = (char *)Vec_PtrEntry(vTokens, k);
if ( !strncmp( pNamePin, pName, Length ) && pName[Length] == '=' )
{
Vec_PtrPush( vTokens, pName );
@@ -583,7 +586,7 @@ int Io_ReadBlifReorderFormalNames( Vec_Ptr_t * vTokens, Mio_Gate_t * pGate )
}
if ( Vec_PtrSize(vTokens) - nSize != nSize - 2 )
return 0;
- Vec_PtrForEachEntryStart( vTokens, pName, k, nSize )
+ Vec_PtrForEachEntryStart( char *, vTokens, pName, k, nSize )
Vec_PtrWriteEntry( vTokens, k - nSize + 2, pName );
Vec_PtrShrink( vTokens, nSize );
return 1;
@@ -609,7 +612,7 @@ int Io_ReadBlifNetworkGate( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
int i, nNames;
// check that the library is available
- pGenlib = Abc_FrameReadLibGen();
+ pGenlib = (Mio_Library_t *)Abc_FrameReadLibGen();
if ( pGenlib == NULL )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -628,7 +631,7 @@ int Io_ReadBlifNetworkGate( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
}
// get the gate
- pGate = Mio_LibraryReadGateByName( pGenlib, vTokens->pArray[1] );
+ pGate = Mio_LibraryReadGateByName( pGenlib, (char *)vTokens->pArray[1] );
if ( pGate == NULL )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -642,7 +645,7 @@ int Io_ReadBlifNetworkGate( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
{
assert( p->pNtkCur->ntkFunc == ABC_FUNC_SOP );
p->pNtkCur->ntkFunc = ABC_FUNC_MAP;
- Extra_MmFlexStop( p->pNtkCur->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)p->pNtkCur->pManFunc );
p->pNtkCur->pManFunc = pGenlib;
}
@@ -659,7 +662,7 @@ int Io_ReadBlifNetworkGate( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
// remove the formal parameter names
for ( i = 2; i < vTokens->nSize; i++ )
{
- vTokens->pArray[i] = Io_ReadBlifCleanName( vTokens->pArray[i] );
+ vTokens->pArray[i] = Io_ReadBlifCleanName( (char *)vTokens->pArray[i] );
if ( vTokens->pArray[i] == NULL )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -708,7 +711,7 @@ int Io_ReadBlifNetworkSubcircuit( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
// store the names of formal/actual inputs/outputs of the box
vNames = Vec_PtrAlloc( 10 );
- Vec_PtrForEachEntryStart( vTokens, pName, i, 1 )
+ Vec_PtrForEachEntryStart( char *, vTokens, pName, i, 1 )
// Vec_PtrPush( vNames, Abc_NtkRegisterName(p->pNtkCur, pName) );
Vec_PtrPush( vNames, Extra_UtilStrsav(pName) ); // memory leak!!!
@@ -717,7 +720,7 @@ int Io_ReadBlifNetworkSubcircuit( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
// set the pointer to the node names
Abc_ObjSetData( pBox, vNames );
// remember the line of the file
- pBox->pCopy = (void *)(ABC_PTRINT_T)Extra_FileReaderGetLineNumber(p->pReader, 0);
+ pBox->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Extra_FileReaderGetLineNumber(p->pReader, 0);
return 0;
}
@@ -758,9 +761,9 @@ int Io_ReadBlifNetworkInputArrival( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
Abc_Obj_t * pNet;
char * pFoo1, * pFoo2;
double TimeRise, TimeFall;
-
+
// make sure this is indeed the .inputs line
- assert( strncmp( vTokens->pArray[0], ".input_arrival", 14 ) == 0 );
+ assert( strncmp( (char *)vTokens->pArray[0], ".input_arrival", 14 ) == 0 );
if ( vTokens->nSize != 4 )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -768,7 +771,7 @@ int Io_ReadBlifNetworkInputArrival( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
Io_ReadBlifPrintErrorMessage( p );
return 1;
}
- pNet = Abc_NtkFindNet( p->pNtkCur, vTokens->pArray[1] );
+ pNet = Abc_NtkFindNet( p->pNtkCur, (char *)vTokens->pArray[1] );
if ( pNet == NULL )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -776,8 +779,8 @@ int Io_ReadBlifNetworkInputArrival( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
Io_ReadBlifPrintErrorMessage( p );
return 1;
}
- TimeRise = strtod( vTokens->pArray[2], &pFoo1 );
- TimeFall = strtod( vTokens->pArray[3], &pFoo2 );
+ TimeRise = strtod( (char *)vTokens->pArray[2], &pFoo1 );
+ TimeFall = strtod( (char *)vTokens->pArray[3], &pFoo2 );
if ( *pFoo1 != '\0' || *pFoo2 != '\0' )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -807,7 +810,7 @@ int Io_ReadBlifNetworkDefaultInputArrival( Io_ReadBlif_t * p, Vec_Ptr_t * vToken
double TimeRise, TimeFall;
// make sure this is indeed the .inputs line
- assert( strncmp( vTokens->pArray[0], ".default_input_arrival", 23 ) == 0 );
+ assert( strncmp( (char *)vTokens->pArray[0], ".default_input_arrival", 23 ) == 0 );
if ( vTokens->nSize != 3 )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -815,8 +818,8 @@ int Io_ReadBlifNetworkDefaultInputArrival( Io_ReadBlif_t * p, Vec_Ptr_t * vToken
Io_ReadBlifPrintErrorMessage( p );
return 1;
}
- TimeRise = strtod( vTokens->pArray[1], &pFoo1 );
- TimeFall = strtod( vTokens->pArray[2], &pFoo2 );
+ TimeRise = strtod( (char *)vTokens->pArray[1], &pFoo1 );
+ TimeFall = strtod( (char *)vTokens->pArray[2], &pFoo2 );
if ( *pFoo1 != '\0' || *pFoo2 != '\0' )
{
p->LineCur = Extra_FileReaderGetLineNumber(p->pReader, 0);
@@ -875,12 +878,12 @@ Vec_Ptr_t * Io_ReadBlifGetTokens( Io_ReadBlif_t * p )
}
// get the new tokens
- vTokens = Extra_FileReaderGetTokens(p->pReader);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p->pReader);
if ( vTokens == NULL )
return vTokens;
// check if there is a transfer to another line
- pLastToken = vTokens->pArray[vTokens->nSize - 1];
+ pLastToken = (char *)vTokens->pArray[vTokens->nSize - 1];
if ( pLastToken[ strlen(pLastToken)-1 ] != '\\' )
return vTokens;
@@ -890,17 +893,17 @@ Vec_Ptr_t * Io_ReadBlifGetTokens( Io_ReadBlif_t * p )
vTokens->nSize--;
// load them into the new array
for ( i = 0; i < vTokens->nSize; i++ )
- Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav(vTokens->pArray[i]) );
+ Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav((char *)vTokens->pArray[i]) );
// load as long as there is the line break
while ( 1 )
{
// get the new tokens
- vTokens = Extra_FileReaderGetTokens(p->pReader);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p->pReader);
if ( vTokens->nSize == 0 )
return p->vNewTokens;
// check if there is a transfer to another line
- pLastToken = vTokens->pArray[vTokens->nSize - 1];
+ pLastToken = (char *)vTokens->pArray[vTokens->nSize - 1];
if ( pLastToken[ strlen(pLastToken)-1 ] == '\\' )
{
// remove the slash
@@ -909,12 +912,12 @@ Vec_Ptr_t * Io_ReadBlifGetTokens( Io_ReadBlif_t * p )
vTokens->nSize--;
// load them into the new array
for ( i = 0; i < vTokens->nSize; i++ )
- Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav(vTokens->pArray[i]) );
+ Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav((char *)vTokens->pArray[i]) );
continue;
}
// otherwise, load them and break
for ( i = 0; i < vTokens->nSize; i++ )
- Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav(vTokens->pArray[i]) );
+ Vec_PtrPush( p->vNewTokens, Extra_UtilStrsav((char *)vTokens->pArray[i]) );
break;
}
return p->vNewTokens;
@@ -993,8 +996,8 @@ int Io_ReadBlifNetworkConnectBoxesOneBox( Io_ReadBlif_t * p, Abc_Obj_t * pBox, s
int i, Length, Start = -1;
// get the model for this box
- pNames = pBox->pData;
- if ( !stmm_lookup( tName2Model, Vec_PtrEntry(pNames, 0), (char **)&pNtkModel ) )
+ pNames = (Vec_Ptr_t *)pBox->pData;
+ if ( !stmm_lookup( tName2Model, (char *)Vec_PtrEntry(pNames, 0), (char **)&pNtkModel ) )
{
p->LineCur = (int)(ABC_PTRINT_T)pBox->pCopy;
sprintf( p->sError, "Cannot find the model for subcircuit %s.", (char*)Vec_PtrEntry(pNames, 0) );
@@ -1009,7 +1012,7 @@ int Io_ReadBlifNetworkConnectBoxesOneBox( Io_ReadBlif_t * p, Abc_Obj_t * pBox, s
Start = 1;
else
{
- Vec_PtrForEachEntryStart( pNames, pName, i, 1 )
+ Vec_PtrForEachEntryStart( char *, pNames, pName, i, 1 )
{
pActual = Io_ReadBlifCleanName(pName);
if ( pActual == NULL )
@@ -1047,7 +1050,7 @@ int Io_ReadBlifNetworkConnectBoxesOneBox( Io_ReadBlif_t * p, Abc_Obj_t * pBox, s
Io_ReadBlifPrintErrorMessage( p );
return 1;
}
- pObj->pCopy = (void *)pActual;
+ pObj->pCopy = (Abc_Obj_t *)pActual;
// quit if we processed all PIs
if ( i == Abc_NtkPiNum(pNtkModel) )
{
@@ -1059,7 +1062,7 @@ int Io_ReadBlifNetworkConnectBoxesOneBox( Io_ReadBlif_t * p, Abc_Obj_t * pBox, s
// create the fanins of the box
Abc_NtkForEachPi( pNtkModel, pObj, i )
{
- pActual = (void *)pObj->pCopy;
+ pActual = (char *)pObj->pCopy;
if ( pActual == NULL )
{
p->LineCur = (int)(ABC_PTRINT_T)pBox->pCopy;
@@ -1076,7 +1079,7 @@ int Io_ReadBlifNetworkConnectBoxesOneBox( Io_ReadBlif_t * p, Abc_Obj_t * pBox, s
// create the fanouts of the box
Abc_NtkForEachPo( pNtkModel, pObj, i )
pObj->pCopy = NULL;
- Vec_PtrForEachEntryStart( pNames, pName, i, Start )
+ Vec_PtrForEachEntryStart( char *, pNames, pName, i, Start )
{
pActual = Io_ReadBlifCleanName(pName);
if ( pActual == NULL )
@@ -1106,12 +1109,12 @@ int Io_ReadBlifNetworkConnectBoxesOneBox( Io_ReadBlif_t * p, Abc_Obj_t * pBox, s
Io_ReadBlifPrintErrorMessage( p );
return 1;
}
- pObj->pCopy = (void *)pActual;
+ pObj->pCopy = (Abc_Obj_t *)pActual;
}
// create the fanouts of the box
Abc_NtkForEachPo( pNtkModel, pObj, i )
{
- pActual = (void *)pObj->pCopy;
+ pActual = (char *)pObj->pCopy;
if ( pActual == NULL )
{
p->LineCur = (int)(ABC_PTRINT_T)pBox->pCopy;
@@ -1126,9 +1129,9 @@ int Io_ReadBlifNetworkConnectBoxesOneBox( Io_ReadBlif_t * p, Abc_Obj_t * pBox, s
pObj->pCopy = NULL;
// remove the array of names, assign the pointer to the model
- Vec_PtrForEachEntry( pBox->pData, pName, i )
+ Vec_PtrForEachEntry( char *, (Vec_Ptr_t *)pBox->pData, pName, i )
ABC_FREE( pName );
- Vec_PtrFree( pBox->pData );
+ Vec_PtrFree( (Vec_Ptr_t *)pBox->pData );
pBox->pData = pNtkModel;
return 0;
}
@@ -1191,3 +1194,5 @@ int Io_ReadBlifNetworkConnectBoxes( Io_ReadBlif_t * p, Abc_Ntk_t * pNtkMaster )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadBlifAig.c b/src/base/io/ioReadBlifAig.c
index 8d4c77d4..caa776f9 100644
--- a/src/base/io/ioReadBlifAig.c
+++ b/src/base/io/ioReadBlifAig.c
@@ -22,6 +22,9 @@
#include "extra.h"
#include "vecPtr.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -60,7 +63,7 @@ struct Io_BlifMan_t_
// temporary objects
Io_BlifObj_t * pObjects; // the storage for objects
int nObjects; // the number of objects allocated
- int iObjNext; // the next ABC_FREE object
+ int iObjNext; // the next free object
// file lines
char * pModel; // .model line
Vec_Ptr_t * vInputs; // .inputs lines
@@ -347,7 +350,7 @@ static int Io_BlifGetLine( Io_BlifMan_t * p, char * pToken )
{
char * pLine;
int i;
- Vec_PtrForEachEntry( p->vLines, pLine, i )
+ Vec_PtrForEachEntry( char *, p->vLines, pLine, i )
if ( pToken < pLine )
return i;
return -1;
@@ -369,7 +372,7 @@ static int Io_BlifEstimatePiNum( Io_BlifMan_t * p )
char * pCur;
int i, fSpaces;
int Counter = 0;
- Vec_PtrForEachEntry( p->vInputs, pCur, i )
+ Vec_PtrForEachEntry( char *, p->vInputs, pCur, i )
for ( fSpaces = 0; *pCur; pCur++ )
{
if ( Io_BlifCharIsSpace(*pCur) )
@@ -493,7 +496,7 @@ static void Io_BlifReadPreparse( Io_BlifMan_t * p )
}
// unfold the line extensions and sort lines by directive
- Vec_PtrForEachEntry( p->vLines, pCur, i )
+ Vec_PtrForEachEntry( char *, p->vLines, pCur, i )
{
if ( *pCur == 0 )
continue;
@@ -569,19 +572,19 @@ static Abc_Ntk_t * Io_BlifParse( Io_BlifMan_t * p )
if ( !Io_BlifParseModel( p, p->pModel ) )
return NULL;
// parse the inputs
- Vec_PtrForEachEntry( p->vInputs, pLine, i )
+ Vec_PtrForEachEntry( char *, p->vInputs, pLine, i )
if ( !Io_BlifParseInputs( p, pLine ) )
return NULL;
// parse the outputs
- Vec_PtrForEachEntry( p->vOutputs, pLine, i )
+ Vec_PtrForEachEntry( char *, p->vOutputs, pLine, i )
if ( !Io_BlifParseOutputs( p, pLine ) )
return NULL;
// parse the latches
- Vec_PtrForEachEntry( p->vLatches, pLine, i )
+ Vec_PtrForEachEntry( char *, p->vLatches, pLine, i )
if ( !Io_BlifParseLatch( p, pLine ) )
return NULL;
// parse the nodes
- Vec_PtrForEachEntry( p->vNames, pLine, i )
+ Vec_PtrForEachEntry( char *, p->vNames, pLine, i )
if ( !Io_BlifParseNames( p, pLine ) )
return NULL;
// reconstruct the network from the parsed data
@@ -608,14 +611,14 @@ static int Io_BlifParseModel( Io_BlifMan_t * p, char * pLine )
{
char * pToken;
Io_BlifSplitIntoTokens( p->vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry( p->vTokens, 0 );
+ pToken = (char *)Vec_PtrEntry( p->vTokens, 0 );
assert( !strcmp(pToken, "model") );
if ( Vec_PtrSize(p->vTokens) != 2 )
{
sprintf( p->sError, "Line %d: Model line has %d entries while it should have 2.", Io_BlifGetLine(p, pToken), Vec_PtrSize(p->vTokens) );
return 0;
}
- p->pModel = Vec_PtrEntry( p->vTokens, 1 );
+ p->pModel = (char *)Vec_PtrEntry( p->vTokens, 1 );
return 1;
}
@@ -636,9 +639,9 @@ static int Io_BlifParseInputs( Io_BlifMan_t * p, char * pLine )
char * pToken;
int i;
Io_BlifSplitIntoTokens( p->vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry(p->vTokens, 0);
+ pToken = (char *)Vec_PtrEntry(p->vTokens, 0);
assert( !strcmp(pToken, "inputs") );
- Vec_PtrForEachEntryStart( p->vTokens, pToken, i, 1 )
+ Vec_PtrForEachEntryStart( char *, p->vTokens, pToken, i, 1 )
{
pObj = Io_BlifHashFindOrAdd( p, pToken );
if ( pObj->fPi )
@@ -669,9 +672,9 @@ static int Io_BlifParseOutputs( Io_BlifMan_t * p, char * pLine )
char * pToken;
int i;
Io_BlifSplitIntoTokens( p->vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry(p->vTokens, 0);
+ pToken = (char *)Vec_PtrEntry(p->vTokens, 0);
assert( !strcmp(pToken, "outputs") );
- Vec_PtrForEachEntryStart( p->vTokens, pToken, i, 1 )
+ Vec_PtrForEachEntryStart( char *, p->vTokens, pToken, i, 1 )
{
pObj = Io_BlifHashFindOrAdd( p, pToken );
if ( pObj->fPo )
@@ -699,7 +702,7 @@ static int Io_BlifParseLatch( Io_BlifMan_t * p, char * pLine )
char * pToken;
int Init;
Io_BlifSplitIntoTokens( p->vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry(p->vTokens,0);
+ pToken = (char *)Vec_PtrEntry(p->vTokens,0);
assert( !strcmp(pToken, "latch") );
if ( Vec_PtrSize(p->vTokens) < 3 )
{
@@ -708,7 +711,7 @@ static int Io_BlifParseLatch( Io_BlifMan_t * p, char * pLine )
}
// get initial value
if ( Vec_PtrSize(p->vTokens) > 3 )
- Init = atoi( Vec_PtrEntry(p->vTokens,3) );
+ Init = atoi( (char *)Vec_PtrEntry(p->vTokens,3) );
else
Init = 2;
if ( Init < 0 || Init > 2 )
@@ -723,12 +726,12 @@ static int Io_BlifParseLatch( Io_BlifMan_t * p, char * pLine )
else // if ( Init == 2 )
Init = IO_BLIF_INIT_DC;
// get latch input
- pObj = Io_BlifHashFindOrAdd( p, Vec_PtrEntry(p->vTokens,1) );
+ pObj = Io_BlifHashFindOrAdd( p, (char *)Vec_PtrEntry(p->vTokens,1) );
pObj->fLi = 1;
Vec_PtrPush( p->vLis, pObj );
pObj->Init = Init;
// get latch output
- pObj = Io_BlifHashFindOrAdd( p, Vec_PtrEntry(p->vTokens,2) );
+ pObj = Io_BlifHashFindOrAdd( p, (char *)Vec_PtrEntry(p->vTokens,2) );
if ( pObj->fPi )
{
sprintf( p->sError, "Line %d: Primary input (%s) is also defined latch output.", Io_BlifGetLine(p, pToken), (char*)Vec_PtrEntry(p->vTokens,2) );
@@ -761,8 +764,8 @@ static int Io_BlifParseNames( Io_BlifMan_t * p, char * pLine )
Io_BlifObj_t * pObj;
char * pName;
Io_BlifSplitIntoTokens( p->vTokens, pLine, '\0' );
- assert( !strcmp(Vec_PtrEntry(p->vTokens,0), "names") );
- pName = Vec_PtrEntryLast( p->vTokens );
+ assert( !strcmp((char *)Vec_PtrEntry(p->vTokens,0), "names") );
+ pName = (char *)Vec_PtrEntryLast( p->vTokens );
pObj = Io_BlifHashFindOrAdd( p, pName );
if ( pObj->fPi )
{
@@ -811,7 +814,7 @@ static Abc_Obj_t * Io_BlifParseTable( Io_BlifMan_t * p, char * pTable, Vec_Ptr_t
return Abc_ObjNot( Abc_AigConst1(p->pAig) );
if ( Vec_PtrSize(p->vTokens) == 1 )
{
- pOutput = Vec_PtrEntry( p->vTokens, 0 );
+ pOutput = (char *)Vec_PtrEntry( p->vTokens, 0 );
if ( ((pOutput[0] - '0') & 0x8E) || pOutput[1] )
{
sprintf( p->sError, "Line %d: Constant table has wrong output value (%s).", Io_BlifGetLine(p, pOutput), pOutput );
@@ -819,7 +822,7 @@ static Abc_Obj_t * Io_BlifParseTable( Io_BlifMan_t * p, char * pTable, Vec_Ptr_t
}
return Abc_ObjNotCond( Abc_AigConst1(p->pAig), pOutput[0] == '0' );
}
- pProduct = Vec_PtrEntry( p->vTokens, 0 );
+ pProduct = (char *)Vec_PtrEntry( p->vTokens, 0 );
if ( Vec_PtrSize(p->vTokens) % 2 == 1 )
{
sprintf( p->sError, "Line %d: Table has odd number of tokens (%d).", Io_BlifGetLine(p, pProduct), Vec_PtrSize(p->vTokens) );
@@ -829,8 +832,8 @@ static Abc_Obj_t * Io_BlifParseTable( Io_BlifMan_t * p, char * pTable, Vec_Ptr_t
pRes = Abc_ObjNot( Abc_AigConst1(p->pAig) );
for ( i = 0; i < Vec_PtrSize(p->vTokens)/2; i++ )
{
- pProduct = Vec_PtrEntry( p->vTokens, 2*i + 0 );
- pOutput = Vec_PtrEntry( p->vTokens, 2*i + 1 );
+ pProduct = (char *)Vec_PtrEntry( p->vTokens, 2*i + 0 );
+ pOutput = (char *)Vec_PtrEntry( p->vTokens, 2*i + 1 );
if ( strlen(pProduct) != (unsigned)Vec_PtrSize(vFanins) )
{
sprintf( p->sError, "Line %d: Cube (%s) has size different from the fanin count (%d).", Io_BlifGetLine(p, pProduct), pProduct, Vec_PtrSize(vFanins) );
@@ -853,16 +856,16 @@ static Abc_Obj_t * Io_BlifParseTable( Io_BlifMan_t * p, char * pTable, Vec_Ptr_t
for ( k = 0; pProduct[k]; k++ )
{
if ( pProduct[k] == '0' )
- pCube = Abc_AigAnd( p->pAig->pManFunc, pCube, Abc_ObjNot(Vec_PtrEntry(vFanins,k)) );
+ pCube = Abc_AigAnd( (Abc_Aig_t *)p->pAig->pManFunc, pCube, Abc_ObjNot((Abc_Obj_t *)Vec_PtrEntry(vFanins,k)) );
else if ( pProduct[k] == '1' )
- pCube = Abc_AigAnd( p->pAig->pManFunc, pCube, Vec_PtrEntry(vFanins,k) );
+ pCube = Abc_AigAnd( (Abc_Aig_t *)p->pAig->pManFunc, pCube, (Abc_Obj_t *)Vec_PtrEntry(vFanins,k) );
else if ( pProduct[k] != '-' )
{
sprintf( p->sError, "Line %d: Product term (%s) contains character (%c).", Io_BlifGetLine(p, pProduct), pProduct, pProduct[k] );
return NULL;
}
}
- pRes = Abc_AigOr( p->pAig->pManFunc, pRes, pCube );
+ pRes = Abc_AigOr( (Abc_Aig_t *)p->pAig->pManFunc, pRes, pCube );
}
pRes = Abc_ObjNotCond( pRes, Polarity == 0 );
return pRes;
@@ -901,13 +904,13 @@ static Abc_Obj_t * Io_BlifParseConstruct_rec( Io_BlifMan_t * p, char * pName )
}
// check if the AIG is already constructed
if ( pObjIo->pEquiv )
- return pObjIo->pEquiv;
+ return (Abc_Obj_t *)pObjIo->pEquiv;
// mark this node on the path
pObjIo->fLoop = 1;
// construct the AIGs for the fanins
vFanins = Vec_PtrAlloc( 8 );
Io_BlifCollectTokens( vFanins, pObjIo->pName - pObjIo->Offset, pObjIo->pName );
- Vec_PtrForEachEntry( vFanins, pNameFanin, i )
+ Vec_PtrForEachEntry( char *, vFanins, pNameFanin, i )
{
pFaninAbc = Io_BlifParseConstruct_rec( p, pNameFanin );
if ( pFaninAbc == NULL )
@@ -923,7 +926,7 @@ static Abc_Obj_t * Io_BlifParseConstruct_rec( Io_BlifMan_t * p, char * pName )
// unmark this node on the path
pObjIo->fLoop = 0;
// remember the new node
- return pObjIo->pEquiv;
+ return (Abc_Obj_t *)pObjIo->pEquiv;
}
/**Function*************************************************************
@@ -948,24 +951,24 @@ static int Io_BlifParseConstruct( Io_BlifMan_t * p )
pAig->pName = Extra_UtilStrsav( p->pModel );
pAig->pSpec = Extra_UtilStrsav( p->pFileName );
// create PIs
- Vec_PtrForEachEntry( p->vPis, pObjIo, i )
+ Vec_PtrForEachEntry( Io_BlifObj_t *, p->vPis, pObjIo, i )
{
pObj = Abc_NtkCreatePi( pAig );
Abc_ObjAssignName( pObj, pObjIo->pName, NULL );
pObjIo->pEquiv = pObj;
}
// create POs
- Vec_PtrForEachEntry( p->vPos, pObjIo, i )
+ Vec_PtrForEachEntry( Io_BlifObj_t *, p->vPos, pObjIo, i )
{
pObj = Abc_NtkCreatePo( pAig );
Abc_ObjAssignName( pObj, pObjIo->pName, NULL );
}
// create latches
- Vec_PtrForEachEntry( p->vLos, pObjIo, i )
+ Vec_PtrForEachEntry( Io_BlifObj_t *, p->vLos, pObjIo, i )
{
// add the latch input terminal
pObj = Abc_NtkCreateBi( pAig );
- pObjIoInput = Vec_PtrEntry( p->vLis, i );
+ pObjIoInput = (Io_BlifObj_t *)Vec_PtrEntry( p->vLis, i );
Abc_ObjAssignName( pObj, pObjIoInput->pName, NULL );
// add the latch box
@@ -983,7 +986,7 @@ static int Io_BlifParseConstruct( Io_BlifMan_t * p )
pObjIo->pEquiv = pObj;
}
// traverse the nodes from the POs
- Vec_PtrForEachEntry( p->vPos, pObjIo, i )
+ Vec_PtrForEachEntry( Io_BlifObj_t *, p->vPos, pObjIo, i )
{
pObj = Io_BlifParseConstruct_rec( p, pObjIo->pName );
if ( pObj == NULL )
@@ -991,7 +994,7 @@ static int Io_BlifParseConstruct( Io_BlifMan_t * p )
Abc_ObjAddFanin( Abc_NtkPo(p->pAig, i), pObj );
}
// traverse the nodes from the latch inputs
- Vec_PtrForEachEntry( p->vLis, pObjIo, i )
+ Vec_PtrForEachEntry( Io_BlifObj_t *, p->vLis, pObjIo, i )
{
pObj = Io_BlifParseConstruct_rec( p, pObjIo->pName );
if ( pObj == NULL )
@@ -1011,3 +1014,5 @@ static int Io_BlifParseConstruct( Io_BlifMan_t * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadBlifMv.c b/src/base/io/ioReadBlifMv.c
index 2e2388d3..c73f8d92 100644
--- a/src/base/io/ioReadBlifMv.c
+++ b/src/base/io/ioReadBlifMv.c
@@ -23,6 +23,8 @@
#include "vecPtr.h"
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -33,6 +35,8 @@ typedef struct Io_MvVar_t_ Io_MvVar_t; // parsing var
typedef struct Io_MvMod_t_ Io_MvMod_t; // parsing model
typedef struct Io_MvMan_t_ Io_MvMan_t; // parsing manager
+Vec_Ptr_t *vGlobalLtlArray;
+
struct Io_MvVar_t_
{
int nValues; // the number of values
@@ -46,12 +50,15 @@ struct Io_MvMod_t_
Vec_Ptr_t * vInputs; // .inputs lines
Vec_Ptr_t * vOutputs; // .outputs lines
Vec_Ptr_t * vLatches; // .latch lines
+ Vec_Ptr_t * vFlops; // .flop lines
Vec_Ptr_t * vResets; // .reset lines
Vec_Ptr_t * vNames; // .names lines
Vec_Ptr_t * vSubckts; // .subckt lines
Vec_Ptr_t * vShorts; // .short lines
Vec_Ptr_t * vOnehots; // .onehot lines
Vec_Ptr_t * vMvs; // .mv lines
+ Vec_Ptr_t * vConstrs; // .constraint lines
+ Vec_Ptr_t * vLtlProperties;
int fBlackBox; // indicates blackbox model
// the resulting network
Abc_Ntk_t * pNtk;
@@ -97,13 +104,16 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p );
static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineInputs( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineOutputs( Io_MvMod_t * p, char * pLine );
+static int Io_MvParseLineConstrs( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineLatch( Io_MvMod_t * p, char * pLine );
+static int Io_MvParseLineFlop( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineSubckt( Io_MvMod_t * p, char * pLine );
static Vec_Int_t * Io_MvParseLineOnehot( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineMv( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineNamesMv( Io_MvMod_t * p, char * pLine, int fReset );
static int Io_MvParseLineNamesBlif( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineShortBlif( Io_MvMod_t * p, char * pLine );
+static int Io_MvParseLineLtlProperty( Io_MvMod_t * p, char * pLine );
static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens );
static Io_MvVar_t * Abc_NtkMvVarDup( Abc_Ntk_t * pNtk, Io_MvVar_t * pVar );
@@ -135,6 +145,7 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
Abc_Lib_t * pDesign = NULL;
char * pDesignName;
int RetValue, i;
+ char * pLtlProp;
// check that the file is available
pFile = fopen( pFileName, "rb" );
@@ -161,10 +172,11 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
p->pDesign = Abc_LibCreate( pDesignName );
ABC_FREE( pDesignName );
// free the HOP manager
- Hop_ManStop( p->pDesign->pManFunc );
+ Hop_ManStop( (Hop_Man_t *)p->pDesign->pManFunc );
p->pDesign->pManFunc = NULL;
// prepare the file for parsing
Io_MvReadPreparse( p );
+ vGlobalLtlArray = Vec_PtrAlloc( 100 );
// parse interfaces of each network and construct the network
if ( Io_MvReadInterfaces( p ) )
pDesign = Io_MvParse( p );
@@ -178,7 +190,7 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
// make sure that everything is okay with the network structure
if ( fCheck )
{
- Vec_PtrForEachEntry( pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pDesign->vModules, pNtk, i )
{
if ( !Abc_NtkCheckRead( pNtk ) )
{
@@ -193,7 +205,7 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
// detect top-level model
RetValue = Abc_LibFindTopLevelModels( pDesign );
- pNtk = Vec_PtrEntry( pDesign->vTops, 0 );
+ pNtk = (Abc_Ntk_t *)Vec_PtrEntry( pDesign->vTops, 0 );
if ( RetValue > 1 )
printf( "Warning: The design has %d root-level modules. The first one (%s) will be used.\n",
Vec_PtrSize(pDesign->vTops), pNtk->pName );
@@ -217,6 +229,9 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
//Io_WriteBlifMv( pNtk, "_temp_.mv" );
if ( pNtk->pSpec == NULL )
pNtk->pSpec = Extra_UtilStrsav( pFileName );
+
+ Vec_PtrForEachEntry( char *, vGlobalLtlArray, pLtlProp, i )
+ Vec_PtrPush( pNtk->vLtlProperties, pLtlProp );
return pNtk;
}
@@ -267,7 +282,7 @@ static void Io_MvFree( Io_MvMan_t * p )
Vec_PtrFree( p->vLines );
if ( p->vModels )
{
- Vec_PtrForEachEntry( p->vModels, pMod, i )
+ Vec_PtrForEachEntry( Io_MvMod_t *, p->vModels, pMod, i )
Io_MvModFree( pMod );
Vec_PtrFree( p->vModels );
}
@@ -296,12 +311,15 @@ static Io_MvMod_t * Io_MvModAlloc()
p->vInputs = Vec_PtrAlloc( 512 );
p->vOutputs = Vec_PtrAlloc( 512 );
p->vLatches = Vec_PtrAlloc( 512 );
+ p->vFlops = Vec_PtrAlloc( 512 );
p->vResets = Vec_PtrAlloc( 512 );
p->vNames = Vec_PtrAlloc( 512 );
p->vSubckts = Vec_PtrAlloc( 512 );
p->vShorts = Vec_PtrAlloc( 512 );
p->vOnehots = Vec_PtrAlloc( 512 );
p->vMvs = Vec_PtrAlloc( 512 );
+ p->vConstrs = Vec_PtrAlloc( 512 );
+ p->vLtlProperties = Vec_PtrAlloc( 512 );
return p;
}
@@ -323,12 +341,14 @@ static void Io_MvModFree( Io_MvMod_t * p )
Vec_PtrFree( p->vInputs );
Vec_PtrFree( p->vOutputs );
Vec_PtrFree( p->vLatches );
+ Vec_PtrFree( p->vFlops );
Vec_PtrFree( p->vResets );
Vec_PtrFree( p->vNames );
Vec_PtrFree( p->vSubckts );
Vec_PtrFree( p->vShorts );
Vec_PtrFree( p->vOnehots );
Vec_PtrFree( p->vMvs );
+ Vec_PtrFree( p->vConstrs );
ABC_FREE( p );
}
@@ -484,7 +504,7 @@ static int Io_MvGetLine( Io_MvMan_t * p, char * pToken )
{
char * pLine;
int i;
- Vec_PtrForEachEntry( p->vLines, pLine, i )
+ Vec_PtrForEachEntry( char *, p->vLines, pLine, i )
if ( pToken < pLine )
return i;
return -1;
@@ -570,7 +590,7 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
}
// unfold the line extensions and sort lines by directive
- Vec_PtrForEachEntry( p->vLines, pCur, i )
+ Vec_PtrForEachEntry( char *, p->vLines, pCur, i )
{
if ( *pCur == 0 )
continue;
@@ -579,7 +599,7 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
if ( !Io_MvCharIsSpace(*pPrev) )
break;
// if it is the line extender, overwrite it with spaces
- if ( *pPrev == '\\' )
+ if ( pPrev >= p->pBuffer && *pPrev == '\\' )
{
for ( ; *pPrev; pPrev++ )
*pPrev = ' ';
@@ -595,8 +615,12 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
Vec_PtrPush( p->pLatest->vNames, pCur );
else if ( p->fBlifMv && (!strncmp(pCur, "def ", 4) || !strncmp(pCur, "default ", 8)) )
continue;
+ else if ( !strncmp( pCur, "ltlformula", 10 ) )
+ Vec_PtrPush( p->pLatest->vLtlProperties, pCur );
else if ( !strncmp(pCur, "latch", 5) )
Vec_PtrPush( p->pLatest->vLatches, pCur );
+ else if ( !strncmp(pCur, "flop", 4) )
+ Vec_PtrPush( p->pLatest->vFlops, pCur );
else if ( !strncmp(pCur, "r ", 2) || !strncmp(pCur, "reset ", 6) )
Vec_PtrPush( p->pLatest->vResets, pCur );
else if ( !strncmp(pCur, "inputs", 6) )
@@ -611,6 +635,8 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
Vec_PtrPush( p->pLatest->vOnehots, pCur );
else if ( p->fBlifMv && !strncmp(pCur, "mv", 2) )
Vec_PtrPush( p->pLatest->vMvs, pCur );
+ else if ( !strncmp(pCur, "constraint", 10) )
+ Vec_PtrPush( p->pLatest->vConstrs, pCur );
else if ( !strncmp(pCur, "blackbox", 8) )
p->pLatest->fBlackBox = 1;
else if ( !strncmp(pCur, "model", 5) )
@@ -628,7 +654,10 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
else if ( !strncmp(pCur, "exdc", 4) )
{
fprintf( stdout, "Line %d: Skipping EXDC network.\n", Io_MvGetLine(p, pCur) );
- break;
+// break;
+ if ( p->pLatest )
+ Vec_PtrPush( p->vModels, p->pLatest );
+ p->pLatest = NULL;
}
else if ( !strncmp(pCur, "attrib", 6) )
{}
@@ -640,6 +669,8 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
{}
else if ( !strncmp(pCur, "no_merge", 8) )
{}
+ else if ( !strncmp(pCur, "wd", 2) )
+ {}
// else if ( !strncmp(pCur, "inouts", 6) )
// {}
else
@@ -667,9 +698,9 @@ static int Io_MvReadInterfaces( Io_MvMan_t * p )
{
Io_MvMod_t * pMod;
char * pLine;
- int i, k;
+ int i, k, nOutsOld;
// iterate through the models
- Vec_PtrForEachEntry( p->vModels, pMod, i )
+ Vec_PtrForEachEntry( Io_MvMod_t *, p->vModels, pMod, i )
{
// parse the model
if ( !Io_MvParseLineModel( pMod, pMod->pName ) )
@@ -681,13 +712,22 @@ static int Io_MvReadInterfaces( Io_MvMan_t * p )
return 0;
}
// parse the inputs
- Vec_PtrForEachEntry( pMod->vInputs, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vInputs, pLine, k )
if ( !Io_MvParseLineInputs( pMod, pLine ) )
return 0;
// parse the outputs
- Vec_PtrForEachEntry( pMod->vOutputs, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vOutputs, pLine, k )
if ( !Io_MvParseLineOutputs( pMod, pLine ) )
return 0;
+ // parse the constraints
+ nOutsOld = Abc_NtkPoNum(pMod->pNtk);
+ Vec_PtrForEachEntry( char *, pMod->vConstrs, pLine, k )
+ if ( !Io_MvParseLineConstrs( pMod, pLine ) )
+ return 0;
+ pMod->pNtk->nConstrs = Abc_NtkPoNum(pMod->pNtk) - nOutsOld;
+ Vec_PtrForEachEntry( char *, pMod->vLtlProperties, pLine, k )
+ if ( !Io_MvParseLineLtlProperty( pMod, pLine ) )
+ return 0;
}
return 1;
}
@@ -711,13 +751,13 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
char * pLine;
int i, k;
// iterate through the models
- Vec_PtrForEachEntry( p->vModels, pMod, i )
+ Vec_PtrForEachEntry( Io_MvMod_t *, p->vModels, pMod, i )
{
// check if there any MV lines
if ( Vec_PtrSize(pMod->vMvs) > 0 )
Abc_NtkStartMvVars( pMod->pNtk );
// parse the mv lines
- Vec_PtrForEachEntry( pMod->vMvs, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vMvs, pLine, k )
if ( !Io_MvParseLineMv( pMod, pLine ) )
return NULL;
// if reset lines are used there should be the same number of them as latches
@@ -733,33 +773,37 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
if ( p->fUseReset )
pMod->pResetLatch = Io_ReadCreateResetLatch( pMod->pNtk, p->fBlifMv );
}
+ // parse the flops
+ Vec_PtrForEachEntry( char *, pMod->vFlops, pLine, k )
+ if ( !Io_MvParseLineFlop( pMod, pLine ) )
+ return NULL;
// parse the latches
- Vec_PtrForEachEntry( pMod->vLatches, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vLatches, pLine, k )
if ( !Io_MvParseLineLatch( pMod, pLine ) )
return NULL;
// parse the reset lines
if ( p->fUseReset )
- Vec_PtrForEachEntry( pMod->vResets, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vResets, pLine, k )
if ( !Io_MvParseLineNamesMv( pMod, pLine, 1 ) )
return NULL;
// parse the nodes
if ( p->fBlifMv )
{
- Vec_PtrForEachEntry( pMod->vNames, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vNames, pLine, k )
if ( !Io_MvParseLineNamesMv( pMod, pLine, 0 ) )
return NULL;
}
else
{
- Vec_PtrForEachEntry( pMod->vNames, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vNames, pLine, k )
if ( !Io_MvParseLineNamesBlif( pMod, pLine ) )
return NULL;
- Vec_PtrForEachEntry( pMod->vShorts, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vShorts, pLine, k )
if ( !Io_MvParseLineShortBlif( pMod, pLine ) )
return NULL;
}
// parse the subcircuits
- Vec_PtrForEachEntry( pMod->vSubckts, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vSubckts, pLine, k )
if ( !Io_MvParseLineSubckt( pMod, pLine ) )
return NULL;
@@ -768,7 +812,7 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
{
if ( pMod->pNtk->ntkFunc == ABC_FUNC_SOP )
{
- Extra_MmFlexStop( pMod->pNtk->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)pMod->pNtk->pManFunc );
pMod->pNtk->pManFunc = NULL;
pMod->pNtk->ntkFunc = ABC_FUNC_BLACKBOX;
}
@@ -786,7 +830,7 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
pObj->pNext = (Abc_Obj_t *)(ABC_PTRINT_T)k;
// derive register
pMod->pNtk->vOnehots = Vec_PtrAlloc( Vec_PtrSize(pMod->vOnehots) );
- Vec_PtrForEachEntry( pMod->vOnehots, pLine, k )
+ Vec_PtrForEachEntry( char *, pMod->vOnehots, pLine, k )
{
vLine = Io_MvParseLineOnehot( pMod, pLine );
if ( vLine == NULL )
@@ -799,7 +843,7 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
pObj->pNext = NULL;
// print the result
printf( "Parsed %d groups of 1-hot registers: { ", Vec_PtrSize(pMod->pNtk->vOnehots) );
- Vec_PtrForEachEntry( pMod->pNtk->vOnehots, vLine, k )
+ Vec_PtrForEachEntry( Vec_Int_t *, pMod->pNtk->vOnehots, vLine, k )
printf( "%d ", Vec_IntSize(vLine) );
printf( "}\n" );
printf( "The total number of 1-hot registers = %d. (%.2f %%)\n",
@@ -812,6 +856,12 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
printf( "One-hotness condition is written into file \"%s\".\n", pFileName );
}
}
+ if ( Vec_PtrSize(pMod->vFlops) )
+ {
+ printf( "Warning: The parser converted %d .flop lines into .latch lines\n", Vec_PtrSize(pMod->vFlops) );
+ printf( "(information about set, reset, enable of the flops may be lost).\n" );
+ }
+
}
if ( p->nNDnodes )
// printf( "Warning: The parser added %d PIs to replace non-deterministic nodes.\n", p->nNDnodes );
@@ -838,7 +888,7 @@ static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine )
Vec_Ptr_t * vTokens = p->pMan->vTokens;
char * pToken, * pPivot;
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry( vTokens, 0 );
+ pToken = (char *)Vec_PtrEntry( vTokens, 0 );
assert( !strcmp(pToken, "model") );
if ( Vec_PtrSize(vTokens) != 2 )
{
@@ -854,7 +904,7 @@ static int Io_MvParseLineModel( Io_MvMod_t * p, char * pLine )
// for ( pPivot = pToken = Vec_PtrEntry(vTokens, 1); *pToken; pToken++ )
// if ( *pToken == '/' || *pToken == '\\' )
// pPivot = pToken+1;
- pPivot = pToken = Vec_PtrEntry(vTokens, 1);
+ pPivot = pToken = (char *)Vec_PtrEntry(vTokens, 1);
p->pNtk->pName = Extra_UtilStrsav( pPivot );
return 1;
}
@@ -876,9 +926,9 @@ static int Io_MvParseLineInputs( Io_MvMod_t * p, char * pLine )
char * pToken;
int i;
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry(vTokens, 0);
+ pToken = (char *)Vec_PtrEntry(vTokens, 0);
assert( !strcmp(pToken, "inputs") );
- Vec_PtrForEachEntryStart( vTokens, pToken, i, 1 )
+ Vec_PtrForEachEntryStart( char *, vTokens, pToken, i, 1 )
Io_ReadCreatePi( p->pNtk, pToken );
return 1;
}
@@ -900,15 +950,82 @@ static int Io_MvParseLineOutputs( Io_MvMod_t * p, char * pLine )
char * pToken;
int i;
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry(vTokens, 0);
+ pToken = (char *)Vec_PtrEntry(vTokens, 0);
assert( !strcmp(pToken, "outputs") );
- Vec_PtrForEachEntryStart( vTokens, pToken, i, 1 )
+ Vec_PtrForEachEntryStart( char *, vTokens, pToken, i, 1 )
Io_ReadCreatePo( p->pNtk, pToken );
return 1;
}
/**Function*************************************************************
+ Synopsis [Parses the outputs line.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static int Io_MvParseLineConstrs( Io_MvMod_t * p, char * pLine )
+{
+ Vec_Ptr_t * vTokens = p->pMan->vTokens;
+ char * pToken;
+ int i;
+ Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
+ pToken = (char *)Vec_PtrEntry(vTokens, 0);
+ assert( !strcmp(pToken, "constraint") );
+ Vec_PtrForEachEntryStart( char *, vTokens, pToken, i, 1 )
+ Io_ReadCreatePo( p->pNtk, pToken );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Parses the LTL property line.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static int Io_MvParseLineLtlProperty( Io_MvMod_t * p, char * pLine )
+{
+ int i, j;
+ int quoteBegin, quoteEnd;
+ char keyWordLtlFormula[11];
+ char *actualLtlFormula;
+
+ //checking if the line begins with the keyword "ltlformula" and
+ //progressing the pointer forword
+ for( i=0; i<10; i++ )
+ keyWordLtlFormula[i] = pLine[i];
+ quoteBegin = i;
+ keyWordLtlFormula[10] = '\0';
+ assert( strcmp( "ltlformula", keyWordLtlFormula ) == 0 );
+ while( pLine[i] != '"' )
+ i++;
+ quoteBegin = i;
+ i = strlen( pLine );
+ while( pLine[i] != '"' )
+ i--;
+ quoteEnd = i;
+ actualLtlFormula = (char *)malloc( sizeof(char) * (quoteEnd - quoteBegin) );
+ //printf("\nThe input ltl formula = ");
+ for( i = quoteBegin + 1, j = 0; i<quoteEnd; i++, j++ )
+ //printf("%c", pLine[i] );
+ actualLtlFormula[j] = pLine[i];
+ actualLtlFormula[j] = '\0';
+ Vec_PtrPush( vGlobalLtlArray, actualLtlFormula );
+ return 1;
+}
+
+
+/**Function*************************************************************
+
Synopsis [Parses the latches line.]
Description []
@@ -925,7 +1042,7 @@ static int Io_MvParseLineLatch( Io_MvMod_t * p, char * pLine )
char * pToken;
int Init;
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
- pToken = Vec_PtrEntry(vTokens,0);
+ pToken = (char *)Vec_PtrEntry(vTokens,0);
assert( !strcmp(pToken, "latch") );
if ( Vec_PtrSize(vTokens) < 3 )
{
@@ -935,7 +1052,7 @@ static int Io_MvParseLineLatch( Io_MvMod_t * p, char * pLine )
// create latch
if ( p->pResetLatch == NULL )
{
- pObj = Io_ReadCreateLatch( p->pNtk, Vec_PtrEntry(vTokens,1), Vec_PtrEntry(vTokens,2) );
+ pObj = Io_ReadCreateLatch( p->pNtk, (char *)Vec_PtrEntry(vTokens,1), (char *)Vec_PtrEntry(vTokens,2) );
// get initial value
if ( p->pMan->fBlifMv )
Abc_LatchSetInit0( pObj );
@@ -945,7 +1062,7 @@ static int Io_MvParseLineLatch( Io_MvMod_t * p, char * pLine )
printf( "Warning: Line %d has .latch directive with unrecognized entries (the total of %d entries).\n",
Io_MvGetLine(p->pMan, pToken), Vec_PtrSize(vTokens) );
if ( Vec_PtrSize(vTokens) > 3 )
- Init = atoi( Vec_PtrEntryLast(vTokens) );
+ Init = atoi( (char *)Vec_PtrEntryLast(vTokens) );
else
Init = 2;
if ( Init < 0 || Init > 2 )
@@ -964,11 +1081,11 @@ static int Io_MvParseLineLatch( Io_MvMod_t * p, char * pLine )
else
{
// get the net corresponding to the output of the latch
- pNet = Abc_NtkFindOrCreateNet( p->pNtk, Vec_PtrEntry(vTokens,2) );
+ pNet = Abc_NtkFindOrCreateNet( p->pNtk, (char *)Vec_PtrEntry(vTokens,2) );
// get the net corresponding to the latch output (feeding into reset MUX)
pNet = Abc_NtkFindOrCreateNet( p->pNtk, Abc_ObjNameSuffix(pNet, "_out") );
// create latch
- pObj = Io_ReadCreateLatch( p->pNtk, Vec_PtrEntry(vTokens,1), Abc_ObjName(pNet) );
+ pObj = Io_ReadCreateLatch( p->pNtk, (char *)Vec_PtrEntry(vTokens,1), Abc_ObjName(pNet) );
// Abc_LatchSetInit0( pObj );
Abc_LatchSetInit0( pObj );
}
@@ -977,6 +1094,81 @@ static int Io_MvParseLineLatch( Io_MvMod_t * p, char * pLine )
/**Function*************************************************************
+ Synopsis [Parses the latches line.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static int Io_MvParseLineFlop( Io_MvMod_t * p, char * pLine )
+{
+ Vec_Ptr_t * vTokens = p->pMan->vTokens;
+ Abc_Obj_t * pObj;
+ char * pToken, * pOutput, * pInput;
+ int i, Init = 2;
+ assert( !p->pMan->fBlifMv );
+ Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
+ pToken = (char *)Vec_PtrEntry(vTokens,0);
+ assert( !strcmp(pToken, "flop") );
+ // get flop output
+ Vec_PtrForEachEntry( char *, vTokens, pToken, i )
+ if ( pToken[0] == 'Q' && pToken[1] == '=' )
+ break;
+ if ( i == Vec_PtrSize(vTokens) )
+ {
+ sprintf( p->pMan->sError, "Line %d: Cannot find flop output.", Io_MvGetLine(p->pMan, (char *)Vec_PtrEntry(vTokens,0)) );
+ return 0;
+ }
+ pOutput = pToken+2;
+ // get flop input
+ Vec_PtrForEachEntry( char *, vTokens, pToken, i )
+ if ( pToken[0] == 'D' && pToken[1] == '=' )
+ break;
+ if ( i == Vec_PtrSize(vTokens) )
+ {
+ sprintf( p->pMan->sError, "Line %d: Cannot find flop input.", Io_MvGetLine(p->pMan, (char *)Vec_PtrEntry(vTokens,0)) );
+ return 0;
+ }
+ pInput = pToken+2;
+ // create latch
+ pObj = Io_ReadCreateLatch( p->pNtk, pInput, pOutput );
+ // get the init value
+ Vec_PtrForEachEntry( char *, vTokens, pToken, i )
+ {
+ if ( !strncmp( pToken, "init=", 5 ) )
+ {
+ Init = 0;
+ if ( pToken[5] == '1' )
+ Init = 1;
+ else if ( pToken[5] == '2' )
+ Init = 2;
+ else if ( pToken[5] != '0' )
+ {
+ sprintf( p->pMan->sError, "Line %d: Cannot read flop init value %s.", Io_MvGetLine(p->pMan, pToken), pToken );
+ return 0;
+ }
+ break;
+ }
+ }
+ if ( Init < 0 || Init > 2 )
+ {
+ sprintf( p->pMan->sError, "Line %d: Initial state of the flop is incorrect \"%s\".", Io_MvGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens,3) );
+ return 0;
+ }
+ if ( Init == 0 )
+ Abc_LatchSetInit0( pObj );
+ else if ( Init == 1 )
+ Abc_LatchSetInit1( pObj );
+ else // if ( Init == 2 )
+ Abc_LatchSetInitDc( pObj );
+ return 1;
+}
+
+/**Function*************************************************************
+
Synopsis [Parses the subckt line.]
Description []
@@ -997,11 +1189,19 @@ static int Io_MvParseLineSubckt( Io_MvMod_t * p, char * pLine )
// split the line into tokens
nEquals = Io_MvCountChars( pLine, '=' );
Io_MvSplitIntoTokensAndClear( vTokens, pLine, '\0', '=' );
- pToken = Vec_PtrEntry(vTokens,0);
+ pToken = (char *)Vec_PtrEntry(vTokens,0);
assert( !strcmp(pToken, "subckt") );
// get the model for this box
- pName = Vec_PtrEntry(vTokens,1);
+ pName = (char *)Vec_PtrEntry(vTokens,1);
+ // skip instance name for now
+ for ( pToken = pName; *pToken; pToken++ )
+ if ( *pToken == '|' )
+ {
+ *pToken = 0;
+ break;
+ }
+ // find the model
pModel = Abc_LibFindModelByName( p->pMan->pDesign, pName );
if ( pModel == NULL )
{
@@ -1027,7 +1227,7 @@ static int Io_MvParseLineSubckt( Io_MvMod_t * p, char * pLine )
pBox = Abc_NtkCreateWhitebox( p->pNtk );
pBox->pData = pModel;
if ( p->pMan->fBlifMv )
- Abc_ObjAssignName( pBox, Vec_PtrEntry(vTokens,2), NULL );
+ Abc_ObjAssignName( pBox, (char *)Vec_PtrEntry(vTokens,2), NULL );
// go through formal inputs
Abc_NtkForEachPi( pModel, pTerm, i )
{
@@ -1047,7 +1247,7 @@ static int Io_MvParseLineSubckt( Io_MvMod_t * p, char * pLine )
if ( k == nEquals )
{
Abc_Obj_t * pNode = Abc_NtkCreateNode( p->pNtk );
- pNode->pData = Abc_SopRegister( p->pNtk->pManFunc, " 0\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)p->pNtk->pManFunc, " 0\n" );
pNet = Abc_NtkFindOrCreateNet( p->pNtk, Abc_ObjNameSuffix(pNode, "abc") );
Abc_ObjAddFanin( pNet, pNode );
pTerm = Abc_NtkCreateBi( p->pNtk );
@@ -1110,13 +1310,13 @@ static Vec_Int_t * Io_MvParseLineOnehot( Io_MvMod_t * p, char * pLine )
// split the line into tokens
nEquals = Io_MvCountChars( pLine, '=' );
Io_MvSplitIntoTokensAndClear( vTokens, pLine, '\0', '=' );
- pToken = Vec_PtrEntry(vTokens,0);
+ pToken = (char *)Vec_PtrEntry(vTokens,0);
assert( !strcmp(pToken, "onehot") );
// iterate through the register names
// vResult = Vec_PtrAlloc( Vec_PtrSize(vTokens) );
vResult = Vec_IntAlloc( Vec_PtrSize(vTokens) );
- Vec_PtrForEachEntryStart( vTokens, pToken, i, 1 )
+ Vec_PtrForEachEntryStart( char *, vTokens, pToken, i, 1 )
{
// check if this register exists
pNet = Abc_NtkFindNet( p->pNtk, pToken );
@@ -1167,7 +1367,7 @@ static int Io_MvParseLineMv( Io_MvMod_t * p, char * pLine )
// count commas and get the tokens
nCommas = Io_MvCountChars( pLine, ',' );
Io_MvSplitIntoTokensAndClear( vTokens, pLine, '\0', ',' );
- pName = Vec_PtrEntry(vTokens,0);
+ pName = (char *)Vec_PtrEntry(vTokens,0);
assert( !strcmp(pName, "mv") );
// get the number of values
if ( Vec_PtrSize(vTokens) <= nCommas + 2 )
@@ -1175,7 +1375,7 @@ static int Io_MvParseLineMv( Io_MvMod_t * p, char * pLine )
sprintf( p->pMan->sError, "Line %d: The number of values in not specified in .mv line.", Io_MvGetLine(p->pMan, pName) );
return 0;
}
- nValues = atoi( Vec_PtrEntry(vTokens,nCommas+2) );
+ nValues = atoi( (char *)Vec_PtrEntry(vTokens,nCommas+2) );
if ( nValues < 2 || nValues > IO_BLIFMV_MAXVALUES )
{
sprintf( p->pMan->sError, "Line %d: The number of values (%d) is incorrect (should be >= 2 and <= %d).",
@@ -1192,10 +1392,10 @@ static int Io_MvParseLineMv( Io_MvMod_t * p, char * pLine )
return 0;
}
// go through variables
- pFlex = Abc_NtkMvVarMan( p->pNtk );
+ pFlex = (Extra_MmFlex_t *)Abc_NtkMvVarMan( p->pNtk );
for ( i = 0; i <= nCommas; i++ )
{
- pName = Vec_PtrEntry( vTokens, i+1 );
+ pName = (char *)Vec_PtrEntry( vTokens, i+1 );
pObj = Abc_NtkFindOrCreateNet( p->pNtk, pName );
// allocate variable
pVar = (Io_MvVar_t *)Extra_MmFlexEntryFetch( pFlex, sizeof(Io_MvVar_t) );
@@ -1205,7 +1405,7 @@ static int Io_MvParseLineMv( Io_MvMod_t * p, char * pLine )
if ( Vec_PtrSize(vTokens) > nCommas + 3 )
{
pVar->pNames = (char **)Extra_MmFlexEntryFetch( pFlex, sizeof(char *) * nValues );
- Vec_PtrForEachEntryStart( vTokens, pName, k, nCommas + 3 )
+ Vec_PtrForEachEntryStart( char *, vTokens, pName, k, nCommas + 3 )
{
pVar->pNames[k-(nCommas + 3)] = (char *)Extra_MmFlexEntryFetch( pFlex, strlen(pName) + 1 );
strcpy( pVar->pNames[k-(nCommas + 3)], pName );
@@ -1222,7 +1422,7 @@ static int Io_MvParseLineMv( Io_MvMod_t * p, char * pLine )
for ( k = i+1; k < nValues; k++ )
if ( !strcmp(pVar->pNames[i], pVar->pNames[k]) )
{
- pName = Vec_PtrEntry(vTokens,0);
+ pName = (char *)Vec_PtrEntry(vTokens,0);
sprintf( p->pMan->sError, "Line %d: Symbolic value name \"%s\" is repeated in .mv line.",
Io_MvGetLine(p->pMan, pName), pVar->pNames[i] );
return 0;
@@ -1251,12 +1451,12 @@ static int Io_MvWriteValues( Abc_Obj_t * pNode, Vec_Str_t * vFunc )
Abc_ObjForEachFanin( pNode, pFanin, i )
{
sprintf( Buffer, "%d", Abc_ObjMvVarNum(pFanin) );
- Vec_StrAppend( vFunc, Buffer );
+ Vec_StrPrintStr( vFunc, Buffer );
Vec_StrPush( vFunc, ' ' );
}
// add the node number of values
sprintf( Buffer, "%d", Abc_ObjMvVarNum(Abc_ObjFanout0(pNode)) );
- Vec_StrAppend( vFunc, Buffer );
+ Vec_StrPrintStr( vFunc, Buffer );
Vec_StrPush( vFunc, '\n' );
return 1;
}
@@ -1294,18 +1494,18 @@ static int Io_MvParseLiteralMv( Io_MvMod_t * p, Abc_Obj_t * pNode, char * pToken
}
Vec_StrPush( vFunc, '=' );
sprintf( Buffer, "%d", i );
- Vec_StrAppend( vFunc, Buffer );
+ Vec_StrPrintStr( vFunc, Buffer );
Vec_StrPush( vFunc, (char)((iLit == -1)? '\n' : ' ') );
return 1;
}
// consider regular literal
assert( iLit < Abc_ObjFaninNum(pNode) );
pNet = iLit >= 0 ? Abc_ObjFanin(pNode, iLit) : Abc_ObjFanout0(pNode);
- pVar = Abc_ObjMvVar( pNet );
+ pVar = (Io_MvVar_t *)Abc_ObjMvVar( pNet );
// if the var is absent or has no symbolic values quit
if ( pVar == NULL || pVar->pNames == NULL )
{
- Vec_StrAppend( vFunc, pToken );
+ Vec_StrPrintStr( vFunc, pToken );
Vec_StrPush( vFunc, (char)((iLit == -1)? '\n' : ' ') );
return 1;
}
@@ -1334,7 +1534,7 @@ static int Io_MvParseLiteralMv( Io_MvMod_t * p, Abc_Obj_t * pNode, char * pToken
}
// value name is found
sprintf( Buffer, "%d", i );
- Vec_StrAppend( vFunc, Buffer );
+ Vec_StrPrintStr( vFunc, Buffer );
// update the pointer
pCur = pNext - 1;
}
@@ -1363,12 +1563,12 @@ static char * Io_MvParseTableMv( Io_MvMod_t * p, Abc_Obj_t * pNode, Vec_Ptr_t *
// write the number of values
// Io_MvWriteValues( pNode, vFunc );
// get the first token
- pFirst = Vec_PtrEntry( vTokens2, 0 );
+ pFirst = (char *)Vec_PtrEntry( vTokens2, 0 );
if ( pFirst[0] == '.' )
{
// write the default literal
Vec_StrPush( vFunc, 'd' );
- pToken = Vec_PtrEntry(vTokens2, 1 + iOut);
+ pToken = (char *)Vec_PtrEntry(vTokens2, 1 + iOut);
if ( !Io_MvParseLiteralMv( p, pNode, pToken, vFunc, -1 ) )
return NULL;
iStart = 1 + nOutputs;
@@ -1381,12 +1581,12 @@ static char * Io_MvParseTableMv( Io_MvMod_t * p, Abc_Obj_t * pNode, Vec_Ptr_t *
// input literals
for ( i = 0; i < nInputs; i++ )
{
- pToken = Vec_PtrEntry( vTokens2, iStart + i );
+ pToken = (char *)Vec_PtrEntry( vTokens2, iStart + i );
if ( !Io_MvParseLiteralMv( p, pNode, pToken, vFunc, i ) )
return NULL;
}
// output literal
- pToken = Vec_PtrEntry( vTokens2, iStart + nInputs + iOut );
+ pToken = (char *)Vec_PtrEntry( vTokens2, iStart + nInputs + iOut );
if ( !Io_MvParseLiteralMv( p, pNode, pToken, vFunc, -1 ) )
return NULL;
// update the counter
@@ -1424,7 +1624,7 @@ static Abc_Obj_t * Io_MvParseAddResetCircuit( Io_MvMod_t * p, char * pName )
// duplicate MV variables
if ( Abc_NtkMvVar(p->pNtk) )
{
- pVar = Abc_ObjMvVar( pOutNet );
+ pVar = (Io_MvVar_t *)Abc_ObjMvVar( pOutNet );
Abc_ObjSetMvVar( pData0Net, Abc_NtkMvVarDup(p->pNtk, pVar) );
Abc_ObjSetMvVar( pData1Net, Abc_NtkMvVarDup(p->pNtk, pVar) );
}
@@ -1439,10 +1639,10 @@ static Abc_Obj_t * Io_MvParseAddResetCircuit( Io_MvMod_t * p, char * pName )
// int nValues = Abc_ObjMvVarNum(pOutNet);
// sprintf( Buffer, "2 %d %d %d\n1 - - =1\n0 - - =2\n", nValues, nValues, nValues );
sprintf( Buffer, "1 - - =1\n0 - - =2\n" );
- pNode->pData = Abc_SopRegister( p->pNtk->pManFunc, Buffer );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)p->pNtk->pManFunc, Buffer );
}
else
- pNode->pData = Abc_SopCreateMux( p->pNtk->pManFunc );
+ pNode->pData = Abc_SopCreateMux( (Extra_MmFlex_t *)p->pNtk->pManFunc );
// add nets
Abc_ObjAddFanin( pNode, pResetLONet );
Abc_ObjAddFanin( pNode, pData1Net );
@@ -1466,7 +1666,7 @@ static int Io_MvParseLineNamesMvOne( Io_MvMod_t * p, Vec_Ptr_t * vTokens, Vec_Pt
Abc_Obj_t * pNet, * pNode;
char * pName;
// get the output name
- pName = Vec_PtrEntry( vTokens, Vec_PtrSize(vTokens) - nOutputs + iOut );
+ pName = (char *)Vec_PtrEntry( vTokens, Vec_PtrSize(vTokens) - nOutputs + iOut );
// create the node
if ( fReset )
{
@@ -1503,7 +1703,7 @@ static int Io_MvParseLineNamesMvOne( Io_MvMod_t * p, Vec_Ptr_t * vTokens, Vec_Pt
pNode->pData = Io_MvParseTableMv( p, pNode, vTokens2, nInputs, nOutputs, iOut );
if ( pNode->pData == NULL )
return 0;
- pNode->pData = Abc_SopRegister( p->pNtk->pManFunc, pNode->pData );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)p->pNtk->pManFunc, (char *)pNode->pData );
//printf( "Finished parsing node \"%s\" with table:\n%s\n", pName, pNode->pData );
return 1;
}
@@ -1537,9 +1737,9 @@ static int Io_MvParseLineNamesMv( Io_MvMod_t * p, char * pLine, int fReset )
// split names line into tokens
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
if ( fReset )
- assert( !strcmp(Vec_PtrEntry(vTokens,0), "r") || !strcmp(Vec_PtrEntry(vTokens,0), "reset") );
+ assert( !strcmp((char *)Vec_PtrEntry(vTokens,0), "r") || !strcmp((char *)Vec_PtrEntry(vTokens,0), "reset") );
else
- assert( !strcmp(Vec_PtrEntry(vTokens,0), "names") || !strcmp(Vec_PtrEntry(vTokens,0), "table") );
+ assert( !strcmp((char *)Vec_PtrEntry(vTokens,0), "names") || !strcmp((char *)Vec_PtrEntry(vTokens,0), "table") );
// find the number of inputs and outputs
nInputs = Vec_PtrSize(vTokens) - 2;
nOutputs = 1;
@@ -1553,9 +1753,9 @@ static int Io_MvParseLineNamesMv( Io_MvMod_t * p, char * pLine, int fReset )
}
}
// split table into tokens
- pName = Vec_PtrEntryLast( vTokens );
+ pName = (char *)Vec_PtrEntryLast( vTokens );
Io_MvSplitIntoTokensMv( vTokens2, pName + strlen(pName) );
- pFirst = Vec_PtrEntry( vTokens2, 0 );
+ pFirst = (char *)Vec_PtrEntry( vTokens2, 0 );
if ( pFirst[0] == '.' )
{
assert( pFirst[1] == 'd' );
@@ -1576,7 +1776,7 @@ static int Io_MvParseLineNamesMv( Io_MvMod_t * p, char * pLine, int fReset )
// add the outputs to the PIs
for ( i = 0; i < nOutputs; i++ )
{
- pName = Vec_PtrEntry( vTokens, Vec_PtrSize(vTokens) - nOutputs + i );
+ pName = (char *)Vec_PtrEntry( vTokens, Vec_PtrSize(vTokens) - nOutputs + i );
// get the net corresponding to this node
pNet = Abc_NtkFindOrCreateNet(p->pNtk, pName);
if ( fReset )
@@ -1625,19 +1825,19 @@ static char * Io_MvParseTableBlif( Io_MvMod_t * p, char * pTable, int nFanins )
// get the tokens
Io_MvSplitIntoTokens( vTokens, pTable, '.' );
if ( Vec_PtrSize(vTokens) == 0 )
- return Abc_SopCreateConst0( p->pNtk->pManFunc );
+ return Abc_SopCreateConst0( (Extra_MmFlex_t *)p->pNtk->pManFunc );
if ( Vec_PtrSize(vTokens) == 1 )
{
- pOutput = Vec_PtrEntry( vTokens, 0 );
+ pOutput = (char *)Vec_PtrEntry( vTokens, 0 );
c = pOutput[0];
if ( (c!='0'&&c!='1'&&c!='x'&&c!='n') || pOutput[1] )
{
sprintf( p->pMan->sError, "Line %d: Constant table has wrong output value \"%s\".", Io_MvGetLine(p->pMan, pOutput), pOutput );
return NULL;
}
- return pOutput[0] == '0' ? Abc_SopCreateConst0(p->pNtk->pManFunc) : Abc_SopCreateConst1(p->pNtk->pManFunc);
+ return pOutput[0] == '0' ? Abc_SopCreateConst0((Extra_MmFlex_t *)p->pNtk->pManFunc) : Abc_SopCreateConst1((Extra_MmFlex_t *)p->pNtk->pManFunc);
}
- pProduct = Vec_PtrEntry( vTokens, 0 );
+ pProduct = (char *)Vec_PtrEntry( vTokens, 0 );
if ( Vec_PtrSize(vTokens) % 2 == 1 )
{
sprintf( p->pMan->sError, "Line %d: Table has odd number of tokens (%d).", Io_MvGetLine(p->pMan, pProduct), Vec_PtrSize(vTokens) );
@@ -1647,8 +1847,8 @@ static char * Io_MvParseTableBlif( Io_MvMod_t * p, char * pTable, int nFanins )
Vec_StrClear( vFunc );
for ( i = 0; i < Vec_PtrSize(vTokens)/2; i++ )
{
- pProduct = Vec_PtrEntry( vTokens, 2*i + 0 );
- pOutput = Vec_PtrEntry( vTokens, 2*i + 1 );
+ pProduct = (char *)Vec_PtrEntry( vTokens, 2*i + 0 );
+ pOutput = (char *)Vec_PtrEntry( vTokens, 2*i + 1 );
if ( strlen(pProduct) != (unsigned)nFanins )
{
sprintf( p->pMan->sError, "Line %d: Cube \"%s\" has size different from the fanin count (%d).", Io_MvGetLine(p->pMan, pProduct), pProduct, nFanins );
@@ -1668,7 +1868,7 @@ static char * Io_MvParseTableBlif( Io_MvMod_t * p, char * pTable, int nFanins )
return NULL;
}
// parse one product
- Vec_StrAppend( vFunc, pProduct );
+ Vec_StrPrintStr( vFunc, pProduct );
Vec_StrPush( vFunc, ' ' );
Vec_StrPush( vFunc, pOutput[0] );
Vec_StrPush( vFunc, '\n' );
@@ -1696,11 +1896,11 @@ static int Io_MvParseLineNamesBlif( Io_MvMod_t * p, char * pLine )
assert( !p->pMan->fBlifMv );
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
// parse the mapped node
- if ( !strcmp(Vec_PtrEntry(vTokens,0), "gate") )
+ if ( !strcmp((char *)Vec_PtrEntry(vTokens,0), "gate") )
return Io_MvParseLineGateBlif( p, vTokens );
// parse the regular name line
- assert( !strcmp(Vec_PtrEntry(vTokens,0), "names") );
- pName = Vec_PtrEntryLast( vTokens );
+ assert( !strcmp((char *)Vec_PtrEntry(vTokens,0), "names") );
+ pName = (char *)Vec_PtrEntryLast( vTokens );
pNet = Abc_NtkFindOrCreateNet( p->pNtk, pName );
if ( Abc_ObjFaninNum(pNet) > 0 )
{
@@ -1713,7 +1913,7 @@ static int Io_MvParseLineNamesBlif( Io_MvMod_t * p, char * pLine )
pNode->pData = Io_MvParseTableBlif( p, pName + strlen(pName), Abc_ObjFaninNum(pNode) );
if ( pNode->pData == NULL )
return 0;
- pNode->pData = Abc_SopRegister( p->pNtk->pManFunc, pNode->pData );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)p->pNtk->pManFunc, (char *)pNode->pData );
return 1;
}
@@ -1737,12 +1937,12 @@ static int Io_MvParseLineShortBlif( Io_MvMod_t * p, char * pLine )
Io_MvSplitIntoTokens( vTokens, pLine, '\0' );
if ( Vec_PtrSize(vTokens) != 3 )
{
- sprintf( p->pMan->sError, "Line %d: Expecting three entries in the .short line.", Io_MvGetLine(p->pMan, Vec_PtrEntry(vTokens,0)) );
+ sprintf( p->pMan->sError, "Line %d: Expecting three entries in the .short line.", Io_MvGetLine(p->pMan, (char *)Vec_PtrEntry(vTokens,0)) );
return 0;
}
// parse the regular name line
- assert( !strcmp(Vec_PtrEntry(vTokens,0), "short") );
- pName = Vec_PtrEntryLast( vTokens );
+ assert( !strcmp((char *)Vec_PtrEntry(vTokens,0), "short") );
+ pName = (char *)Vec_PtrEntryLast( vTokens );
pNet = Abc_NtkFindOrCreateNet( p->pNtk, pName );
if ( Abc_ObjFaninNum(pNet) > 0 )
{
@@ -1752,7 +1952,7 @@ static int Io_MvParseLineShortBlif( Io_MvMod_t * p, char * pLine )
// create fanins
pNode = Io_ReadCreateNode( p->pNtk, pName, (char **)(vTokens->pArray + 1), 1 );
// parse the table of this node
- pNode->pData = Abc_SopRegister( p->pNtk->pManFunc, "1 1\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)p->pNtk->pManFunc, "1 1\n" );
return 1;
}
@@ -1774,7 +1974,7 @@ Io_MvVar_t * Abc_NtkMvVarDup( Abc_Ntk_t * pNtk, Io_MvVar_t * pVar )
int i;
if ( pVar == NULL )
return NULL;
- pFlex = Abc_NtkMvVarMan( pNtk );
+ pFlex = (Extra_MmFlex_t *)Abc_NtkMvVarMan( pNtk );
assert( pFlex != NULL );
pVarDup = (Io_MvVar_t *)Extra_MmFlexEntryFetch( pFlex, sizeof(Io_MvVar_t) );
pVarDup->nValues = pVar->nValues;
@@ -1790,10 +1990,14 @@ Io_MvVar_t * Abc_NtkMvVarDup( Abc_Ntk_t * pNtk, Io_MvVar_t * pVar )
return pVarDup;
}
+ABC_NAMESPACE_IMPL_END
#include "mio.h"
#include "main.h"
+ABC_NAMESPACE_IMPL_START
+
+
/**Function*************************************************************
Synopsis []
@@ -1835,10 +2039,10 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
char ** ppNames, * pName;
int i, nNames;
- pName = vTokens->pArray[0];
+ pName = (char *)vTokens->pArray[0];
// check that the library is available
- pGenlib = Abc_FrameReadLibGen();
+ pGenlib = (Mio_Library_t *)Abc_FrameReadLibGen();
if ( pGenlib == NULL )
{
sprintf( p->pMan->sError, "Line %d: The current library is not available.", Io_MvGetLine(p->pMan, pName) );
@@ -1853,7 +2057,7 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
}
// get the gate
- pGate = Mio_LibraryReadGateByName( pGenlib, vTokens->pArray[1] );
+ pGate = Mio_LibraryReadGateByName( pGenlib, (char *)vTokens->pArray[1] );
if ( pGate == NULL )
{
sprintf( p->pMan->sError, "Line %d: Cannot find gate \"%s\" in the library.", Io_MvGetLine(p->pMan, pName), (char*)vTokens->pArray[1] );
@@ -1865,7 +2069,7 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
{
assert( p->pNtk->ntkFunc == ABC_FUNC_SOP );
p->pNtk->ntkFunc = ABC_FUNC_MAP;
- Extra_MmFlexStop( p->pNtk->pManFunc );
+ Extra_MmFlexStop( (Extra_MmFlex_t *)p->pNtk->pManFunc );
p->pNtk->pManFunc = pGenlib;
}
@@ -1879,7 +2083,7 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
// remove the formal parameter names
for ( i = 2; i < vTokens->nSize; i++ )
{
- vTokens->pArray[i] = Io_ReadBlifCleanName( vTokens->pArray[i] );
+ vTokens->pArray[i] = Io_ReadBlifCleanName( (char *)vTokens->pArray[i] );
if ( vTokens->pArray[i] == NULL )
{
sprintf( p->pMan->sError, "Line %d: Invalid gate input assignment.", Io_MvGetLine(p->pMan, pName) );
@@ -1902,3 +2106,5 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadDsd.c b/src/base/io/ioReadDsd.c
index 4848e4e9..35bc6aaa 100644
--- a/src/base/io/ioReadDsd.c
+++ b/src/base/io/ioReadDsd.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -183,11 +186,11 @@ Abc_Obj_t * Io_ReadDsd_rec( Abc_Ntk_t * pNtk, char * pCur, char * pSop )
}
}
if ( pSop )
- pObj->pData = Abc_SopRegister( pNtk->pManFunc, pSop );
+ pObj->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, pSop );
else if ( TypeExor )
- pObj->pData = Abc_SopCreateXorSpecial( pNtk->pManFunc, nParts );
+ pObj->pData = Abc_SopCreateXorSpecial( (Extra_MmFlex_t *)pNtk->pManFunc, nParts );
else
- pObj->pData = Abc_SopCreateAnd( pNtk->pManFunc, nParts, NULL );
+ pObj->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtk->pManFunc, nParts, NULL );
return pObj;
}
if ( *pCur >= 'a' && *pCur <= 'z' )
@@ -248,7 +251,7 @@ Abc_Ntk_t * Io_ReadDsd( char * pForm )
// create PIs
vNames = Abc_NodeGetFakeNames( nInputs );
for ( i = 0; i < nInputs; i++ )
- Abc_ObjAssignName( Abc_NtkCreatePi(pNtk), Vec_PtrEntry(vNames, i), NULL );
+ Abc_ObjAssignName( Abc_NtkCreatePi(pNtk), (char *)Vec_PtrEntry(vNames, i), NULL );
Abc_NodeFreeNames( vNames );
// transform the formula by inserting parantheses
@@ -306,3 +309,5 @@ Abc_Ntk_t * Io_ReadDsd( char * pForm )
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadEdif.c b/src/base/io/ioReadEdif.c
index 26e49d0e..8c739e61 100644
--- a/src/base/io/ioReadEdif.c
+++ b/src/base/io/ioReadEdif.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -90,8 +93,8 @@ Abc_Ntk_t * Io_ReadEdifNetwork( Extra_FileReader_t * p )
int fTokensReady, iLine, i;
// read the first line
- vTokens = Extra_FileReaderGetTokens(p);
- if ( strcmp( vTokens->pArray[0], "edif" ) != 0 )
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ if ( strcmp( (char *)vTokens->pArray[0], "edif" ) != 0 )
{
printf( "%s: Wrong input file format.\n", Extra_FileReaderGetFileName(p) );
return NULL;
@@ -103,19 +106,19 @@ Abc_Ntk_t * Io_ReadEdifNetwork( Extra_FileReader_t * p )
// go through the lines of the file
fTokensReady = 0;
pProgress = Extra_ProgressBarStart( stdout, Extra_FileReaderGetFileSize(p) );
- for ( iLine = 1; fTokensReady || (vTokens = Extra_FileReaderGetTokens(p)); iLine++ )
+ for ( iLine = 1; fTokensReady || (vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p)); iLine++ )
{
Extra_ProgressBarUpdate( pProgress, Extra_FileReaderGetCurPosition(p), NULL );
// get the type of the line
fTokensReady = 0;
- if ( strcmp( vTokens->pArray[0], "instance" ) == 0 )
+ if ( strcmp( (char *)vTokens->pArray[0], "instance" ) == 0 )
{
- pNetName = vTokens->pArray[1];
+ pNetName = (char *)vTokens->pArray[1];
pNet = Abc_NtkFindOrCreateNet( pNtk, pNetName );
- vTokens = Extra_FileReaderGetTokens(p);
- vTokens = Extra_FileReaderGetTokens(p);
- pGateName = vTokens->pArray[1];
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ pGateName = (char *)vTokens->pArray[1];
if ( strncmp( pGateName, "Flip", 4 ) == 0 )
{
pObj = Abc_NtkCreateLatch( pNtk );
@@ -129,63 +132,63 @@ Abc_Ntk_t * Io_ReadEdifNetwork( Extra_FileReader_t * p )
}
Abc_ObjAddFanin( pNet, pObj );
}
- else if ( strcmp( vTokens->pArray[0], "net" ) == 0 )
+ else if ( strcmp( (char *)vTokens->pArray[0], "net" ) == 0 )
{
- pNetName = vTokens->pArray[1];
+ pNetName = (char *)vTokens->pArray[1];
if ( strcmp( pNetName, "CK" ) == 0 || strcmp( pNetName, "RESET" ) == 0 )
continue;
if ( strcmp( pNetName + strlen(pNetName) - 4, "_out" ) == 0 )
pNetName[strlen(pNetName) - 4] = 0;
pNet = Abc_NtkFindNet( pNtk, pNetName );
assert( pNet );
- vTokens = Extra_FileReaderGetTokens(p);
- vTokens = Extra_FileReaderGetTokens(p);
- vTokens = Extra_FileReaderGetTokens(p);
- while ( strcmp( vTokens->pArray[0], "portRef" ) == 0 )
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ while ( strcmp( (char *)vTokens->pArray[0], "portRef" ) == 0 )
{
- if ( strcmp( pNetName, vTokens->pArray[3] ) != 0 )
+ if ( strcmp( pNetName, (char *)vTokens->pArray[3] ) != 0 )
{
- pFanout = Abc_NtkFindNet( pNtk, vTokens->pArray[3] );
+ pFanout = Abc_NtkFindNet( pNtk, (char *)vTokens->pArray[3] );
Abc_ObjAddFanin( Abc_ObjFanin0(pFanout), pNet );
}
- vTokens = Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
}
fTokensReady = 1;
}
- else if ( strcmp( vTokens->pArray[0], "library" ) == 0 )
+ else if ( strcmp( (char *)vTokens->pArray[0], "library" ) == 0 )
{
- vTokens = Extra_FileReaderGetTokens(p);
- vTokens = Extra_FileReaderGetTokens(p);
- vTokens = Extra_FileReaderGetTokens(p);
- vTokens = Extra_FileReaderGetTokens(p);
- vTokens = Extra_FileReaderGetTokens(p);
- while ( strcmp( vTokens->pArray[0], "port" ) == 0 )
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
+ while ( strcmp( (char *)vTokens->pArray[0], "port" ) == 0 )
{
- pNetName = vTokens->pArray[1];
+ pNetName = (char *)vTokens->pArray[1];
if ( strcmp( pNetName, "CK" ) == 0 || strcmp( pNetName, "RESET" ) == 0 )
{
- vTokens = Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
continue;
}
if ( strcmp( pNetName + strlen(pNetName) - 3, "_PO" ) == 0 )
pNetName[strlen(pNetName) - 3] = 0;
- if ( strcmp( vTokens->pArray[3], "INPUT" ) == 0 )
- Io_ReadCreatePi( pNtk, vTokens->pArray[1] );
- else if ( strcmp( vTokens->pArray[3], "OUTPUT" ) == 0 )
- Io_ReadCreatePo( pNtk, vTokens->pArray[1] );
+ if ( strcmp( (char *)vTokens->pArray[3], "INPUT" ) == 0 )
+ Io_ReadCreatePi( pNtk, (char *)vTokens->pArray[1] );
+ else if ( strcmp( (char *)vTokens->pArray[3], "OUTPUT" ) == 0 )
+ Io_ReadCreatePo( pNtk, (char *)vTokens->pArray[1] );
else
{
printf( "%s (line %d): Wrong interface specification.\n", Extra_FileReaderGetFileName(p), iLine );
Abc_NtkDelete( pNtk );
return NULL;
}
- vTokens = Extra_FileReaderGetTokens(p);
+ vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p);
}
}
- else if ( strcmp( vTokens->pArray[0], "design" ) == 0 )
+ else if ( strcmp( (char *)vTokens->pArray[0], "design" ) == 0 )
{
ABC_FREE( pNtk->pName );
- pNtk->pName = Extra_UtilStrsav( vTokens->pArray[3] );
+ pNtk->pName = (char *)Extra_UtilStrsav( (char *)vTokens->pArray[3] );
break;
}
}
@@ -194,22 +197,22 @@ Abc_Ntk_t * Io_ReadEdifNetwork( Extra_FileReader_t * p )
// assign logic functions
Abc_NtkForEachNode( pNtk, pObj, i )
{
- if ( strncmp( pObj->pData, "And", 3 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateAnd(pNtk->pManFunc, Abc_ObjFaninNum(pObj), NULL) );
- else if ( strncmp( pObj->pData, "Or", 2 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateOr(pNtk->pManFunc, Abc_ObjFaninNum(pObj), NULL) );
- else if ( strncmp( pObj->pData, "Nand", 4 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateNand(pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
- else if ( strncmp( pObj->pData, "Nor", 3 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateNor(pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
- else if ( strncmp( pObj->pData, "Exor", 4 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateXor(pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
- else if ( strncmp( pObj->pData, "Exnor", 5 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateNxor(pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
- else if ( strncmp( pObj->pData, "Inv", 3 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateInv(pNtk->pManFunc) );
- else if ( strncmp( pObj->pData, "Buf", 3 ) == 0 )
- Abc_ObjSetData( pObj, Abc_SopCreateBuf(pNtk->pManFunc) );
+ if ( strncmp( (char *)pObj->pData, "And", 3 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateAnd((Extra_MmFlex_t *)pNtk->pManFunc, Abc_ObjFaninNum(pObj), NULL) );
+ else if ( strncmp( (char *)pObj->pData, "Or", 2 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateOr((Extra_MmFlex_t *)pNtk->pManFunc, Abc_ObjFaninNum(pObj), NULL) );
+ else if ( strncmp( (char *)pObj->pData, "Nand", 4 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateNand((Extra_MmFlex_t *)pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
+ else if ( strncmp( (char *)pObj->pData, "Nor", 3 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateNor((Extra_MmFlex_t *)pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
+ else if ( strncmp( (char *)pObj->pData, "Exor", 4 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateXor((Extra_MmFlex_t *)pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
+ else if ( strncmp( (char *)pObj->pData, "Exnor", 5 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateNxor((Extra_MmFlex_t *)pNtk->pManFunc, Abc_ObjFaninNum(pObj)) );
+ else if ( strncmp( (char *)pObj->pData, "Inv", 3 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateInv((Extra_MmFlex_t *)pNtk->pManFunc) );
+ else if ( strncmp( (char *)pObj->pData, "Buf", 3 ) == 0 )
+ Abc_ObjSetData( pObj, Abc_SopCreateBuf((Extra_MmFlex_t *)pNtk->pManFunc) );
else
{
printf( "%s: Unknown gate type \"%s\".\n", Extra_FileReaderGetFileName(p), (char*)pObj->pData );
@@ -233,3 +236,5 @@ Abc_Ntk_t * Io_ReadEdifNetwork( Extra_FileReader_t * p )
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadEqn.c b/src/base/io/ioReadEqn.c
index f778197b..1e4f5d46 100644
--- a/src/base/io/ioReadEqn.c
+++ b/src/base/io/ioReadEqn.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -100,13 +103,13 @@ Abc_Ntk_t * Io_ReadEqnNetwork( Extra_FileReader_t * p )
// go through the lines of the file
vVars = Vec_PtrAlloc( 100 );
pProgress = Extra_ProgressBarStart( stdout, Extra_FileReaderGetFileSize(p) );
- for ( iLine = 0; (vTokens = Extra_FileReaderGetTokens(p)); iLine++ )
+ for ( iLine = 0; (vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p)); iLine++ )
{
Extra_ProgressBarUpdate( pProgress, Extra_FileReaderGetCurPosition(p), NULL );
// check if the first token contains anything
- Io_ReadEqnStrCompact( vTokens->pArray[0] );
- if ( strlen(vTokens->pArray[0]) == 0 )
+ Io_ReadEqnStrCompact( (char *)vTokens->pArray[0] );
+ if ( strlen((char *)vTokens->pArray[0]) == 0 )
break;
// if the number of tokens is different from two, error
@@ -118,16 +121,16 @@ Abc_Ntk_t * Io_ReadEqnNetwork( Extra_FileReader_t * p )
}
// get the type of the line
- if ( strncmp( vTokens->pArray[0], "INORDER", 7 ) == 0 )
+ if ( strncmp( (char *)vTokens->pArray[0], "INORDER", 7 ) == 0 )
{
- Io_ReadEqnStrCutAt( vTokens->pArray[1], " \n\r\t", 0, vVars );
- Vec_PtrForEachEntry( vVars, pVarName, i )
+ Io_ReadEqnStrCutAt( (char *)vTokens->pArray[1], " \n\r\t", 0, vVars );
+ Vec_PtrForEachEntry( char *, vVars, pVarName, i )
Io_ReadCreatePi( pNtk, pVarName );
}
- else if ( strncmp( vTokens->pArray[0], "OUTORDER", 8 ) == 0 )
+ else if ( strncmp( (char *)vTokens->pArray[0], "OUTORDER", 8 ) == 0 )
{
- Io_ReadEqnStrCutAt( vTokens->pArray[1], " \n\r\t", 0, vVars );
- Vec_PtrForEachEntry( vVars, pVarName, i )
+ Io_ReadEqnStrCutAt( (char *)vTokens->pArray[1], " \n\r\t", 0, vVars );
+ Vec_PtrForEachEntry( char *, vVars, pVarName, i )
Io_ReadCreatePo( pNtk, pVarName );
}
else
@@ -135,8 +138,8 @@ Abc_Ntk_t * Io_ReadEqnNetwork( Extra_FileReader_t * p )
extern Hop_Obj_t * Parse_FormulaParserEqn( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVarNames, Hop_Man_t * pMan );
// get hold of the node name and its formula
- pNodeName = vTokens->pArray[0];
- pFormula = vTokens->pArray[1];
+ pNodeName = (char *)vTokens->pArray[0];
+ pFormula = (char *)vTokens->pArray[1];
// compact the formula
Io_ReadEqnStrCompact( pFormula );
@@ -156,7 +159,7 @@ Abc_Ntk_t * Io_ReadEqnNetwork( Extra_FileReader_t * p )
// create the node
pNode = Io_ReadCreateNode( pNtk, pNodeName, (char **)Vec_PtrArray(vVars), Vec_PtrSize(vVars) );
// derive the function
- pNode->pData = Parse_FormulaParserEqn( stdout, pFormula, vVars, pNtk->pManFunc );
+ pNode->pData = Parse_FormulaParserEqn( stdout, pFormula, vVars, (Hop_Man_t *)pNtk->pManFunc );
// remove the cubes
ABC_FREE( pFormulaCopy );
}
@@ -204,7 +207,7 @@ int Io_ReadEqnStrFind( Vec_Ptr_t * vTokens, char * pName )
{
char * pToken;
int i;
- Vec_PtrForEachEntry( vTokens, pToken, i )
+ Vec_PtrForEachEntry( char *, vTokens, pToken, i )
if ( strcmp( pToken, pName ) == 0 )
return i;
return -1;
@@ -237,3 +240,5 @@ void Io_ReadEqnStrCutAt( char * pStr, char * pStop, int fUniqueOnly, Vec_Ptr_t *
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadPla.c b/src/base/io/ioReadPla.c
index 347d1daa..85029ce8 100644
--- a/src/base/io/ioReadPla.c
+++ b/src/base/io/ioReadPla.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -95,12 +98,12 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
// go through the lines of the file
nCubes = 0;
pProgress = Extra_ProgressBarStart( stdout, Extra_FileReaderGetFileSize(p) );
- for ( iLine = 0; (vTokens = Extra_FileReaderGetTokens(p)); iLine++ )
+ for ( iLine = 0; (vTokens = (Vec_Ptr_t *)Extra_FileReaderGetTokens(p)); iLine++ )
{
Extra_ProgressBarUpdate( pProgress, Extra_FileReaderGetCurPosition(p), NULL );
// if it is the end of file, quit the loop
- if ( strcmp( vTokens->pArray[0], ".e" ) == 0 )
+ if ( strcmp( (char *)vTokens->pArray[0], ".e" ) == 0 )
break;
if ( vTokens->nSize == 1 )
@@ -111,25 +114,25 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
return NULL;
}
- if ( strcmp( vTokens->pArray[0], ".i" ) == 0 )
- nInputs = atoi(vTokens->pArray[1]);
- else if ( strcmp( vTokens->pArray[0], ".o" ) == 0 )
- nOutputs = atoi(vTokens->pArray[1]);
- else if ( strcmp( vTokens->pArray[0], ".p" ) == 0 )
- nProducts = atoi(vTokens->pArray[1]);
- else if ( strcmp( vTokens->pArray[0], ".ilb" ) == 0 )
+ if ( strcmp( (char *)vTokens->pArray[0], ".i" ) == 0 )
+ nInputs = atoi((char *)vTokens->pArray[1]);
+ else if ( strcmp( (char *)vTokens->pArray[0], ".o" ) == 0 )
+ nOutputs = atoi((char *)vTokens->pArray[1]);
+ else if ( strcmp( (char *)vTokens->pArray[0], ".p" ) == 0 )
+ nProducts = atoi((char *)vTokens->pArray[1]);
+ else if ( strcmp( (char *)vTokens->pArray[0], ".ilb" ) == 0 )
{
if ( vTokens->nSize - 1 != nInputs )
printf( "Warning: Mismatch between the number of PIs on the .i line (%d) and the number of PIs on the .ilb line (%d).\n", nInputs, vTokens->nSize - 1 );
for ( i = 1; i < vTokens->nSize; i++ )
- Io_ReadCreatePi( pNtk, vTokens->pArray[i] );
+ Io_ReadCreatePi( pNtk, (char *)vTokens->pArray[i] );
}
- else if ( strcmp( vTokens->pArray[0], ".ob" ) == 0 )
+ else if ( strcmp( (char *)vTokens->pArray[0], ".ob" ) == 0 )
{
if ( vTokens->nSize - 1 != nOutputs )
printf( "Warning: Mismatch between the number of POs on the .o line (%d) and the number of POs on the .ob line (%d).\n", nOutputs, vTokens->nSize - 1 );
for ( i = 1; i < vTokens->nSize; i++ )
- Io_ReadCreatePo( pNtk, vTokens->pArray[i] );
+ Io_ReadCreatePo( pNtk, (char *)vTokens->pArray[i] );
}
else
{
@@ -189,8 +192,8 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
Abc_NtkDelete( pNtk );
return NULL;
}
- pCubeIn = vTokens->pArray[0];
- pCubeOut = vTokens->pArray[1];
+ pCubeIn = (char *)vTokens->pArray[0];
+ pCubeOut = (char *)vTokens->pArray[1];
if ( strlen(pCubeIn) != (unsigned)nInputs )
{
printf( "%s (line %d): Input cube length (%zu) differs from the number of inputs (%d).\n",
@@ -211,8 +214,8 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
{
if ( pCubeOut[i] == '0' )
{
- Vec_StrAppend( ppSops[i], pCubeIn );
- Vec_StrAppend( ppSops[i], " 1\n" );
+ Vec_StrPrintStr( ppSops[i], pCubeIn );
+ Vec_StrPrintStr( ppSops[i], " 1\n" );
}
}
}
@@ -222,8 +225,8 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
{
if ( pCubeOut[i] == '1' )
{
- Vec_StrAppend( ppSops[i], pCubeIn );
- Vec_StrAppend( ppSops[i], " 1\n" );
+ Vec_StrPrintStr( ppSops[i], pCubeIn );
+ Vec_StrPrintStr( ppSops[i], " 1\n" );
}
}
}
@@ -242,12 +245,12 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
if ( ppSops[i]->nSize == 0 )
{
Abc_ObjRemoveFanins(pNode);
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, " 0\n" );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, " 0\n" );
Vec_StrFree( ppSops[i] );
continue;
}
Vec_StrPush( ppSops[i], 0 );
- pNode->pData = Abc_SopRegister( pNtk->pManFunc, ppSops[i]->pArray );
+ pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, ppSops[i]->pArray );
Vec_StrFree( ppSops[i] );
}
ABC_FREE( ppSops );
@@ -262,3 +265,5 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioReadVerilog.c b/src/base/io/ioReadVerilog.c
index 9847c2da..94147745 100644
--- a/src/base/io/ioReadVerilog.c
+++ b/src/base/io/ioReadVerilog.c
@@ -19,12 +19,16 @@
***********************************************************************/
#include "ioAbc.h"
+#include "ver.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-extern Abc_Lib_t * Ver_ParseFile( char * pFileName, Abc_Lib_t * pGateLib, int fCheck, int fUseMemMan );
+//extern Abc_Lib_t * Ver_ParseFile( char * pFileName, Abc_Lib_t * pGateLib, int fCheck, int fUseMemMan );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -54,7 +58,7 @@ Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck )
// detect top-level model
RetValue = Abc_LibFindTopLevelModels( pDesign );
- pNtk = Vec_PtrEntry( pDesign->vTops, 0 );
+ pNtk = (Abc_Ntk_t *)Vec_PtrEntry( pDesign->vTops, 0 );
if ( RetValue > 1 )
printf( "Warning: The design has %d root-level modules. The first one (%s) will be used.\n",
Vec_PtrSize(pDesign->vTops), pNtk->pName );
@@ -88,3 +92,5 @@ Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck )
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioUtil.c b/src/base/io/ioUtil.c
index c00c3008..a4dbf949 100644
--- a/src/base/io/ioUtil.c
+++ b/src/base/io/ioUtil.c
@@ -19,6 +19,10 @@
***********************************************************************/
#include "ioAbc.h"
+#include "main.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -73,6 +77,8 @@ Io_FileType_t Io_ReadFileType( char * pFileName )
return IO_FILE_BLIFMV;
if ( !strcmp( pExt, "pla" ) )
return IO_FILE_PLA;
+ if ( !strcmp( pExt, "smv" ) )
+ return IO_FILE_SMV;
if ( !strcmp( pExt, "v" ) )
return IO_FILE_VERILOG;
return IO_FILE_UNKNOWN;
@@ -156,7 +162,56 @@ Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck
return pNtk;
}
-
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t *temporaryLtlStore( Abc_Ntk_t *pNtk )
+{
+ Vec_Ptr_t *tempStore;
+ char *pFormula;
+ int i;
+
+ if( pNtk && Vec_PtrSize( pNtk->vLtlProperties ) > 0 )
+ {
+ tempStore = Vec_PtrAlloc( Vec_PtrSize( pNtk->vLtlProperties ) );
+ Vec_PtrForEachEntry( char *, pNtk->vLtlProperties, pFormula, i )
+ Vec_PtrPush( tempStore, pFormula );
+ assert( Vec_PtrSize( tempStore ) == Vec_PtrSize( pNtk->vLtlProperties ) );
+ return tempStore;
+ }
+ else
+ return NULL;
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void updateLtlStoreOfNtk( Abc_Ntk_t *pNtk, Vec_Ptr_t *tempLtlStore )
+{
+ int i;
+ char *pFormula;
+
+ assert( tempLtlStore != NULL );
+ Vec_PtrForEachEntry( char *, tempLtlStore, pFormula, i )
+ Vec_PtrPush( pNtk->vLtlProperties, pFormula );
+}
+
/**Function*************************************************************
Synopsis [Read the network from a file.]
@@ -171,8 +226,10 @@ Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck
Abc_Ntk_t * Io_Read( char * pFileName, Io_FileType_t FileType, int fCheck )
{
Abc_Ntk_t * pNtk, * pTemp;
+ Vec_Ptr_t * vLtl;
// get the netlist
pNtk = Io_ReadNetlist( pFileName, FileType, fCheck );
+ vLtl = temporaryLtlStore( pNtk );
if ( pNtk == NULL )
return NULL;
if ( !Abc_NtkIsNetlist(pNtk) )
@@ -217,6 +274,8 @@ Abc_Ntk_t * Io_Read( char * pFileName, Io_FileType_t FileType, int fCheck )
}
// convert the netlist into the logic network
pNtk = Abc_NtkToLogic( pTemp = pNtk );
+ if( vLtl )
+ updateLtlStoreOfNtk( pNtk, vLtl );
Abc_NtkDelete( pTemp );
if ( pNtk == NULL )
{
@@ -331,6 +390,15 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType )
}
pNtkTemp = Abc_NtkToNetlistBench( pNtk );
}
+ else if ( FileType == IO_FILE_SMV )
+ {
+ if ( !Abc_NtkIsStrash(pNtk) )
+ {
+ fprintf( stdout, "Writing traditional SMV is available for AIGs only.\n" );
+ return;
+ }
+ pNtkTemp = Abc_NtkToNetlistBench( pNtk );
+ }
else
pNtkTemp = Abc_NtkToNetlist( pNtk );
@@ -344,7 +412,7 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType )
{
if ( !Abc_NtkHasSop(pNtkTemp) && !Abc_NtkHasMapping(pNtkTemp) )
Abc_NtkToSop( pNtkTemp, 0 );
- Io_WriteBlif( pNtkTemp, pFileName, 1 );
+ Io_WriteBlif( pNtkTemp, pFileName, 1, 0, 0 );
}
else if ( FileType == IO_FILE_BLIFMV )
{
@@ -364,6 +432,8 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType )
Abc_NtkToAig( pNtkTemp );
Io_WriteEqn( pNtkTemp, pFileName );
}
+ else if ( FileType == IO_FILE_SMV )
+ Io_WriteSmv( pNtkTemp, pFileName );
else if ( FileType == IO_FILE_VERILOG )
{
if ( !Abc_NtkHasAig(pNtkTemp) && !Abc_NtkHasMapping(pNtkTemp) )
@@ -459,7 +529,7 @@ void Io_WriteHie( Abc_Ntk_t * pNtk, char * pBaseName, char * pFileName )
{
if ( !Abc_NtkHasSop(pNtkResult) && !Abc_NtkHasMapping(pNtkResult) )
Abc_NtkToSop( pNtkResult, 0 );
- Io_WriteBlif( pNtkResult, pFileName, 1 );
+ Io_WriteBlif( pNtkResult, pFileName, 1, 0, 0 );
}
else if ( Io_ReadFileType(pFileName) == IO_FILE_VERILOG )
{
@@ -611,7 +681,7 @@ Abc_Obj_t * Io_ReadCreateResetLatch( Abc_Ntk_t * pNtk, int fBlifMv )
Abc_LatchSetInit0( pLatch );
// feed the latch with constant1- node
// pNode = Abc_NtkCreateNode( pNtk );
-// pNode->pData = Abc_SopRegister( pNtk->pManFunc, "2\n1\n" );
+// pNode->pData = Abc_SopRegister( (Extra_MmFlex_t *)pNtk->pManFunc, "2\n1\n" );
pNode = Abc_NtkCreateNodeConst1( pNtk );
Abc_ObjAddFanin( Abc_ObjFanin0(Abc_ObjFanin0(pLatch)), pNode );
return pLatch;
@@ -657,7 +727,7 @@ Abc_Obj_t * Io_ReadCreateNode( Abc_Ntk_t * pNtk, char * pNameOut, char * pNamesI
SeeAlso []
***********************************************************************/
-Abc_Obj_t * Io_ReadCreateConst( Abc_Ntk_t * pNtk, char * pName, bool fConst1 )
+Abc_Obj_t * Io_ReadCreateConst( Abc_Ntk_t * pNtk, char * pName, int fConst1 )
{
Abc_Obj_t * pNet, * pTerm;
pTerm = fConst1? Abc_NtkCreateNodeConst1(pNtk) : Abc_NtkCreateNodeConst0(pNtk);
@@ -725,7 +795,6 @@ Abc_Obj_t * Io_ReadCreateBuf( Abc_Ntk_t * pNtk, char * pNameIn, char * pNameOut
FILE * Io_FileOpen( const char * FileName, const char * PathVar, const char * Mode, int fVerbose )
{
char * t = 0, * c = 0, * i;
- extern char * Abc_FrameReadFlag( char * pFlag );
if ( PathVar == 0 )
{
@@ -768,3 +837,5 @@ FILE * Io_FileOpen( const char * FileName, const char * PathVar, const char * Mo
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteAiger.c b/src/base/io/ioWriteAiger.c
index 54db0641..3900cf26 100644
--- a/src/base/io/ioWriteAiger.c
+++ b/src/base/io/ioWriteAiger.c
@@ -21,12 +21,16 @@
// The code in this file is developed in collaboration with Mark Jarvin of Toronto.
+#include "bzlib.h"
#include "ioAbc.h"
#include <stdarg.h>
-#include "bzlib.h"
#include "zlib.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
#ifdef _WIN32
#define vsnprintf _vsnprintf
#endif
@@ -137,7 +141,7 @@ Binary Format Definition
static unsigned Io_ObjMakeLit( int Var, int fCompl ) { return (Var << 1) | fCompl; }
static unsigned Io_ObjAigerNum( Abc_Obj_t * pObj ) { return (unsigned)(ABC_PTRINT_T)pObj->pCopy; }
-static void Io_ObjSetAigerNum( Abc_Obj_t * pObj, unsigned Num ) { pObj->pCopy = (void *)(ABC_PTRINT_T)Num; }
+static void Io_ObjSetAigerNum( Abc_Obj_t * pObj, unsigned Num ) { pObj->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Num; }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -451,7 +455,7 @@ void Io_WriteAigerGz( Abc_Ntk_t * pNtk, char * pFileName, int fWriteSymbols )
// write the nodes into the buffer
Pos = 0;
nBufferSize = 6 * Abc_NtkNodeNum(pNtk) + 100; // skeptically assuming 3 chars per one AIG edge
- pBuffer = ABC_ALLOC( char, nBufferSize );
+ pBuffer = ABC_ALLOC( unsigned char, nBufferSize );
pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
Abc_AigForEachAnd( pNtk, pObj, i )
{
@@ -751,3 +755,5 @@ void Io_WriteAiger( Abc_Ntk_t * pNtk, char * pFileName, int fWriteSymbols, int f
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteBaf.c b/src/base/io/ioWriteBaf.c
index 1154e218..a65115b3 100644
--- a/src/base/io/ioWriteBaf.c
+++ b/src/base/io/ioWriteBaf.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -126,9 +129,9 @@ void Io_WriteBaf( Abc_Ntk_t * pNtk, char * pFileName )
Abc_NtkCleanCopy( pNtk );
nNodes = 1;
Abc_NtkForEachCi( pNtk, pObj, i )
- pObj->pCopy = (void *)(ABC_PTRINT_T)nNodes++;
+ pObj->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)nNodes++;
Abc_AigForEachAnd( pNtk, pObj, i )
- pObj->pCopy = (void *)(ABC_PTRINT_T)nNodes++;
+ pObj->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)nNodes++;
// write the nodes into the buffer
nAnds = 0;
@@ -138,15 +141,15 @@ void Io_WriteBaf( Abc_Ntk_t * pNtk, char * pFileName )
Abc_AigForEachAnd( pNtk, pObj, i )
{
Extra_ProgressBarUpdate( pProgress, nAnds, NULL );
- pBufferNode[nAnds++] = (((int)(ABC_PTRINT_T)Abc_ObjFanin0(pObj)->pCopy) << 1) | Abc_ObjFaninC0(pObj);
- pBufferNode[nAnds++] = (((int)(ABC_PTRINT_T)Abc_ObjFanin1(pObj)->pCopy) << 1) | Abc_ObjFaninC1(pObj);
+ pBufferNode[nAnds++] = (((int)(ABC_PTRINT_T)Abc_ObjFanin0(pObj)->pCopy) << 1) | (int)Abc_ObjFaninC0(pObj);
+ pBufferNode[nAnds++] = (((int)(ABC_PTRINT_T)Abc_ObjFanin1(pObj)->pCopy) << 1) | (int)Abc_ObjFaninC1(pObj);
}
// write the COs into the buffer
Abc_NtkForEachCo( pNtk, pObj, i )
{
Extra_ProgressBarUpdate( pProgress, nAnds, NULL );
- pBufferNode[nAnds] = (((int)(ABC_PTRINT_T)Abc_ObjFanin0(pObj)->pCopy) << 1) | Abc_ObjFaninC0(pObj);
+ pBufferNode[nAnds] = (((int)(ABC_PTRINT_T)Abc_ObjFanin0(pObj)->pCopy) << 1) | (int)Abc_ObjFaninC0(pObj);
if ( Abc_ObjFanoutNum(pObj) > 0 && Abc_ObjIsLatch(Abc_ObjFanout0(pObj)) )
pBufferNode[nAnds] = (pBufferNode[nAnds] << 2) | ((int)(ABC_PTRINT_T)Abc_ObjData(Abc_ObjFanout0(pObj)) & 3);
nAnds++;
@@ -166,3 +169,5 @@ void Io_WriteBaf( Abc_Ntk_t * pNtk, char * pFileName )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteBblif.c b/src/base/io/ioWriteBblif.c
index e5bd6503..5cace190 100644
--- a/src/base/io/ioWriteBblif.c
+++ b/src/base/io/ioWriteBblif.c
@@ -21,6 +21,9 @@
#include "ioAbc.h"
#include "bblif.h"
+ABC_NAMESPACE_IMPL_START
+
+
// For description of Binary BLIF format, refer to "abc/src/aig/bbl/bblif.h"
////////////////////////////////////////////////////////////////////////
@@ -63,13 +66,13 @@ Bbl_Man_t * Bbl_ManFromAbc( Abc_Ntk_t * pNtk )
Abc_NtkForEachCi( pNtk, pObj, i )
Bbl_ManCreateObject( p, BBL_OBJ_CI, Abc_ObjId(pObj), 0, NULL );
// create internal nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
- Bbl_ManCreateObject( p, BBL_OBJ_NODE, Abc_ObjId(pObj), Abc_ObjFaninNum(pObj), pObj->pData );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
+ Bbl_ManCreateObject( p, BBL_OBJ_NODE, Abc_ObjId(pObj), Abc_ObjFaninNum(pObj), (char *)pObj->pData );
// create combinational outputs
Abc_NtkForEachCo( pNtk, pObj, i )
Bbl_ManCreateObject( p, BBL_OBJ_CO, Abc_ObjId(pObj), 1, NULL );
// create fanin/fanout connections for internal nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
Abc_ObjForEachFanin( pObj, pFanin, k )
Bbl_ManAddFanin( p, Abc_ObjId(pObj), Abc_ObjId(pFanin) );
// create fanin/fanout connections for combinational outputs
@@ -109,3 +112,5 @@ void Io_WriteBblif( Abc_Ntk_t * pNtk, char * pFileName )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteBench.c b/src/base/io/ioWriteBench.c
index 147976da..4ca1ac0a 100644
--- a/src/base/io/ioWriteBench.c
+++ b/src/base/io/ioWriteBench.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -47,7 +50,7 @@ static int Io_WriteBenchLutOneNode( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t *
SeeAlso []
***********************************************************************/
-int Io_WriteBench( Abc_Ntk_t * pNtk, char * pFileName )
+int Io_WriteBench( Abc_Ntk_t * pNtk, const char * pFileName )
{
Abc_Ntk_t * pExdc;
FILE * pFile;
@@ -258,8 +261,8 @@ int Io_WriteBenchLutOneNode( FILE * pFile, Abc_Obj_t * pNode, Vec_Int_t * vTruth
nFanins = Abc_ObjFaninNum(pNode);
assert( nFanins <= 8 );
// compute the truth table
- pTruth = Hop_ManConvertAigToTruth( pNode->pNtk->pManFunc, Hop_Regular(pNode->pData), nFanins, vTruth, 0 );
- if ( Hop_IsComplement(pNode->pData) )
+ pTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNode->pNtk->pManFunc, Hop_Regular((Hop_Obj_t *)pNode->pData), nFanins, vTruth, 0 );
+ if ( Hop_IsComplement((Hop_Obj_t *)pNode->pData) )
Extra_TruthNot( pTruth, pTruth, nFanins );
// consider simple cases
if ( Extra_TruthIsConst0(pTruth, nFanins) )
@@ -333,3 +336,5 @@ int Io_WriteBenchCheckNames( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteBlif.c b/src/base/io/ioWriteBlif.c
index d1adaf90..7233161b 100644
--- a/src/base/io/ioWriteBlif.c
+++ b/src/base/io/ioWriteBlif.c
@@ -22,12 +22,15 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static void Io_NtkWrite( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
-static void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
+static void Io_NtkWrite( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches, int fBb2Wb, int fSeq );
+static void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches, int fBb2Wb, int fSeq );
static void Io_NtkWritePis( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
static void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches );
static void Io_NtkWriteSubckt( FILE * pFile, Abc_Obj_t * pNode );
@@ -62,7 +65,7 @@ void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
fprintf( stdout, "Writing BLIF has failed.\n" );
return;
}
- Io_WriteBlif( pNtkTemp, FileName, fWriteLatches );
+ Io_WriteBlif( pNtkTemp, FileName, fWriteLatches, 0, 0 );
Abc_NtkDelete( pNtkTemp );
}
@@ -77,7 +80,7 @@ void Io_WriteBlifLogic( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
SeeAlso []
***********************************************************************/
-void Io_WriteBlif( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
+void Io_WriteBlif( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches, int fBb2Wb, int fSeq )
{
FILE * pFile;
Abc_Ntk_t * pNtkTemp;
@@ -92,18 +95,18 @@ void Io_WriteBlif( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
}
fprintf( pFile, "# Benchmark \"%s\" written by ABC on %s\n", pNtk->pName, Extra_TimeStamp() );
// write the master network
- Io_NtkWrite( pFile, pNtk, fWriteLatches );
+ Io_NtkWrite( pFile, pNtk, fWriteLatches, fBb2Wb, fSeq );
// make sure there is no logic hierarchy
assert( Abc_NtkWhiteboxNum(pNtk) == 0 );
// write the hierarchy if present
if ( Abc_NtkBlackboxNum(pNtk) > 0 )
{
- Vec_PtrForEachEntry( pNtk->pDesign->vModules, pNtkTemp, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pNtkTemp, i )
{
if ( pNtkTemp == pNtk )
continue;
fprintf( pFile, "\n\n" );
- Io_NtkWrite( pFile, pNtkTemp, fWriteLatches );
+ Io_NtkWrite( pFile, pNtkTemp, fWriteLatches, fBb2Wb, fSeq );
}
}
fclose( pFile );
@@ -120,21 +123,21 @@ void Io_WriteBlif( Abc_Ntk_t * pNtk, char * FileName, int fWriteLatches )
SeeAlso []
***********************************************************************/
-void Io_NtkWrite( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
+void Io_NtkWrite( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches, int fBb2Wb, int fSeq )
{
Abc_Ntk_t * pExdc;
assert( Abc_NtkIsNetlist(pNtk) );
// write the model name
fprintf( pFile, ".model %s\n", Abc_NtkName(pNtk) );
// write the network
- Io_NtkWriteOne( pFile, pNtk, fWriteLatches );
+ Io_NtkWriteOne( pFile, pNtk, fWriteLatches, fBb2Wb, fSeq );
// write EXDC network if it exists
pExdc = Abc_NtkExdc( pNtk );
if ( pExdc )
{
fprintf( pFile, "\n" );
fprintf( pFile, ".exdc\n" );
- Io_NtkWriteOne( pFile, pExdc, fWriteLatches );
+ Io_NtkWriteOne( pFile, pExdc, fWriteLatches, fBb2Wb, fSeq );
}
// finalize the file
fprintf( pFile, ".end\n" );
@@ -148,10 +151,51 @@ void Io_NtkWrite( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
SideEffects []
+ SeeAlso []
+
+***********************************************************************/
+void Io_NtkWriteConvertedBox( FILE * pFile, Abc_Ntk_t * pNtk, int fSeq )
+{
+ Abc_Obj_t * pObj;
+ int i, v;
+ if ( fSeq )
+ {
+ fprintf( pFile, ".attrib white box seq\n" );
+ }
+ else
+ {
+ fprintf( pFile, ".attrib white box comb\n" );
+ fprintf( pFile, ".delay 1\n" );
+ }
+ Abc_NtkForEachPo( pNtk, pObj, i )
+ {
+ // write the .names line
+ fprintf( pFile, ".names" );
+ Io_NtkWritePis( pFile, pNtk, 1 );
+ if ( fSeq )
+ fprintf( pFile, " %s_in\n", Abc_ObjName(Abc_ObjFanin0(pObj)) );
+ else
+ fprintf( pFile, " %s\n", Abc_ObjName(Abc_ObjFanin0(pObj)) );
+ for ( v = 0; v < Abc_NtkPiNum(pNtk); v++ )
+ fprintf( pFile, "1" );
+ fprintf( pFile, " 1\n" );
+ if ( fSeq )
+ fprintf( pFile, ".latch %s_in %s 1\n", Abc_ObjName(Abc_ObjFanin0(pObj)), Abc_ObjName(Abc_ObjFanin0(pObj)) );
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Write one network.]
+
+ Description []
+
+ SideEffects []
+
SeeAlso []
***********************************************************************/
-void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
+void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches, int fBb2Wb, int fSeq )
{
ProgressBar * pProgress;
Abc_Obj_t * pNode, * pLatch;
@@ -167,18 +211,13 @@ void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
Io_NtkWritePos( pFile, pNtk, fWriteLatches );
fprintf( pFile, "\n" );
- // write the assertions
- if ( Abc_NtkAssertNum(pNtk) )
- {
- fprintf( pFile, ".asserts" );
- Io_NtkWriteAsserts( pFile, pNtk );
- fprintf( pFile, "\n" );
- }
-
// write the blackbox
if ( Abc_NtkHasBlackbox( pNtk ) )
{
- fprintf( pFile, ".blackbox\n" );
+ if ( fBb2Wb )
+ Io_NtkWriteConvertedBox( pFile, pNtk, fSeq );
+ else
+ fprintf( pFile, ".blackbox\n" );
return;
}
@@ -205,7 +244,7 @@ void Io_NtkWriteOne( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
}
// write each internal node
- Length = Abc_NtkHasMapping(pNtk)? Mio_LibraryReadGateNameMax(pNtk->pManFunc) : 0;
+ Length = Abc_NtkHasMapping(pNtk)? Mio_LibraryReadGateNameMax((Mio_Library_t *)pNtk->pManFunc) : 0;
pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
Abc_NtkForEachNode( pNtk, pNode, i )
{
@@ -344,46 +383,6 @@ void Io_NtkWritePos( FILE * pFile, Abc_Ntk_t * pNtk, int fWriteLatches )
/**Function*************************************************************
- Synopsis [Writes the assertion list.]
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-void Io_NtkWriteAsserts( FILE * pFile, Abc_Ntk_t * pNtk )
-{
- Abc_Obj_t * pTerm, * pNet;
- int LineLength;
- int AddedLength;
- int NameCounter;
- int i;
-
- LineLength = 8;
- NameCounter = 0;
-
- Abc_NtkForEachAssert( pNtk, pTerm, i )
- {
- pNet = Abc_ObjFanin0(pTerm);
- // get the line length after this name is written
- AddedLength = strlen(Abc_ObjName(pNet)) + 1;
- if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
- { // write the line extender
- fprintf( pFile, " \\\n" );
- // reset the line length
- LineLength = 0;
- NameCounter = 0;
- }
- fprintf( pFile, " %s", Abc_ObjName(pNet) );
- LineLength += AddedLength;
- NameCounter++;
- }
-}
-
-/**Function*************************************************************
-
Synopsis [Write the latch into a file.]
Description []
@@ -395,7 +394,7 @@ void Io_NtkWriteAsserts( FILE * pFile, Abc_Ntk_t * pNtk )
***********************************************************************/
void Io_NtkWriteSubckt( FILE * pFile, Abc_Obj_t * pNode )
{
- Abc_Ntk_t * pModel = pNode->pData;
+ Abc_Ntk_t * pModel = (Abc_Ntk_t *)pNode->pData;
Abc_Obj_t * pTerm;
int i;
// write the subcircuit
@@ -487,7 +486,7 @@ void Io_NtkWriteNode( FILE * pFile, Abc_Obj_t * pNode, int Length )
***********************************************************************/
void Io_NtkWriteNodeGate( FILE * pFile, Abc_Obj_t * pNode, int Length )
{
- Mio_Gate_t * pGate = pNode->pData;
+ Mio_Gate_t * pGate = (Mio_Gate_t *)pNode->pData;
Mio_Pin_t * pGatePin;
int i;
// write the node
@@ -585,8 +584,52 @@ void Io_WriteTimingInfo( FILE * pFile, Abc_Ntk_t * pNtk )
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_NtkConvertBb2Wb( char * pFileNameIn, char * pFileNameOut, int fSeq, int fVerbose )
+{
+ FILE * pFile;
+ Abc_Ntk_t * pNetlist;
+ // check the files
+ pFile = fopen( pFileNameIn, "rb" );
+ if ( pFile == NULL )
+ {
+ printf( "Input file \"%s\" cannot be opened.\n", pFileNameIn );
+ return;
+ }
+ fclose( pFile );
+ // check the files
+ pFile = fopen( pFileNameOut, "wb" );
+ if ( pFile == NULL )
+ {
+ printf( "Output file \"%s\" cannot be opened.\n", pFileNameOut );
+ return;
+ }
+ fclose( pFile );
+ // derive AIG for signal correspondence
+ pNetlist = Io_ReadNetlist( pFileNameIn, Io_ReadFileType(pFileNameIn), 1 );
+ if ( pNetlist == NULL )
+ {
+ printf( "Reading input file \"%s\" has failed.\n", pFileNameIn );
+ return;
+ }
+ Io_WriteBlif( pNetlist, pFileNameOut, 1, 1, fSeq );
+ Abc_NtkDelete( pNetlist );
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteBlifMv.c b/src/base/io/ioWriteBlifMv.c
index e1494475..62028606 100644
--- a/src/base/io/ioWriteBlifMv.c
+++ b/src/base/io/ioWriteBlifMv.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -72,7 +75,7 @@ void Io_WriteBlifMv( Abc_Ntk_t * pNtk, char * FileName )
// write the remaining networks
if ( pNtk->pDesign )
{
- Vec_PtrForEachEntry( pNtk->pDesign->vModules, pNtkTemp, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pNtkTemp, i )
{
if ( pNtkTemp == pNtk )
continue;
@@ -135,14 +138,6 @@ void Io_NtkWriteBlifMvOne( FILE * pFile, Abc_Ntk_t * pNtk )
Io_NtkWriteBlifMvPos( pFile, pNtk );
fprintf( pFile, "\n" );
- // write the assertions
- if ( Abc_NtkAssertNum(pNtk) )
- {
- fprintf( pFile, ".asserts" );
- Io_NtkWriteBlifMvAsserts( pFile, pNtk );
- fprintf( pFile, "\n" );
- }
-
// write the MV directives
fprintf( pFile, "\n" );
Abc_NtkForEachCi( pNtk, pTerm, i )
@@ -286,46 +281,6 @@ void Io_NtkWriteBlifMvPos( FILE * pFile, Abc_Ntk_t * pNtk )
/**Function*************************************************************
- Synopsis [Writes the assertion list.]
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-void Io_NtkWriteBlifMvAsserts( FILE * pFile, Abc_Ntk_t * pNtk )
-{
- Abc_Obj_t * pTerm, * pNet;
- int LineLength;
- int AddedLength;
- int NameCounter;
- int i;
-
- LineLength = 8;
- NameCounter = 0;
-
- Abc_NtkForEachAssert( pNtk, pTerm, i )
- {
- pNet = Abc_ObjFanin0(pTerm);
- // get the line length after this name is written
- AddedLength = strlen(Abc_ObjName(pNet)) + 1;
- if ( NameCounter && LineLength + AddedLength + 3 > IO_WRITE_LINE_LENGTH )
- { // write the line extender
- fprintf( pFile, " \\\n" );
- // reset the line length
- LineLength = 0;
- NameCounter = 0;
- }
- fprintf( pFile, " %s", Abc_ObjName(pNet) );
- LineLength += AddedLength;
- NameCounter++;
- }
-}
-
-/**Function*************************************************************
-
Synopsis [Write the latch into a file.]
Description []
@@ -365,7 +320,7 @@ void Io_NtkWriteBlifMvLatch( FILE * pFile, Abc_Obj_t * pLatch )
***********************************************************************/
void Io_NtkWriteBlifMvSubckt( FILE * pFile, Abc_Obj_t * pNode )
{
- Abc_Ntk_t * pModel = pNode->pData;
+ Abc_Ntk_t * pModel = (Abc_Ntk_t *)pNode->pData;
Abc_Obj_t * pTerm;
int i;
// write the MV directives
@@ -436,7 +391,7 @@ void Io_NtkWriteBlifMvNode( FILE * pFile, Abc_Obj_t * pNode )
fprintf( pFile, "\n" );
// write the cubes
- pCur = Abc_ObjData(pNode);
+ pCur = (char *)Abc_ObjData(pNode);
if ( *pCur == 'd' )
{
fprintf( pFile, ".default " );
@@ -517,3 +472,5 @@ void Io_NtkWriteBlifMvNodeFanins( FILE * pFile, Abc_Obj_t * pNode )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteBook.c b/src/base/io/ioWriteBook.c
index 322c3ef4..9d0df473 100644
--- a/src/base/io/ioWriteBook.c
+++ b/src/base/io/ioWriteBook.c
@@ -21,6 +21,9 @@
#include "ioAbc.h"
#include "main.h"
#include "mio.h"
+
+ABC_NAMESPACE_IMPL_START
+
#define NODES 0
#define PL 1
#define coreHeight 1
@@ -33,8 +36,8 @@
static unsigned Io_NtkWriteNodes( FILE * pFile, Abc_Ntk_t * pNtk );
static void Io_NtkWritePiPoNodes( FILE * pFile, Abc_Ntk_t * pNtk );
-static void Io_NtkWriteLatchNode( FILE * pFile, Abc_Obj_t * pLatch, bool NodesOrPl );
-static unsigned Io_NtkWriteIntNode( FILE * pFile, Abc_Obj_t * pNode, bool NodesOrPl );
+static void Io_NtkWriteLatchNode( FILE * pFile, Abc_Obj_t * pLatch, int NodesOrPl );
+static unsigned Io_NtkWriteIntNode( FILE * pFile, Abc_Obj_t * pNode, int NodesOrPl );
static unsigned Io_NtkWriteNodeGate( FILE * pFile, Abc_Obj_t * pNode );
static void Io_NtkWriteNets( FILE * pFile, Abc_Ntk_t * pNtk );
static void Io_NtkWriteIntNet( FILE * pFile, Abc_Obj_t * pNode );
@@ -42,13 +45,13 @@ static void Io_NtkBuildLayout( FILE * pFile1, FILE *pFile2, Abc_Ntk_t * pNtk, do
static void Io_NtkWriteScl( FILE * pFile, unsigned numCoreRows, double layoutWidth );
static void Io_NtkWritePl( FILE * pFile, Abc_Ntk_t * pNtk, unsigned numTerms, double layoutHeight, double layoutWidth );
static Vec_Ptr_t * Io_NtkOrderingPads( Abc_Ntk_t * pNtk, Vec_Ptr_t * vTerms );
-static Abc_Obj_t * Io_NtkBfsPads( Abc_Ntk_t * pNtk, Abc_Obj_t * pCurrEntry, unsigned numTerms, bool * pOrdered );
-static bool Abc_NodeIsNand2( Abc_Obj_t * pNode );
-static bool Abc_NodeIsNor2( Abc_Obj_t * pNode );
-static bool Abc_NodeIsAnd2( Abc_Obj_t * pNode );
-static bool Abc_NodeIsOr2( Abc_Obj_t * pNode );
-static bool Abc_NodeIsXor2( Abc_Obj_t * pNode );
-static bool Abc_NodeIsXnor2( Abc_Obj_t * pNode );
+static Abc_Obj_t * Io_NtkBfsPads( Abc_Ntk_t * pNtk, Abc_Obj_t * pCurrEntry, unsigned numTerms, int * pOrdered );
+static int Abc_NodeIsNand2( Abc_Obj_t * pNode );
+static int Abc_NodeIsNor2( Abc_Obj_t * pNode );
+static int Abc_NodeIsAnd2( Abc_Obj_t * pNode );
+static int Abc_NodeIsOr2( Abc_Obj_t * pNode );
+static int Abc_NodeIsXor2( Abc_Obj_t * pNode );
+static int Abc_NodeIsXnor2( Abc_Obj_t * pNode );
static inline double Abc_Rint( double x ) { return (double)(int)x; }
@@ -139,7 +142,7 @@ void Io_WriteBook( Abc_Ntk_t * pNtk, char * FileName )
// write the hierarchy if present
if ( Abc_NtkBlackboxNum(pNtk) > 0 )
{
- Vec_PtrForEachEntry( pNtk->pDesign->vModules, pNtkTemp, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pNtkTemp, i )
{
if ( pNtkTemp == pNtk )
continue;
@@ -255,7 +258,7 @@ void Io_NtkWritePiPoNodes( FILE * pFile, Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-void Io_NtkWriteLatchNode( FILE * pFile, Abc_Obj_t * pLatch, bool NodesOrPl )
+void Io_NtkWriteLatchNode( FILE * pFile, Abc_Obj_t * pLatch, int NodesOrPl )
{
Abc_Obj_t * pNetLi, * pNetLo;
@@ -278,7 +281,7 @@ void Io_NtkWriteLatchNode( FILE * pFile, Abc_Obj_t * pLatch, bool NodesOrPl )
SeeAlso []
***********************************************************************/
-unsigned Io_NtkWriteIntNode( FILE * pFile, Abc_Obj_t * pNode, bool NodesOrPl )
+unsigned Io_NtkWriteIntNode( FILE * pFile, Abc_Obj_t * pNode, int NodesOrPl )
{
unsigned sizex=0, sizey=coreHeight, isize=0;
//double nx, ny, xstep, ystep;
@@ -317,7 +320,7 @@ unsigned Io_NtkWriteIntNode( FILE * pFile, Abc_Obj_t * pNode, bool NodesOrPl )
else
{
assert( isize > 2 );
- sizex=isize+Abc_SopGetCubeNum(pNode->pData);
+ sizex=isize+Abc_SopGetCubeNum((char *)pNode->pData);
}
}
}
@@ -370,7 +373,7 @@ unsigned Io_NtkWriteIntNode( FILE * pFile, Abc_Obj_t * pNode, bool NodesOrPl )
***********************************************************************/
unsigned Io_NtkWriteNodeGate( FILE * pFile, Abc_Obj_t * pNode )
{
- Mio_Gate_t * pGate = pNode->pData;
+ Mio_Gate_t * pGate = (Mio_Gate_t *)pNode->pData;
Mio_Pin_t * pGatePin;
int i;
// write the node gate
@@ -459,7 +462,7 @@ void Io_NtkWriteIntNet( FILE * pFile, Abc_Obj_t * pNet )
Abc_ObjForEachFanout( pFanin, pNeto, j )
fprintf( pFile, "%s_", Abc_ObjName(pNeto) );
if ( Abc_NtkHasMapping(pNet->pNtk) )
- fprintf( pFile, "%s : ", Mio_GateReadName(pFanin->pData) );
+ fprintf( pFile, "%s : ", Mio_GateReadName((Mio_Gate_t *)pFanin->pData) );
else
fprintf( pFile, "name I : " );
}
@@ -487,7 +490,7 @@ void Io_NtkWriteIntNet( FILE * pFile, Abc_Obj_t * pNet )
Abc_ObjForEachFanout( pFanout, pNeto, j )
fprintf( pFile, "%s_", Abc_ObjName(pNeto) );
if ( Abc_NtkHasMapping(pNet->pNtk) )
- fprintf( pFile, "%s : ", Mio_GateReadName(pFanout->pData) );
+ fprintf( pFile, "%s : ", Mio_GateReadName((Mio_Gate_t *)pFanout->pData) );
else
fprintf( pFile, "name O : " );
}
@@ -626,7 +629,7 @@ void Io_NtkWritePl( FILE * pFile, Abc_Ntk_t * pNtk, unsigned numTerms, double la
delta = layoutWidth / termsOnTop;
for(t = 0; t < termsOnTop; t++)
{
- pTerm = Vec_PtrEntry( vOrderedTerms, t );
+ pTerm = (Abc_Obj_t *)Vec_PtrEntry( vOrderedTerms, t );
if( Abc_ObjIsPi(pTerm) )
fprintf( pFile, "i%s_input\t\t", Abc_ObjName(Abc_ObjFanout0(pTerm)) );
else
@@ -642,7 +645,7 @@ void Io_NtkWritePl( FILE * pFile, Abc_Ntk_t * pNtk, unsigned numTerms, double la
delta = layoutWidth / termsOnBottom;
for(;t < termsOnTop+termsOnBottom; t++)
{
- pTerm = Vec_PtrEntry( vOrderedTerms, t );
+ pTerm = (Abc_Obj_t *)Vec_PtrEntry( vOrderedTerms, t );
if( Abc_ObjIsPi(pTerm) )
fprintf( pFile, "i%s_input\t\t", Abc_ObjName(Abc_ObjFanout0(pTerm)) );
else
@@ -658,7 +661,7 @@ void Io_NtkWritePl( FILE * pFile, Abc_Ntk_t * pNtk, unsigned numTerms, double la
delta = layoutHeight / termsOnLeft;
for(;t < termsOnTop+termsOnBottom+termsOnLeft; t++)
{
- pTerm = Vec_PtrEntry( vOrderedTerms, t );
+ pTerm = (Abc_Obj_t *)Vec_PtrEntry( vOrderedTerms, t );
if( Abc_ObjIsPi(pTerm) )
fprintf( pFile, "i%s_input\t\t", Abc_ObjName(Abc_ObjFanout0(pTerm)) );
else
@@ -674,7 +677,7 @@ void Io_NtkWritePl( FILE * pFile, Abc_Ntk_t * pNtk, unsigned numTerms, double la
delta = layoutHeight / termsOnRight;
for(;t < termsOnTop+termsOnBottom+termsOnLeft+termsOnRight; t++)
{
- pTerm = Vec_PtrEntry( vOrderedTerms, t );
+ pTerm = (Abc_Obj_t *)Vec_PtrEntry( vOrderedTerms, t );
if( Abc_ObjIsPi(pTerm) )
fprintf( pFile, "i%s_input\t\t", Abc_ObjName(Abc_ObjFanout0(pTerm)) );
else
@@ -715,8 +718,8 @@ Vec_Ptr_t * Io_NtkOrderingPads( Abc_Ntk_t * pNtk, Vec_Ptr_t * vTerms )
ProgressBar * pProgress;
unsigned numTerms=Vec_PtrSize(vTerms);
unsigned termIdx=0, termCount=0;
- bool * pOrdered = ABC_ALLOC(bool, numTerms);
- bool newNeighbor=1;
+ int * pOrdered = ABC_ALLOC(int, numTerms);
+ int newNeighbor=1;
Vec_Ptr_t * vOrderedTerms = Vec_PtrAlloc ( numTerms );
Abc_Obj_t * pNeighbor, * pNextTerm;
unsigned i;
@@ -724,13 +727,13 @@ Vec_Ptr_t * Io_NtkOrderingPads( Abc_Ntk_t * pNtk, Vec_Ptr_t * vTerms )
for( i=0 ; i<numTerms ; i++ )
pOrdered[i]=0;
- pNextTerm = Vec_PtrEntry(vTerms, termIdx++);
+ pNextTerm = (Abc_Obj_t *)Vec_PtrEntry(vTerms, termIdx++);
pProgress = Extra_ProgressBarStart( stdout, numTerms );
while( termCount < numTerms && termIdx < numTerms )
{
if( pOrdered[Abc_ObjId(pNextTerm)] && !newNeighbor )
{
- pNextTerm = Vec_PtrEntry( vTerms, termIdx++ );
+ pNextTerm = (Abc_Obj_t *)Vec_PtrEntry( vTerms, termIdx++ );
continue;
}
if(!Vec_PtrPushUnique( vOrderedTerms, pNextTerm ))
@@ -746,7 +749,7 @@ Vec_Ptr_t * Io_NtkOrderingPads( Abc_Ntk_t * pNtk, Vec_Ptr_t * vTerms )
pNextTerm=pNeighbor;
}
else if(termIdx < numTerms)
- pNextTerm = Vec_PtrEntry( vTerms, termIdx++ );
+ pNextTerm = (Abc_Obj_t *)Vec_PtrEntry( vTerms, termIdx++ );
Extra_ProgressBarUpdate( pProgress, termCount, NULL );
}
@@ -766,11 +769,11 @@ Vec_Ptr_t * Io_NtkOrderingPads( Abc_Ntk_t * pNtk, Vec_Ptr_t * vTerms )
SeeAlso []
***********************************************************************/
-Abc_Obj_t * Io_NtkBfsPads( Abc_Ntk_t * pNtk, Abc_Obj_t * pTerm, unsigned numTerms, bool * pOrdered )
+Abc_Obj_t * Io_NtkBfsPads( Abc_Ntk_t * pNtk, Abc_Obj_t * pTerm, unsigned numTerms, int * pOrdered )
{
Vec_Ptr_t * vNeighbors = Vec_PtrAlloc ( numTerms );
Abc_Obj_t * pNet, * pNode, * pNeighbor;
- bool foundNeighbor=0;
+ int foundNeighbor=0;
int i;
assert(Abc_ObjIsPi(pTerm) || Abc_ObjIsPo(pTerm) );
@@ -791,7 +794,7 @@ Abc_Obj_t * Io_NtkBfsPads( Abc_Ntk_t * pNtk, Abc_Obj_t * pTerm, unsigned numTerm
while ( Vec_PtrSize(vNeighbors) >0 )
{
- pNeighbor = Vec_PtrEntry( vNeighbors, 0 );
+ pNeighbor = (Abc_Obj_t *)Vec_PtrEntry( vNeighbors, 0 );
assert( Abc_ObjIsNode(pNeighbor) || Abc_ObjIsTerm(pNeighbor) );
Vec_PtrRemove( vNeighbors, pNeighbor );
@@ -836,7 +839,7 @@ Abc_Obj_t * Io_NtkBfsPads( Abc_Ntk_t * pNtk, Abc_Obj_t * pTerm, unsigned numTerm
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsNand2( Abc_Obj_t * pNode )
+int Abc_NodeIsNand2( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsNetlist(pNtk) );
@@ -844,11 +847,11 @@ bool Abc_NodeIsNand2( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 2 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return ( !strcmp((pNode->pData), "-0 1\n0- 1\n") ||
- !strcmp((pNode->pData), "0- 1\n-0 1\n") ||
- !strcmp((pNode->pData), "11 0\n") );
+ return ( !strcmp(((char *)pNode->pData), "-0 1\n0- 1\n") ||
+ !strcmp(((char *)pNode->pData), "0- 1\n-0 1\n") ||
+ !strcmp(((char *)pNode->pData), "11 0\n") );
if ( Abc_NtkHasMapping(pNtk) )
- return pNode->pData == Mio_LibraryReadNand2(Abc_FrameReadLibGen());
+ return pNode->pData == (void *)Mio_LibraryReadNand2((Mio_Library_t *)Abc_FrameReadLibGen());
assert( 0 );
return 0;
}
@@ -864,7 +867,7 @@ bool Abc_NodeIsNand2( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsNor2( Abc_Obj_t * pNode )
+int Abc_NodeIsNor2( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsNetlist(pNtk) );
@@ -872,7 +875,7 @@ bool Abc_NodeIsNor2( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 2 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return ( !strcmp((pNode->pData), "00 1\n") );
+ return ( !strcmp(((char *)pNode->pData), "00 1\n") );
assert( 0 );
return 0;
}
@@ -888,7 +891,7 @@ bool Abc_NodeIsNor2( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsAnd2( Abc_Obj_t * pNode )
+int Abc_NodeIsAnd2( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsNetlist(pNtk) );
@@ -896,9 +899,9 @@ bool Abc_NodeIsAnd2( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 2 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return Abc_SopIsAndType((pNode->pData));
+ return Abc_SopIsAndType(((char *)pNode->pData));
if ( Abc_NtkHasMapping(pNtk) )
- return pNode->pData == Mio_LibraryReadAnd2(Abc_FrameReadLibGen());
+ return pNode->pData == (void *)Mio_LibraryReadAnd2((Mio_Library_t *)Abc_FrameReadLibGen());
assert( 0 );
return 0;
}
@@ -914,7 +917,7 @@ bool Abc_NodeIsAnd2( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsOr2( Abc_Obj_t * pNode )
+int Abc_NodeIsOr2( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsNetlist(pNtk) );
@@ -922,10 +925,10 @@ bool Abc_NodeIsOr2( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 2 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return ( Abc_SopIsOrType((pNode->pData)) ||
- !strcmp((pNode->pData), "01 0\n") ||
- !strcmp((pNode->pData), "10 0\n") ||
- !strcmp((pNode->pData), "00 0\n") );
+ return ( Abc_SopIsOrType(((char *)pNode->pData)) ||
+ !strcmp(((char *)pNode->pData), "01 0\n") ||
+ !strcmp(((char *)pNode->pData), "10 0\n") ||
+ !strcmp(((char *)pNode->pData), "00 0\n") );
//off-sets, too
assert( 0 );
return 0;
@@ -942,7 +945,7 @@ bool Abc_NodeIsOr2( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsXor2( Abc_Obj_t * pNode )
+int Abc_NodeIsXor2( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsNetlist(pNtk) );
@@ -950,7 +953,7 @@ bool Abc_NodeIsXor2( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 2 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return ( !strcmp((pNode->pData), "01 1\n10 1\n") || !strcmp((pNode->pData), "10 1\n01 1\n") );
+ return ( !strcmp(((char *)pNode->pData), "01 1\n10 1\n") || !strcmp(((char *)pNode->pData), "10 1\n01 1\n") );
assert( 0 );
return 0;
}
@@ -966,7 +969,7 @@ bool Abc_NodeIsXor2( Abc_Obj_t * pNode )
SeeAlso []
***********************************************************************/
-bool Abc_NodeIsXnor2( Abc_Obj_t * pNode )
+int Abc_NodeIsXnor2( Abc_Obj_t * pNode )
{
Abc_Ntk_t * pNtk = pNode->pNtk;
assert( Abc_NtkIsNetlist(pNtk) );
@@ -974,7 +977,7 @@ bool Abc_NodeIsXnor2( Abc_Obj_t * pNode )
if ( Abc_ObjFaninNum(pNode) != 2 )
return 0;
if ( Abc_NtkHasSop(pNtk) )
- return ( !strcmp((pNode->pData), "11 1\n00 1\n") || !strcmp((pNode->pData), "00 1\n11 1\n") );
+ return ( !strcmp(((char *)pNode->pData), "11 1\n00 1\n") || !strcmp(((char *)pNode->pData), "00 1\n11 1\n") );
assert( 0 );
return 0;
}
@@ -984,3 +987,5 @@ bool Abc_NodeIsXnor2( Abc_Obj_t * pNode )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteCnf.c b/src/base/io/ioWriteCnf.c
index 3df189d1..6cb82a0a 100644
--- a/src/base/io/ioWriteCnf.c
+++ b/src/base/io/ioWriteCnf.c
@@ -21,6 +21,9 @@
#include "ioAbc.h"
#include "satSolver.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -68,7 +71,7 @@ int Io_WriteCnf( Abc_Ntk_t * pNtk, char * pFileName, int fAllPrimes )
if ( Abc_NtkIsLogic(pNtk) )
Abc_NtkToBdd( pNtk );
// create solver with clauses
- pSat = Abc_NtkMiterSatCreate( pNtk, fAllPrimes );
+ pSat = (sat_solver *)Abc_NtkMiterSatCreate( pNtk, fAllPrimes );
if ( pSat == NULL )
{
fprintf( stdout, "The problem is trivially UNSAT. No CNF file is generated.\n" );
@@ -113,3 +116,5 @@ void Io_WriteCnfOutputPiMapping( FILE * pFile, int incrementVars )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteDot.c b/src/base/io/ioWriteDot.c
index 64be1425..c1b9befc 100644
--- a/src/base/io/ioWriteDot.c
+++ b/src/base/io/ioWriteDot.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -105,10 +108,10 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
}
// mark the nodes from the set
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
pNode->fMarkC = 1;
if ( vNodesShow )
- Vec_PtrForEachEntry( vNodesShow, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodesShow, pNode, i )
pNode->fMarkB = 1;
// get the levels of nodes
@@ -117,7 +120,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
{
LevelMin = Abc_NtkLevelReverse( pNtk );
assert( LevelMax == LevelMin );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
if ( Abc_ObjIsNode(pNode) )
pNode->Level = LevelMax - pNode->Level + 1;
}
@@ -126,7 +129,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
LevelMin = 10000;
LevelMax = -1;
fHasCos = 0;
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjIsCo(pNode) )
{
@@ -143,7 +146,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
if ( fHasCos )
{
LevelMax++;
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjIsCo(pNode) )
pNode->Level = LevelMax;
@@ -247,7 +250,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
// the labeling node of this level
fprintf( pFile, " Level%d;\n", LevelMax );
// generate the PO nodes
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( !Abc_ObjIsCo(pNode) )
continue;
@@ -273,7 +276,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
fprintf( pFile, " rank = same;\n" );
// the labeling node of this level
fprintf( pFile, " Level%d;\n", Level );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( (int)pNode->Level != Level )
continue;
@@ -296,11 +299,11 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
if ( Abc_NtkIsStrash(pNtk) )
pSopString = "";
else if ( Abc_NtkHasMapping(pNtk) && fGateNames )
- pSopString = Mio_GateReadName(pNode->pData);
+ pSopString = Mio_GateReadName((Mio_Gate_t *)pNode->pData);
else if ( Abc_NtkHasMapping(pNtk) )
- pSopString = Abc_NtkPrintSop(Mio_GateReadSop(pNode->pData));
+ pSopString = Abc_NtkPrintSop(Mio_GateReadSop((Mio_Gate_t *)pNode->pData));
else
- pSopString = Abc_NtkPrintSop(pNode->pData);
+ pSopString = Abc_NtkPrintSop((char *)pNode->pData);
fprintf( pFile, " Node%d [label = \"%d\\n%s\"", pNode->Id, pNode->Id, pSopString );
// fprintf( pFile, " Node%d [label = \"%d\\n%s\"", pNode->Id,
// SuppSize,
@@ -324,7 +327,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
// the labeling node of this level
fprintf( pFile, " Level%d;\n", LevelMin );
// generate the PO nodes
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( !Abc_ObjIsCi(pNode) )
{
@@ -356,7 +359,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
// generate invisible edges from the square down
fprintf( pFile, "title1 -> title2 [style = invis];\n" );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( (int)pNode->Level != LevelMax )
continue;
@@ -364,7 +367,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
}
// generate edges
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjIsLatch(pNode) )
continue;
@@ -392,10 +395,10 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
fclose( pFile );
// unmark the nodes from the set
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
pNode->fMarkC = 0;
if ( vNodesShow )
- Vec_PtrForEachEntry( vNodesShow, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodesShow, pNode, i )
pNode->fMarkB = 0;
// convert the network back into BDDs if this is how it was
@@ -456,10 +459,10 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
}
// mark the nodes from the set
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
pNode->fMarkC = 1;
if ( vNodesShow )
- Vec_PtrForEachEntry( vNodesShow, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodesShow, pNode, i )
pNode->fMarkB = 1;
// get the levels of nodes
@@ -468,7 +471,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
{
LevelMin = Abc_NtkLevelReverse( pNtk );
assert( LevelMax == LevelMin );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
if ( Abc_ObjIsNode(pNode) )
pNode->Level = LevelMax - pNode->Level + 1;
}
@@ -477,7 +480,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
LevelMin = 10000;
LevelMax = -1;
fHasCos = 0;
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjIsCo(pNode) )
{
@@ -494,7 +497,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
if ( fHasCos )
{
LevelMax++;
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjIsCo(pNode) )
pNode->Level = LevelMax;
@@ -598,7 +601,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
// the labeling node of this level
fprintf( pFile, " Level%d;\n", LevelMax );
// generate the PO nodes
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( !Abc_ObjIsPo(pNode) )
continue;
@@ -629,11 +632,11 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
if ( Abc_NtkIsStrash(pNtk) )
pSopString = "";
else if ( Abc_NtkHasMapping(pNtk) && fGateNames )
- pSopString = Mio_GateReadName(pNode->pData);
+ pSopString = Mio_GateReadName((Mio_Gate_t *)pNode->pData);
else if ( Abc_NtkHasMapping(pNtk) )
- pSopString = Abc_NtkPrintSop(Mio_GateReadSop(pNode->pData));
+ pSopString = Abc_NtkPrintSop(Mio_GateReadSop((Mio_Gate_t *)pNode->pData));
else
- pSopString = Abc_NtkPrintSop(pNode->pData);
+ pSopString = Abc_NtkPrintSop((char *)pNode->pData);
fprintf( pFile, " Node%d [label = \"%d\\n%s\"", pNode->Id, pNode->Id, pSopString );
fprintf( pFile, ", shape = ellipse" );
@@ -654,7 +657,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
// the labeling node of this level
fprintf( pFile, " Level%d;\n", LevelMin );
// generate the PO nodes
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( pNode->Level > 0 )
continue;
@@ -685,7 +688,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
}
// fprintf( pFile, "{\n" );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( !Abc_ObjIsLatch(pNode) )
continue;
@@ -702,7 +705,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
// generate invisible edges from the square down
fprintf( pFile, "title1 -> title2 [style = invis];\n" );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( (int)pNode->Level != LevelMax )
continue;
@@ -712,7 +715,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
}
// generate edges
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
if ( Abc_ObjIsBi(pNode) || Abc_ObjIsBo(pNode) )
continue;
@@ -750,10 +753,10 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
fclose( pFile );
// unmark the nodes from the set
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
pNode->fMarkC = 0;
if ( vNodesShow )
- Vec_PtrForEachEntry( vNodesShow, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodesShow, pNode, i )
pNode->fMarkB = 0;
// convert the network back into BDDs if this is how it was
@@ -807,7 +810,7 @@ int Abc_NtkCountLogicNodes( Vec_Ptr_t * vNodes )
{
Abc_Obj_t * pObj;
int i, Counter = 0;
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
if ( !Abc_ObjIsNode(pObj) )
continue;
@@ -823,3 +826,5 @@ int Abc_NtkCountLogicNodes( Vec_Ptr_t * vNodes )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteEqn.c b/src/base/io/ioWriteEqn.c
index 228e4ae9..d3784187 100644
--- a/src/base/io/ioWriteEqn.c
+++ b/src/base/io/ioWriteEqn.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -108,9 +111,9 @@ void Io_NtkWriteEqnOne( FILE * pFile, Abc_Ntk_t * pNtk )
fprintf( pFile, "%s = ", Abc_ObjName(Abc_ObjFanout0(pNode)) );
// set the input names
Abc_ObjForEachFanin( pNode, pFanin, k )
- Hop_IthVar(pNtk->pManFunc, k)->pData = Abc_ObjName(pFanin);
+ Hop_IthVar((Hop_Man_t *)pNtk->pManFunc, k)->pData = Abc_ObjName(pFanin);
// write the formula
- Hop_ObjPrintEqn( pFile, pNode->pData, vLevels, 0 );
+ Hop_ObjPrintEqn( pFile, (Hop_Obj_t *)pNode->pData, vLevels, 0 );
fprintf( pFile, ";\n" );
}
Extra_ProgressBarStop( pProgress );
@@ -250,3 +253,5 @@ int Io_NtkWriteEqnCheck( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteGml.c b/src/base/io/ioWriteGml.c
index d84e5f67..49a90d9c 100644
--- a/src/base/io/ioWriteGml.c
+++ b/src/base/io/ioWriteGml.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -114,3 +117,5 @@ void Io_WriteGml( Abc_Ntk_t * pNtk, char * pFileName )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteList.c b/src/base/io/ioWriteList.c
index c06b39d7..22d0d1af 100644
--- a/src/base/io/ioWriteList.c
+++ b/src/base/io/ioWriteList.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
-------- Original Message --------
Subject: Re: abc release and retiming
@@ -286,3 +289,5 @@ void Io_WriteCellNet( Abc_Ntk_t * pNtk, char * pFileName )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWritePla.c b/src/base/io/ioWritePla.c
index 93332793..ce6ee31f 100644
--- a/src/base/io/ioWritePla.c
+++ b/src/base/io/ioWritePla.c
@@ -20,6 +20,9 @@
#include "ioAbc.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -100,7 +103,7 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
nProducts++;
continue;
}
- nProducts += Abc_SopGetCubeNum(pDriver->pData);
+ nProducts += Abc_SopGetCubeNum((char *)pDriver->pData);
}
// collect the parameters
@@ -155,11 +158,11 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
}
// make sure the cover is not complemented
- assert( !Abc_SopIsComplement( pDriver->pData ) );
+ assert( !Abc_SopIsComplement( (char *)pDriver->pData ) );
// write the cubes
nFanins = Abc_ObjFaninNum(pDriver);
- Abc_SopForEachCube( pDriver->pData, nFanins, pCube )
+ Abc_SopForEachCube( (char *)pDriver->pData, nFanins, pCube )
{
Abc_ObjForEachFanin( pDriver, pFanin, k )
{
@@ -195,3 +198,5 @@ int Io_WritePlaOne( FILE * pFile, Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteSmv.c b/src/base/io/ioWriteSmv.c
new file mode 100644
index 00000000..c767bcaa
--- /dev/null
+++ b/src/base/io/ioWriteSmv.c
@@ -0,0 +1,265 @@
+/**CFile****************************************************************
+
+ FileName [ioWriteSmv.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Command processing package.]
+
+ Synopsis [Procedures to write the network in SMV format.]
+
+ Author [Satrajit Chatterjee]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: ioWriteSmv.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "ioAbc.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+static int Io_WriteSmvCheckNames( Abc_Ntk_t * pNtk );
+
+static int Io_WriteSmvOne( FILE * pFile, Abc_Ntk_t * pNtk );
+static int Io_WriteSmvOneNode( FILE * pFile, Abc_Obj_t * pNode );
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+// This returns a pointer to a static area, so be careful in using results
+// of this function i.e. don't call this twice in the same printf call.
+//
+// This function replaces '|' with '_' I think abc introduces '|' when
+// flattening hierarchy. The '|' is interpreted as a or function by nusmv
+// which is unfortunate. This probably should be fixed elsewhere.
+static char *cleanUNSAFE( const char *s )
+{
+ char *t;
+ static char buffer[1024];
+ assert (strlen(s) < 1024);
+ strcpy(buffer, s);
+ for (t = buffer; *t != 0; ++t) *t = (*t == '|') ? '_' : *t;
+ return buffer;
+}
+
+static int hasPrefix(const char *needle, const char *haystack)
+{
+ return (strncmp(haystack, needle, strlen(needle)) == 0);
+}
+
+/**Function*************************************************************
+
+ Synopsis [Writes the network in SMV format.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Io_WriteSmv( Abc_Ntk_t * pNtk, char * pFileName )
+{
+ Abc_Ntk_t * pExdc;
+ FILE * pFile;
+ assert( Abc_NtkIsSopNetlist(pNtk) );
+ if ( !Io_WriteSmvCheckNames(pNtk) )
+ {
+ fprintf( stdout, "Io_WriteSmv(): Signal names in this benchmark contain parantheses making them impossible to reproduce in the SMV format. Use \"short_names\".\n" );
+ return 0;
+ }
+ pFile = fopen( pFileName, "w" );
+ if ( pFile == NULL )
+ {
+ fprintf( stdout, "Io_WriteSmv(): Cannot open the output file.\n" );
+ return 0;
+ }
+ fprintf( pFile, "-- benchmark \"%s\" written by ABC on %s\n", pNtk->pName, Extra_TimeStamp() );
+ // write the network
+ Io_WriteSmvOne( pFile, pNtk );
+ // write EXDC network if it exists
+ pExdc = Abc_NtkExdc( pNtk );
+ if ( pExdc )
+ printf( "Io_WriteSmv: EXDC is not written (warning).\n" );
+ // finalize the file
+ fclose( pFile );
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Writes the network in SMV format.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Io_WriteSmvOne( FILE * pFile, Abc_Ntk_t * pNtk )
+{
+ ProgressBar * pProgress;
+ Abc_Obj_t * pNode;
+ int i;
+
+ // write the PIs/POs/latches
+ fprintf( pFile, "MODULE main\n"); // nusmv needs top module to be main
+ fprintf ( pFile, "\n" );
+
+ fprintf( pFile, "VAR -- inputs\n");
+ Abc_NtkForEachPi( pNtk, pNode, i )
+ fprintf( pFile, " %s : boolean;\n",
+ cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(pNode))) );
+ fprintf ( pFile, "\n" );
+
+ fprintf( pFile, "VAR -- state variables\n");
+ Abc_NtkForEachLatch( pNtk, pNode, i )
+ fprintf( pFile, " %s : boolean;\n",
+ cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(Abc_ObjFanout0(pNode)))) );
+ fprintf ( pFile, "\n" );
+
+ // No outputs needed for NuSMV:
+ // TODO: Add sepcs by recognizing assume_.* and assert_.*
+ //
+ // Abc_NtkForEachPo( pNtk, pNode, i )
+ // fprintf( pFile, "OUTPUT(%s)\n", Abc_ObjName(Abc_ObjFanin0(pNode)) );
+
+ // write internal nodes
+ fprintf( pFile, "DEFINE\n");
+ pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
+ Abc_NtkForEachNode( pNtk, pNode, i )
+ {
+ Extra_ProgressBarUpdate( pProgress, i, NULL );
+ Io_WriteSmvOneNode( pFile, pNode );
+ }
+ Extra_ProgressBarStop( pProgress );
+ fprintf ( pFile, "\n" );
+
+ fprintf( pFile, "ASSIGN\n");
+ Abc_NtkForEachLatch( pNtk, pNode, i )
+ {
+ int Reset = (int)(ABC_PTRUINT_T)Abc_ObjData( pNode );
+ assert (Reset >= 1);
+ assert (Reset <= 3);
+
+ if (Reset != 3)
+ {
+ fprintf( pFile, " init(%s) := %d;\n",
+ cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(Abc_ObjFanout0(pNode)))),
+ Reset - 1);
+ }
+ fprintf( pFile, " next(%s) := ",
+ cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(Abc_ObjFanout0(pNode)))) );
+ fprintf( pFile, "%s;\n",
+ cleanUNSAFE(Abc_ObjName(Abc_ObjFanin0(Abc_ObjFanin0(pNode)))) );
+ }
+
+ fprintf ( pFile, "\n" );
+ Abc_NtkForEachPo( pNtk, pNode, i )
+ {
+ const char *n = cleanUNSAFE(Abc_ObjName(Abc_ObjFanin0(pNode)));
+ // fprintf( pFile, "-- output %s;\n", n );
+ if (hasPrefix("assume_fair_", n))
+ {
+ fprintf( pFile, "FAIRNESS %s;\n", n );
+ }
+ else if (hasPrefix("Assert_", n) ||
+ hasPrefix("assert_safety_", n))
+ {
+ fprintf( pFile, "INVARSPEC %s;\n", n );
+ }
+ else if (hasPrefix("assert_fair_", n))
+ {
+ fprintf( pFile, "LTLSPEC G F %s;\n", n );
+ }
+ }
+
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Writes the network in SMV format.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Io_WriteSmvOneNode( FILE * pFile, Abc_Obj_t * pNode )
+{
+ int nFanins;
+
+ assert( Abc_ObjIsNode(pNode) );
+ nFanins = Abc_ObjFaninNum(pNode);
+ if ( nFanins == 0 )
+ { // write the constant 1 node
+ assert( Abc_NodeIsConst1(pNode) );
+ fprintf( pFile, " %s", cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(pNode)) ) );
+ fprintf( pFile, " := 1;\n" );
+ }
+ else if ( nFanins == 1 )
+ { // write the interver/buffer
+ if ( Abc_NodeIsBuf(pNode) )
+ {
+ fprintf( pFile, " %s := ", cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(pNode))) );
+ fprintf( pFile, "%s;\n", cleanUNSAFE(Abc_ObjName(Abc_ObjFanin0(pNode))) );
+ }
+ else
+ {
+ fprintf( pFile, " %s := !", cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(pNode))) );
+ fprintf( pFile, "%s;\n", cleanUNSAFE(Abc_ObjName(Abc_ObjFanin0(pNode))) );
+ }
+ }
+ else
+ { // write the AND gate
+ fprintf( pFile, " %s", cleanUNSAFE(Abc_ObjName(Abc_ObjFanout0(pNode))) );
+ fprintf( pFile, " := %s & ", cleanUNSAFE(Abc_ObjName(Abc_ObjFanin0(pNode))) );
+ fprintf( pFile, "%s;\n", cleanUNSAFE(Abc_ObjName(Abc_ObjFanin1(pNode))) );
+ }
+ return 1;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Returns 1 if the names cannot be written into the bench file.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Io_WriteSmvCheckNames( Abc_Ntk_t * pNtk )
+{
+ Abc_Obj_t * pObj;
+ char * pName;
+ int i;
+ Abc_NtkForEachObj( pNtk, pObj, i )
+ for ( pName = Nm_ManFindNameById(pNtk->pManName, i); pName && *pName; pName++ )
+ if ( *pName == '(' || *pName == ')' )
+ return 0;
+ return 1;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/ioWriteVerilog.c b/src/base/io/ioWriteVerilog.c
index f2ac1b1d..7f9bee95 100644
--- a/src/base/io/ioWriteVerilog.c
+++ b/src/base/io/ioWriteVerilog.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "mio.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -80,7 +83,7 @@ void Io_WriteVerilog( Abc_Ntk_t * pNtk, char * pFileName )
// write the network first
Io_WriteVerilogInt( pFile, pNtk );
// write other things
- Vec_PtrForEachEntry( pNtk->pDesign->vModules, pNetlist, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pNtk->pDesign->vModules, pNetlist, i )
{
assert( Abc_NtkIsNetlist(pNetlist) );
if ( pNetlist == pNtk )
@@ -495,7 +498,7 @@ void Io_WriteVerilogObjects( FILE * pFile, Abc_Ntk_t * pNtk )
{
if ( Abc_ObjIsLatch(pObj) )
continue;
- pNtkBox = pObj->pData;
+ pNtkBox = (Abc_Ntk_t *)pObj->pData;
fprintf( pFile, " %s box%0*d", pNtkBox->pName, nDigits, Counter++ );
fprintf( pFile, "(" );
Abc_NtkForEachPi( pNtkBox, pTerm, k )
@@ -513,12 +516,12 @@ void Io_WriteVerilogObjects( FILE * pFile, Abc_Ntk_t * pNtk )
// write nodes
if ( Abc_NtkHasMapping(pNtk) )
{
- Length = Mio_LibraryReadGateNameMax(pNtk->pManFunc);
+ Length = Mio_LibraryReadGateNameMax((Mio_Library_t *)pNtk->pManFunc);
nDigits = Extra_Base10Log( Abc_NtkNodeNum(pNtk) );
Counter = 0;
Abc_NtkForEachNode( pNtk, pObj, k )
{
- Mio_Gate_t * pGate = pObj->pData;
+ Mio_Gate_t * pGate = (Mio_Gate_t *)pObj->pData;
Mio_Pin_t * pGatePin;
// write the node
fprintf( pFile, " %-*s g%0*d", Length, Mio_GateReadName(pGate), nDigits, Counter++ );
@@ -539,17 +542,17 @@ void Io_WriteVerilogObjects( FILE * pFile, Abc_Ntk_t * pNtk )
vLevels = Vec_VecAlloc( 10 );
Abc_NtkForEachNode( pNtk, pObj, i )
{
- pFunc = pObj->pData;
+ pFunc = (Hop_Obj_t *)pObj->pData;
fprintf( pFile, " assign %s = ", Io_WriteVerilogGetName(Abc_ObjName(Abc_ObjFanout0(pObj))) );
// set the input names
Abc_ObjForEachFanin( pObj, pFanin, k )
- Hop_IthVar(pNtk->pManFunc, k)->pData = Extra_UtilStrsav(Io_WriteVerilogGetName(Abc_ObjName(pFanin)));
+ Hop_IthVar((Hop_Man_t *)pNtk->pManFunc, k)->pData = Extra_UtilStrsav(Io_WriteVerilogGetName(Abc_ObjName(pFanin)));
// write the formula
Hop_ObjPrintVerilog( pFile, pFunc, vLevels, 0 );
fprintf( pFile, ";\n" );
// clear the input names
Abc_ObjForEachFanin( pObj, pFanin, k )
- ABC_FREE( Hop_IthVar(pNtk->pManFunc, k)->pData );
+ ABC_FREE( Hop_IthVar((Hop_Man_t *)pNtk->pManFunc, k)->pData );
}
Vec_VecFree( vLevels );
}
@@ -637,3 +640,5 @@ char * Io_WriteVerilogGetName( char * pName )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/io/module.make b/src/base/io/module.make
index 993bd7d2..dee459da 100644
--- a/src/base/io/module.make
+++ b/src/base/io/module.make
@@ -25,4 +25,5 @@ SRC += src/base/io/io.c \
src/base/io/ioWriteGml.c \
src/base/io/ioWriteList.c \
src/base/io/ioWritePla.c \
- src/base/io/ioWriteVerilog.c
+ src/base/io/ioWriteVerilog.c \
+ src/base/io/ioWriteSmv.c
diff --git a/src/base/main/libSupport.c b/src/base/main/libSupport.c
index 6bffc2bd..3c0b20c7 100644
--- a/src/base/main/libSupport.c
+++ b/src/base/main/libSupport.c
@@ -20,8 +20,12 @@
#include <stdio.h>
#include <string.h>
+
+#include "abc.h"
#include "mainInt.h"
-#include "abc_global.h"
+
+ABC_NAMESPACE_IMPL_START
+
#ifndef WIN32
# include <sys/types.h>
@@ -29,6 +33,14 @@
# include <dlfcn.h>
#endif
+// fix by Paddy O'Brien on Sep 22, 2009
+#ifdef __CYGWIN__
+#ifndef RTLD_LOCAL
+#define RTLD_LOCAL 0
+#endif
+#endif
+
+
#define MAX_LIBS 256
static void* libHandles[MAX_LIBS+1]; // will be null terminated
@@ -192,3 +204,5 @@ void Libs_End(Abc_Frame_t * pAbc)
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/main/main.c b/src/base/main/main.c
index ebe7c755..42ea255d 100644
--- a/src/base/main/main.c
+++ b/src/base/main/main.c
@@ -17,9 +17,17 @@
Revision [$Id: main.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
-
+
+#include "abc.h"
#include "mainInt.h"
+#ifdef ABC_PYTHON_EMBED
+#include <Python.h>
+
+#endif /* ABC_PYTHON_EMBED */
+
+ABC_NAMESPACE_IMPL_START
+
// this line should be included in the library project
//#define ABC_LIB
@@ -29,7 +37,7 @@
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static int TypeCheck( Abc_Frame_t * pAbc, char * s);
+static int TypeCheck( Abc_Frame_t * pAbc, const char * s);
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -48,23 +56,20 @@ static int TypeCheck( Abc_Frame_t * pAbc, char * s);
SeeAlso []
***********************************************************************/
-#if defined(ABC_USE_BINARY)
-int main_( int argc, char * argv[] )
-#else
-int main( int argc, char * argv[] )
-#endif
+int Abc_RealMain( int argc, char * argv[] )
{
Abc_Frame_t * pAbc;
char sCommandUsr[500], sCommandTmp[100], sReadCmd[20], sWriteCmd[20], c;
- char * sCommand, * sOutFile, * sInFile;
+ const char * sOutFile, * sInFile;
+ char * sCommand;
int fStatus = 0;
- bool fBatch, fInitSource, fInitRead, fFinalWrite;
+ int fBatch, fInitSource, fInitRead, fFinalWrite;
// added to detect memory leaks:
#if defined(_DEBUG) && defined(_MSC_VER)
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
-
+
// Npn_Experiment();
// Npn_Generate();
@@ -72,6 +77,23 @@ int main( int argc, char * argv[] )
// will be initialized on first call
pAbc = Abc_FrameGetGlobalFrame();
+#ifdef ABC_PYTHON_EMBED
+ {
+ PyObject* pName;
+ PyObject* pModule;
+ void init_pyabc(void);
+
+ Py_SetProgramName(argv[0]);
+ Py_NoSiteFlag = 1;
+ Py_Initialize();
+
+ init_pyabc();
+
+ pModule = PyImport_ImportModule("pyabc");
+ Py_DECREF(pModule);
+ }
+#endif /* ABC_PYTHON_EMBED */
+
// default options
fBatch = 0;
fInitSource = 1;
@@ -223,9 +245,15 @@ int main( int argc, char * argv[] )
break;
}
}
-
+
+#ifdef ABC_PYTHON_EMBED
+ {
+ Py_Finalize();
+ }
+#endif /* ABC_PYTHON_EMBED */
+
// if the memory should be freed, quit packages
- if ( fStatus < 0 )
+// if ( fStatus < 0 )
{
Abc_Stop();
}
@@ -239,57 +267,6 @@ usage:
#endif
-/**Function*************************************************************
-
- Synopsis [Initialization procedure for the library project.]
-
- Description [Note that when Abc_Start() is run in a static library
- project, it does not load the resource file by default. As a result,
- ABC is not set up the same way, as when it is run on a command line.
- For example, some error messages while parsing files will not be
- produced, and intermediate networks will not be checked for consistancy.
- One possibility is to load the resource file after Abc_Start() as follows:
- Abc_UtilsSource( Abc_FrameGetGlobalFrame() );]
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-void Abc_Start()
-{
- Abc_Frame_t * pAbc;
- // added to detect memory leaks:
-#if defined(_DEBUG) && defined(_MSC_VER)
- _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
-#endif
- // start the glocal frame
- pAbc = Abc_FrameGetGlobalFrame();
- // source the resource file
-// Abc_UtilsSource( pAbc );
-}
-
-/**Function*************************************************************
-
- Synopsis [Deallocation procedure for the library project.]
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-void Abc_Stop()
-{
- Abc_Frame_t * pAbc;
- pAbc = Abc_FrameGetGlobalFrame();
- // perform uninitializations
- Abc_FrameEnd( pAbc );
- // stop the framework
- Abc_FrameDeallocate( pAbc );
-}
-
/**Function********************************************************************
Synopsis [Returns 1 if s is a file type recognized, else returns 0.]
@@ -300,7 +277,7 @@ void Abc_Stop()
SideEffects []
******************************************************************************/
-static int TypeCheck( Abc_Frame_t * pAbc, char * s )
+static int TypeCheck( Abc_Frame_t * pAbc, const char * s )
{
if (strcmp(s, "blif") == 0)
return 1;
@@ -324,3 +301,13 @@ static int TypeCheck( Abc_Frame_t * pAbc, char * s )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
+#if defined(ABC_USE_BINARY)
+int main_( int argc, char * argv[] )
+#else
+int main( int argc, char * argv[] )
+#endif
+{
+ return ABC_NAMESPACE_PREFIX Abc_RealMain(argc, argv);
+}
diff --git a/src/base/main/main.h b/src/base/main/main.h
index 0c5aeb3e..f3e03b47 100644
--- a/src/base/main/main.h
+++ b/src/base/main/main.h
@@ -21,12 +21,6 @@
#ifndef __MAIN_H__
#define __MAIN_H__
-////////////////////////////////////////////////////////////////////////
-/// TYPEDEFS ///
-////////////////////////////////////////////////////////////////////////
-
-// the framework containing all data
-typedef struct Abc_Frame_t_ Abc_Frame_t;
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
@@ -39,16 +33,24 @@ typedef struct Abc_Frame_t_ Abc_Frame_t;
// core packages
#include "abc.h"
+
+ABC_NAMESPACE_HEADER_START
+// the framework containing all data
+typedef struct Abc_Frame_t_ Abc_Frame_t;
+ABC_NAMESPACE_HEADER_END
+
#include "cmd.h"
#include "ioAbc.h"
+ABC_NAMESPACE_HEADER_START
+
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+////////////////////////////////////////////////////////////////////////
+/// TYPEDEFS ///
+////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// GLOBAL VARIABLES ///
@@ -74,10 +76,11 @@ extern ABC_DLL void Abc_Stop();
extern ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk( Abc_Frame_t * p );
extern ABC_DLL FILE * Abc_FrameReadOut( Abc_Frame_t * p );
extern ABC_DLL FILE * Abc_FrameReadErr( Abc_Frame_t * p );
-extern ABC_DLL bool Abc_FrameReadMode( Abc_Frame_t * p );
-extern ABC_DLL bool Abc_FrameSetMode( Abc_Frame_t * p, bool fNameMode );
+extern ABC_DLL int Abc_FrameReadMode( Abc_Frame_t * p );
+extern ABC_DLL int Abc_FrameSetMode( Abc_Frame_t * p, int fNameMode );
extern ABC_DLL void Abc_FrameRestart( Abc_Frame_t * p );
-extern ABC_DLL bool Abc_FrameShowProgress( Abc_Frame_t * p );
+extern ABC_DLL int Abc_FrameShowProgress( Abc_Frame_t * p );
+extern ABC_DLL void Abc_FrameClearVerifStatus( Abc_Frame_t * p );
extern ABC_DLL void Abc_FrameSetCurrentNetwork( Abc_Frame_t * p, Abc_Ntk_t * pNet );
extern ABC_DLL void Abc_FrameSwapCurrentAndBackup( Abc_Frame_t * p );
@@ -99,7 +102,16 @@ extern ABC_DLL void * Abc_FrameReadLibVer();
extern ABC_DLL void * Abc_FrameReadManDd();
extern ABC_DLL void * Abc_FrameReadManDec();
extern ABC_DLL char * Abc_FrameReadFlag( char * pFlag );
-extern ABC_DLL bool Abc_FrameIsFlagEnabled( char * pFlag );
+extern ABC_DLL int Abc_FrameIsFlagEnabled( char * pFlag );
+
+extern ABC_DLL int Abc_FrameReadBmcFrames( Abc_Frame_t * p );
+extern ABC_DLL int Abc_FrameReadProbStatus( Abc_Frame_t * p );
+extern ABC_DLL void * Abc_FrameReadCex( Abc_Frame_t * p );
+
+extern ABC_DLL int Abc_FrameReadCexPiNum( Abc_Frame_t * p );
+extern ABC_DLL int Abc_FrameReadCexRegNum( Abc_Frame_t * p );
+extern ABC_DLL int Abc_FrameReadCexPo( Abc_Frame_t * p );
+extern ABC_DLL int Abc_FrameReadCexFrame( Abc_Frame_t * p );
extern ABC_DLL void Abc_FrameSetNtkStore( Abc_Ntk_t * pNtk );
extern ABC_DLL void Abc_FrameSetNtkStoreSize( int nStored );
@@ -110,9 +122,11 @@ extern ABC_DLL void Abc_FrameSetLibSuper( void * pLib );
extern ABC_DLL void Abc_FrameSetLibVer( void * pLib );
extern ABC_DLL void Abc_FrameSetFlag( char * pFlag, char * pValue );
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif
diff --git a/src/base/main/mainFrame.c b/src/base/main/mainFrame.c
index 81070bd8..6a2fe5b3 100644
--- a/src/base/main/mainFrame.c
+++ b/src/base/main/mainFrame.c
@@ -18,19 +18,20 @@
***********************************************************************/
-#include "mainInt.h"
#include "abc.h"
+#include "mainInt.h"
#include "dec.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
static Abc_Frame_t * s_GlobalFrame = NULL;
-extern void * Aig_ManDupSimple( void * p );
-extern void Aig_ManStop( void * pAig );
-
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
@@ -46,23 +47,32 @@ extern void Aig_ManStop( void * pAig );
SeeAlso []
***********************************************************************/
-Vec_Ptr_t * Abc_FrameReadStore() { return s_GlobalFrame->vStore; }
-int Abc_FrameReadStoreSize() { return Vec_PtrSize(s_GlobalFrame->vStore); }
-void * Abc_FrameReadLibLut() { return s_GlobalFrame->pLibLut; }
-void * Abc_FrameReadLibGen() { return s_GlobalFrame->pLibGen; }
-void * Abc_FrameReadLibGen2() { return s_GlobalFrame->pLibGen2; }
-void * Abc_FrameReadLibSuper() { return s_GlobalFrame->pLibSuper; }
-void * Abc_FrameReadLibVer() { return s_GlobalFrame->pLibVer; }
-void * Abc_FrameReadManDd() { if ( s_GlobalFrame->dd == NULL ) s_GlobalFrame->dd = Cudd_Init( 0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 ); return s_GlobalFrame->dd; }
-void * Abc_FrameReadManDec() { if ( s_GlobalFrame->pManDec == NULL ) s_GlobalFrame->pManDec = Dec_ManStart(); return s_GlobalFrame->pManDec; }
-char * Abc_FrameReadFlag( char * pFlag ) { return Cmd_FlagReadByName( s_GlobalFrame, pFlag ); }
-
-void Abc_FrameSetLibLut( void * pLib ) { s_GlobalFrame->pLibLut = pLib; }
-void Abc_FrameSetLibGen( void * pLib ) { s_GlobalFrame->pLibGen = pLib; }
-void Abc_FrameSetLibGen2( void * pLib ) { s_GlobalFrame->pLibGen2 = pLib; }
-void Abc_FrameSetLibSuper( void * pLib ) { s_GlobalFrame->pLibSuper = pLib; }
-void Abc_FrameSetLibVer( void * pLib ) { s_GlobalFrame->pLibVer = pLib; }
-void Abc_FrameSetFlag( char * pFlag, char * pValue ) { Cmd_FlagUpdateValue( s_GlobalFrame, pFlag, pValue ); }
+Vec_Ptr_t * Abc_FrameReadStore() { return s_GlobalFrame->vStore; }
+int Abc_FrameReadStoreSize() { return Vec_PtrSize(s_GlobalFrame->vStore); }
+void * Abc_FrameReadLibLut() { return s_GlobalFrame->pLibLut; }
+void * Abc_FrameReadLibGen() { return s_GlobalFrame->pLibGen; }
+void * Abc_FrameReadLibGen2() { return s_GlobalFrame->pLibGen2; }
+void * Abc_FrameReadLibSuper() { return s_GlobalFrame->pLibSuper; }
+void * Abc_FrameReadLibVer() { return s_GlobalFrame->pLibVer; }
+void * Abc_FrameReadManDd() { if ( s_GlobalFrame->dd == NULL ) s_GlobalFrame->dd = Cudd_Init( 0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 ); return s_GlobalFrame->dd; }
+void * Abc_FrameReadManDec() { if ( s_GlobalFrame->pManDec == NULL ) s_GlobalFrame->pManDec = Dec_ManStart(); return s_GlobalFrame->pManDec; }
+char * Abc_FrameReadFlag( char * pFlag ) { return Cmd_FlagReadByName( s_GlobalFrame, pFlag ); }
+
+int Abc_FrameReadBmcFrames( Abc_Frame_t * p ) { return s_GlobalFrame->nFrames; }
+int Abc_FrameReadProbStatus( Abc_Frame_t * p ) { return s_GlobalFrame->Status; }
+void * Abc_FrameReadCex( Abc_Frame_t * p ) { return s_GlobalFrame->pCex; }
+
+int Abc_FrameReadCexPiNum( Abc_Frame_t * p ) { return s_GlobalFrame->pCex->nPis; }
+int Abc_FrameReadCexRegNum( Abc_Frame_t * p ) { return s_GlobalFrame->pCex->nRegs; }
+int Abc_FrameReadCexPo( Abc_Frame_t * p ) { return s_GlobalFrame->pCex->iPo; }
+int Abc_FrameReadCexFrame( Abc_Frame_t * p ) { return s_GlobalFrame->pCex->iFrame; }
+
+void Abc_FrameSetLibLut( void * pLib ) { s_GlobalFrame->pLibLut = pLib; }
+void Abc_FrameSetLibGen( void * pLib ) { s_GlobalFrame->pLibGen = pLib; }
+void Abc_FrameSetLibGen2( void * pLib ) { s_GlobalFrame->pLibGen2 = pLib; }
+void Abc_FrameSetLibSuper( void * pLib ) { s_GlobalFrame->pLibSuper = pLib; }
+void Abc_FrameSetLibVer( void * pLib ) { s_GlobalFrame->pLibVer = pLib; }
+void Abc_FrameSetFlag( char * pFlag, char * pValue ) { Cmd_FlagUpdateValue( s_GlobalFrame, pFlag, pValue ); }
/**Function*************************************************************
@@ -75,7 +85,7 @@ void Abc_FrameSetFlag( char * pFlag, char * pValue ) { Cmd_FlagUpdateVal
SeeAlso []
***********************************************************************/
-bool Abc_FrameIsFlagEnabled( char * pFlag )
+int Abc_FrameIsFlagEnabled( char * pFlag )
{
char * pValue;
// if flag is not defined, it is not enabled
@@ -105,17 +115,18 @@ Abc_Frame_t * Abc_FrameAllocate()
extern void define_cube_size( int n );
extern void set_espresso_flags();
// allocate and clean
- p = ABC_ALLOC( Abc_Frame_t, 1 );
- memset( p, 0, sizeof(Abc_Frame_t) );
+ p = ABC_CALLOC( Abc_Frame_t, 1 );
// get version
p->sVersion = Abc_UtilsGetVersion( p );
// set streams
p->Err = stderr;
p->Out = stdout;
p->Hst = NULL;
+ p->Status = -1;
+ p->nFrames = -1;
// set the starting step
- p->nSteps = 1;
- p->fBatchMode = 0;
+ p->nSteps = 1;
+ p->fBatchMode = 0;
// networks to be used by choice
p->vStore = Vec_PtrAlloc( 16 );
// initialize decomposition manager
@@ -123,6 +134,7 @@ Abc_Frame_t * Abc_FrameAllocate()
// set_espresso_flags();
// initialize the trace manager
// Abc_HManStart();
+ p->vPlugInComBinPairs = Vec_PtrAlloc( 100 );
return p;
}
@@ -147,15 +159,24 @@ void Abc_FrameDeallocate( Abc_Frame_t * p )
// undefine_cube_size();
Rwt_ManGlobalStop();
// Ivy_TruthManStop();
- if ( p->pLibVer ) Abc_LibFree( p->pLibVer, NULL );
- if ( p->pManDec ) Dec_ManStop( p->pManDec );
+ if ( p->pLibVer ) Abc_LibFree( (Abc_Lib_t *)p->pLibVer, NULL );
+ if ( p->pManDec ) Dec_ManStop( (Dec_Man_t *)p->pManDec );
if ( p->dd ) Extra_StopManager( p->dd );
if ( p->vStore ) Vec_PtrFree( p->vStore );
- if ( p->pSave1 ) Aig_ManStop( p->pSave1 );
- if ( p->pSave2 ) Aig_ManStop( p->pSave2 );
- if ( p->pSave3 ) Aig_ManStop( p->pSave3 );
- if ( p->pSave4 ) Aig_ManStop( p->pSave4 );
+ if ( p->pSave1 ) Aig_ManStop( (Aig_Man_t *)p->pSave1 );
+ if ( p->pSave2 ) Aig_ManStop( (Aig_Man_t *)p->pSave2 );
+ if ( p->pSave3 ) Aig_ManStop( (Aig_Man_t *)p->pSave3 );
+ if ( p->pSave4 ) Aig_ManStop( (Aig_Man_t *)p->pSave4 );
+ if ( p->vPlugInComBinPairs )
+ {
+ char * pTemp;
+ int i;
+ Vec_PtrForEachEntry( char *, p->vPlugInComBinPairs, pTemp, i )
+ ABC_FREE( pTemp );
+ Vec_PtrFree( p->vPlugInComBinPairs );
+ }
Abc_FrameDeleteAllNetworks( p );
+ ABC_FREE( p->pCex );
ABC_FREE( p );
s_GlobalFrame = NULL;
}
@@ -187,7 +208,25 @@ void Abc_FrameRestart( Abc_Frame_t * p )
SeeAlso []
***********************************************************************/
-bool Abc_FrameShowProgress( Abc_Frame_t * p )
+void Abc_FrameClearVerifStatus( Abc_Frame_t * p )
+{
+ p->nFrames = -1;
+ p->Status = -1;
+ ABC_FREE( p->pCex );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_FrameShowProgress( Abc_Frame_t * p )
{
return Abc_FrameIsFlagEnabled( "progressbar" );
}
@@ -275,10 +314,10 @@ int Abc_FrameReadMode( Abc_Frame_t * p )
SeeAlso []
***********************************************************************/
-bool Abc_FrameSetMode( Abc_Frame_t * p, bool fNameMode )
+int Abc_FrameSetMode( Abc_Frame_t * p, int fNameMode )
{
char Buffer[2];
- bool fNameModeOld;
+ int fNameModeOld;
fNameModeOld = Abc_FrameReadMode( p );
Buffer[0] = '0' + fNameMode;
Buffer[1] = 0;
@@ -536,7 +575,7 @@ void Abc_FrameSetSave1( void * pAig )
{
Abc_Frame_t * pFrame = Abc_FrameGetGlobalFrame();
if ( pFrame->pSave1 )
- Aig_ManStop( pFrame->pSave1 );
+ Aig_ManStop( (Aig_Man_t *)pFrame->pSave1 );
pFrame->pSave1 = pAig;
}
@@ -555,7 +594,7 @@ void Abc_FrameSetSave2( void * pAig )
{
Abc_Frame_t * pFrame = Abc_FrameGetGlobalFrame();
if ( pFrame->pSave2 )
- Aig_ManStop( pFrame->pSave2 );
+ Aig_ManStop( (Aig_Man_t *)pFrame->pSave2 );
pFrame->pSave2 = pAig;
}
@@ -578,3 +617,5 @@ void * Abc_FrameReadSave2() { void * pAig = Abc_FrameGetGlobalFrame()->pSave2;
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/main/mainInit.c b/src/base/main/mainInit.c
index 03953e5b..a6f4b9e1 100644
--- a/src/base/main/mainInit.c
+++ b/src/base/main/mainInit.c
@@ -18,8 +18,12 @@
***********************************************************************/
+#include "abc.h"
#include "mainInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -38,8 +42,10 @@ extern void Mio_Init( Abc_Frame_t * pAbc );
extern void Mio_End ( Abc_Frame_t * pAbc );
extern void Super_Init( Abc_Frame_t * pAbc );
extern void Super_End ( Abc_Frame_t * pAbc );
-extern void Libs_Init(Abc_Frame_t * pAbc);
-extern void Libs_End(Abc_Frame_t * pAbc);
+extern void Libs_Init( Abc_Frame_t * pAbc );
+extern void Libs_End( Abc_Frame_t * pAbc );
+extern void Load_Init( Abc_Frame_t * pAbc );
+extern void Load_End( Abc_Frame_t * pAbc );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -59,6 +65,7 @@ extern void Libs_End(Abc_Frame_t * pAbc);
void Abc_FrameInit( Abc_Frame_t * pAbc )
{
Cmd_Init( pAbc );
+ Cmd_CommandExecute( pAbc, "set checkread" );
Io_Init( pAbc );
Abc_Init( pAbc );
Fpga_Init( pAbc );
@@ -66,6 +73,8 @@ void Abc_FrameInit( Abc_Frame_t * pAbc )
Mio_Init( pAbc );
Super_Init( pAbc );
Libs_Init( pAbc );
+ Load_Init( pAbc );
+ EXT_ABC_INIT(pAbc) // plugin for external functionality
}
@@ -90,6 +99,8 @@ void Abc_FrameEnd( Abc_Frame_t * pAbc )
Mio_End( pAbc );
Super_End( pAbc );
Libs_End( pAbc );
+ Load_End( pAbc );
+ EXT_ABC_END(pAbc) // plugin for external functionality
}
@@ -98,3 +109,5 @@ void Abc_FrameEnd( Abc_Frame_t * pAbc )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/main/mainInt.h b/src/base/main/mainInt.h
index 01bf5eb2..21fe407d 100644
--- a/src/base/main/mainInt.h
+++ b/src/base/main/mainInt.h
@@ -20,12 +20,24 @@
#ifndef __MAIN_INT_H__
#define __MAIN_INT_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
#include "main.h"
+#include "tim.h"
+#include "if.h"
+#include "aig.h"
+#include "gia.h"
+#include "ssw.h"
+#include "fra.h"
+#include "nwkMerge.h"
+#include "ntlnwk.h"
+#include "ext.h"
+
+ABC_NAMESPACE_HEADER_START
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
@@ -75,21 +87,33 @@ struct Abc_Frame_t_
void * pLibVer; // the current Verilog library
// new code
- void * pAbc8Ntl; // the current design
- void * pAbc8Nwk; // the current mapped network
- void * pAbc8Aig; // the current AIG
- void * pAbc8Lib; // the current LUT library
- void * pAig;
- void * pCex;
+ Ntl_Man_t * pAbc8Ntl; // the current design
+ Nwk_Man_t * pAbc8Nwk; // the current mapped network
+ Aig_Man_t * pAbc8Aig; // the current AIG
+ If_Lib_t * pAbc8Lib; // the current LUT library
+
+ EXT_ABC_FRAME // plugin for external functionality
+ If_Lib_t * pAbc85Lib; // the current LUT library
+
+ Gia_Man_t * pGia;
+ Gia_Man_t * pGia2;
+ Abc_Cex_t * pCex;
void * pSave1;
void * pSave2;
void * pSave3;
void * pSave4;
+ // related to LTL
+ Vec_Ptr_t * vLTLProperties_global;
+
// the addition to keep the best Ntl that can be used to restore
void * pAbc8NtlBestDelay; // the best delay, Ntl
void * pAbc8NtlBestArea; // the best area
+ int Status; // the status of verification problem (proved=1, disproved=0, undecided=-1)
+ int nFrames; // the number of time frames completed by BMC
+
+ Vec_Ptr_t * vPlugInComBinPairs; // pairs of command and its binary name
};
////////////////////////////////////////////////////////////////////////
@@ -120,6 +144,10 @@ extern ABC_DLL void Abc_UtilsPrintHello( Abc_Frame_t * pAbc );
extern ABC_DLL void Abc_UtilsPrintUsage( Abc_Frame_t * pAbc, char * ProgName );
extern ABC_DLL void Abc_UtilsSource( Abc_Frame_t * pAbc );
+
+
+ABC_NAMESPACE_HEADER_END
+
#endif
////////////////////////////////////////////////////////////////////////
diff --git a/src/base/main/mainLib.c b/src/base/main/mainLib.c
new file mode 100644
index 00000000..39078ed9
--- /dev/null
+++ b/src/base/main/mainLib.c
@@ -0,0 +1,93 @@
+/**CFile****************************************************************
+
+ FileName [main.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [The main package.]
+
+ Synopsis [Here everything starts.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: main.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "mainInt.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Initialization procedure for the library project.]
+
+ Description [Note that when Abc_Start() is run in a static library
+ project, it does not load the resource file by default. As a result,
+ ABC is not set up the same way, as when it is run on a command line.
+ For example, some error messages while parsing files will not be
+ produced, and intermediate networks will not be checked for consistancy.
+ One possibility is to load the resource file after Abc_Start() as follows:
+ Abc_UtilsSource( Abc_FrameGetGlobalFrame() );]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_Start()
+{
+ Abc_Frame_t * pAbc;
+ // added to detect memory leaks:
+#if defined(_DEBUG) && defined(_MSC_VER)
+ _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
+#endif
+ // start the glocal frame
+ pAbc = Abc_FrameGetGlobalFrame();
+ // source the resource file
+// Abc_UtilsSource( pAbc );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Deallocation procedure for the library project.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Abc_Stop()
+{
+ Abc_Frame_t * pAbc;
+ pAbc = Abc_FrameGetGlobalFrame();
+ // perform uninitializations
+ Abc_FrameEnd( pAbc );
+ // stop the framework
+ Abc_FrameDeallocate( pAbc );
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/main/mainMC.c b/src/base/main/mainMC.c
index 7761d428..5e77db57 100644
--- a/src/base/main/mainMC.c
+++ b/src/base/main/mainMC.c
@@ -24,6 +24,9 @@
#include "fra.h"
#include "ioa.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -196,3 +199,5 @@ int main( int argc, char * argv[] )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/main/mainUtils.c b/src/base/main/mainUtils.c
index f6751b6b..dadcbdd1 100644
--- a/src/base/main/mainUtils.c
+++ b/src/base/main/mainUtils.c
@@ -7,7 +7,7 @@
PackageName [The main package.]
Synopsis [Miscellaneous utilities.]
-
+
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
@@ -18,6 +18,7 @@
***********************************************************************/
+#include "abc.h"
#include "mainInt.h"
#ifndef _WIN32
@@ -25,10 +26,14 @@
#include <readline/history.h>
#endif
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static char * DateReadFromDateString(char * datestr);
+
+static char * DateReadFromDateString( char * datestr );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -181,6 +186,22 @@ void Abc_UtilsSource( Abc_Frame_t * pAbc )
}
#endif
+#ifdef ABC_PYTHON_EMBED
+ if ( getenv("ABC_PYTHON_ABC_RC") )
+ {
+ /* read script file from $ABC_PYTHON_ABC_RC */
+
+ char * sPath = getenv("ABC_PYTHON_ABC_RC");
+
+ if (sPath){
+ char * sCmd = ABC_ALLOC(char, strlen(sPath) + 50);
+ (void) sprintf(sCmd, "source -s %s", sPath);
+ (void) Cmd_CommandExecute(pAbc, sCmd);
+ ABC_FREE(sCmd);
+ }
+ }
+ else
+#endif /* #ifdef ABC_PYTHON_EMBED */
{
char * sPath1, * sPath2;
char * home;
@@ -228,13 +249,13 @@ void Abc_UtilsSource( Abc_Frame_t * pAbc )
/* execute the abc script which can be open with the "open_path" */
Cmd_CommandExecute( pAbc, "source -s abc.rc" );
}
-
+
#endif //WIN32
{
// reset command history
char * pName;
int i;
- Vec_PtrForEachEntry( pAbc->aHistory, pName, i )
+ Vec_PtrForEachEntry( char *, pAbc->aHistory, pName, i )
ABC_FREE( pName );
pAbc->aHistory->nSize = 0;
}
@@ -250,9 +271,7 @@ void Abc_UtilsSource( Abc_Frame_t * pAbc )
SideEffects []
******************************************************************************/
-char *
-DateReadFromDateString(
- char * datestr)
+char * DateReadFromDateString( char * datestr )
{
static char result[25];
char day[10];
@@ -291,3 +310,5 @@ DateReadFromDateString(
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/main/module.make b/src/base/main/module.make
index 367f89f6..3d03cc12 100644
--- a/src/base/main/module.make
+++ b/src/base/main/module.make
@@ -1,5 +1,6 @@
SRC += src/base/main/main.c \
src/base/main/mainFrame.c \
src/base/main/mainInit.c \
+ src/base/main/mainLib.c \
src/base/main/libSupport.c \
src/base/main/mainUtils.c
diff --git a/src/base/seq/seq.h b/src/base/seq/seq.h
index 3faca29e..7faefe19 100644
--- a/src/base/seq/seq.h
+++ b/src/base/seq/seq.h
@@ -21,6 +21,7 @@
#ifndef __SEQ_H__
#define __SEQ_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -29,9 +30,10 @@
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+
+ABC_NAMESPACE_HEADER_START
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
@@ -70,7 +72,7 @@ extern void Seq_NtkSkewForward( Abc_Ntk_t * pNtk, float period, int f
/*=== abcSeq.c ===============================================================*/
extern Abc_Ntk_t * Abc_NtkAigToSeq( Abc_Ntk_t * pNtk );
extern Abc_Ntk_t * Abc_NtkSeqToLogicSop( Abc_Ntk_t * pNtk );
-extern bool Abc_NtkSeqCheck( Abc_Ntk_t * pNtk );
+extern int Abc_NtkSeqCheck( Abc_Ntk_t * pNtk );
/*=== seqShare.c =============================================================*/
extern void Seq_NtkShareFanouts( Abc_Ntk_t * pNtk );
extern void Seq_NtkShareLatches( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk );
@@ -89,9 +91,11 @@ extern int Seq_MapComputeAreaFlows( Abc_Ntk_t * pNtk, int fVerbose )
extern Vec_Ptr_t * Seq_NtkReachNodes( Abc_Ntk_t * pNtk, int fFromPos );
extern int Seq_NtkCleanup( Abc_Ntk_t * pNtk, int fVerbose );
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif
diff --git a/src/base/seq/seqAigCore.c b/src/base/seq/seqAigCore.c
index 42fa14a2..ce4563f9 100644
--- a/src/base/seq/seqAigCore.c
+++ b/src/base/seq/seqAigCore.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -43,8 +46,8 @@ static int Abc_ObjRetimeBackward( Abc_Obj_t * pObj, Abc_Ntk_t * pNtk, st
static void Abc_ObjRetimeBackwardUpdateEdge( Abc_Obj_t * pObj, int Edge, stmm_table * tTable );
static void Abc_NtkRetimeSetInitialValues( Abc_Ntk_t * pNtk, stmm_table * tTable, int * pModel );
-static Vec_Ptr_t * Abc_NtkUtilRetimingTry( Abc_Ntk_t * pNtk, bool fForward );
-static Vec_Ptr_t * Abc_NtkUtilRetimingGetMoves( Abc_Ntk_t * pNtk, Vec_Int_t * vSteps, bool fForward );
+static Vec_Ptr_t * Abc_NtkUtilRetimingTry( Abc_Ntk_t * pNtk, int fForward );
+static Vec_Ptr_t * Abc_NtkUtilRetimingGetMoves( Abc_Ntk_t * pNtk, Vec_Int_t * vSteps, int fForward );
static Vec_Int_t * Abc_NtkUtilRetimingSplit( Vec_Str_t * vLags, int fForward );
static void Abc_ObjRetimeForwardTry( Abc_Obj_t * pObj, int nLatches );
static void Abc_ObjRetimeBackwardTry( Abc_Obj_t * pObj, int nLatches );
@@ -102,7 +105,7 @@ void Seq_NtkSeqRetimeForward( Abc_Ntk_t * pNtk, int fInitial, int fVerbose )
// get the forward moves
vMoves = Abc_NtkUtilRetimingTry( pNtk, 1 );
// undo the forward moves
- Vec_PtrForEachEntryReverse( vMoves, pNode, i )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, vMoves, pNode, i )
Abc_ObjRetimeBackwardTry( pNode, 1 );
// implement this forward retiming
Seq_NtkImplementRetimingForward( pNtk, vMoves );
@@ -130,7 +133,7 @@ void Seq_NtkSeqRetimeBackward( Abc_Ntk_t * pNtk, int fInitial, int fVerbose )
// get the backward moves
vMoves = Abc_NtkUtilRetimingTry( pNtk, 0 );
// undo the backward moves
- Vec_PtrForEachEntryReverse( vMoves, pNode, i )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, vMoves, pNode, i )
Abc_ObjRetimeForwardTry( pNode, 1 );
// implement this backward retiming
RetValue = Seq_NtkImplementRetimingBackward( pNtk, vMoves, fVerbose );
@@ -202,7 +205,7 @@ void Seq_NtkImplementRetimingForward( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMoves )
{
Abc_Obj_t * pNode;
int i;
- Vec_PtrForEachEntry( vMoves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vMoves, pNode, i )
Abc_ObjRetimeForward( pNode );
}
@@ -309,7 +312,7 @@ int Seq_NtkImplementRetimingBackward( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMoves, int
// perform the backward moves and build the network for initial state computation
RetValue = 0;
- Vec_PtrForEachEntry( vMoves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vMoves, pNode, i )
RetValue |= Abc_ObjRetimeBackward( pNode, pNtkProb, tTable, vValues );
// add the PIs corresponding to the white spots
@@ -319,7 +322,6 @@ int Seq_NtkImplementRetimingBackward( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMoves, int
// add the PI/PO names
Abc_NtkAddDummyPiNames( pNtkProb );
Abc_NtkAddDummyPoNames( pNtkProb );
- Abc_NtkAddDummyAssertNames( pNtkProb );
// make sure everything is okay with the network structure
if ( !Abc_NtkDoCheck( pNtkProb ) )
@@ -468,7 +470,7 @@ int Abc_ObjRetimeBackward( Abc_Obj_t * pObj, Abc_Ntk_t * pNtkNew, stmm_table * t
// add new AND-gate to the network
pNodeNew = Abc_NtkCreateNode( pNtkNew );
- pNodeNew->pData = Abc_SopCreateAnd2( pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
+ pNodeNew->pData = Abc_SopCreateAnd2( (Extra_MmFlex_t *)pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
// add PO fanouts if any
if ( fMet0 )
@@ -536,7 +538,7 @@ int Abc_ObjRetimeBackward( Abc_Obj_t * pObj, Abc_Ntk_t * pNtkNew, stmm_table * t
// add the buffer
pBuffer = Abc_NtkCreateNode( pNtkNew );
- pBuffer->pData = Abc_SopCreateBuf( pNtkNew->pManFunc );
+ pBuffer->pData = Abc_SopCreateBuf( (Extra_MmFlex_t *)pNtkNew->pManFunc );
Abc_ObjAddFanin( pNodeNew, pBuffer );
// point to it from the table
RetEdge.iNode = pObj->Id;
@@ -547,7 +549,7 @@ int Abc_ObjRetimeBackward( Abc_Obj_t * pObj, Abc_Ntk_t * pNtkNew, stmm_table * t
// add the buffer
pBuffer = Abc_NtkCreateNode( pNtkNew );
- pBuffer->pData = Abc_SopCreateBuf( pNtkNew->pManFunc );
+ pBuffer->pData = Abc_SopCreateBuf( (Extra_MmFlex_t *)pNtkNew->pManFunc );
Abc_ObjAddFanin( pNodeNew, pBuffer );
// point to it from the table
RetEdge.iNode = pObj->Id;
@@ -641,7 +643,7 @@ void Abc_NtkRetimeSetInitialValues( Abc_Ntk_t * pNtk, stmm_table * tTable, int *
SeeAlso []
***********************************************************************/
-Vec_Ptr_t * Abc_NtkUtilRetimingTry( Abc_Ntk_t * pNtk, bool fForward )
+Vec_Ptr_t * Abc_NtkUtilRetimingTry( Abc_Ntk_t * pNtk, int fForward )
{
Vec_Ptr_t * vNodes, * vMoves;
Abc_Obj_t * pNode, * pFanout, * pFanin;
@@ -656,7 +658,7 @@ Vec_Ptr_t * Abc_NtkUtilRetimingTry( Abc_Ntk_t * pNtk, bool fForward )
}
// process the nodes
vMoves = Vec_PtrAlloc( 100 );
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
{
// printf( "(%d,%d) ", Seq_ObjFaninL0(pNode), Seq_ObjFaninL0(pNode) );
// unmark the node as processed
@@ -723,7 +725,7 @@ Vec_Ptr_t * Abc_NtkUtilRetimingTry( Abc_Ntk_t * pNtk, bool fForward )
SeeAlso []
***********************************************************************/
-Vec_Ptr_t * Abc_NtkUtilRetimingGetMoves( Abc_Ntk_t * pNtk, Vec_Int_t * vSteps, bool fForward )
+Vec_Ptr_t * Abc_NtkUtilRetimingGetMoves( Abc_Ntk_t * pNtk, Vec_Int_t * vSteps, int fForward )
{
Seq_RetStep_t RetStep;
Vec_Ptr_t * vMoves;
@@ -833,12 +835,12 @@ Vec_Ptr_t * Abc_NtkUtilRetimingGetMoves( Abc_Ntk_t * pNtk, Vec_Int_t * vSteps, b
// undo the tentative retiming
if ( fForward )
{
- Vec_PtrForEachEntryReverse( vMoves, pNode, i )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, vMoves, pNode, i )
Abc_ObjRetimeBackwardTry( pNode, 1 );
}
else
{
- Vec_PtrForEachEntryReverse( vMoves, pNode, i )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, vMoves, pNode, i )
Abc_ObjRetimeForwardTry( pNode, 1 );
}
return vMoves;
@@ -975,3 +977,5 @@ void Abc_ObjRetimeBackwardTry( Abc_Obj_t * pObj, int nLatches )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqAigIter.c b/src/base/seq/seqAigIter.c
index 392638b8..b71312f7 100644
--- a/src/base/seq/seqAigIter.c
+++ b/src/base/seq/seqAigIter.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -266,3 +269,5 @@ int Seq_RetimeNodeUpdateLValue( Abc_Obj_t * pObj, int Fi )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqCreate.c b/src/base/seq/seqCreate.c
index 16c7cc92..ec4fa6aa 100644
--- a/src/base/seq/seqCreate.c
+++ b/src/base/seq/seqCreate.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
A sequential network is similar to AIG in that it contains only
AND gates. However, the AND-gates are currently not hashed.
@@ -269,7 +272,7 @@ Abc_Ntk_t * Abc_NtkSeqToLogicSop( Abc_Ntk_t * pNtk )
Abc_AigForEachAnd( pNtk, pObj, i )
{
Abc_NtkDupObj(pNtkNew, pObj, 0);
- pObj->pCopy->pData = Abc_SopCreateAnd2( pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
+ pObj->pCopy->pData = Abc_SopCreateAnd2( (Extra_MmFlex_t *)pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
}
// share and create the latches
Seq_NtkShareLatches( pNtkNew, pNtk );
@@ -344,10 +347,10 @@ Abc_Ntk_t * Abc_NtkSeqToLogicSop_old( Abc_Ntk_t * pNtk )
if ( Abc_ObjFaninNum(pObj) == 1 )
{
assert( !Abc_ObjFaninC0(pObj) );
- pObj->pCopy->pData = Abc_SopCreateBuf( pNtkNew->pManFunc );
+ pObj->pCopy->pData = Abc_SopCreateBuf( (Extra_MmFlex_t *)pNtkNew->pManFunc );
continue;
}
- pObj->pCopy->pData = Abc_SopCreateAnd2( pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
+ pObj->pCopy->pData = Abc_SopCreateAnd2( (Extra_MmFlex_t *)pNtkNew->pManFunc, Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
}
// connect the objects
Abc_NtkForEachObj( pNtk, pObj, i )
@@ -419,7 +422,7 @@ Abc_Obj_t * Abc_NodeSeqToLogic( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pFanin, Seq_Lat
SeeAlso []
***********************************************************************/
-bool Abc_NtkSeqCheck( Abc_Ntk_t * pNtk )
+int Abc_NtkSeqCheck( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj;
int i, nFanins;
@@ -480,3 +483,5 @@ bool Abc_NtkSeqCheck( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqFpgaCore.c b/src/base/seq/seqFpgaCore.c
index b106ded2..8ab97b43 100644
--- a/src/base/seq/seqFpgaCore.c
+++ b/src/base/seq/seqFpgaCore.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -125,11 +128,11 @@ Abc_Ntk_t * Seq_NtkFpgaDup( Abc_Ntk_t * pNtk )
Seq_Resize( pNtkNew->pManFunc, nObjsNew );
// duplicate the nodes in the mapping
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
Abc_NtkDupObj( pNtkNew, pObj, 0 );
// recursively construct the internals of each node
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
{
vLeaves = Vec_VecEntry( p->vMapCuts, i );
Seq_FpgaMappingBuild_rec( pNtkNew, pNtk, pObj->Id << 8, 1, Seq_NodeGetLag(pObj), vLeaves );
@@ -143,12 +146,12 @@ Abc_Ntk_t * Seq_NtkFpgaDup( Abc_Ntk_t * pNtk )
Seq_NodeDupLats( pObj->pCopy, pObj, 0 );
// transfer the mapping info to the new manager
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
{
// get the leaves of the cut
vLeaves = Vec_VecEntry( p->vMapCuts, i );
// convert the leaf nodes
- Vec_PtrForEachEntry( vLeaves, pLeaf, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, k )
{
SeqEdge = (unsigned)pLeaf;
pLeaf = Abc_NtkObj( pNtk, SeqEdge >> 8 );
@@ -198,7 +201,7 @@ int Seq_NtkFpgaInitCompatible( Abc_Ntk_t * pNtk, int fVerbose )
vTotalEdges = Vec_VecStart( p->nVarsMax );
// go through all the nodes (cuts) used in the mapping
- Vec_PtrForEachEntry( p->vMapAnds, pAnd, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pAnd, i )
{
// printf( "*** Node %d.\n", pAnd->Id );
@@ -210,7 +213,7 @@ int Seq_NtkFpgaInitCompatible( Abc_Ntk_t * pNtk, int fVerbose )
Seq_FpgaMappingEdges_rec( pNtk, pAnd->Id << 8, NULL, vLeaves, vTotalEdges );
// for each leaf, consider its edges
- Vec_PtrForEachEntry( vLeaves, pLeaf, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, k )
{
SeqEdge = (unsigned)pLeaf;
pLeaf = Abc_NtkObj( pNtk, SeqEdge >> 8 );
@@ -221,7 +224,7 @@ int Seq_NtkFpgaInitCompatible( Abc_Ntk_t * pNtk, int fVerbose )
// go through the edges
vEdges = Vec_VecEntry( vTotalEdges, k );
pFanout0 = NULL;
- Vec_PtrForEachEntry( vEdges, pFanout1, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vEdges, pFanout1, m )
{
Edge1 = Abc_ObjIsComplement(pFanout1);
pFanout1 = Abc_ObjRegular(pFanout1);
@@ -290,14 +293,14 @@ Abc_Ntk_t * Seq_NtkSeqFpgaMapped( Abc_Ntk_t * pNtk )
pNtkMap = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
// duplicate the nodes used in the mapping
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
pObj->pCopy = Abc_NtkCreateNode( pNtkMap );
// create and share the latches
Seq_NtkShareLatchesMapping( pNtkMap, pNtk, p->vMapAnds, 1 );
// connect the nodes
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
{
// get the leaves of this gate
vLeaves = Vec_VecEntry( p->vMapCuts, i );
@@ -350,7 +353,7 @@ int Seq_FpgaMappingCount( Abc_Ntk_t * pNtk )
Vec_Ptr_t * vLeaves;
Abc_Obj_t * pAnd;
int i, Counter = 0;
- Vec_PtrForEachEntry( p->vMapAnds, pAnd, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pAnd, i )
{
vLeaves = Vec_VecEntry( p->vMapCuts, i );
Counter += Seq_FpgaMappingCount_rec( pNtk, pAnd->Id << 8, vLeaves );
@@ -378,7 +381,7 @@ int Seq_FpgaMappingCount_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Vec_Ptr_t * vL
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
if ( SeqEdge == (unsigned)pLeaf )
return 0;
// continue unfolding
@@ -413,7 +416,7 @@ Abc_Obj_t * Seq_FpgaMappingBuild_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, uns
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
if ( SeqEdge == (unsigned)pLeaf )
return pObj->pCopy;
// continue unfolding
@@ -460,7 +463,7 @@ DdNode * Seq_FpgaMappingBdd_rec( DdManager * dd, Abc_Ntk_t * pNtk, unsigned SeqE
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
if ( SeqEdge == (unsigned)pLeaf )
return Cudd_bddIthVar( dd, i );
// continue unfolding
@@ -504,7 +507,7 @@ void Seq_FpgaMappingEdges_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Abc_Obj_t * p
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
if ( SeqEdge == (unsigned)pLeaf )
{
@@ -546,7 +549,7 @@ void Seq_FpgaMappingConnect_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Abc_Obj_t *
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, add the connection and return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
if ( SeqEdge == (unsigned)pLeaf )
{
@@ -598,7 +601,7 @@ DdNode * Seq_FpgaMappingConnectBdd_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Abc_
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, add the connection and return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
if ( SeqEdge == (unsigned)pLeaf )
{
@@ -641,3 +644,5 @@ DdNode * Seq_FpgaMappingConnectBdd_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Abc_
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqFpgaIter.c b/src/base/seq/seqFpgaIter.c
index a300b362..c4551a73 100644
--- a/src/base/seq/seqFpgaIter.c
+++ b/src/base/seq/seqFpgaIter.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "fpga.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -268,3 +271,5 @@ int Seq_FpgaNodeUpdateLValue( Abc_Obj_t * pObj, int Fi )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqInt.h b/src/base/seq/seqInt.h
index daa2ab38..89ce6843 100644
--- a/src/base/seq/seqInt.h
+++ b/src/base/seq/seqInt.h
@@ -21,6 +21,7 @@
#ifndef __SEQ_INT_H__
#define __SEQ_INT_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -37,9 +38,10 @@
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+
+ABC_NAMESPACE_HEADER_START
+
#define SEQ_FULL_MASK 0xFFFFFFFF
@@ -244,9 +246,11 @@ extern int Seq_ObjFanoutLMin( Abc_Obj_t * pObj );
extern int Seq_ObjFanoutLSum( Abc_Obj_t * pObj );
extern int Seq_ObjFaninLSum( Abc_Obj_t * pObj );
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif
diff --git a/src/base/seq/seqLatch.c b/src/base/seq/seqLatch.c
index cb3e1e36..f6384fcb 100644
--- a/src/base/seq/seqLatch.c
+++ b/src/base/seq/seqLatch.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -221,3 +224,5 @@ int Seq_NodeCompareLats( Abc_Obj_t * pObj1, int Edge1, Abc_Obj_t * pObj2, int Ed
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqMan.c b/src/base/seq/seqMan.c
index bdfb2630..d0697b36 100644
--- a/src/base/seq/seqMan.c
+++ b/src/base/seq/seqMan.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -107,7 +110,7 @@ void Seq_Delete( Abc_Seq_t * p )
if ( p->fStandCells && p->vMapAnds )
{
void * pVoid; int i;
- Vec_PtrForEachEntry( p->vMapAnds, pVoid, i )
+ Vec_PtrForEachEntry( void *, p->vMapAnds, pVoid, i )
free( pVoid );
}
if ( p->vMapDelays ) Vec_VecFree( p->vMapDelays ); // the nodes used in the mapping
@@ -131,3 +134,5 @@ void Seq_Delete( Abc_Seq_t * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqMapCore.c b/src/base/seq/seqMapCore.c
index c465f31f..cd1db3a7 100644
--- a/src/base/seq/seqMapCore.c
+++ b/src/base/seq/seqMapCore.c
@@ -23,6 +23,9 @@
#include "mio.h"
#include "mapper.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -137,7 +140,7 @@ Abc_Ntk_t * Seq_NtkMapDup( Abc_Ntk_t * pNtk )
Seq_Resize( pNtkNew->pManFunc, nObjsNew );
// duplicate the nodes in the mapping
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
{
// Abc_NtkDupObj( pNtkNew, pMatch->pAnd );
if ( !pMatch->fCompl )
@@ -147,13 +150,13 @@ Abc_Ntk_t * Seq_NtkMapDup( Abc_Ntk_t * pNtk )
}
// compute the real phase assignment
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
{
pMatch->uPhaseR = 0;
// get the leaves of the cut
vLeaves = Vec_VecEntry( p->vMapCuts, i );
// convert the leaf nodes
- Vec_PtrForEachEntry( vLeaves, pLeaf, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, k )
{
SeqEdge = (unsigned)pLeaf;
pLeaf = Abc_NtkObj( pNtk, SeqEdge >> 8 );
@@ -178,7 +181,7 @@ Abc_Ntk_t * Seq_NtkMapDup( Abc_Ntk_t * pNtk )
// recursively construct the internals of each node
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
{
// if ( pMatch->pSuper == NULL )
// {
@@ -210,12 +213,12 @@ Abc_Ntk_t * Seq_NtkMapDup( Abc_Ntk_t * pNtk )
Seq_NodeDupLats( pObj->pCopy, pObj, 0 );
// transfer the mapping info to the new manager
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
{
// get the leaves of the cut
vLeaves = Vec_VecEntry( p->vMapCuts, i );
// convert the leaf nodes
- Vec_PtrForEachEntry( vLeaves, pLeaf, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, k )
{
SeqEdge = (unsigned)pLeaf;
pLeaf = Abc_NtkObj( pNtk, SeqEdge >> 8 );
@@ -286,7 +289,7 @@ int Seq_NtkMapInitCompatible( Abc_Ntk_t * pNtk, int fVerbose )
vTotalEdges = Vec_VecStart( p->nVarsMax );
// go through all the nodes (cuts) used in the mapping
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
{
pAnd = pMatch->pAnd;
// printf( "*** Node %d.\n", pAnd->Id );
@@ -299,7 +302,7 @@ int Seq_NtkMapInitCompatible( Abc_Ntk_t * pNtk, int fVerbose )
Seq_MapMappingEdges_rec( pNtk, pAnd->Id << 8, NULL, vLeaves, vTotalEdges );
// for each leaf, consider its edges
- Vec_PtrForEachEntry( vLeaves, pLeaf, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, k )
{
SeqEdge = (unsigned)pLeaf;
pLeaf = Abc_NtkObj( pNtk, SeqEdge >> 8 );
@@ -310,7 +313,7 @@ int Seq_NtkMapInitCompatible( Abc_Ntk_t * pNtk, int fVerbose )
// go through the edges
vEdges = Vec_VecEntry( vTotalEdges, k );
pFanout0 = NULL;
- Vec_PtrForEachEntry( vEdges, pFanout1, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vEdges, pFanout1, m )
{
Edge1 = Abc_ObjIsComplement(pFanout1);
pFanout1 = Abc_ObjRegular(pFanout1);
@@ -380,14 +383,14 @@ Abc_Ntk_t * Seq_NtkSeqMapMapped( Abc_Ntk_t * pNtk )
pNtkMap = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
// duplicate the nodes used in the mapping
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
pMatch->pAnd->pCopy = Abc_NtkCreateNode( pNtkMap );
// create and share the latches
Seq_NtkShareLatchesMapping( pNtkMap, pNtk, p->vMapAnds, 0 );
// connect the nodes
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
{
pObj = pMatch->pAnd;
// get the leaves of this gate
@@ -442,7 +445,7 @@ int Seq_MapMappingCount( Abc_Ntk_t * pNtk )
Vec_Ptr_t * vLeaves;
Seq_Match_t * pMatch;
int i, Counter = 0;
- Vec_PtrForEachEntry( p->vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Seq_Match_t *, p->vMapAnds, pMatch, i )
{
vLeaves = Vec_VecEntry( p->vMapCuts, i );
Counter += Seq_MapMappingCount_rec( pNtk, pMatch->pAnd->Id << 8, vLeaves );
@@ -470,7 +473,7 @@ int Seq_MapMappingCount_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Vec_Ptr_t * vLe
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
if ( SeqEdge == (unsigned)pLeaf )
return 0;
// continue unfolding
@@ -505,7 +508,7 @@ Abc_Obj_t * Seq_MapMappingBuild_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, unsi
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
if ( SeqEdge == (unsigned)pLeaf )
{
// if ( uPhase & (1 << i) ) // negative phase is required
@@ -562,7 +565,7 @@ void Seq_MapMappingEdges_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Abc_Obj_t * pP
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
if ( SeqEdge == (unsigned)pLeaf )
{
@@ -606,7 +609,7 @@ DdNode * Seq_MapMappingConnectBdd_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Abc_O
pObj = Abc_NtkObj( pNtk, SeqEdge >> 8 );
Lag = SeqEdge & 255;
// if the node is the fanin of the cut, add the connection and return
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
if ( SeqEdge == (unsigned)pLeaf )
{
@@ -650,3 +653,5 @@ DdNode * Seq_MapMappingConnectBdd_rec( Abc_Ntk_t * pNtk, unsigned SeqEdge, Abc_O
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqMapIter.c b/src/base/seq/seqMapIter.c
index 30333cea..bb762d62 100644
--- a/src/base/seq/seqMapIter.c
+++ b/src/base/seq/seqMapIter.c
@@ -23,6 +23,9 @@
#include "mio.h"
#include "mapperInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
// the internal procedures
static float Seq_MapRetimeDelayLagsInternal( Abc_Ntk_t * pNtk, int fVerbose );
static float Seq_MapRetimeSearch_rec( Abc_Ntk_t * pNtk, float FiMin, float FiMax, float Delta, int fVerbose );
@@ -621,3 +624,5 @@ void Seq_MapCanonicizeTruthTables( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqMaxMeanCycle.c b/src/base/seq/seqMaxMeanCycle.c
index 46d73cbd..b62e4b33 100644
--- a/src/base/seq/seqMaxMeanCycle.c
+++ b/src/base/seq/seqMaxMeanCycle.c
@@ -21,6 +21,9 @@
#include "seqInt.h"
#include "hash.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -350,7 +353,7 @@ Hash_Ptr_t * Seq_NtkPathDelays( Abc_Ntk_t * pNtk, int fVerbose ) {
Abc_NodeDelayTraceArrival( vNodes->pArray[i] );
// there is a path to each set of Co endpoints
- Vec_PtrForEachEntry( vEndpoints, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vEndpoints, pObj, i )
{
assert(pObj);
assert( Abc_ObjIsCo( pObj ) );
@@ -565,3 +568,5 @@ void Seq_NtkSkewForward( Abc_Ntk_t * pNtk, float period, int fMinimize ) {
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqRetCore.c b/src/base/seq/seqRetCore.c
index ddc92cc8..846a6707 100644
--- a/src/base/seq/seqRetCore.c
+++ b/src/base/seq/seqRetCore.c
@@ -21,6 +21,9 @@
#include "seqInt.h"
#include "dec.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -136,7 +139,7 @@ Abc_Ntk_t * Seq_NtkRetimeDerive( Abc_Ntk_t * pNtk, int fVerbose )
// create one AND for each logic node in the topological order
vMapAnds = Abc_NtkDfs( pNtk, 0 );
- Vec_PtrForEachEntry( vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vMapAnds, pObj, i )
{
if ( pObj->Id == 0 )
{
@@ -159,7 +162,7 @@ Abc_Ntk_t * Seq_NtkRetimeDerive( Abc_Ntk_t * pNtk, int fVerbose )
// create internal AND nodes w/o strashing for each logic node (including constants)
vMapFanins = Vec_VecStart( Vec_PtrSize(vMapAnds) );
- Vec_PtrForEachEntry( vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vMapAnds, pObj, i )
{
// get the SOP of the node
if ( Abc_NtkHasMapping(pNtk) )
@@ -179,7 +182,7 @@ Abc_Ntk_t * Seq_NtkRetimeDerive( Abc_Ntk_t * pNtk, int fVerbose )
Seq_Resize( p, Abc_NtkObjNumMax(pNtkNew) );
// add the sequential edges
- Vec_PtrForEachEntry( vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vMapAnds, pObj, i )
{
vMirrors = Vec_VecEntry( vMapFanins, i );
Abc_ObjForEachFanin( pObj, pFanin, k )
@@ -206,7 +209,7 @@ Abc_Ntk_t * Seq_NtkRetimeDerive( Abc_Ntk_t * pNtk, int fVerbose )
p->vMapFanins = vMapFanins;
p->vMapCuts = Vec_VecStart( Vec_PtrSize(p->vMapAnds) );
p->vMapDelays = Vec_VecStart( Vec_PtrSize(p->vMapAnds) );
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
{
// change the node to be the new one
Vec_PtrWriteEntry( p->vMapAnds, i, pObj->pCopy );
@@ -366,7 +369,7 @@ Abc_Ntk_t * Seq_NtkRetimeReconstruct( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkSeq )
// connect the objects
// Abc_NtkForEachNode( pNtkOld, pObj, i )
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
{
// pObj is from pNtkSeq - transform to pNtkOld
pObj = pObj->pNext;
@@ -491,3 +494,5 @@ Abc_Obj_t * Seq_EdgeReconstructPO( Abc_Obj_t * pNode )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqRetIter.c b/src/base/seq/seqRetIter.c
index 99c50914..816e71a1 100644
--- a/src/base/seq/seqRetIter.c
+++ b/src/base/seq/seqRetIter.c
@@ -22,6 +22,9 @@
#include "main.h"
#include "fpga.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -106,21 +109,21 @@ int Seq_NtkRetimeDelayLags( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtk, int fVerbose
assert( RetValue );
// fix the problem with non-converged delays
- Vec_PtrForEachEntry( p->vMapAnds, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pNode, i )
if ( Seq_NodeGetLValueP(pNode) < -ABC_INFINITY/2 )
Seq_NodeSetLValueP( pNode, 0 );
// experiment by adding an epsilon to all LValues
-// Vec_PtrForEachEntry( p->vMapAnds, pNode, i )
+// Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pNode, i )
// Seq_NodeSetLValueP( pNode, Seq_NodeGetLValueP(pNode) - p->fEpsilon );
// save the retiming lags
// mark the nodes
- Vec_PtrForEachEntry( p->vMapAnds, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pNode, i )
pNode->fMarkA = 1;
// process the nodes
Vec_StrFill( p->vLags, p->nSize, 0 );
- Vec_PtrForEachEntry( p->vMapAnds, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pNode, i )
{
if ( Vec_PtrSize( Vec_VecEntry(p->vMapCuts, i) ) == 0 )
{
@@ -131,7 +134,7 @@ int Seq_NtkRetimeDelayLags( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtk, int fVerbose
Seq_NodeRetimeSetLag_rec( pNode, NodeLag );
}
// unmark the nodes
- Vec_PtrForEachEntry( p->vMapAnds, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pNode, i )
pNode->fMarkA = 0;
// print the result
@@ -208,7 +211,7 @@ int Seq_NtkMappingForPeriod( Abc_Ntk_t * pNtk, float Fi, int fVerbose )
for ( c = 0; c < p->nMaxIters; c++ )
{
fChange = 0;
- Vec_PtrForEachEntry( p->vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, i )
{
Counter++;
vLeaves = Vec_VecEntry( p->vMapCuts, i );
@@ -281,7 +284,7 @@ int Seq_NtkNodeUpdateLValue( Abc_Obj_t * pObj, float Fi, Vec_Ptr_t * vLeaves, Ve
}
// get the new arrival time of the cut output
lValueNew = -ABC_INFINITY;
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
SeqEdge = (unsigned)pLeaf;
pLeaf = Abc_NtkObj( pObj->pNtk, SeqEdge >> 8 );
@@ -354,7 +357,7 @@ void Seq_NodePrintInfo( Abc_Obj_t * pNode )
pNode->Id, Seq_NodeGetLValueP(pNode), Seq_NodeGetLag(pNode) );
// find the number
- Vec_PtrForEachEntry( p->vMapAnds, pObj, Number )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vMapAnds, pObj, Number )
if ( pObj == pNode )
break;
@@ -362,7 +365,7 @@ void Seq_NodePrintInfo( Abc_Obj_t * pNode )
vLeaves = Vec_VecEntry( p->vMapCuts, Number );
// print the leaves
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
SeqEdge = (unsigned)pLeaf;
pFanin = Abc_NtkObj( pNode->pNtk, SeqEdge >> 8 );
@@ -401,3 +404,5 @@ void Seq_NodePrintInfoPlus( Abc_Obj_t * pNode )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqShare.c b/src/base/seq/seqShare.c
index 742de46b..bccfff80 100644
--- a/src/base/seq/seqShare.c
+++ b/src/base/seq/seqShare.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -156,7 +159,7 @@ void Seq_NodeShareOne( Abc_Obj_t * pNode, Abc_InitType_t Init, Vec_Ptr_t * vNode
Seq_NodeInsertFirst( pBuffer, 0, InitNew );
// redirect the fanouts
- Vec_PtrForEachEntry( vNodes, pFanout, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pFanout, i )
Abc_ObjPatchFanin( pFanout, pNode, pBuffer );
}
@@ -279,7 +282,7 @@ void Seq_NtkShareLatches( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk )
stmm_table * tLatchMap;
int i;
assert( Abc_NtkIsSeq( pNtk ) );
- tLatchMap = stmm_init_table( stmm_ptrcmp, stmm_ptrhash );
+ tLatchMap = stmm_init_table( (int (*)(void))stmm_ptrcmp, (int (*)(void))stmm_ptrhash );
Abc_AigForEachAnd( pNtk, pObj, i )
{
pFanin = Abc_ObjFanin0(pObj);
@@ -315,7 +318,7 @@ void Seq_NtkShareLatchesMapping( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, Vec_Ptr_
assert( Abc_NtkIsSeq( pNtk ) );
// start the table
- tLatchMap = stmm_init_table( stmm_ptrcmp, stmm_ptrhash );
+ tLatchMap = stmm_init_table( (int (*)(void))stmm_ptrcmp, (int (*)(void))stmm_ptrhash );
// create the array of all nodes with sharable fanouts
vNodes = Vec_PtrAlloc( 100 );
@@ -324,17 +327,17 @@ void Seq_NtkShareLatchesMapping( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, Vec_Ptr_
Vec_PtrPush( vNodes, pObj );
if ( fFpga )
{
- Vec_PtrForEachEntry( vMapAnds, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vMapAnds, pObj, i )
Vec_PtrPush( vNodes, pObj );
}
else
{
- Vec_PtrForEachEntry( vMapAnds, pMatch, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vMapAnds, pMatch, i )
Vec_PtrPush( vNodes, pMatch->pAnd );
}
// process nodes used in the mapping
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
{
// make sure the label is clean
Abc_ObjForEachFanout( pObj, pFanout, k )
@@ -386,3 +389,5 @@ void Seq_NtkShareLatchesClean( Abc_Ntk_t * pNtk )
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/seq/seqUtil.c b/src/base/seq/seqUtil.c
index 55b9df8e..137151e2 100644
--- a/src/base/seq/seqUtil.c
+++ b/src/base/seq/seqUtil.c
@@ -20,6 +20,9 @@
#include "seqInt.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -595,3 +598,5 @@ int Seq_NtkCleanup( Abc_Ntk_t * pNtk, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/temp.c b/src/base/temp.c
deleted file mode 100644
index 55709247..00000000
--- a/src/base/temp.c
+++ /dev/null
@@ -1,83 +0,0 @@
-
-/**Function*************************************************************
-
- Synopsis [Command procedure to allow for static BDD variable ordering.]
-
- Description [This procedure should be integrated in "abc\src\base\abci\abc.c"
- similar to how procedure Abc_CommandReorder() is currently integrated.]
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
- FILE * pOut, * pErr, * pFile;
- Abc_Ntk_t * pNtk;
- char * pFileName;
- int c;
- int fReverse;
- int fVerbose;
- extern void Abc_NtkImplementCiOrder( Abc_Ntk_t * pNtk, char * pFileName, int fReverse, int fVerbose );
- extern void Abc_NtkFindCiOrder( Abc_Ntk_t * pNtk, int fReverse, int fVerbose );
-
- pNtk = Abc_FrameReadNtk(pAbc);
- pOut = Abc_FrameReadOut(pAbc);
- pErr = Abc_FrameReadErr(pAbc);
-
- // set defaults
- fReverse = 0;
- fVerbose = 0;
- Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
- {
- switch ( c )
- {
- case 'r':
- fReverse ^= 1;
- break;
- case 'v':
- fVerbose ^= 1;
- break;
- case 'h':
- goto usage;
- default:
- goto usage;
- }
- }
-
- if ( pNtk == NULL )
- {
- fprintf( pErr, "Empty network.\n" );
- return 1;
- }
-
- // if the var order file is given, implement this order
- pFileName = NULL;
- if ( argc == globalUtilOptind + 1 )
- {
- pFileName = argv[globalUtilOptind];
- pFile = fopen( pFileName, "r" );
- if ( pFile == NULL )
- {
- fprintf( pErr, "Cannot open file \"%s\" with the BDD variable order.\n", pFileName );
- return 1;
- }
- fclose( pFile );
- }
- if ( pFileName )
- Abc_NtkImplementCiOrder( pNtk, pFileName, fReverse, fVerbose );
- else
- Abc_NtkFindCiOrder( pNtk, fReverse, fVerbose );
- return 0;
-
-usage:
- fprintf( pErr, "usage: order [-rvh] <file>\n" );
- fprintf( pErr, "\t computes a good static CI variable order\n" );
- fprintf( pErr, "\t-r : toggle reverse ordering [default = %s]\n", fReverse? "yes": "no" );
- fprintf( pErr, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
- fprintf( pErr, "\t-h : print the command usage\n");
- fprintf( pErr, "\t<file> : (optional) file with the given variable order\n" );
- return 1;
-}
diff --git a/src/base/ver/ver.h b/src/base/ver/ver.h
index 01199863..ab679664 100644
--- a/src/base/ver/ver.h
+++ b/src/base/ver/ver.h
@@ -21,6 +21,7 @@
#ifndef __VER_H__
#define __VER_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -32,9 +33,10 @@
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+
+ABC_NAMESPACE_HEADER_START
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
@@ -106,9 +108,11 @@ extern void Ver_StreamSkipChars( Ver_Stream_t * p, char * pCharsToSkip
extern void Ver_StreamSkipToChars( Ver_Stream_t * p, char * pCharsToStop );
extern char * Ver_StreamGetWord( Ver_Stream_t * p, char * pCharsToStop );
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif
diff --git a/src/base/ver/verCore.c b/src/base/ver/verCore.c
index 42d6349a..bb7142f3 100644
--- a/src/base/ver/verCore.c
+++ b/src/base/ver/verCore.c
@@ -22,6 +22,9 @@
#include "mio.h"
#include "main.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -164,7 +167,7 @@ Abc_Lib_t * Ver_ParseFile( char * pFileName, Abc_Lib_t * pGateLib, int fCheck, i
p->fUseMemMan = fUseMemMan;
if ( glo_fMapped )
{
- Hop_ManStop(p->pDesign->pManFunc);
+ Hop_ManStop((Hop_Man_t *)p->pDesign->pManFunc);
p->pDesign->pManFunc = NULL;
}
// parse the file
@@ -220,7 +223,7 @@ void Ver_ParseInternal( Ver_Man_t * pMan )
return;
// connect the boxes and check
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
{
// fix the dangling nets
Abc_NtkFinalizeRead( pNtk );
@@ -484,7 +487,7 @@ int Ver_ParseModule( Ver_Man_t * pMan )
RetValue = Ver_ParseInitial( pMan, pNtk );
else if ( !strcmp( pWord, "endmodule" ) )
break;
- else if ( pMan->pDesign->pGenlib && (pGate = Mio_LibraryReadGateByName(pMan->pDesign->pGenlib, pWord)) ) // current design
+ else if ( pMan->pDesign->pGenlib && (pGate = Mio_LibraryReadGateByName((Mio_Library_t *)pMan->pDesign->pGenlib, pWord)) ) // current design
RetValue = Ver_ParseGate( pMan, pNtk, pGate );
// else if ( pMan->pDesign->pLibrary && st_lookup(pMan->pDesign->pLibrary->tModules, pWord, (char**)&pNtkTemp) ) // gate library
// RetValue = Ver_ParseGate( pMan, pNtkTemp );
@@ -604,7 +607,7 @@ void Ver_ParseRemoveSuffixTable( Ver_Man_t * pMan )
char * pKey, * pValue;
if ( pMan->tName2Suffix == NULL )
return;
- st_foreach_item( pMan->tName2Suffix, gen, (char **)&pKey, (char **)&pValue )
+ st_foreach_item( pMan->tName2Suffix, gen, (const char **)&pKey, (char **)&pValue )
ABC_FREE( pKey );
st_free_table( pMan->tName2Suffix );
pMan->tName2Suffix = NULL;
@@ -1205,9 +1208,9 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
if ( pMan->fMapped )
{
if ( !strcmp( pEquation, "1\'b0" ) )
- pFunc = (Hop_Obj_t *)Mio_LibraryReadConst0(Abc_FrameReadLibGen());
+ pFunc = (Hop_Obj_t *)Mio_LibraryReadConst0((Mio_Library_t *)Abc_FrameReadLibGen());
else if ( !strcmp( pEquation, "1\'b1" ) )
- pFunc = (Hop_Obj_t *)Mio_LibraryReadConst1(Abc_FrameReadLibGen());
+ pFunc = (Hop_Obj_t *)Mio_LibraryReadConst1((Mio_Library_t *)Abc_FrameReadLibGen());
else
{
// "assign foo = \bar ;"
@@ -1225,7 +1228,7 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
Vec_PtrPush( pMan->vNames, (void *)(ABC_PTRUINT_T)strlen(pEquation) );
Vec_PtrPush( pMan->vNames, pEquation );
// get the buffer
- pFunc = (Hop_Obj_t *)Mio_LibraryReadBuf(Abc_FrameReadLibGen());
+ pFunc = (Hop_Obj_t *)Mio_LibraryReadBuf((Mio_Library_t *)Abc_FrameReadLibGen());
if ( pFunc == NULL )
{
sprintf( pMan->sError, "Reading assign statement for node %s has failed because the genlib library has no buffer.", Abc_ObjName(pNet) );
@@ -1237,13 +1240,13 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
else
{
if ( !strcmp(pEquation, "0") || !strcmp(pEquation, "1\'b0") || !strcmp(pEquation, "1\'bx") )
- pFunc = Hop_ManConst0(pNtk->pManFunc);
+ pFunc = Hop_ManConst0((Hop_Man_t *)pNtk->pManFunc);
else if ( !strcmp(pEquation, "1") || !strcmp(pEquation, "1\'b1") )
- pFunc = Hop_ManConst1(pNtk->pManFunc);
+ pFunc = Hop_ManConst1((Hop_Man_t *)pNtk->pManFunc);
else if ( fReduction )
- pFunc = Ver_FormulaReduction( pEquation, pNtk->pManFunc, pMan->vNames, pMan->sError );
+ pFunc = (Hop_Obj_t *)Ver_FormulaReduction( pEquation, pNtk->pManFunc, pMan->vNames, pMan->sError );
else
- pFunc = Ver_FormulaParser( pEquation, pNtk->pManFunc, pMan->vNames, pMan->vStackFn, pMan->vStackOp, pMan->sError );
+ pFunc = (Hop_Obj_t *)Ver_FormulaParser( pEquation, pNtk->pManFunc, pMan->vNames, pMan->vStackFn, pMan->vStackOp, pMan->sError );
if ( pFunc == NULL )
{
Ver_ParsePrintErrorMessage( pMan );
@@ -1260,7 +1263,7 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
{
// get the name of this signal
Length = (int)(ABC_PTRUINT_T)Vec_PtrEntry( pMan->vNames, 2*i );
- pName = Vec_PtrEntry( pMan->vNames, 2*i + 1 );
+ pName = (char *)Vec_PtrEntry( pMan->vNames, 2*i + 1 );
pName[Length] = 0;
// find the corresponding net
pNet = Ver_ParseFindNet( pNtk, pName );
@@ -1367,15 +1370,15 @@ int Ver_ParseGateStandard( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Ver_GateType_t Ga
}
// add logic function
if ( GateType == VER_GATE_AND || GateType == VER_GATE_NAND )
- pNode->pData = Hop_CreateAnd( pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
+ pNode->pData = Hop_CreateAnd( (Hop_Man_t *)pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
else if ( GateType == VER_GATE_OR || GateType == VER_GATE_NOR )
- pNode->pData = Hop_CreateOr( pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
+ pNode->pData = Hop_CreateOr( (Hop_Man_t *)pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
else if ( GateType == VER_GATE_XOR || GateType == VER_GATE_XNOR )
- pNode->pData = Hop_CreateExor( pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
+ pNode->pData = Hop_CreateExor( (Hop_Man_t *)pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
else if ( GateType == VER_GATE_BUF || GateType == VER_GATE_NOT )
- pNode->pData = Hop_CreateAnd( pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
+ pNode->pData = Hop_CreateAnd( (Hop_Man_t *)pNtk->pManFunc, Abc_ObjFaninNum(pNode) );
if ( GateType == VER_GATE_NAND || GateType == VER_GATE_NOR || GateType == VER_GATE_XNOR || GateType == VER_GATE_NOT )
- pNode->pData = Hop_Not( pNode->pData );
+ pNode->pData = Hop_Not( (Hop_Obj_t *)pNode->pData );
return 1;
}
@@ -2033,7 +2036,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
{
Vec_Ptr_t * vBundles = (Vec_Ptr_t *)pBox->pCopy;
Abc_Ntk_t * pNtk = pBox->pNtk;
- Abc_Ntk_t * pNtkBox = pBox->pData;
+ Abc_Ntk_t * pNtkBox = (Abc_Ntk_t *)pBox->pData;
Abc_Obj_t * pTerm, * pTermNew, * pNetAct;
Ver_Bundle_t * pBundle;
char * pNameFormal;
@@ -2055,7 +2058,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
Abc_ObjFanin0(pTerm)->pCopy = NULL;
*/
// check if some of them do not have formal names
- Vec_PtrForEachEntry( vBundles, pBundle, k )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, k )
if ( pBundle->pNameFormal == NULL )
break;
if ( k < Vec_PtrSize(vBundles) )
@@ -2063,7 +2066,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
printf( "Warning: The instance %s of network %s will be connected without using formal names.\n", pNtkBox->pName, Abc_ObjName(pBox) );
// add all actual nets in the bundles
iBundle = 0;
- Vec_PtrForEachEntry( vBundles, pBundle, j )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, j )
iBundle += Vec_PtrSize(pBundle->vNetsActual);
// check the number of actual nets is the same as the number of formal nets
@@ -2078,9 +2081,9 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
iBundle = 0;
Abc_NtkForEachPi( pNtkBox, pTerm, i )
{
- pBundle = Vec_PtrEntry( vBundles, iBundle++ );
+ pBundle = (Ver_Bundle_t *)Vec_PtrEntry( vBundles, iBundle++ );
// the bundle is found - add the connections - using order LSB to MSB
- Vec_PtrForEachEntryReverse( pBundle->vNetsActual, pNetAct, k )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, k )
{
pTermNew = Abc_NtkCreateBi( pNtk );
Abc_ObjAddFanin( pBox, pTermNew );
@@ -2092,9 +2095,9 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
// create fanins of the box
Abc_NtkForEachPo( pNtkBox, pTerm, i )
{
- pBundle = Vec_PtrEntry( vBundles, iBundle++ );
+ pBundle = (Ver_Bundle_t *)Vec_PtrEntry( vBundles, iBundle++ );
// the bundle is found - add the connections - using order LSB to MSB
- Vec_PtrForEachEntryReverse( pBundle->vNetsActual, pNetAct, k )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, k )
{
pTermNew = Abc_NtkCreateBo( pNtk );
Abc_ObjAddFanin( pTermNew, pBox );
@@ -2105,7 +2108,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
}
// free the bundling
- Vec_PtrForEachEntry( vBundles, pBundle, k )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, k )
Ver_ParseFreeBundle( pBundle );
Vec_PtrFree( vBundles );
pBox->pCopy = NULL;
@@ -2120,7 +2123,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
pNameFormal = Abc_ObjName( Abc_ObjFanout0(pTerm) );
// try to find the bundle with this formal net
pBundle = NULL;
- Vec_PtrForEachEntry( vBundles, pBundle, k )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, k )
if ( !strcmp(pBundle->pNameFormal, pNameFormal) )
break;
assert( pBundle != NULL );
@@ -2138,7 +2141,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
// compare names before brace
if ( Length > 0 )
{
- Vec_PtrForEachEntry( vBundles, pBundle, j )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, j )
if ( !strncmp(pBundle->pNameFormal, pNameFormal, Length) && (int)strlen(pBundle->pNameFormal) == Length )
break;
if ( j == Vec_PtrSize(vBundles) )
@@ -2154,7 +2157,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
}
}
// the bundle is found - add the connections - using order LSB to MSB
- Vec_PtrForEachEntryReverse( pBundle->vNetsActual, pNetAct, k )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, k )
{
pTermNew = Abc_NtkCreateBi( pNtk );
Abc_ObjAddFanin( pBox, pTermNew );
@@ -2171,7 +2174,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
pNameFormal = Abc_ObjName( Abc_ObjFanin0(pTerm) );
// try to find this formal net in the bundle
pBundle = NULL;
- Vec_PtrForEachEntry( vBundles, pBundle, k )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, k )
if ( !strcmp(pBundle->pNameFormal, pNameFormal) )
break;
assert( pBundle != NULL );
@@ -2189,7 +2192,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
// compare names before brace
if ( Length > 0 )
{
- Vec_PtrForEachEntry( vBundles, pBundle, j )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, j )
if ( !strncmp(pBundle->pNameFormal, pNameFormal, Length) && (int)strlen(pBundle->pNameFormal) == Length )
break;
if ( j == Vec_PtrSize(vBundles) )
@@ -2210,7 +2213,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
}
}
// the bundle is found - add the connections
- Vec_PtrForEachEntryReverse( pBundle->vNetsActual, pNetAct, k )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, k )
{
if ( !strcmp(Abc_ObjName(pNetAct), "1\'b0") || !strcmp(Abc_ObjName(pNetAct), "1\'b1") )
{
@@ -2228,7 +2231,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
}
// free the bundling
- Vec_PtrForEachEntry( vBundles, pBundle, k )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, k )
Ver_ParseFreeBundle( pBundle );
Vec_PtrFree( vBundles );
pBox->pCopy = NULL;
@@ -2253,7 +2256,7 @@ int Ver_ParseConnectDefBoxes( Ver_Man_t * pMan )
Abc_Obj_t * pBox;
int i, k, RetValue = 1;
// go through all the modules
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
{
// go through all the boxes of this module
Abc_NtkForEachBox( pNtk, pBox, k )
@@ -2264,7 +2267,7 @@ int Ver_ParseConnectDefBoxes( Ver_Man_t * pMan )
if ( pBox->pData == NULL )
continue;
// if the network is undefined, it will be connected later
- if ( !Ver_NtkIsDefined(pBox->pData) )
+ if ( !Ver_NtkIsDefined((Abc_Ntk_t *)pBox->pData) )
{
RetValue = 2;
continue;
@@ -2273,7 +2276,7 @@ int Ver_ParseConnectDefBoxes( Ver_Man_t * pMan )
if ( !Ver_ParseConnectBox( pMan, pBox ) )
return 0;
// if the network is a true blackbox, skip
- if ( Abc_NtkHasBlackbox(pBox->pData) )
+ if ( Abc_NtkHasBlackbox((Abc_Ntk_t *)pBox->pData) )
continue;
// convert the box to the whitebox
Abc_ObjBlackboxToWhitebox( pBox );
@@ -2300,15 +2303,15 @@ Vec_Ptr_t * Ver_ParseCollectUndefBoxes( Ver_Man_t * pMan )
Abc_Obj_t * pBox;
int i, k;
// clear the module structures
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
pNtk->pData = NULL;
// go through all the blackboxes
vUndefs = Vec_PtrAlloc( 16 );
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
{
Abc_NtkForEachBlackbox( pNtk, pBox, k )
{
- pNtkBox = pBox->pData;
+ pNtkBox = (Abc_Ntk_t *)pBox->pData;
if ( pNtkBox == NULL )
continue;
if ( Ver_NtkIsDefined(pNtkBox) )
@@ -2320,7 +2323,7 @@ Vec_Ptr_t * Ver_ParseCollectUndefBoxes( Ver_Man_t * pMan )
pNtkBox->pData = Vec_PtrAlloc( 16 );
}
// save the instance
- Vec_PtrPush( pNtkBox->pData, pBox );
+ Vec_PtrPush( (Vec_Ptr_t *)pNtkBox->pData, pBox );
}
}
return vUndefs;
@@ -2344,25 +2347,25 @@ void Ver_ParseReportUndefBoxes( Ver_Man_t * pMan )
int i, k, nBoxes;
// clean
nBoxes = 0;
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
{
pNtk->fHiePath = 0;
if ( !Ver_NtkIsDefined(pNtk) )
nBoxes++;
}
// count
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
Abc_NtkForEachBlackbox( pNtk, pBox, k )
- if ( pBox->pData && !Ver_NtkIsDefined(pBox->pData) )
+ if ( pBox->pData && !Ver_NtkIsDefined((Abc_Ntk_t *)pBox->pData) )
((Abc_Ntk_t *)pBox->pData)->fHiePath++;
// print the stats
printf( "Warning: The design contains %d undefined objects interpreted as blackboxes:\n", nBoxes );
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
if ( !Ver_NtkIsDefined(pNtk) )
printf( "%s (%d) ", Abc_NtkName(pNtk), pNtk->fHiePath );
printf( "\n" );
// clean
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
pNtk->fHiePath = 0;
}
@@ -2384,14 +2387,14 @@ int Ver_ParseCheckNondrivenNets( Vec_Ptr_t * vUndefs )
Abc_Obj_t * pBox, * pNet;
int i, k, j, m;
// go through undef box types
- Vec_PtrForEachEntry( vUndefs, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vUndefs, pNtk, i )
// go through instances of this type
- Vec_PtrForEachEntry( pNtk->pData, pBox, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, (Vec_Ptr_t *)pNtk->pData, pBox, k )
// go through the bundles of this instance
- Vec_PtrForEachEntryReverse( (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
+ Vec_PtrForEachEntryReverse( Ver_Bundle_t *, (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
// go through the actual nets of this bundle
if ( pBundle )
- Vec_PtrForEachEntry( pBundle->vNetsActual, pNet, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pBundle->vNetsActual, pNet, m )
{
if ( Abc_ObjFaninNum(pNet) == 0 ) // non-driven
if ( strcmp(Abc_ObjName(pNet), "1\'b0") && strcmp(Abc_ObjName(pNet), "1\'b1") ) // diff from a const
@@ -2417,10 +2420,10 @@ int Ver_ParseFormalNetsAreDriven( Abc_Ntk_t * pNtk, char * pNameFormal )
Abc_Obj_t * pBox, * pNet;
int k, j, m;
// go through instances of this type
- Vec_PtrForEachEntry( pNtk->pData, pBox, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, (Vec_Ptr_t *)pNtk->pData, pBox, k )
{
// find a bundle with the given name in this instance
- Vec_PtrForEachEntryReverse( (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
+ Vec_PtrForEachEntryReverse( Ver_Bundle_t *, (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
if ( pBundle && !strcmp( pBundle->pNameFormal, pNameFormal ) )
break;
// skip non-driven bundles
@@ -2428,7 +2431,7 @@ int Ver_ParseFormalNetsAreDriven( Abc_Ntk_t * pNtk, char * pNameFormal )
continue;
// check if all nets are driven in this bundle
assert(pBundle); // Verify that pBundle was assigned to.
- Vec_PtrForEachEntry( pBundle->vNetsActual, pNet, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pBundle->vNetsActual, pNet, m )
if ( Abc_ObjFaninNum(pNet) > 0 )
return 1;
}
@@ -2452,16 +2455,16 @@ Ver_Bundle_t * Ver_ParseGetNondrivenBundle( Abc_Ntk_t * pNtk, int Counter )
Abc_Obj_t * pBox, * pNet;
int k, m;
// go through instances of this type
- Vec_PtrForEachEntry( pNtk->pData, pBox, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, (Vec_Ptr_t *)pNtk->pData, pBox, k )
{
if ( Counter >= Vec_PtrSize((Vec_Ptr_t *)pBox->pCopy) )
continue;
// get the bundle given distance away
- pBundle = Vec_PtrEntry( (Vec_Ptr_t *)pBox->pCopy, Vec_PtrSize((Vec_Ptr_t *)pBox->pCopy) - 1 - Counter );
+ pBundle = (Ver_Bundle_t *)Vec_PtrEntry( (Vec_Ptr_t *)pBox->pCopy, Vec_PtrSize((Vec_Ptr_t *)pBox->pCopy) - 1 - Counter );
if ( pBundle == NULL )
continue;
// go through the actual nets of this bundle
- Vec_PtrForEachEntry( pBundle->vNetsActual, pNet, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pBundle->vNetsActual, pNet, m )
if ( !Abc_ObjFaninNum(pNet) && !Ver_ParseFormalNetsAreDriven(pNtk, pBundle->pNameFormal) ) // non-driven
return pBundle;
}
@@ -2488,7 +2491,7 @@ int Ver_ParseDriveFormal( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Ver_Bundle_t * pBu
int k, j, m;
// drive this net in the undef box
- Vec_PtrForEachEntry( pBundle0->vNetsActual, pNetAct, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pBundle0->vNetsActual, pNetAct, m )
{
// create the formal net
if ( Vec_PtrSize(pBundle0->vNetsActual) == 1 )
@@ -2508,10 +2511,10 @@ int Ver_ParseDriveFormal( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Ver_Bundle_t * pBu
// go through instances of this type
pName = Extra_UtilStrsav(pBundle0->pNameFormal);
- Vec_PtrForEachEntry( pNtk->pData, pBox, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, (Vec_Ptr_t *)pNtk->pData, pBox, k )
{
// find a bundle with the given name in this instance
- Vec_PtrForEachEntryReverse( (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
+ Vec_PtrForEachEntryReverse( Ver_Bundle_t *, (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
if ( pBundle && !strcmp( pBundle->pNameFormal, pName ) )
break;
// skip non-driven bundles
@@ -2519,7 +2522,7 @@ int Ver_ParseDriveFormal( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Ver_Bundle_t * pBu
continue;
// check if any nets are driven in this bundle
assert(pBundle); // Verify pBundle was assigned to.
- Vec_PtrForEachEntry( pBundle->vNetsActual, pNetAct, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, m )
if ( Abc_ObjFaninNum(pNetAct) > 0 )
{
sprintf( pMan->sError, "Internal error while trying to connect undefined boxes. It is likely that the algorithm currently used has its limitations." );
@@ -2527,7 +2530,7 @@ int Ver_ParseDriveFormal( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Ver_Bundle_t * pBu
return 0;
}
// drive the nets by the undef box
- Vec_PtrForEachEntryReverse( pBundle->vNetsActual, pNetAct, m )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, m )
{
pTermNew = Abc_NtkCreateBo( pNetAct->pNtk );
Abc_ObjAddFanin( pTermNew, pBox );
@@ -2561,14 +2564,14 @@ int Ver_ParseDriveInputs( Ver_Man_t * pMan, Vec_Ptr_t * vUndefs )
Abc_Obj_t * pBox, * pBox2, * pTerm, * pTermNew, * pNetFormal, * pNetAct;
int i, k, j, m, CountCur, CountTotal = -1;
// iterate through the undef boxes
- Vec_PtrForEachEntry( vUndefs, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vUndefs, pNtk, i )
{
// count the number of unconnected bundles for instances of this type of box
CountTotal = -1;
- Vec_PtrForEachEntry( pNtk->pData, pBox, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, (Vec_Ptr_t *)pNtk->pData, pBox, k )
{
CountCur = 0;
- Vec_PtrForEachEntry( (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
CountCur += (pBundle != NULL);
if ( CountTotal == -1 )
CountTotal = CountCur;
@@ -2582,12 +2585,12 @@ int Ver_ParseDriveInputs( Ver_Man_t * pMan, Vec_Ptr_t * vUndefs )
}
// create formals
- pBox = Vec_PtrEntry( pNtk->pData, 0 );
- Vec_PtrForEachEntry( (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
+ pBox = (Abc_Obj_t *)Vec_PtrEntry( (Vec_Ptr_t *)pNtk->pData, 0 );
+ Vec_PtrForEachEntry( Ver_Bundle_t *, (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
{
if ( pBundle == NULL )
continue;
- Vec_PtrForEachEntry( pBundle->vNetsActual, pNetAct, m )
+ Vec_PtrForEachEntry( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, m )
{
// find create the formal net
if ( Vec_PtrSize(pBundle->vNetsActual) == 1 )
@@ -2607,15 +2610,15 @@ int Ver_ParseDriveInputs( Ver_Man_t * pMan, Vec_Ptr_t * vUndefs )
}
// go through all the boxes
- Vec_PtrForEachEntry( pNtk->pData, pBox, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, (Vec_Ptr_t *)pNtk->pData, pBox, k )
{
// go through all the bundles
- Vec_PtrForEachEntry( (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, (Vec_Ptr_t *)pBox->pCopy, pBundle, j )
{
if ( pBundle == NULL )
continue;
// drive the nets by the undef box
- Vec_PtrForEachEntryReverse( pBundle->vNetsActual, pNetAct, m )
+ Vec_PtrForEachEntryReverse( Abc_Obj_t *, pBundle->vNetsActual, pNetAct, m )
{
pTermNew = Abc_NtkCreateBi( pNetAct->pNtk );
Abc_ObjAddFanin( pBox, pTermNew );
@@ -2652,9 +2655,9 @@ int Ver_ParseMaxBoxSize( Vec_Ptr_t * vUndefs )
Abc_Obj_t * pBox;
int i, k, nMaxSize = 0;
// go through undef box types
- Vec_PtrForEachEntry( vUndefs, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vUndefs, pNtk, i )
// go through instances of this type
- Vec_PtrForEachEntry( pNtk->pData, pBox, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, (Vec_Ptr_t *)pNtk->pData, pBox, k )
// check the number of bundles of this instance
if ( nMaxSize < Vec_PtrSize((Vec_Ptr_t *)pBox->pCopy) )
nMaxSize = Vec_PtrSize((Vec_Ptr_t *)pBox->pCopy);
@@ -2688,21 +2691,21 @@ void Ver_ParsePrintLog( Ver_Man_t * pMan )
pFile = fopen( Buffer, "w" );
// count the total number of instances and how many times they occur
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
pNtk->fHieVisited = 0;
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
Abc_NtkForEachBox( pNtk, pBox, k )
{
if ( Abc_ObjIsLatch(pBox) )
continue;
- pNtkBox = pBox->pData;
+ pNtkBox = (Abc_Ntk_t *)pBox->pData;
if ( pNtkBox == NULL )
continue;
pNtkBox->fHieVisited++;
}
// print each box and its stats
fprintf( pFile, "The hierarhical design %s contains %d modules:\n", pMan->pFileName, Vec_PtrSize(pMan->pDesign->vModules) );
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
{
fprintf( pFile, "%-24s : ", Abc_NtkName(pNtk) );
if ( !Ver_NtkIsDefined(pNtk) )
@@ -2720,7 +2723,7 @@ void Ver_ParsePrintLog( Ver_Man_t * pMan )
fprintf( pFile, " box = %6d", Abc_NtkBoxNum(pNtk)-Abc_NtkLatchNum(pNtk) );
fprintf( pFile, "\n" );
}
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
pNtk->fHieVisited = 0;
// report instances with dangling outputs
@@ -2730,21 +2733,21 @@ void Ver_ParsePrintLog( Ver_Man_t * pMan )
Ver_Bundle_t * pBundle;
int j, nActNets, Counter = 0;
// count the number of instances with dangling outputs
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
{
Abc_NtkForEachBox( pNtk, pBox, k )
{
if ( Abc_ObjIsLatch(pBox) )
continue;
vBundles = (Vec_Ptr_t *)pBox->pCopy;
- pNtkBox = pBox->pData;
+ pNtkBox = (Abc_Ntk_t *)pBox->pData;
if ( pNtkBox == NULL )
continue;
if ( !Ver_NtkIsDefined(pNtkBox) )
continue;
// count the number of actual nets
nActNets = 0;
- Vec_PtrForEachEntry( vBundles, pBundle, j )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, j )
nActNets += Vec_PtrSize(pBundle->vNetsActual);
// the box is defined and will be connected
if ( nActNets != Abc_NtkPiNum(pNtkBox) + Abc_NtkPoNum(pNtkBox) )
@@ -2758,21 +2761,21 @@ void Ver_ParsePrintLog( Ver_Man_t * pMan )
fprintf( pFile, "\n" );
fprintf( pFile, "The outputs of %d box instances are not connected:\n", Counter );
// enumerate through the boxes
- Vec_PtrForEachEntry( pMan->pDesign->vModules, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, pMan->pDesign->vModules, pNtk, i )
{
Abc_NtkForEachBox( pNtk, pBox, k )
{
if ( Abc_ObjIsLatch(pBox) )
continue;
vBundles = (Vec_Ptr_t *)pBox->pCopy;
- pNtkBox = pBox->pData;
+ pNtkBox = (Abc_Ntk_t *)pBox->pData;
if ( pNtkBox == NULL )
continue;
if ( !Ver_NtkIsDefined(pNtkBox) )
continue;
// count the number of actual nets
nActNets = 0;
- Vec_PtrForEachEntry( vBundles, pBundle, j )
+ Vec_PtrForEachEntry( Ver_Bundle_t *, vBundles, pBundle, j )
nActNets += Vec_PtrSize(pBundle->vNetsActual);
// the box is defined and will be connected
if ( nActNets != Abc_NtkPiNum(pNtkBox) + Abc_NtkPoNum(pNtkBox) )
@@ -2835,7 +2838,7 @@ int Ver_ParseAttachBoxes( Ver_Man_t * pMan )
{
// go through undef box types
pBundle = NULL;
- Vec_PtrForEachEntry( vUndefs, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vUndefs, pNtk, i )
if ( (pBundle = Ver_ParseGetNondrivenBundle( pNtk, Counter )) )
break;
if ( pBundle == NULL )
@@ -2853,9 +2856,9 @@ int Ver_ParseAttachBoxes( Ver_Man_t * pMan )
return 0;
// cleanup
- Vec_PtrForEachEntry( vUndefs, pNtk, i )
+ Vec_PtrForEachEntry( Abc_Ntk_t *, vUndefs, pNtk, i )
{
- Vec_PtrFree( pNtk->pData );
+ Vec_PtrFree( (Vec_Ptr_t *)pNtk->pData );
pNtk->pData = NULL;
}
Vec_PtrFree( vUndefs );
@@ -2970,3 +2973,5 @@ Abc_Obj_t * Ver_ParseCreateInv( Abc_Ntk_t * pNtk, Abc_Obj_t * pNet )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/ver/verFormula.c b/src/base/ver/verFormula.c
index 3ed5f556..bf34b00f 100644
--- a/src/base/ver/verFormula.c
+++ b/src/base/ver/verFormula.c
@@ -20,6 +20,9 @@
#include "ver.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -84,9 +87,9 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
Vec_IntClear( vStackOp );
if ( !strcmp(pFormula, "0") || !strcmp(pFormula, "1\'b0") )
- return Hop_ManConst0(pMan);
+ return Hop_ManConst0((Hop_Man_t *)pMan);
if ( !strcmp(pFormula, "1") || !strcmp(pFormula, "1\'b1") )
- return Hop_ManConst1(pMan);
+ return Hop_ManConst1((Hop_Man_t *)pMan);
// make sure that the number of opening and closing parantheses is the same
nParans = 0;
@@ -214,7 +217,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
// }
// perform the given operation
- if ( Ver_FormulaParserTopOper( pMan, vStackFn, Oper ) == NULL )
+ if ( Ver_FormulaParserTopOper( (Hop_Man_t *)pMan, vStackFn, Oper ) == NULL )
{
sprintf( pErrorMessage, "Parse_FormulaParser(): Unknown operation\n" );
return NULL;
@@ -245,7 +248,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
sprintf( pErrorMessage, "Parse_FormulaParser(): Incorrect state." );
return NULL;
}
- bTemp = Hop_IthVar( pMan, v );
+ bTemp = Hop_IthVar( (Hop_Man_t *)pMan, v );
Vec_PtrPush( vStackFn, bTemp ); // Cudd_Ref( bTemp );
Flag = VER_PARSE_FLAG_VAR;
break;
@@ -269,7 +272,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
else
{
// Vec_PtrPush( vStackFn, Cudd_Not(Vec_PtrPop(vStackFn)) );
- Vec_PtrPush( vStackFn, Hop_Not(Vec_PtrPop(vStackFn)) );
+ Vec_PtrPush( vStackFn, Hop_Not((Hop_Obj_t *)Vec_PtrPop(vStackFn)) );
}
}
else // if ( Flag == VER_PARSE_FLAG_OPER )
@@ -285,7 +288,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
Oper2 = Vec_IntPop( vStackOp ); // the operation before the last one
if ( Oper2 >= Oper1 && !(Oper1 == Oper2 && Oper1 == VER_PARSE_OPER_MUX) )
{ // if Oper2 precedence is higher or equal, execute it
- if ( Ver_FormulaParserTopOper( pMan, vStackFn, Oper2 ) == NULL )
+ if ( Ver_FormulaParserTopOper( (Hop_Man_t *)pMan, vStackFn, Oper2 ) == NULL )
{
sprintf( pErrorMessage, "Parse_FormulaParser(): Unknown operation\n" );
return NULL;
@@ -305,7 +308,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
{
if ( Vec_PtrSize(vStackFn) )
{
- bFunc = Vec_PtrPop(vStackFn);
+ bFunc = (Hop_Obj_t *)Vec_PtrPop(vStackFn);
if ( !Vec_PtrSize(vStackFn) )
if ( !Vec_IntSize(vStackOp) )
{
@@ -340,8 +343,8 @@ Hop_Obj_t * Ver_FormulaParserTopOper( Hop_Man_t * pMan, Vec_Ptr_t * vStackFn, in
{
Hop_Obj_t * bArg0, * bArg1, * bArg2, * bFunc;
// perform the given operation
- bArg2 = Vec_PtrPop( vStackFn );
- bArg1 = Vec_PtrPop( vStackFn );
+ bArg2 = (Hop_Obj_t *)Vec_PtrPop( vStackFn );
+ bArg1 = (Hop_Obj_t *)Vec_PtrPop( vStackFn );
if ( Oper == VER_PARSE_OPER_AND )
bFunc = Hop_And( pMan, bArg1, bArg2 );
else if ( Oper == VER_PARSE_OPER_XOR )
@@ -352,7 +355,7 @@ Hop_Obj_t * Ver_FormulaParserTopOper( Hop_Man_t * pMan, Vec_Ptr_t * vStackFn, in
bFunc = Hop_Not( Hop_Exor( pMan, bArg1, bArg2 ) );
else if ( Oper == VER_PARSE_OPER_MUX )
{
- bArg0 = Vec_PtrPop( vStackFn );
+ bArg0 = (Hop_Obj_t *)Vec_PtrPop( vStackFn );
// bFunc = Cudd_bddIte( dd, bArg0, bArg1, bArg2 ); Cudd_Ref( bFunc );
bFunc = Hop_Mux( pMan, bArg0, bArg1, bArg2 );
// Cudd_RecursiveDeref( dd, bArg0 );
@@ -407,7 +410,7 @@ int Ver_FormulaParserFindVar( char * pString, Vec_Ptr_t * vNames )
nLength2 = (int)(ABC_PTRUINT_T)Vec_PtrEntry( vNames, 2*i + 0 );
if ( nLength2 != nLength )
continue;
- pTemp2 = Vec_PtrEntry( vNames, 2*i + 1 );
+ pTemp2 = (char *)Vec_PtrEntry( vNames, 2*i + 1 );
if ( strncmp( pString, pTemp2, nLength ) )
continue;
return i;
@@ -459,11 +462,11 @@ void * Ver_FormulaReduction( char * pFormula, void * pMan, Vec_Ptr_t * vNames, c
}
// compute the function
if ( Symbol == '&' )
- pRes = Hop_CreateAnd( pMan, Vec_PtrSize(vNames)/2 );
+ pRes = Hop_CreateAnd( (Hop_Man_t *)pMan, Vec_PtrSize(vNames)/2 );
else if ( Symbol == '|' )
- pRes = Hop_CreateOr( pMan, Vec_PtrSize(vNames)/2 );
+ pRes = Hop_CreateOr( (Hop_Man_t *)pMan, Vec_PtrSize(vNames)/2 );
else if ( Symbol == '^' )
- pRes = Hop_CreateExor( pMan, Vec_PtrSize(vNames)/2 );
+ pRes = Hop_CreateExor( (Hop_Man_t *)pMan, Vec_PtrSize(vNames)/2 );
return Hop_NotCond( pRes, fCompl );
}
@@ -472,3 +475,5 @@ void * Ver_FormulaReduction( char * pFormula, void * pMan, Vec_Ptr_t * vNames, c
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/ver/verParse.c b/src/base/ver/verParse.c
index c38399f2..553d0348 100644
--- a/src/base/ver/verParse.c
+++ b/src/base/ver/verParse.c
@@ -20,6 +20,9 @@
#include "ver.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -124,3 +127,5 @@ char * Ver_ParseGetName( Ver_Man_t * pMan )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/ver/verStream.c b/src/base/ver/verStream.c
index 8acaf5ec..75e183b3 100644
--- a/src/base/ver/verStream.c
+++ b/src/base/ver/verStream.c
@@ -20,6 +20,9 @@
#include "ver.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -441,3 +444,5 @@ char * Ver_StreamGetWord( Ver_Stream_t * p, char * pCharsToStop )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/ver/verWords.c b/src/base/ver/verWords.c
index f9d27010..3934a373 100644
--- a/src/base/ver/verWords.c
+++ b/src/base/ver/verWords.c
@@ -20,6 +20,9 @@
#include "ver.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -46,3 +49,5 @@
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/base/ver/ver_.c b/src/base/ver/ver_.c
index 76599dac..ef9f8155 100644
--- a/src/base/ver/ver_.c
+++ b/src/base/ver/ver_.c
@@ -20,6 +20,9 @@
#include "ver.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -46,3 +49,5 @@
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+