abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abc.c File Reference
#include "base/abc/abc.h"
#include "base/main/main.h"
#include "base/main/mainInt.h"
#include "proof/fraig/fraig.h"
#include "opt/fxu/fxu.h"
#include "opt/cut/cut.h"
#include "map/fpga/fpga.h"
#include "map/if/if.h"
#include "opt/sim/sim.h"
#include "opt/res/res.h"
#include "opt/lpk/lpk.h"
#include "aig/gia/giaAig.h"
#include "opt/dar/dar.h"
#include "opt/mfs/mfs.h"
#include "proof/fra/fra.h"
#include "aig/saig/saig.h"
#include "proof/int/int.h"
#include "proof/dch/dch.h"
#include "proof/ssw/ssw.h"
#include "opt/cgt/cgt.h"
#include "bool/kit/kit.h"
#include "map/amap/amap.h"
#include "opt/ret/retInt.h"
#include "sat/cnf/cnf.h"
#include "proof/cec/cec.h"
#include "proof/pdr/pdr.h"
#include "misc/tim/tim.h"
#include "proof/llb/llb.h"
#include "proof/bbr/bbr.h"
#include "map/cov/cov.h"
#include "base/cmd/cmd.h"
#include "proof/abs/abs.h"
#include "sat/bmc/bmc.h"
#include "proof/ssc/ssc.h"
#include "opt/sfm/sfm.h"
#include "bool/rpo/rpo.h"
#include "map/mpm/mpm.h"
#include <unistd.h>
#include "abciUnfold2.c"

Go to the source code of this file.

Functions

static ABC_NAMESPACE_IMPL_START int Abc_CommandPrintStats (Abc_Frame_t *pAbc, int argc, char **argv)
 DECLARATIONS ///. More...
 
static int Abc_CommandPrintExdc (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintIo (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintLatch (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintFanio (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintMffc (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintFactor (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintLevel (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintSupport (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintSymms (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintUnate (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintAuto (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintKMap (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintGates (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintSharing (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPrintXCut (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_CommandPrintDelay (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)
 
static int Abc_CommandShowCut (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCollapse (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandStrash (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandBalance (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMuxStruct (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMulti (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRenode (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCleanup (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSweep (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFastExtract (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandEliminate (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDisjoint (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSparsify (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandLutpack (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandLutmin (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMfs (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMfs2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTrace (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSpeedup (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPowerdown (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAddBuffs (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTestDec (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTestNpn (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTestRPO (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRewrite (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRefactor (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRestructure (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandResubstitute (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRr (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCascade (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandExtract (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandVarMin (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandLogic (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandComb (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMiter (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_CommandSwapPos (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRemovePo (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDropSat (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAddPi (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAppend (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPutOnTop (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)
 
static int Abc_CommandSop (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandBdd (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAig (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandReorder (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandBidec (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandOrder (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMuxes (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCubes (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSplitSop (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandExtSeqDcs (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandReach (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCone (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandNode (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTopmost (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTopAnd (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTrim (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandShortNames (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMoveNames (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandExdcFree (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandExdcGet (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandExdcSet (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCareSet (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCut (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandEspresso (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandGen (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandGenFsm (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_CommandOutdec (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandNodeDup (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTestColor (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)
 
static int Abc_CommandQuaRel (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandQuaReach (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSenseInput (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandNpnLoad (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandNpnSave (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSendAig (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSendStatus (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandBackup (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRestore (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMinisat (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMinisimp (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandIStrash (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandICut (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_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)
 
static int Abc_CommandIRewriteSeq (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandIResyn (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandISat (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandIFraig (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_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)
 
static int Abc_CommandQbf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFraig (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFraigTrust (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFraigStore (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFraigRestore (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFraigClean (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFraigSweep (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFraigDress (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRecStart3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRecStop3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRecPs3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRecAdd3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRecDump3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRecMerge3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandMap (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAmap (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandUnmap (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAttach (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSuperChoice (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSuperChoiceLut (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandIf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandIfif (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDsdSave (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDsdLoad (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDsdFree (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDsdPs (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDsdMatch (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDsdMerge (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDsdFilter (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandScut (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandInit (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandZero (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandUndc (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandOneHot (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPipe (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSeq (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandUnseq (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandRetime (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDRetime (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFlowRetime (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCRetime (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSeqFpga (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_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)
 
static int Abc_CommandXsim (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSim (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSim3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDarPhase (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSynch (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandClockGate (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandExtWin (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandInsWin (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPermute (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandUnpermute (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCubeEnum (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCec (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDCec (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDSec (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSat (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDSat (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPSat (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandProve (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandIProve (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_CommandTempor (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandInduction (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_CommandUnfold2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandFold2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandBm (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandBm2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandSaucy (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandTestCex (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandPdr (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandReconcile (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCexSave (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCexLoad (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCexCut (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandCexMerge (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandDualRail (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandBlockPo (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandIso (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)
 
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_CommandAbc9Save (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Load (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Read (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReadBlif (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReadCBlif (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReadStg (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReadVer (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9WriteVer (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Write (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Ps (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9PFan (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9PSig (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Status (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9MuxProfile (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Show (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9SetRegNum (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Strash (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Topand (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Add1Hot (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Cof (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Trim (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Dfs (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Sim (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Sim3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_CommandAbc9Equiv3 (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_CommandAbc9Dsd (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_CommandAbc9Fx (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Balance (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9BalanceLut (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Syn2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Syn3 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Syn4 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Synch2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9False (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Miter (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Miter2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Append (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)
 
static int Abc_CommandAbc9Scorr (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Choice (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Sat (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9SatEnum (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Fraig (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9CFraig (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Srm (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Srm2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Filter (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Reduce (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9EquivMark (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9EquivFilter (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Cec (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Verify (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Sweep (Abc_Frame_t *pAbc, int argc, char **argv)
 
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_CommandAbc9Sopb (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Dsdb (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Flow (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Flow2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9If (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Iff (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9If2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Jf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Kf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Lf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Mf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Nf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Unmap (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Struct (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_CommandAbc9Rpm (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9BackReach (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Posplit (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReachM (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReachP (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReachN (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ReachY (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Undo (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Iso (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9CexInfo (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Cycle (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Cone (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Slice (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9PoPart (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9GroupProve (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9MultiProve (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9SplitProve (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Bmc (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ChainBmc (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9BCore (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9ICheck (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9SatTest (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9FFTest (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Qbf (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Inse (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Maxi (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Bmci (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9PoXsim (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Demiter (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Fadds (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Mfs (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_CommandAbc9GlaDerive (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9GlaRefine (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9GlaShrink (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Gla (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Vta (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Vta2Gla (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Gla2Vta (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Fla2Gla (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Gla2Fla (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Abc_CommandAbc9Test (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandAbcLivenessToSafety (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandAbcLivenessToSafetySim (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandAbcLivenessToSafetyWithLTL (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandCS_kLiveness (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandNChooseK (Abc_Frame_t *pAbc, int argc, char **argv)
 
Aig_Man_tAbc_NtkToDar (Abc_Ntk_t *pNtk, int fExors, int fRegisters)
 
Abc_Ntk_tAbc_NtkFromAigPhase (Aig_Man_t *pMan)
 
void Abc_FrameReplaceCex (Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
 FUNCTION DEFINITIONS ///. More...
 
void Abc_FrameReplaceCexVec (Abc_Frame_t *pAbc, Vec_Ptr_t **pvCexVec)
 
void Abc_FrameReplacePoEquivs (Abc_Frame_t *pAbc, Vec_Ptr_t **pvPoEquivs)
 
void Abc_FrameReplacePoStatuses (Abc_Frame_t *pAbc, Vec_Int_t **pvStatuses)
 
Vec_Int_tAbc_FrameDeriveStatusArray (Vec_Ptr_t *vCexes)
 
void Abc_FrameClearDesign ()
 
void Abc_FrameUpdateGia (Abc_Frame_t *pAbc, Gia_Man_t *pNew)
 
Gia_Man_tAbc_FrameGetGia (Abc_Frame_t *pAbc)
 
void Abc_Init (Abc_Frame_t *pAbc)
 DECLARATIONS ///. More...
 
void Abc_End (Abc_Frame_t *pAbc)
 
int Abc_CommandCexMin (Abc_Frame_t *pAbc, int argc, char **argv)
 
static int Gia_ManCompareWithBest (Gia_Man_t *pBest, Gia_Man_t *p, int *pnBestLuts, int *pnBestEdges, int *pnBestLevels)
 
int Abc_CommandAbc9PoPart2 (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandAbc9CexCut (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandAbc9CexMerge (Abc_Frame_t *pAbc, int argc, char **argv)
 
int Abc_CommandAbc9CexMin (Abc_Frame_t *pAbc, int argc, char **argv)
 

Function Documentation

int Abc_CommandAbc9AbsDerive ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37390 of file abc.c.

37391 {
37392  Gia_Man_t * pTemp = NULL;
37393  int c, fVerbose = 0;
37395  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
37396  {
37397  switch ( c )
37398  {
37399  case 'v':
37400  fVerbose ^= 1;
37401  break;
37402  case 'h':
37403  goto usage;
37404  default:
37405  goto usage;
37406  }
37407  }
37408  if ( pAbc->pGia == NULL )
37409  {
37410  Abc_Print( -1, "Abc_CommandAbc9AbsDerive(): There is no AIG.\n" );
37411  return 1;
37412  }
37413  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
37414  {
37415  Abc_Print( -1, "The network is combinational.\n" );
37416  return 0;
37417  }
37418  if ( pAbc->pGia->vFlopClasses == NULL )
37419  {
37420  Abc_Print( -1, "Abstraction flop map is missing.\n" );
37421  return 0;
37422  }
37423  pTemp = Gia_ManDupAbsFlops( pAbc->pGia, pAbc->pGia->vFlopClasses );
37424  Abc_FrameUpdateGia( pAbc, pTemp );
37425  return 0;
37426 
37427 usage:
37428  Abc_Print( -2, "usage: &abs_derive [-vh]\n" );
37429  Abc_Print( -2, "\t derives abstracted model using the pre-computed flop map\n" );
37430  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37431  Abc_Print( -2, "\t-h : print the command usage\n");
37432  return 1;
37433 }
Gia_Man_t * Gia_ManDupAbsFlops(Gia_Man_t *p, Vec_Int_t *vFlopClasses)
FUNCTION DECLARATIONS ///.
Definition: absDup.c:65
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9AbsRefine ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37446 of file abc.c.

37447 {
37448 // Gia_Man_t * pTemp = NULL;
37449  int c;
37450  int nFfToAddMax = 0;
37451  int fTryFour = 1;
37452  int fSensePath = 0;
37453  int fVerbose = 0;
37454 
37456  while ( ( c = Extra_UtilGetopt( argc, argv, "Mtsvh" ) ) != EOF )
37457  {
37458  switch ( c )
37459  {
37460  case 'M':
37461  if ( globalUtilOptind >= argc )
37462  {
37463  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
37464  goto usage;
37465  }
37466  nFfToAddMax = atoi(argv[globalUtilOptind]);
37467  globalUtilOptind++;
37468  if ( nFfToAddMax < 0 )
37469  goto usage;
37470  break;
37471  case 't':
37472  fTryFour ^= 1;
37473  break;
37474  case 's':
37475  fSensePath ^= 1;
37476  break;
37477  case 'v':
37478  fVerbose ^= 1;
37479  break;
37480  case 'h':
37481  goto usage;
37482  default:
37483  goto usage;
37484  }
37485  }
37486  if ( pAbc->pGia == NULL )
37487  {
37488  Abc_Print( -1, "Abc_CommandAbc9AbsRefine(): There is no AIG.\n" );
37489  return 1;
37490  }
37491  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
37492  {
37493  Abc_Print( -1, "The network is combinational.\n" );
37494  return 0;
37495  }
37496  if ( pAbc->pCex == NULL )
37497  {
37498  Abc_Print( -1, "Abc_CommandAbc9AbsRefine(): There is no counter-example.\n" );
37499  return 1;
37500  }
37501  pAbc->Status = Gia_ManCexAbstractionRefine( pAbc->pGia, pAbc->pCex, nFfToAddMax, fTryFour, fSensePath, fVerbose );
37502  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
37503  return 0;
37504 
37505 usage:
37506  Abc_Print( -2, "usage: &abs_refine [-M <num>] [-tsvh]\n" );
37507  Abc_Print( -2, "\t refines the pre-computed flop map using the counter-example\n" );
37508  Abc_Print( -2, "\t-M num : the max number of flops to add (0 = not used) [default = %d]\n", nFfToAddMax );
37509  Abc_Print( -2, "\t-t : toggle trying four abstractions instead of one [default = %s]\n", fTryFour? "yes": "no" );
37510  Abc_Print( -2, "\t-s : toggle using the path sensitization algorithm [default = %s]\n", fSensePath? "yes": "no" );
37511  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37512  Abc_Print( -2, "\t-h : print the command usage\n");
37513  return 1;
37514 }
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Gia_ManCexAbstractionRefine(Gia_Man_t *pGia, Abc_Cex_t *pCex, int nFfToAddMax, int fTryFour, int fSensePath, int fVerbose)
Definition: absOldRef.c:372
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Add1Hot ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26825 of file abc.c.

26826 {
26827  Gia_Man_t * pTemp;
26828  int c, fVerbose = 1;
26830  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
26831  {
26832  switch ( c )
26833  {
26834  case 'v':
26835  fVerbose ^= 1;
26836  break;
26837  case 'h':
26838  goto usage;
26839  default:
26840  goto usage;
26841  }
26842  }
26843  if ( pAbc->pGia == NULL )
26844  {
26845  Abc_Print( -1, "Abc_CommandAbc9Add1Hot(): There is no AIG.\n" );
26846  return 1;
26847  }
26848  pTemp = Gia_ManDupOneHot( pAbc->pGia );
26849  Abc_FrameUpdateGia( pAbc, pTemp );
26850  return 0;
26851 
26852 usage:
26853  Abc_Print( -2, "usage: &add1hot [-vh]\n" );
26854  Abc_Print( -2, "\t adds 1-hotness constraints as additional primary outputs\n" );
26855  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
26856  Abc_Print( -2, "\t-h : print the command usage\n");
26857  return 1;
26858 }
Gia_Man_t * Gia_ManDupOneHot(Gia_Man_t *p)
Definition: giaDup.c:2785
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Append ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29511 of file abc.c.

29512 {
29513  FILE * pFile;
29514  Gia_Man_t * pSecond;
29515  char * FileName, * pTemp;
29516  char ** pArgvNew;
29517  int nArgcNew;
29518  int c;
29519  int fVerbose = 0;
29521  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
29522  {
29523  switch ( c )
29524  {
29525  case 'v':
29526  fVerbose ^= 1;
29527  break;
29528  case 'h':
29529  goto usage;
29530  default:
29531  goto usage;
29532  }
29533  }
29534 
29535  pArgvNew = argv + globalUtilOptind;
29536  nArgcNew = argc - globalUtilOptind;
29537  if ( nArgcNew != 1 )
29538  {
29539  Abc_Print( -1, "File name is not given on the command line.\n" );
29540  return 1;
29541  }
29542 
29543  // get the input file name
29544  FileName = pArgvNew[0];
29545  // fix the wrong symbol
29546  for ( pTemp = FileName; *pTemp; pTemp++ )
29547  if ( *pTemp == '>' )
29548  *pTemp = '\\';
29549  if ( (pFile = fopen( FileName, "r" )) == NULL )
29550  {
29551  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
29552  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
29553  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
29554  Abc_Print( 1, "\n" );
29555  return 1;
29556  }
29557  fclose( pFile );
29558  pSecond = Gia_AigerRead( FileName, 0, 0 );
29559  if ( pSecond == NULL )
29560  {
29561  Abc_Print( -1, "Reading AIGER has failed.\n" );
29562  return 0;
29563  }
29564  // compute the miter
29565  Gia_ManDupAppend( pAbc->pGia, pSecond );
29566  Gia_ManStop( pSecond );
29567  return 0;
29568 
29569 usage:
29570  Abc_Print( -2, "usage: &append [-vh] <file>\n" );
29571  Abc_Print( -2, "\t appends <file> to the current AIG using new PIs and POs\n" );
29572  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
29573  Abc_Print( -2, "\t-h : print the command usage\n");
29574  Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
29575  return 1;
29576 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Gia_ManDupAppend(Gia_Man_t *p, Gia_Man_t *pTwo)
Definition: giaDup.c:746
int Abc_CommandAbc9BackReach ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33936 of file abc.c.

33937 {
33938  extern Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int nTimeMax, int fVerbose );
33939 
33940  Gia_Man_t * pTemp = NULL;
33941  int c, fVerbose = 0;
33942  int nFrameMax = 1000000;
33943  int nConfMax = 1000000;
33944  int nTimeMax = 10;
33946  while ( ( c = Extra_UtilGetopt( argc, argv, "FCTvh" ) ) != EOF )
33947  {
33948  switch ( c )
33949  {
33950  case 'F':
33951  if ( globalUtilOptind >= argc )
33952  {
33953  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
33954  goto usage;
33955  }
33956  nFrameMax = atoi(argv[globalUtilOptind]);
33957  globalUtilOptind++;
33958  if ( nFrameMax < 0 )
33959  goto usage;
33960  break;
33961  case 'C':
33962  if ( globalUtilOptind >= argc )
33963  {
33964  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
33965  goto usage;
33966  }
33967  nConfMax = atoi(argv[globalUtilOptind]);
33968  globalUtilOptind++;
33969  if ( nConfMax < 0 )
33970  goto usage;
33971  break;
33972  case 'T':
33973  if ( globalUtilOptind >= argc )
33974  {
33975  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
33976  goto usage;
33977  }
33978  nTimeMax = atoi(argv[globalUtilOptind]);
33979  globalUtilOptind++;
33980  if ( nTimeMax < 0 )
33981  goto usage;
33982  break;
33983  case 'v':
33984  fVerbose ^= 1;
33985  break;
33986  case 'h':
33987  goto usage;
33988  default:
33989  goto usage;
33990  }
33991  }
33992  if ( pAbc->pGia == NULL )
33993  {
33994  Abc_Print( -1, "Abc_CommandAbc9BackReach(): There is no AIG.\n" );
33995  return 1;
33996  }
33997  if ( Gia_ManPoNum(pAbc->pGia) != 1 )
33998  {
33999  Abc_Print( -1, "Abc_CommandAbc9BackReach(): The number of POs is different from 1.\n" );
34000  return 1;
34001  }
34002  pTemp = Gia_ManCofTest( pAbc->pGia, nFrameMax, nConfMax, nTimeMax, fVerbose );
34003  Abc_FrameUpdateGia( pAbc, pTemp );
34004  return 0;
34005 
34006 usage:
34007  Abc_Print( -2, "usage: &back_reach [-FCT <num>] [-vh]\n" );
34008  Abc_Print( -2, "\t performs backward reachability by circuit cofactoring\n" );
34009  Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", nFrameMax );
34010  Abc_Print( -2, "\t-C num : the conflict limit at a node during induction [default = %d]\n", nConfMax );
34011  Abc_Print( -2, "\t-T num : the timeout for property directed reachability [default = %d]\n", nTimeMax );
34012  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
34013  Abc_Print( -2, "\t-h : print the command usage\n");
34014  return 1;
34015 }
Gia_Man_t * Gia_ManCofTest(Gia_Man_t *pGia, int nFrameMax, int nConfMax, int nTimeMax, int fVerbose)
Definition: giaCCof.c:266
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Balance ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28736 of file abc.c.

28737 {
28738  Gia_Man_t * pTemp = NULL;
28739  int nNewNodesMax = ABC_INFINITY;
28740  int fDelayOnly = 0;
28741  int fSimpleAnd = 0;
28742  int fKeepLevel = 0;
28743  int c, fVerbose = 0;
28744  int fVeryVerbose = 0;
28746  while ( ( c = Extra_UtilGetopt( argc, argv, "Ndalvwh" ) ) != EOF )
28747  {
28748  switch ( c )
28749  {
28750  case 'N':
28751  if ( globalUtilOptind >= argc )
28752  {
28753  Abc_Print( -1, "Command line switch \"-N\" should be followed by a char string.\n" );
28754  goto usage;
28755  }
28756  nNewNodesMax = atoi(argv[globalUtilOptind]);
28757  globalUtilOptind++;
28758  if ( nNewNodesMax < 0 )
28759  goto usage;
28760  break;
28761  case 'd':
28762  fDelayOnly ^= 1;
28763  break;
28764  case 'a':
28765  fSimpleAnd ^= 1;
28766  break;
28767  case 'l':
28768  fKeepLevel ^= 1;
28769  break;
28770  case 'v':
28771  fVerbose ^= 1;
28772  break;
28773  case 'w':
28774  fVeryVerbose ^= 1;
28775  break;
28776  case 'h':
28777  goto usage;
28778  default:
28779  goto usage;
28780  }
28781  }
28782  if ( pAbc->pGia == NULL )
28783  {
28784  Abc_Print( -1, "Abc_CommandAbc9Balance(): There is no AIG.\n" );
28785  return 1;
28786  }
28787  if ( fDelayOnly )
28788  pTemp = Gia_ManBalance( pAbc->pGia, fSimpleAnd, fVerbose );
28789  else
28790  pTemp = Gia_ManAreaBalance( pAbc->pGia, fSimpleAnd, nNewNodesMax, fVerbose, fVeryVerbose );
28791  Abc_FrameUpdateGia( pAbc, pTemp );
28792  return 0;
28793 
28794 usage:
28795  Abc_Print( -2, "usage: &b [-N num] [-davwh]\n" );
28796  Abc_Print( -2, "\t performs AIG balancing to reduce delay and area\n" );
28797  Abc_Print( -2, "\t-N num : the max fanout count to skip a divisor [default = %d]\n", nNewNodesMax );
28798  Abc_Print( -2, "\t-d : toggle delay only balancing [default = %s]\n", fDelayOnly? "yes": "no" );
28799  Abc_Print( -2, "\t-a : toggle using AND instead of AND/XOR/MUX [default = %s]\n", fSimpleAnd? "yes": "no" );
28800 // Abc_Print( -2, "\t-l : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
28801  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28802  Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
28803  Abc_Print( -2, "\t-h : print the command usage\n");
28804  return 1;
28805 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManBalance(Gia_Man_t *p, int fSimpleAnd, int fVerbose)
Definition: giaBalAig.c:365
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
Gia_Man_t * Gia_ManAreaBalance(Gia_Man_t *p, int fSimpleAnd, int nNewNodesMax, int fVerbose, int fVeryVerbose)
Definition: giaBalAig.c:968
int Abc_CommandAbc9BalanceLut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28818 of file abc.c.

28819 {
28820  extern Gia_Man_t * Gia_ManBalanceLut( Gia_Man_t * p, int nLutSize, int nCutNum, int fVerbose );
28821  extern Gia_Man_t * Gia_ManLutBalance( Gia_Man_t * p, int nLutSize, int fUseMuxes, int fRecursive, int fOptArea, int fVerbose );
28822  Gia_Man_t * pTemp = NULL;
28823  int fUseOld = 0;
28824  int nLutSize = 6;
28825  int nCutNum = 8;
28826  int fUseMuxes = 1;
28827  int fRecursive = 1;
28828  int fOptArea = 1;
28829  int c, fVerbose = 0;
28830  int fVeryVerbose = 0;
28832  while ( ( c = Extra_UtilGetopt( argc, argv, "KCnmravwh" ) ) != EOF )
28833  {
28834  switch ( c )
28835  {
28836  case 'K':
28837  if ( globalUtilOptind >= argc )
28838  {
28839  Abc_Print( -1, "Command line switch \"-K\" should be followed by a char string.\n" );
28840  goto usage;
28841  }
28842  nLutSize = atoi(argv[globalUtilOptind]);
28843  globalUtilOptind++;
28844  if ( nLutSize < 0 )
28845  goto usage;
28846  break;
28847  case 'C':
28848  if ( globalUtilOptind >= argc )
28849  {
28850  Abc_Print( -1, "Command line switch \"-C\" should be followed by a char string.\n" );
28851  goto usage;
28852  }
28853  nCutNum = atoi(argv[globalUtilOptind]);
28854  globalUtilOptind++;
28855  if ( nCutNum < 0 )
28856  goto usage;
28857  break;
28858  case 'n':
28859  fUseOld ^= 1;
28860  break;
28861  case 'm':
28862  fUseMuxes ^= 1;
28863  break;
28864  case 'r':
28865  fRecursive ^= 1;
28866  break;
28867  case 'a':
28868  fOptArea ^= 1;
28869  break;
28870  case 'v':
28871  fVerbose ^= 1;
28872  break;
28873  case 'w':
28874  fVeryVerbose ^= 1;
28875  break;
28876  case 'h':
28877  goto usage;
28878  default:
28879  goto usage;
28880  }
28881  }
28882  if ( pAbc->pGia == NULL )
28883  {
28884  Abc_Print( -1, "Abc_CommandAbc9BalanceLut(): There is no AIG.\n" );
28885  return 1;
28886  }
28887  if ( fUseOld )
28888  pTemp = Gia_ManBalanceLut( pAbc->pGia, nLutSize, nCutNum, fVerbose );
28889  else
28890  pTemp = Gia_ManLutBalance( pAbc->pGia, nLutSize, fUseMuxes, fRecursive, fOptArea, fVerbose );
28891  Abc_FrameUpdateGia( pAbc, pTemp );
28892  return 0;
28893 
28894 usage:
28895  Abc_Print( -2, "usage: &blut [-KC num] [-mravh]\n" );
28896  Abc_Print( -2, "\t performs AIG balancing for the given LUT size\n" );
28897  Abc_Print( -2, "\t-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", 6, nLutSize );
28898  Abc_Print( -2, "\t-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", 8, nCutNum );
28899  Abc_Print( -2, "\t-m : toggle performing MUX restructuring [default = %s]\n", fUseMuxes? "yes": "no" );
28900  Abc_Print( -2, "\t-r : toggle performing recursive restructuring [default = %s]\n", fRecursive? "yes": "no" );
28901  Abc_Print( -2, "\t-a : toggle performing area-oriented restructuring [default = %s]\n", fOptArea? "yes": "no" );
28902  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28903 // Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
28904  Abc_Print( -2, "\t-h : print the command usage\n");
28905  return 1;
28906 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Gia_Man_t * Gia_ManBalanceLut(Gia_Man_t *p, int nLutSize, int nCutNum, int fVerbose)
Definition: giaBalLut.c:959
Gia_Man_t * Gia_ManLutBalance(Gia_Man_t *p, int nLutSize, int fUseMuxes, int fRecursive, int fOptArea, int fVerbose)
Definition: giaStr.c:1377
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9BCore ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35874 of file abc.c.

35875 {
35876  int c;
35877  Bmc_BCorePar_t Pars, * pPars = &Pars;
35878  memset( pPars, 0, sizeof(Bmc_BCorePar_t) );
35879  pPars->iFrame = 10; // timeframe
35880  pPars->iOutput = 0; // property output
35881  pPars->nTimeOut = 0; // timeout in seconds
35882  pPars->pFilePivots = NULL; // file name with AIG IDs of pivot objects
35883  pPars->pFileProof = NULL; // file name to write the resulting proof
35884  pPars->fVerbose = 0; // verbose output
35886  while ( ( c = Extra_UtilGetopt( argc, argv, "FOTVvh" ) ) != EOF )
35887  {
35888  switch ( c )
35889  {
35890  case 'F':
35891  if ( globalUtilOptind >= argc )
35892  {
35893  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
35894  goto usage;
35895  }
35896  pPars->iFrame = atoi(argv[globalUtilOptind]);
35897  globalUtilOptind++;
35898  if ( pPars->iFrame < 0 )
35899  goto usage;
35900  break;
35901  case 'O':
35902  if ( globalUtilOptind >= argc )
35903  {
35904  Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
35905  goto usage;
35906  }
35907  pPars->iOutput = atoi(argv[globalUtilOptind]);
35908  globalUtilOptind++;
35909  if ( pPars->iOutput < 0 )
35910  goto usage;
35911  break;
35912  case 'T':
35913  if ( globalUtilOptind >= argc )
35914  {
35915  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
35916  goto usage;
35917  }
35918  pPars->nTimeOut = atoi(argv[globalUtilOptind]);
35919  globalUtilOptind++;
35920  if ( pPars->nTimeOut < 0 )
35921  goto usage;
35922  break;
35923  case 'V':
35924  if ( globalUtilOptind >= argc )
35925  {
35926  Abc_Print( -1, "Command line switch \"-V\" should be followed by a file name.\n" );
35927  goto usage;
35928  }
35929  pPars->pFilePivots = argv[globalUtilOptind];
35930  globalUtilOptind++;
35931  break;
35932  case 'v':
35933  pPars->fVerbose ^= 1;
35934  break;
35935  case 'h':
35936  goto usage;
35937  default:
35938  goto usage;
35939  }
35940  }
35941  if ( pAbc->pGia == NULL )
35942  {
35943  Abc_Print( -1, "Abc_CommandAbc9BCore(): There is no AIG.\n" );
35944  return 0;
35945  }
35946  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
35947  {
35948  Abc_Print( -1, "Abc_CommandAbc9BCore(): AIG has no registers.\n" );
35949  return 0;
35950  }
35951  // get the file name
35952  if ( pPars->pFilePivots != NULL )
35953  {
35954  FILE * pFile;
35955  pFile = fopen( pPars->pFilePivots, "r" );
35956  if ( pFile == NULL )
35957  {
35958  Abc_Print( -1, "Abc_CommandAbc9BCore(): Cannot open file \"%s\" with pivot node IDs.\n", pPars->pFilePivots );
35959  return 0;
35960  }
35961  fclose( pFile );
35962  }
35963  // get the file name
35964  if ( argc == globalUtilOptind + 1 )
35965  {
35966  FILE * pFile;
35967  pPars->pFileProof = argv[globalUtilOptind];
35968  pFile = fopen( pPars->pFileProof, "wb" );
35969  if ( pFile == NULL )
35970  {
35971  Abc_Print( -1, "Abc_CommandAbc9BCore(): Cannot open file \"%s\" for writing the proof.\n", pPars->pFileProof );
35972  return 0;
35973  }
35974  fclose( pFile );
35975  }
35976  Bmc_ManBCorePerform( pAbc->pGia, pPars );
35977  return 0;
35978 
35979 usage:
35980  Abc_Print( -2, "usage: &bcore [-FOTV num] [-vh] <file>\n" );
35981  Abc_Print( -2, "\t records UNSAT core of the BMC instance\n" );
35982  Abc_Print( -2, "\t-F num : the zero-based index of a timeframe [default = %d]\n", pPars->iFrame );
35983  Abc_Print( -2, "\t-O num : the zero-based index of a primary output [default = %d]\n", pPars->iOutput );
35984  Abc_Print( -2, "\t-T num : approximate timeout in seconds [default = %d]\n", pPars->nTimeOut );
35985  Abc_Print( -2, "\t-V file: file name with AIG IDs of pivot variables [default = no pivots]\n" );
35986  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
35987  Abc_Print( -2, "\t-h : print the command usage\n");
35988  Abc_Print( -2, "\t<file> : file name to write the resulting proof [default = stdout]\n");
35989  return 1;
35990 }
char * memset()
int nTimeOut
Definition: bmc.h:103
char * pFileProof
Definition: bmc.h:105
int fVerbose
Definition: bmc.h:106
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int iOutput
Definition: bmc.h:102
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int iFrame
Definition: bmc.h:101
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Bmc_ManBCorePerform(Gia_Man_t *pGia, Bmc_BCorePar_t *pPars)
MACRO DEFINITIONS ///.
Definition: bmcBCore.c:196
char * pFilePivots
Definition: bmc.h:104
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Bidec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28511 of file abc.c.

28512 {
28513  Gia_Man_t * pTemp;
28514  int c, fVerbose = 0;
28515  int fUpdateLevel = 1;
28517  while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
28518  {
28519  switch ( c )
28520  {
28521  case 'l':
28522  fUpdateLevel ^= 1;
28523  break;
28524  case 'v':
28525  fVerbose ^= 1;
28526  break;
28527  case 'h':
28528  goto usage;
28529  default:
28530  goto usage;
28531  }
28532  }
28533  if ( pAbc->pGia == NULL )
28534  {
28535  Abc_Print( -1, "Abc_CommandAbc9Bidec(): There is no AIG.\n" );
28536  return 1;
28537  }
28538  if ( !Gia_ManHasMapping(pAbc->pGia) )
28539  {
28540  Abc_Print( -1, "Abc_CommandAbc9Bidec(): Mapping of the AIG is not defined.\n" );
28541  return 1;
28542  }
28543  pTemp = Gia_ManPerformBidec( pAbc->pGia, fVerbose );
28544  Abc_FrameUpdateGia( pAbc, pTemp );
28545  return 0;
28546 
28547 usage:
28548  Abc_Print( -2, "usage: &bidec [-vh]\n" );
28549  Abc_Print( -2, "\t performs heavy rewriting of the AIG\n" );
28550 // Abc_Print( -2, "\t-l : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
28551  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28552  Abc_Print( -2, "\t-h : print the command usage\n");
28553  return 1;
28554 }
Gia_Man_t * Gia_ManPerformBidec(Gia_Man_t *p, int fVerbose)
Definition: giaBidec.c:233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Bmc ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35658 of file abc.c.

35659 {
35660  int c;
35661  Bmc_AndPar_t Pars, * pPars = &Pars;
35662  memset( pPars, 0, sizeof(Bmc_AndPar_t) );
35663  pPars->nStart = 0; // starting timeframe
35664  pPars->nFramesMax = 0; // maximum number of timeframes
35665  pPars->nFramesAdd = 50; // the number of additional frames
35666  pPars->nConfLimit = 0; // maximum number of conflicts at a node
35667  pPars->nTimeOut = 0; // timeout in seconds
35668  pPars->fLoadCnf = 0; // dynamic CNF loading
35669  pPars->fDumpFrames = 0; // dump unrolled timeframes
35670  pPars->fUseSynth = 0; // use synthesis
35671  pPars->fUseOldCnf = 1; // use old CNF construction
35672  pPars->fVerbose = 0; // verbose
35673  pPars->fVeryVerbose = 0; // very verbose
35674  pPars->fNotVerbose = 0; // skip line-by-line print-out
35675  pPars->iFrame = 0; // explored up to this frame
35676  pPars->nFailOuts = 0; // the number of failed outputs
35677  pPars->nDropOuts = 0; // the number of dropped outputs
35679  while ( ( c = Extra_UtilGetopt( argc, argv, "SFATdscvwh" ) ) != EOF )
35680  {
35681  switch ( c )
35682  {
35683  case 'S':
35684  if ( globalUtilOptind >= argc )
35685  {
35686  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
35687  goto usage;
35688  }
35689  pPars->nStart = atoi(argv[globalUtilOptind]);
35690  globalUtilOptind++;
35691  if ( pPars->nStart < 0 )
35692  goto usage;
35693  break;
35694  case 'F':
35695  if ( globalUtilOptind >= argc )
35696  {
35697  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
35698  goto usage;
35699  }
35700  pPars->nFramesMax = atoi(argv[globalUtilOptind]);
35701  globalUtilOptind++;
35702  if ( pPars->nFramesMax < 0 )
35703  goto usage;
35704  break;
35705  case 'A':
35706  if ( globalUtilOptind >= argc )
35707  {
35708  Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
35709  goto usage;
35710  }
35711  pPars->nFramesAdd = atoi(argv[globalUtilOptind]);
35712  globalUtilOptind++;
35713  if ( pPars->nFramesAdd < 0 )
35714  goto usage;
35715  break;
35716  case 'T':
35717  if ( globalUtilOptind >= argc )
35718  {
35719  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
35720  goto usage;
35721  }
35722  pPars->nTimeOut = atoi(argv[globalUtilOptind]);
35723  globalUtilOptind++;
35724  if ( pPars->nTimeOut < 0 )
35725  goto usage;
35726  break;
35727  case 'd':
35728  pPars->fDumpFrames ^= 1;
35729  break;
35730  case 's':
35731  pPars->fUseSynth ^= 1;
35732  break;
35733  case 'c':
35734  pPars->fUseOldCnf ^= 1;
35735  break;
35736  case 'v':
35737  pPars->fVerbose ^= 1;
35738  break;
35739  case 'w':
35740  pPars->fVeryVerbose ^= 1;
35741  break;
35742  case 'h':
35743  goto usage;
35744  default:
35745  goto usage;
35746  }
35747  }
35748  if ( pAbc->pGia == NULL )
35749  {
35750  Abc_Print( -1, "Abc_CommandAbc9Bmc(): There is no AIG.\n" );
35751  return 0;
35752  }
35753  if ( !pPars->fUseOldCnf && !Sdm_ManCanRead() )
35754  {
35755  Abc_Print( -1, "Abc_CommandAbc9Bmc(): Cannot input precomputed DSD information.\n" );
35756  return 0;
35757  }
35758  pAbc->Status = Gia_ManBmcPerform( pAbc->pGia, pPars );
35759  pAbc->nFrames = pPars->iFrame;
35760  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
35761  return 0;
35762 
35763 usage:
35764  Abc_Print( -2, "usage: &bmc [-SFAT num] [-dscvwh]\n" );
35765  Abc_Print( -2, "\t performs bounded model checking\n" );
35766  Abc_Print( -2, "\t-S num : the starting timeframe [default = %d]\n", pPars->nStart );
35767  Abc_Print( -2, "\t-F num : the maximum number of timeframes [default = %d]\n", pPars->nFramesMax );
35768  Abc_Print( -2, "\t-A num : the number of additional frames to unroll [default = %d]\n", pPars->nFramesAdd );
35769  Abc_Print( -2, "\t-T num : approximate timeout in seconds [default = %d]\n", pPars->nTimeOut );
35770  Abc_Print( -2, "\t-d : toggle dumping unfolded timeframes [default = %s]\n", pPars->fDumpFrames? "yes": "no" );
35771  Abc_Print( -2, "\t-s : toggle synthesizing unrolled timeframes [default = %s]\n", pPars->fUseSynth? "yes": "no" );
35772  Abc_Print( -2, "\t-c : toggle using old CNF computation [default = %s]\n", pPars->fUseOldCnf? "yes": "no" );
35773  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
35774  Abc_Print( -2, "\t-w : toggle printing information about unfolding [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
35775  Abc_Print( -2, "\t-h : print the command usage\n");
35776  return 1;
35777 }
char * memset()
int nFramesMax
Definition: bmc.h:82
int nFramesAdd
Definition: bmc.h:83
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
int nTimeOut
Definition: bmc.h:85
int fDumpFrames
Definition: bmc.h:87
int nFailOuts
Definition: bmc.h:94
int fUseSynth
Definition: bmc.h:88
int fVerbose
Definition: bmc.h:90
int fNotVerbose
Definition: bmc.h:92
int Gia_ManBmcPerform(Gia_Man_t *p, Bmc_AndPar_t *pPars)
Definition: bmcBmcAnd.c:1066
int fUseOldCnf
Definition: bmc.h:89
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int fVeryVerbose
Definition: bmc.h:91
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fLoadCnf
Definition: bmc.h:86
int Sdm_ManCanRead()
int nStart
Definition: bmc.h:81
int nConfLimit
Definition: bmc.h:84
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int nDropOuts
Definition: bmc.h:95
int iFrame
Definition: bmc.h:93
int Abc_CommandAbc9Bmci ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36675 of file abc.c.

36676 {
36677  extern int Gia_ManBmciTest( Gia_Man_t * p, Vec_Int_t * vInit, int nFrames, int nWords, int nTimeOut, int fSim, int fVerbose );
36678  int c, nFrames = 1000, nWords = 1000, nTimeOut = 0, fSim = 0, fVerbose = 0;
36680  while ( ( c = Extra_UtilGetopt( argc, argv, "FWTsvh" ) ) != EOF )
36681  {
36682  switch ( c )
36683  {
36684  case 'F':
36685  if ( globalUtilOptind >= argc )
36686  {
36687  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
36688  goto usage;
36689  }
36690  nFrames = atoi(argv[globalUtilOptind]);
36691  globalUtilOptind++;
36692  if ( nFrames < 0 )
36693  goto usage;
36694  break;
36695  case 'W':
36696  if ( globalUtilOptind >= argc )
36697  {
36698  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
36699  goto usage;
36700  }
36701  nWords = atoi(argv[globalUtilOptind]);
36702  globalUtilOptind++;
36703  if ( nWords < 0 )
36704  goto usage;
36705  break;
36706  case 'T':
36707  if ( globalUtilOptind >= argc )
36708  {
36709  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
36710  goto usage;
36711  }
36712  nTimeOut = atoi(argv[globalUtilOptind]);
36713  globalUtilOptind++;
36714  if ( nTimeOut < 0 )
36715  goto usage;
36716  break;
36717  case 's':
36718  fSim ^= 1;
36719  break;
36720  case 'v':
36721  fVerbose ^= 1;
36722  break;
36723  case 'h':
36724  goto usage;
36725  default:
36726  goto usage;
36727  }
36728  }
36729  if ( pAbc->pGia == NULL )
36730  {
36731  Abc_Print( -1, "Abc_CommandAbc9Bmci(): There is no AIG.\n" );
36732  return 0;
36733  }
36734  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
36735  {
36736  Abc_Print( -1, "Abc_CommandAbc9Bmci(): AIG is combinational.\n" );
36737  return 0;
36738  }
36739  if ( pAbc->pGia->vInitClasses == NULL )
36740  {
36741  Abc_Print( -1, "Abc_CommandAbc9Bmci(): Init array is not given.\n" );
36742  return 0;
36743  }
36744  Gia_ManBmciTest( pAbc->pGia, pAbc->pGia->vInitClasses, nFrames, nWords, nTimeOut, fSim, fVerbose );
36745  return 0;
36746 
36747 usage:
36748  Abc_Print( -2, "usage: &bmci [-FWT num] [-svh]\n" );
36749  Abc_Print( -2, "\t experimental procedure\n" );
36750  Abc_Print( -2, "\t-F num : the number of timeframes [default = %d]\n", nFrames );
36751  Abc_Print( -2, "\t-W num : the number of machine words [default = %d]\n", nWords );
36752  Abc_Print( -2, "\t-T num : approximate global runtime limit in seconds [default = %d]\n", nTimeOut );
36753  Abc_Print( -2, "\t-s : toggles using ternary simulation [default = %s]\n", fSim? "yes": "no" );
36754  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
36755  Abc_Print( -2, "\t-h : print the command usage\n");
36756  return 1;
36757 }
int Gia_ManBmciTest(Gia_Man_t *p, Vec_Int_t *vInit, int nFrames, int nWords, int nTimeOut, int fSim, int fVerbose)
Definition: bmcBmci.c:330
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int nWords
Definition: abcNpn.c:127
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Cec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30811 of file abc.c.

30812 {
30813  Cec_ParCec_t ParsCec, * pPars = &ParsCec;
30814  FILE * pFile;
30815  Gia_Man_t * pSecond, * pMiter;
30816  char * FileName, * pTemp;
30817  char ** pArgvNew;
30818  int c, nArgcNew, fMiter = 0, fDualOutput = 0, fDumpMiter = 0;
30819  Cec_ManCecSetDefaultParams( pPars );
30821  while ( ( c = Extra_UtilGetopt( argc, argv, "CTnmdavh" ) ) != EOF )
30822  {
30823  switch ( c )
30824  {
30825  case 'C':
30826  if ( globalUtilOptind >= argc )
30827  {
30828  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
30829  goto usage;
30830  }
30831  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
30832  globalUtilOptind++;
30833  if ( pPars->nBTLimit < 0 )
30834  goto usage;
30835  break;
30836  case 'T':
30837  if ( globalUtilOptind >= argc )
30838  {
30839  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
30840  goto usage;
30841  }
30842  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
30843  globalUtilOptind++;
30844  if ( pPars->TimeLimit < 0 )
30845  goto usage;
30846  break;
30847  case 'n':
30848  pPars->fNaive ^= 1;
30849  break;
30850  case 'm':
30851  fMiter ^= 1;
30852  break;
30853  case 'd':
30854  fDualOutput ^= 1;
30855  break;
30856  case 'a':
30857  fDumpMiter ^= 1;
30858  break;
30859  case 'v':
30860  pPars->fVerbose ^= 1;
30861  break;
30862  case 'h':
30863  goto usage;
30864  default:
30865  goto usage;
30866  }
30867  }
30868  if ( fMiter )
30869  {
30870  if ( fDualOutput )
30871  {
30872  if ( Gia_ManPoNum(pAbc->pGia) & 1 )
30873  {
30874  Abc_Print( -1, "The dual-output miter should have an even number of outputs.\n" );
30875  return 1;
30876  }
30877  Abc_Print( 1, "Assuming the current network is a double-output miter. (Conflict limit = %d.)\n", pPars->nBTLimit );
30878  pAbc->Status = Cec_ManVerify( pAbc->pGia, pPars );
30879  }
30880  else
30881  {
30882  Gia_Man_t * pTemp;
30883  Abc_Print( 1, "Assuming the current network is a single-output miter. (Conflict limit = %d.)\n", pPars->nBTLimit );
30884  pTemp = Gia_ManTransformToDual( pAbc->pGia );
30885  pAbc->Status = Cec_ManVerify( pTemp, pPars );
30886  Gia_ManStop( pTemp );
30887  }
30888  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexComb );
30889  return 0;
30890  }
30891 
30892  pArgvNew = argv + globalUtilOptind;
30893  nArgcNew = argc - globalUtilOptind;
30894  if ( nArgcNew != 1 )
30895  {
30896  if ( pAbc->pGia->pSpec == NULL )
30897  {
30898  Abc_Print( -1, "File name is not given on the command line.\n" );
30899  return 1;
30900  }
30901  FileName = pAbc->pGia->pSpec;
30902  }
30903  else
30904  FileName = pArgvNew[0];
30905  // fix the wrong symbol
30906  for ( pTemp = FileName; *pTemp; pTemp++ )
30907  if ( *pTemp == '>' )
30908  *pTemp = '\\';
30909  if ( (pFile = fopen( FileName, "r" )) == NULL )
30910  {
30911  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
30912  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
30913  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
30914  Abc_Print( 1, "\n" );
30915  return 1;
30916  }
30917  fclose( pFile );
30918  pSecond = Gia_AigerRead( FileName, 0, 0 );
30919  if ( pSecond == NULL )
30920  {
30921  Abc_Print( -1, "Reading AIGER has failed.\n" );
30922  return 0;
30923  }
30924  // compute the miter
30925  pMiter = Gia_ManMiter( pAbc->pGia, pSecond, 0, 1, 0, 0, pPars->fVerbose );
30926  if ( pMiter )
30927  {
30928  if ( fDumpMiter )
30929  {
30930  Abc_Print( 0, "The verification miter is written into file \"%s\".\n", "cec_miter.aig" );
30931  Gia_AigerWrite( pMiter, "cec_miter.aig", 0, 0 );
30932  }
30933  pAbc->Status = Cec_ManVerify( pMiter, pPars );
30934  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexComb );
30935  Gia_ManStop( pMiter );
30936  }
30937  Gia_ManStop( pSecond );
30938  return 0;
30939 
30940 usage:
30941  Abc_Print( -2, "usage: &cec [-CT num] [-nmdavh]\n" );
30942  Abc_Print( -2, "\t new combinational equivalence checker\n" );
30943  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
30944  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
30945  Abc_Print( -2, "\t-n : toggle using naive SAT-based checking [default = %s]\n", pPars->fNaive? "yes":"no");
30946  Abc_Print( -2, "\t-m : toggle miter vs. two circuits [default = %s]\n", fMiter? "miter":"two circuits");
30947  Abc_Print( -2, "\t-d : toggle using dual output miter [default = %s]\n", fDualOutput? "yes":"no");
30948  Abc_Print( -2, "\t-a : toggle writing dual-output miter [default = %s]\n", fDumpMiter? "yes":"no");
30949  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
30950  Abc_Print( -2, "\t-h : print the command usage\n");
30951  return 1;
30952 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
int nBTLimit
Definition: cec.h:120
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Cec_ManCecSetDefaultParams(Cec_ParCec_t *p)
Definition: cecCore.c:157
int globalUtilOptind
Definition: extraUtilUtil.c:45
int TimeLimit
Definition: cec.h:121
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
Definition: giaAiger.c:1024
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Cec_ManVerify(Gia_Man_t *p, Cec_ParCec_t *pPars)
MACRO DEFINITIONS ///.
Definition: cecCec.c:308
int fVerbose
Definition: cec.h:127
Gia_Man_t * Gia_ManTransformToDual(Gia_Man_t *p)
Definition: giaDup.c:2353
int fNaive
Definition: cec.h:125
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
Definition: giaDup.c:2128
int Abc_CommandAbc9CexCut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37186 of file abc.c.

37187 {
37188  return -1;
37189 }
int Abc_CommandAbc9CexInfo ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34844 of file abc.c.

34845 {
34846  extern void Bmc_CexTest( Gia_Man_t * p, Abc_Cex_t * pCex, int fVerbose );
34847  int c, fDualOut = 0, fVerbose = 0;
34849  while ( ( c = Extra_UtilGetopt( argc, argv, "dvh" ) ) != EOF )
34850  {
34851  switch ( c )
34852  {
34853  case 'd':
34854  fDualOut ^= 1;
34855  break;
34856  case 'v':
34857  fVerbose ^= 1;
34858  break;
34859  case 'h':
34860  goto usage;
34861  default:
34862  goto usage;
34863  }
34864  }
34865  if ( pAbc->pGia == NULL )
34866  {
34867  Abc_Print( -1, "Abc_CommandAbc9CexInfo(): There is no AIG.\n" );
34868  return 1;
34869  }
34870  if ( pAbc->pCex == NULL )
34871  {
34872  Abc_Print( -1, "Abc_CommandAbc9CexInfo(): There is no CEX.\n" );
34873  return 1;
34874  }
34875  Bmc_CexTest( pAbc->pGia, pAbc->pCex, fVerbose );
34876  return 0;
34877 
34878 usage:
34879  Abc_Print( -2, "usage: &cexinfo [-vh]\n" );
34880  Abc_Print( -2, "\t prints information about the current counter-example\n" );
34881  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
34882  Abc_Print( -2, "\t-h : print the command usage\n");
34883  return 1;
34884 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Bmc_CexTest(Gia_Man_t *p, Abc_Cex_t *pCex, int fVerbose)
Definition: bmcCexTools.c:816
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
int Abc_CommandAbc9CexMerge ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37202 of file abc.c.

37203 {
37204  Abc_Cex_t * pCexNew;
37205  int c;
37206  int iFrStart = 0;
37207  int iFrStop = ABC_INFINITY;
37208  int fVerbose = 0;
37210  while ( ( c = Extra_UtilGetopt( argc, argv, "FGvh" ) ) != EOF )
37211  {
37212  switch ( c )
37213  {
37214  case 'F':
37215  if ( globalUtilOptind >= argc )
37216  {
37217  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
37218  goto usage;
37219  }
37220  iFrStart = atoi(argv[globalUtilOptind]);
37221  globalUtilOptind++;
37222  if ( iFrStart < 0 )
37223  goto usage;
37224  break;
37225  case 'G':
37226  if ( globalUtilOptind >= argc )
37227  {
37228  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
37229  goto usage;
37230  }
37231  iFrStop = atoi(argv[globalUtilOptind]);
37232  globalUtilOptind++;
37233  if ( iFrStop < 0 )
37234  goto usage;
37235  break;
37236  case 'v':
37237  fVerbose ^= 1;
37238  break;
37239  case 'h':
37240  goto usage;
37241  default:
37242  Abc_Print( -2, "Unknown switch.\n");
37243  goto usage;
37244  }
37245  }
37246 
37247  if ( pAbc->pCex == NULL )
37248  {
37249  Abc_Print( 1, "There is no current cex.\n");
37250  return 0;
37251  }
37252  if ( pAbc->pCex2 == NULL )
37253  {
37254  Abc_Print( 1, "There is no saved cex.\n");
37255  return 0;
37256  }
37257  if ( iFrStop - iFrStart < pAbc->pCex->iFrame )
37258  {
37259  Abc_Print( 1, "Current CEX does not allow to shorten the saved CEX.\n");
37260  return 0;
37261  }
37262  pCexNew = Abc_CexMerge( pAbc->pCex2, pAbc->pCex, iFrStart, iFrStop );
37263  if ( pCexNew == NULL )
37264  {
37265  Abc_Print( 1, "Merging CEXes has failed.\n");
37266  return 0;
37267  }
37268  // replace the saved CEX
37269  ABC_FREE( pAbc->pCex2 );
37270  pAbc->pCex2 = pCexNew;
37271  return 0;
37272 
37273 usage:
37274  Abc_Print( -2, "usage: &cexmerge [-FG num] [-vh]\n" );
37275  Abc_Print( -2, "\t merges the current CEX into the saved one\n" );
37276  Abc_Print( -2, "\t and sets the resulting CEX as the saved one\n" );
37277  Abc_Print( -2, "\t-F num : 0-based number of the starting frame [default = %d]\n", iFrStart );
37278  Abc_Print( -2, "\t-G num : 0-based number of the ending frame [default = %d]\n", iFrStop );
37279  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37280  Abc_Print( -2, "\t-h : print the command usage\n");
37281  return 1;
37282 }
Abc_Cex_t * Abc_CexMerge(Abc_Cex_t *pCex, Abc_Cex_t *pPart, int iFrBeg, int iFrEnd)
Definition: utilCex.c:197
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
int Abc_CommandAbc9CexMin ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37295 of file abc.c.

37296 {
37297  extern Abc_Cex_t * Gia_ManCexMin( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int nRealPis, int fJustMax, int fUseAll, int fVerbose );
37298  Abc_Cex_t * pCexNew;
37299  int iFrameStart = 0;
37300  int nRealPis = -1;
37301  int fJustMax = 1;
37302  int fUseAll = 0;
37303  int c, fVerbose = 0;
37305  while ( ( c = Extra_UtilGetopt( argc, argv, "FNjavh" ) ) != EOF )
37306  {
37307  switch ( c )
37308  {
37309  case 'F':
37310  if ( globalUtilOptind >= argc )
37311  {
37312  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
37313  goto usage;
37314  }
37315  iFrameStart = atoi(argv[globalUtilOptind]);
37316  globalUtilOptind++;
37317  if ( iFrameStart < 0 )
37318  goto usage;
37319  break;
37320  case 'N':
37321  if ( globalUtilOptind >= argc )
37322  {
37323  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
37324  goto usage;
37325  }
37326  nRealPis = atoi(argv[globalUtilOptind]);
37327  globalUtilOptind++;
37328  if ( nRealPis < 0 )
37329  goto usage;
37330  break;
37331  case 'j':
37332  fJustMax ^= 1;
37333  break;
37334  case 'a':
37335  fUseAll ^= 1;
37336  break;
37337  case 'v':
37338  fVerbose ^= 1;
37339  break;
37340  case 'h':
37341  goto usage;
37342  default:
37343  goto usage;
37344  }
37345  }
37346  if ( pAbc->pGia == NULL )
37347  {
37348  Abc_Print( -1, "Abc_CommandAbc9CexMin(): There is no AIG.\n" );
37349  return 1;
37350  }
37351  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
37352  {
37353  Abc_Print( -1, "Abc_CommandAbc9CexMin(): The network is combinational.\n" );
37354  return 0;
37355  }
37356  if ( pAbc->pCex == NULL )
37357  {
37358  Abc_Print( -1, "Abc_CommandAbc9CexMin(): There is no counter-example.\n" );
37359  return 1;
37360  }
37361  pCexNew = Gia_ManCexMin( pAbc->pGia, pAbc->pCex, iFrameStart, nRealPis, fJustMax, fUseAll, fVerbose );
37362  if ( pCexNew )
37363  Abc_FrameReplaceCex( pAbc, &pCexNew );
37364  return 0;
37365 
37366 usage:
37367  Abc_Print( -2, "usage: &cexmin [-FN num] [-javh]\n" );
37368  Abc_Print( -2, "\t minimizes a deep counter-example\n" );
37369  Abc_Print( -2, "\t-F num : starting timeframe for minimization [default = %d]\n", iFrameStart );
37370  Abc_Print( -2, "\t-N num : the number of real primary inputs [default = %d]\n", nRealPis );
37371  Abc_Print( -2, "\t-j : toggle computing all justifying assignments [default = %s]\n", fJustMax? "yes": "no" );
37372  Abc_Print( -2, "\t-a : toggle using all terminal objects [default = %s]\n", fUseAll? "yes": "no" );
37373  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37374  Abc_Print( -2, "\t-h : print the command usage\n");
37375  return 1;
37376 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Abc_Cex_t * Gia_ManCexMin(Gia_Man_t *p, Abc_Cex_t *pCex, int iFrameStart, int nRealPis, int fJustMax, int fUseAll, int fVerbose)
Definition: bmcCexMin2.c:317
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9CFraig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30272 of file abc.c.

30273 {
30274  Gia_Man_t * pTemp;
30275  int c;
30276  Ssc_Pars_t Pars, * pPars = &Pars;
30277  Ssc_ManSetDefaultParams( pPars );
30279  while ( ( c = Extra_UtilGetopt( argc, argv, "WCacvh" ) ) != EOF )
30280  {
30281  switch ( c )
30282  {
30283  case 'W':
30284  if ( globalUtilOptind >= argc )
30285  {
30286  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
30287  goto usage;
30288  }
30289  pPars->nWords = atoi(argv[globalUtilOptind]);
30290  globalUtilOptind++;
30291  if ( pPars->nWords < 0 )
30292  goto usage;
30293  break;
30294  case 'C':
30295  if ( globalUtilOptind >= argc )
30296  {
30297  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
30298  goto usage;
30299  }
30300  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
30301  globalUtilOptind++;
30302  if ( pPars->nBTLimit < 0 )
30303  goto usage;
30304  break;
30305  case 'a':
30306  pPars->fAppend ^= 1;
30307  break;
30308  case 'c':
30309  pPars->fVerify ^= 1;
30310  break;
30311  case 'v':
30312  pPars->fVerbose ^= 1;
30313  break;
30314  default:
30315  goto usage;
30316  }
30317  }
30318  if ( pAbc->pGia == NULL )
30319  {
30320  Abc_Print( -1, "Abc_CommandAbc9CFraig(): There is no AIG.\n" );
30321  return 1;
30322  }
30323  pTemp = Ssc_PerformSweepingConstr( pAbc->pGia, pPars );
30324  Abc_FrameUpdateGia( pAbc, pTemp );
30325  return 0;
30326 
30327 usage:
30328  Abc_Print( -2, "usage: &cfraig [-WC <num>] [-acvh]\n" );
30329  Abc_Print( -2, "\t performs combinational SAT sweeping under constraints\n" );
30330  Abc_Print( -2, "\t which are present in the AIG or set manually using \"constr\"\n" );
30331  Abc_Print( -2, "\t (constraints are listed as last POs and true when they are 0)\n" );
30332  Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
30333  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
30334  Abc_Print( -2, "\t-a : toggle appending constraints to the result [default = %s]\n", pPars->fAppend? "yes": "no" );
30335  Abc_Print( -2, "\t-c : toggle performing internal verification [default = %s]\n", pPars->fVerify? "yes": "no" );
30336  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
30337  Abc_Print( -2, "\t-h : print the command usage\n");
30338  return 1;
30339 }
void Ssc_ManSetDefaultParams(Ssc_Pars_t *p)
MACRO DEFINITIONS ///.
Definition: sscCore.c:46
typedefABC_NAMESPACE_HEADER_START struct Ssc_Pars_t_ Ssc_Pars_t
INCLUDES ///.
Definition: ssc.h:43
Gia_Man_t * Ssc_PerformSweepingConstr(Gia_Man_t *p, Ssc_Pars_t *pPars)
Definition: sscCore.c:420
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9ChainBmc ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35790 of file abc.c.

35791 {
35792  extern int Bmc_ChainTest( Gia_Man_t * p, int nFrameMax, int nConfMax, int fVerbose, int fVeryVerbose );
35793  int nFrameMax = 200;
35794  int nConfMax = 0;
35795  int fVerbose = 0;
35796  int fVeryVerbose = 0;
35797  int c;
35799  while ( ( c = Extra_UtilGetopt( argc, argv, "FCvwh" ) ) != EOF )
35800  {
35801  switch ( c )
35802  {
35803  case 'F':
35804  if ( globalUtilOptind >= argc )
35805  {
35806  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
35807  goto usage;
35808  }
35809  nFrameMax = atoi(argv[globalUtilOptind]);
35810  globalUtilOptind++;
35811  if ( nFrameMax < 0 )
35812  goto usage;
35813  break;
35814  case 'C':
35815  if ( globalUtilOptind >= argc )
35816  {
35817  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
35818  goto usage;
35819  }
35820  nConfMax = atoi(argv[globalUtilOptind]);
35821  globalUtilOptind++;
35822  if ( nConfMax < 0 )
35823  goto usage;
35824  break;
35825  case 'v':
35826  fVerbose ^= 1;
35827  break;
35828  case 'w':
35829  fVeryVerbose ^= 1;
35830  break;
35831  case 'h':
35832  goto usage;
35833  default:
35834  goto usage;
35835  }
35836  }
35837  if ( pAbc->pGia == NULL )
35838  {
35839  Abc_Print( -1, "Abc_CommandAbc9ChainBmc(): There is no AIG.\n" );
35840  return 0;
35841  }
35842  if ( !Gia_ManRegNum(pAbc->pGia) )
35843  {
35844  Abc_Print( -1, "Abc_CommandAbc9ChainBmc(): The AIG is combinational.\n" );
35845  return 0;
35846  }
35847  Bmc_ChainTest( pAbc->pGia, nFrameMax, nConfMax, fVerbose, fVeryVerbose );
35848  //pAbc->Status = ...;
35849  //pAbc->nFrames = pPars->iFrame;
35850  //Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
35851  return 0;
35852 usage:
35853  Abc_Print( -2, "usage: &chainbmc [-FC <num>] [-vwh]\n" );
35854  Abc_Print( -2, "\t runs a specialized flavor of BMC\n" );
35855  Abc_Print( -2, "\t-F <num> : the max number of timeframes (0 = unused) [default = %d]\n", nFrameMax );
35856  Abc_Print( -2, "\t-C <num> : the max number of conflicts (0 = unused) [default = %d]\n", nConfMax );
35857  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
35858  Abc_Print( -2, "\t-w : toggle printing even more information [default = %s]\n", fVeryVerbose? "yes": "no" );
35859  Abc_Print( -2, "\t-h : print the command usage\n");
35860  return 1;
35861 }
int Bmc_ChainTest(Gia_Man_t *p, int nFrameMax, int nConfMax, int fVerbose, int fVeryVerbose)
Definition: bmcChain.c:274
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Choice ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29889 of file abc.c.

29890 {
29891  Cec_ParChc_t Pars, * pPars = &Pars;
29892  Gia_Man_t * pTemp;
29893  int c;
29894  Cec_ManChcSetDefaultParams( pPars );
29896  while ( ( c = Extra_UtilGetopt( argc, argv, "Ccvh" ) ) != EOF )
29897  {
29898  switch ( c )
29899  {
29900  case 'C':
29901  if ( globalUtilOptind >= argc )
29902  {
29903  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
29904  goto usage;
29905  }
29906  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
29907  globalUtilOptind++;
29908  if ( pPars->nBTLimit < 0 )
29909  goto usage;
29910  break;
29911  case 'c':
29912  pPars->fUseCSat ^= 1;
29913  break;
29914  case 'v':
29915  pPars->fVerbose ^= 1;
29916  break;
29917  default:
29918  goto usage;
29919  }
29920  }
29921  if ( pAbc->pGia == NULL )
29922  {
29923  Abc_Print( -1, "Abc_CommandAbc9Choice(): There is no AIG.\n" );
29924  return 1;
29925  }
29926  pTemp = Cec_ManChoiceComputation( pAbc->pGia, pPars );
29927  Abc_FrameUpdateGia( pAbc, pTemp );
29928  return 0;
29929 
29930 usage:
29931  Abc_Print( -2, "usage: &choice [-C num] [-cvh]\n" );
29932  Abc_Print( -2, "\t performs computation of structural choices\n" );
29933  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
29934  Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
29935  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
29936  Abc_Print( -2, "\t-h : print the command usage\n");
29937  return 1;
29938 }
int fUseCSat
Definition: cec.h:166
void Cec_ManChcSetDefaultParams(Cec_ParChc_t *p)
Definition: cecCore.c:211
Gia_Man_t * Cec_ManChoiceComputation(Gia_Man_t *pAig, Cec_ParChc_t *pPars)
Definition: cecChoice.c:348
int nBTLimit
Definition: cec.h:164
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int fVerbose
Definition: cec.h:168
int Abc_CommandAbc9Cof ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26871 of file abc.c.

26872 {
26873  Gia_Man_t * pTemp;
26874  int c, fVerbose = 0;
26875  int iVar = 0, nLimFan = 0;
26877  while ( ( c = Extra_UtilGetopt( argc, argv, "VLvh" ) ) != EOF )
26878  {
26879  switch ( c )
26880  {
26881  case 'V':
26882  if ( globalUtilOptind >= argc )
26883  {
26884  Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
26885  goto usage;
26886  }
26887  iVar = atoi(argv[globalUtilOptind]);
26888  globalUtilOptind++;
26889  if ( iVar < 0 )
26890  goto usage;
26891  break;
26892  case 'L':
26893  if ( globalUtilOptind >= argc )
26894  {
26895  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
26896  goto usage;
26897  }
26898  nLimFan = atoi(argv[globalUtilOptind]);
26899  globalUtilOptind++;
26900  if ( nLimFan < 0 )
26901  goto usage;
26902  break;
26903  case 'v':
26904  fVerbose ^= 1;
26905  break;
26906  case 'h':
26907  goto usage;
26908  default:
26909  goto usage;
26910  }
26911  }
26912  if ( pAbc->pGia == NULL )
26913  {
26914  Abc_Print( -1, "Abc_CommandAbc9Cof(): There is no AIG.\n" );
26915  return 1;
26916  }
26917  if ( nLimFan )
26918  {
26919  Abc_Print( -1, "Cofactoring all variables whose fanout count is higher than %d.\n", nLimFan );
26920  pTemp = Gia_ManDupCofAll( pAbc->pGia, nLimFan, fVerbose );
26921  Abc_FrameUpdateGia( pAbc, pTemp );
26922  }
26923  else if ( iVar )
26924  {
26925  Abc_Print( -1, "Cofactoring one variable with object ID %d.\n", iVar );
26926  pTemp = Gia_ManDupCof( pAbc->pGia, iVar );
26927  Abc_FrameUpdateGia( pAbc, pTemp );
26928  }
26929  else
26930  {
26931  Abc_Print( -1, "One of the parameters, -V <num> or -L <num>, should be set on the command line.\n" );
26932  goto usage;
26933  }
26934  return 0;
26935 
26936 usage:
26937  Abc_Print( -2, "usage: &cof [-VL num] [-vh]\n" );
26938  Abc_Print( -2, "\t performs cofactoring w.r.t. variable(s)\n" );
26939  Abc_Print( -2, "\t-V num : the zero-based ID of one variable to cofactor [default = %d]\n", iVar );
26940  Abc_Print( -2, "\t-L num : cofactor vars with fanout count higher than this [default = %d]\n", nLimFan );
26941  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
26942  Abc_Print( -2, "\t-h : print the command usage\n");
26943  return 1;
26944 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManDupCof(Gia_Man_t *p, int iVar)
Definition: giaCof.c:862
int globalUtilOptind
Definition: extraUtilUtil.c:45
Gia_Man_t * Gia_ManDupCofAll(Gia_Man_t *p, int nFanLim, int fVerbose)
Definition: giaCof.c:987
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Cone ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34961 of file abc.c.

34962 {
34963  Gia_Man_t * pTemp;
34964  Vec_Int_t * vPos;
34965  int c, iOutNum = -1, nOutRange = 1, iPartNum = -1, nLevelMax = 0, nTimeWindow = 0, fUseAllCis = 0, fVerbose = 0;
34967  while ( ( c = Extra_UtilGetopt( argc, argv, "ORPLWavh" ) ) != EOF )
34968  {
34969  switch ( c )
34970  {
34971  case 'O':
34972  if ( globalUtilOptind >= argc )
34973  {
34974  Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
34975  goto usage;
34976  }
34977  iOutNum = atoi(argv[globalUtilOptind]);
34978  globalUtilOptind++;
34979  if ( iOutNum < 0 )
34980  goto usage;
34981  break;
34982  case 'R':
34983  if ( globalUtilOptind >= argc )
34984  {
34985  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
34986  goto usage;
34987  }
34988  nOutRange = atoi(argv[globalUtilOptind]);
34989  globalUtilOptind++;
34990  if ( nOutRange < 0 )
34991  goto usage;
34992  break;
34993  case 'P':
34994  if ( globalUtilOptind >= argc )
34995  {
34996  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
34997  goto usage;
34998  }
34999  iPartNum = atoi(argv[globalUtilOptind]);
35000  globalUtilOptind++;
35001  if ( iPartNum < 0 )
35002  goto usage;
35003  break;
35004  case 'L':
35005  if ( globalUtilOptind >= argc )
35006  {
35007  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
35008  goto usage;
35009  }
35010  nLevelMax = atoi(argv[globalUtilOptind]);
35011  globalUtilOptind++;
35012  if ( nLevelMax < 0 )
35013  goto usage;
35014  break;
35015  case 'W':
35016  if ( globalUtilOptind >= argc )
35017  {
35018  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
35019  goto usage;
35020  }
35021  nTimeWindow = atoi(argv[globalUtilOptind]);
35022  globalUtilOptind++;
35023  if ( nTimeWindow < 0 )
35024  goto usage;
35025  break;
35026  case 'a':
35027  fUseAllCis ^= 1;
35028  break;
35029  case 'v':
35030  fVerbose ^= 1;
35031  break;
35032  case 'h':
35033  goto usage;
35034  default:
35035  goto usage;
35036  }
35037  }
35038  if ( pAbc->pGia == NULL )
35039  {
35040  Abc_Print( -1, "Abc_CommandAbc9Cone(): There is no AIG.\n" );
35041  return 1;
35042  }
35043  if ( nLevelMax || nTimeWindow )
35044  {
35045  if ( nLevelMax && nTimeWindow )
35046  {
35047  Abc_Print( -1, "Abc_CommandAbc9Cone(): Parameters -L (max level) and -W (timing window) cannot be specified at the same time.\n" );
35048  return 1;
35049  }
35050  else
35051  {
35052  pTemp = Gia_ManExtractWindow( pAbc->pGia, nLevelMax, nTimeWindow, fVerbose );
35053  Abc_FrameUpdateGia( pAbc, pTemp );
35054  return 0;
35055  }
35056  }
35057  if ( iPartNum >= 0 )
35058  {
35059  Vec_Int_t * vClass;
35060  Vec_Vec_t * vClasses = (Vec_Vec_t *)pAbc->vPoEquivs;
35061  if ( vClasses == NULL )
35062  {
35063  Abc_Print( -1, "Abc_CommandAbc9Cone(): Partitions are not defined.\n" );
35064  return 1;
35065  }
35066  if ( iPartNum >= Vec_VecSize(vClasses) )
35067  {
35068  Abc_Print( -1, "Abc_CommandAbc9Cone(): Partition index exceed the array size.\n" );
35069  return 1;
35070  }
35071  vClass = Vec_VecEntryInt( vClasses, iPartNum );
35072  pTemp = Gia_ManDupCones( pAbc->pGia, Vec_IntArray(vClass), Vec_IntSize(vClass), !fUseAllCis );
35073  if ( pTemp )
35074  Abc_FrameUpdateGia( pAbc, pTemp );
35075  return 0;
35076  }
35077  if ( iOutNum < 0 || iOutNum + nOutRange >= Gia_ManPoNum(pAbc->pGia) )
35078  {
35079  Abc_Print( -1, "Abc_CommandAbc9Cone(): Range of outputs to extract is incorrect.\n" );
35080  return 1;
35081  }
35082  vPos = Vec_IntStartRange( iOutNum, nOutRange );
35083  pTemp = Gia_ManDupCones( pAbc->pGia, Vec_IntArray(vPos), nOutRange, !fUseAllCis );
35084  Vec_IntFree( vPos );
35085  if ( pTemp )
35086  Abc_FrameUpdateGia( pAbc, pTemp );
35087  return 0;
35088 
35089 usage:
35090  Abc_Print( -2, "usage: &cone [-ORPLW num] [-avh]\n" );
35091  Abc_Print( -2, "\t extracting multi-output sequential logic cones\n" );
35092  Abc_Print( -2, "\t-O num : the index of first PO to extract [default = %d]\n", iOutNum );
35093  Abc_Print( -2, "\t-R num : (optional) the number of outputs to extract [default = %d]\n", nOutRange );
35094  Abc_Print( -2, "\t-P num : (optional) the partition number to extract [default = %d]\n", iPartNum );
35095  Abc_Print( -2, "\t-L num : (optional) extract cones with higher level [default = %d]\n", nLevelMax );
35096  Abc_Print( -2, "\t-W num : (optional) extract cones falling into this window [default = %d]\n", nTimeWindow );
35097  Abc_Print( -2, "\t-a : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
35098  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
35099  Abc_Print( -2, "\t-h : print the command usage\n");
35100  return 1;
35101 }
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
Gia_Man_t * Gia_ManDupCones(Gia_Man_t *p, int *pPos, int nPos, int fTrimPis)
Definition: giaDup.c:2691
Gia_Man_t * Gia_ManExtractWindow(Gia_Man_t *p, int LevelMax, int nTimeWindow, int fVerbose)
Definition: giaBalMap.c:236
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static Vec_Int_t * Vec_IntStartRange(int First, int Range)
Definition: vecInt.h:127
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
if(last==0)
Definition: sparse_int.h:34
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static Vec_Int_t * Vec_VecEntryInt(Vec_Vec_t *p, int i)
Definition: vecVec.h:276
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Vec_VecSize(Vec_Vec_t *p)
Definition: vecVec.h:222
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
int Abc_CommandAbc9Cycle ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34897 of file abc.c.

34898 {
34899  Gia_Man_t * pTemp;
34900  int c, nFrames = 10, fUseCex = 0, fVerbose = 0;
34902  while ( ( c = Extra_UtilGetopt( argc, argv, "Fcvh" ) ) != EOF )
34903  {
34904  switch ( c )
34905  {
34906  case 'F':
34907  if ( globalUtilOptind >= argc )
34908  {
34909  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
34910  goto usage;
34911  }
34912  nFrames = atoi(argv[globalUtilOptind]);
34913  globalUtilOptind++;
34914  if ( nFrames < 0 )
34915  goto usage;
34916  break;
34917  case 'c':
34918  fUseCex ^= 1;
34919  break;
34920  case 'v':
34921  fVerbose ^= 1;
34922  break;
34923  case 'h':
34924  goto usage;
34925  default:
34926  goto usage;
34927  }
34928  }
34929  if ( pAbc->pGia == NULL )
34930  {
34931  Abc_Print( -1, "Abc_CommandAbc9Cycle(): There is no AIG.\n" );
34932  return 1;
34933  }
34934  pTemp = Gia_ManDupCycled( pAbc->pGia, fUseCex ? pAbc->pCex : NULL, nFrames );
34935  Abc_FrameUpdateGia( pAbc, pTemp );
34936  return 0;
34937 
34938 usage:
34939  Abc_Print( -2, "usage: &cycle [-F num] [-cvh]\n" );
34940  Abc_Print( -2, "\t cycles sequential circuit for the given number of timeframes\n" );
34941  Abc_Print( -2, "\t to derive a new initial state (which may be on the envelope)\n" );
34942  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
34943  Abc_Print( -2, "\t-c : toggle using PI values from the current CEX [default = %s]\n", fUseCex? "yes": "no" );
34944  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
34945  Abc_Print( -2, "\t-h : print the command usage\n");
34946  return 1;
34947 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Gia_Man_t * Gia_ManDupCycled(Gia_Man_t *pAig, Abc_Cex_t *pCex, int nFrames)
Definition: giaDup.c:523
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Dc2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28408 of file abc.c.

28409 {
28410  Gia_Man_t * pTemp;
28411  int c, fVerbose = 0;
28412  int fUpdateLevel = 1;
28414  while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
28415  {
28416  switch ( c )
28417  {
28418  case 'l':
28419  fUpdateLevel ^= 1;
28420  break;
28421  case 'v':
28422  fVerbose ^= 1;
28423  break;
28424  case 'h':
28425  goto usage;
28426  default:
28427  goto usage;
28428  }
28429  }
28430  if ( pAbc->pGia == NULL )
28431  {
28432  Abc_Print( -1, "Abc_CommandAbc9Dc2(): There is no AIG.\n" );
28433  return 1;
28434  }
28435  pTemp = Gia_ManCompress2( pAbc->pGia, fUpdateLevel, fVerbose );
28436  Abc_FrameUpdateGia( pAbc, pTemp );
28437  return 0;
28438 
28439 usage:
28440  Abc_Print( -2, "usage: &dc2 [-lvh]\n" );
28441  Abc_Print( -2, "\t performs heavy rewriting of the AIG\n" );
28442  Abc_Print( -2, "\t-l : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
28443  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28444  Abc_Print( -2, "\t-h : print the command usage\n");
28445  return 1;
28446 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManCompress2(Gia_Man_t *p, int fUpdateLevel, int fVerbose)
Definition: giaAig.c:551
int Abc_CommandAbc9Dch ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33757 of file abc.c.

33758 {
33759  Gia_Man_t * pTemp;
33760  Dch_Pars_t Pars, * pPars = &Pars;
33761  int c;
33762  // set defaults
33763  Dch_ManSetDefaultParams( pPars );
33765  while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptfvh" ) ) != EOF )
33766  {
33767  switch ( c )
33768  {
33769  case 'W':
33770  if ( globalUtilOptind >= argc )
33771  {
33772  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
33773  goto usage;
33774  }
33775  pPars->nWords = atoi(argv[globalUtilOptind]);
33776  globalUtilOptind++;
33777  if ( pPars->nWords < 0 )
33778  goto usage;
33779  break;
33780  case 'C':
33781  if ( globalUtilOptind >= argc )
33782  {
33783  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
33784  goto usage;
33785  }
33786  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
33787  globalUtilOptind++;
33788  if ( pPars->nBTLimit < 0 )
33789  goto usage;
33790  break;
33791  case 'S':
33792  if ( globalUtilOptind >= argc )
33793  {
33794  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
33795  goto usage;
33796  }
33797  pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
33798  globalUtilOptind++;
33799  if ( pPars->nSatVarMax < 0 )
33800  goto usage;
33801  break;
33802  case 's':
33803  pPars->fSynthesis ^= 1;
33804  break;
33805  case 'p':
33806  pPars->fPower ^= 1;
33807  break;
33808  case 't':
33809  pPars->fSimulateTfo ^= 1;
33810  break;
33811  case 'f':
33812  pPars->fLightSynth ^= 1;
33813  break;
33814  case 'v':
33815  pPars->fVerbose ^= 1;
33816  break;
33817  case 'h':
33818  goto usage;
33819  default:
33820  goto usage;
33821  }
33822  }
33823  if ( pAbc->pGia == NULL )
33824  {
33825  Abc_Print( -1, "Abc_CommandAbc9Dch(): There is no AIG.\n" );
33826  return 1;
33827  }
33828  if ( Gia_ManBufNum(pAbc->pGia) )
33829  {
33830  Abc_Print( -1, "Abc_CommandAbc9Dch(): This command does not work with barrier buffers.\n" );
33831  return 1;
33832  }
33833  pTemp = Gia_ManPerformDch( pAbc->pGia, pPars );
33834  Abc_FrameUpdateGia( pAbc, pTemp );
33835  return 0;
33836 
33837 usage:
33838  Abc_Print( -2, "usage: &dch [-WCS num] [-sptfvh]\n" );
33839  Abc_Print( -2, "\t computes structural choices using a new approach\n" );
33840  Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
33841  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
33842  Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
33843  Abc_Print( -2, "\t-s : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
33844  Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
33845  Abc_Print( -2, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
33846  Abc_Print( -2, "\t-f : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
33847  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
33848  Abc_Print( -2, "\t-h : print the command usage\n");
33849  return 1;
33850 }
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition: dchCore.c:45
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition: dch.h:43
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManPerformDch(Gia_Man_t *p, void *pPars)
Definition: giaAig.c:577
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
static int Gia_ManBufNum(Gia_Man_t *p)
Definition: gia.h:392
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Demiter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36833 of file abc.c.

36834 {
36835  extern Gia_Man_t * Gia_ManDupDemiter( Gia_Man_t * p, int fVerbose );
36836  Gia_Man_t * pTemp;
36837  int c, fVerbose = 0;
36839  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
36840  {
36841  switch ( c )
36842  {
36843  case 'v':
36844  fVerbose ^= 1;
36845  break;
36846  case 'h':
36847  goto usage;
36848  default:
36849  goto usage;
36850  }
36851  }
36852  if ( pAbc->pGia == NULL )
36853  {
36854  Abc_Print( -1, "Abc_CommandAbc9Demiter(): There is no AIG.\n" );
36855  return 0;
36856  }
36857  if ( Gia_ManPoNum(pAbc->pGia) != 1 )
36858  {
36859  Abc_Print( -1, "Abc_CommandAbc9Demiter(): Miter should have one output.\n" );
36860  return 0;
36861  }
36862  pTemp = Gia_ManDupDemiter( pAbc->pGia, fVerbose );
36863  Abc_FrameUpdateGia( pAbc, pTemp );
36864  if ( fVerbose )
36865  Gia_ManPrintStatsMiter( pTemp, 0 );
36866  return 0;
36867 
36868 usage:
36869  Abc_Print( -2, "usage: &demiter [-vh]\n" );
36870  Abc_Print( -2, "\t decomposes a single-output miter\n" );
36871  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
36872  Abc_Print( -2, "\t-h : print the command usage\n");
36873  return 1;
36874 }
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Gia_Man_t * Gia_ManDupDemiter(Gia_Man_t *p, int fVerbose)
Definition: giaDup.c:3038
void Gia_ManPrintStatsMiter(Gia_Man_t *p, int fVerbose)
Definition: giaMan.c:594
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Dfs ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27038 of file abc.c.

27039 {
27040  Gia_Man_t * pTemp;
27041  int c;
27042  int fNormal = 0;
27043  int fReverse = 0;
27044  int fVerbose = 0;
27046  while ( ( c = Extra_UtilGetopt( argc, argv, "nrvh" ) ) != EOF )
27047  {
27048  switch ( c )
27049  {
27050  case 'n':
27051  fNormal ^= 1;
27052  break;
27053  case 'r':
27054  fReverse ^= 1;
27055  break;
27056  case 'v':
27057  fVerbose ^= 1;
27058  break;
27059  case 'h':
27060  goto usage;
27061  default:
27062  goto usage;
27063  }
27064  }
27065  if ( pAbc->pGia == NULL )
27066  {
27067  Abc_Print( -1, "Abc_CommandAbc9Dfs(): There is no AIG.\n" );
27068  return 1;
27069  }
27070  if ( fNormal )
27071  {
27072  pTemp = Gia_ManDupOrderAiger( pAbc->pGia );
27073  if ( fVerbose )
27074  Abc_Print( -1, "AIG objects are reordered as follows: CIs, ANDs, COs.\n" );
27075  }
27076  else if ( fReverse )
27077  {
27078  pTemp = Gia_ManDupOrderDfsReverse( pAbc->pGia );
27079  if ( fVerbose )
27080  Abc_Print( -1, "AIG objects are reordered in the reserve DFS order.\n" );
27081  }
27082  else
27083  {
27084  pTemp = Gia_ManDupOrderDfs( pAbc->pGia );
27085  if ( fVerbose )
27086  Abc_Print( -1, "AIG objects are reordered in the DFS order.\n" );
27087  }
27088  Abc_FrameUpdateGia( pAbc, pTemp );
27089  return 0;
27090 
27091 usage:
27092  Abc_Print( -2, "usage: &dfs [-nrvh]\n" );
27093  Abc_Print( -2, "\t orders objects in the DFS order\n" );
27094  Abc_Print( -2, "\t-n : toggle using normalized ordering [default = %s]\n", fNormal? "yes": "no" );
27095  Abc_Print( -2, "\t-r : toggle using reverse DFS ordering [default = %s]\n", fReverse? "yes": "no" );
27096  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
27097  Abc_Print( -2, "\t-h : print the command usage\n");
27098  return 1;
27099 }
Gia_Man_t * Gia_ManDupOrderAiger(Gia_Man_t *p)
Definition: giaDup.c:397
Gia_Man_t * Gia_ManDupOrderDfs(Gia_Man_t *p)
Definition: giaDup.c:170
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManDupOrderDfsReverse(Gia_Man_t *p)
Definition: giaDup.c:363
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Dsd ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28459 of file abc.c.

28460 {
28461  extern Gia_Man_t * Gia_ManCollapseTest( Gia_Man_t * p, int fVerbose );
28462  Gia_Man_t * pTemp;
28463  int c, fVerbose = 0;
28464  int fUpdateLevel = 1;
28466  while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
28467  {
28468  switch ( c )
28469  {
28470  case 'l':
28471  fUpdateLevel ^= 1;
28472  break;
28473  case 'v':
28474  fVerbose ^= 1;
28475  break;
28476  case 'h':
28477  goto usage;
28478  default:
28479  goto usage;
28480  }
28481  }
28482  if ( pAbc->pGia == NULL )
28483  {
28484  Abc_Print( -1, "Abc_CommandAbc9Dsd(): There is no AIG.\n" );
28485  return 1;
28486  }
28487  pTemp = Gia_ManCollapseTest( pAbc->pGia, fVerbose );
28488  Abc_FrameUpdateGia( pAbc, pTemp );
28489  return 0;
28490 
28491 usage:
28492  Abc_Print( -2, "usage: &dsd [-vh]\n" );
28493  Abc_Print( -2, "\t performs DSD-based collapsing\n" );
28494 // Abc_Print( -2, "\t-l : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
28495  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28496  Abc_Print( -2, "\t-h : print the command usage\n");
28497  return 1;
28498 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Gia_Man_t * Gia_ManCollapseTest(Gia_Man_t *p, int fVerbose)
Definition: giaClp.c:346
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Dsdb ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31402 of file abc.c.

31403 {
31404  Gia_Man_t * pTemp;
31405  int nLevelMax = 0;
31406  int nTimeWindow = 0;
31407  int nLutSize = 6;
31408  int nCutNum = 8;
31409  int nRelaxRatio = 0;
31410  int c, fVerbose = 0;
31412  while ( ( c = Extra_UtilGetopt( argc, argv, "LWKCRvh" ) ) != EOF )
31413  {
31414  switch ( c )
31415  {
31416  case 'L':
31417  if ( globalUtilOptind >= argc )
31418  {
31419  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
31420  goto usage;
31421  }
31422  nLevelMax = atoi(argv[globalUtilOptind]);
31423  globalUtilOptind++;
31424  if ( nLevelMax < 0 )
31425  goto usage;
31426  break;
31427  case 'W':
31428  if ( globalUtilOptind >= argc )
31429  {
31430  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
31431  goto usage;
31432  }
31433  nTimeWindow = atoi(argv[globalUtilOptind]);
31434  globalUtilOptind++;
31435  if ( nTimeWindow < 0 )
31436  goto usage;
31437  break;
31438  case 'K':
31439  if ( globalUtilOptind >= argc )
31440  {
31441  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
31442  goto usage;
31443  }
31444  nLutSize = atoi(argv[globalUtilOptind]);
31445  globalUtilOptind++;
31446  if ( nLutSize < 0 )
31447  goto usage;
31448  break;
31449  case 'C':
31450  if ( globalUtilOptind >= argc )
31451  {
31452  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
31453  goto usage;
31454  }
31455  nCutNum = atoi(argv[globalUtilOptind]);
31456  globalUtilOptind++;
31457  if ( nCutNum < 0 )
31458  goto usage;
31459  break;
31460  case 'R':
31461  if ( globalUtilOptind >= argc )
31462  {
31463  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
31464  goto usage;
31465  }
31466  nRelaxRatio = atoi(argv[globalUtilOptind]);
31467  globalUtilOptind++;
31468  if ( nRelaxRatio < 0 )
31469  goto usage;
31470  break;
31471  case 'v':
31472  fVerbose ^= 1;
31473  break;
31474  case 'h':
31475  goto usage;
31476  default:
31477  goto usage;
31478  }
31479  }
31480  if ( pAbc->pGia == NULL )
31481  {
31482  Abc_Print( -1, "Abc_CommandAbc9Dsdb(): There is no AIG.\n" );
31483  return 1;
31484  }
31485  if ( nLutSize > DAU_MAX_VAR )
31486  {
31487  printf( "Abc_CommandAbc9Dsdb(): Size of the required DSD manager (%d) exceeds the precompiled limit (%d) (change parameter DAU_MAX_VAR).\n", nLutSize, DAU_MAX_VAR );
31488  return 0;
31489  }
31491  {
31492  printf( "Abc_CommandAbc9Dsdb(): Incompatible size of the DSD manager (run \"dsd_free -b\").\n" );
31493  return 0;
31494  }
31495  if ( nLevelMax || nTimeWindow )
31496  pTemp = Gia_ManPerformDsdBalanceWin( pAbc->pGia, nLevelMax, nTimeWindow, nLutSize, nCutNum, nRelaxRatio, fVerbose );
31497  else
31498  pTemp = Gia_ManPerformDsdBalance( pAbc->pGia, nLutSize, nCutNum, nRelaxRatio, fVerbose );
31499  Abc_FrameUpdateGia( pAbc, pTemp );
31500  return 0;
31501 
31502 usage:
31503  Abc_Print( -2, "usage: &dsdb [-LWKCR num] [-vh]\n" );
31504  Abc_Print( -2, "\t performs DSD balancing\n" );
31505  Abc_Print( -2, "\t-L num : optimize paths above this level [default = %d]\n", nLevelMax );
31506  Abc_Print( -2, "\t-W num : optimize paths falling into this window [default = %d]\n", nTimeWindow );
31507  Abc_Print( -2, "\t-K num : the number of LUT inputs (LUT size) [default = %d]\n", nLutSize );
31508  Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
31509  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
31510  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
31511  Abc_Print( -2, "\t-h : print the command usage\n");
31512  return 1;
31513 }
Gia_Man_t * Gia_ManPerformDsdBalanceWin(Gia_Man_t *p, int LevelMax, int nTimeWindow, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose)
Definition: giaBalMap.c:298
Gia_Man_t * Gia_ManPerformDsdBalance(Gia_Man_t *p, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose)
Definition: giaIf.c:2058
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
#define DAU_MAX_VAR
INCLUDES ///.
Definition: dau.h:42
int globalUtilOptind
Definition: extraUtilUtil.c:45
int If_DsdManVarNum(If_DsdMan_t *p)
Definition: ifDsd.c:165
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL void * Abc_FrameReadManDsd2()
Definition: mainFrame.c:63
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Embed ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31201 of file abc.c.

31202 {
31203  Emb_Par_t Pars, * pPars = &Pars;
31204  int c;
31205  pPars->nDims = 30;
31206  pPars->nIters = 10;
31207  pPars->nSols = 2;
31208  pPars->fRefine = 0;
31209  pPars->fCluster = 0;
31210  pPars->fDump = 0;
31211  pPars->fDumpLarge = 0;
31212  pPars->fShowImage = 0;
31213  pPars->fVerbose = 0;
31215  while ( ( c = Extra_UtilGetopt( argc, argv, "DIrcdlsvh" ) ) != EOF )
31216  {
31217  switch ( c )
31218  {
31219  case 'D':
31220  if ( globalUtilOptind >= argc )
31221  {
31222  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
31223  goto usage;
31224  }
31225  pPars->nDims = atoi(argv[globalUtilOptind]);
31226  globalUtilOptind++;
31227  if ( pPars->nDims < 0 )
31228  goto usage;
31229  break;
31230  case 'I':
31231  if ( globalUtilOptind >= argc )
31232  {
31233  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
31234  goto usage;
31235  }
31236  pPars->nIters = atoi(argv[globalUtilOptind]);
31237  globalUtilOptind++;
31238  if ( pPars->nIters < 0 )
31239  goto usage;
31240  break;
31241  case 'r':
31242  pPars->fRefine ^= 1;
31243  break;
31244  case 'c':
31245  pPars->fCluster ^= 1;
31246  break;
31247  case 'd':
31248  pPars->fDump ^= 1;
31249  break;
31250  case 'l':
31251  pPars->fDumpLarge ^= 1;
31252  break;
31253  case 's':
31254  pPars->fShowImage ^= 1;
31255  break;
31256  case 'v':
31257  pPars->fVerbose ^= 1;
31258  break;
31259  case 'h':
31260  goto usage;
31261  default:
31262  goto usage;
31263  }
31264  }
31265  if ( pAbc->pGia == NULL )
31266  {
31267  Abc_Print( -1, "Abc_CommandAbc9Embed(): There is no AIG.\n" );
31268  return 1;
31269  }
31270  Gia_ManSolveProblem( pAbc->pGia, pPars );
31271  return 0;
31272 
31273 usage:
31274  Abc_Print( -2, "usage: &embed [-DI <num>] [-rdlscvh]\n" );
31275  Abc_Print( -2, "\t fast placement based on high-dimensional embedding from\n" );
31276  Abc_Print( -2, "\t D. Harel and Y. Koren, \"Graph drawing by high-dimensional\n" );
31277  Abc_Print( -2, "\t embedding\", J. Graph Algs & Apps, 2004, Vol 8(2), pp. 195-217\n" );
31278  Abc_Print( -2, "\t-D num : the number of dimensions for embedding [default = %d]\n", pPars->nDims );
31279  Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", pPars->nIters );
31280  Abc_Print( -2, "\t-r : toggle the use of refinement [default = %s]\n", pPars->fRefine? "yes":"no");
31281  Abc_Print( -2, "\t-c : toggle clustered representation [default = %s]\n", pPars->fCluster? "yes":"no");
31282  Abc_Print( -2, "\t-d : toggle dumping placement into a Gnuplot file [default = %s]\n", pPars->fDump? "yes":"no");
31283  Abc_Print( -2, "\t-l : toggle dumping Gnuplot for large placement [default = %s]\n", pPars->fDumpLarge? "yes":"no");
31284  Abc_Print( -2, "\t-s : toggle showing image if Gnuplot is installed [default = %s]\n", pPars->fShowImage? "yes":"no");
31285  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
31286  Abc_Print( -2, "\t-h : print the command usage\n");
31287  return 1;
31288 }
int nDims
Definition: gia.h:211
void Gia_ManSolveProblem(Gia_Man_t *pGia, Emb_Par_t *pPars)
Definition: giaEmbed.c:1791
int nIters
Definition: gia.h:213
int fVerbose
Definition: gia.h:219
int fDumpLarge
Definition: gia.h:217
int nSols
Definition: gia.h:212
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fShowImage
Definition: gia.h:218
int globalUtilOptind
Definition: extraUtilUtil.c:45
int fRefine
Definition: gia.h:214
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fCluster
Definition: gia.h:215
int fDump
Definition: gia.h:216
int Abc_CommandAbc9Enable ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28353 of file abc.c.

28354 {
28355  Gia_Man_t * pTemp;
28356  int c;
28357  int fRemove = 0;
28358  int fVerbose = 0;
28360  while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
28361  {
28362  switch ( c )
28363  {
28364  case 'r':
28365  fRemove ^= 1;
28366  break;
28367  case 'v':
28368  fVerbose ^= 1;
28369  break;
28370  case 'h':
28371  goto usage;
28372  default:
28373  goto usage;
28374  }
28375  }
28376  if ( pAbc->pGia == NULL )
28377  {
28378  Abc_Print( -1, "Abc_CommandAbc9Enable(): There is no AIG.\n" );
28379  return 1;
28380  }
28381  if ( fRemove )
28382  pTemp = Gia_ManRemoveEnables( pAbc->pGia );
28383  else
28384  pTemp = Gia_ManDupSelf( pAbc->pGia );
28385  Abc_FrameUpdateGia( pAbc, pTemp );
28386  return 0;
28387 
28388 usage:
28389  Abc_Print( -2, "usage: &enable [-rvh]\n" );
28390  Abc_Print( -2, "\t adds or removes flop enable signals\n" );
28391  Abc_Print( -2, "\t-r : toggle adding vs. removing enables [default = %s]\n", fRemove? "remove": "add" );
28392  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28393  Abc_Print( -2, "\t-h : print the command usage\n");
28394  return 1;
28395 }
Gia_Man_t * Gia_ManRemoveEnables(Gia_Man_t *p)
Definition: giaEnable.c:514
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManDupSelf(Gia_Man_t *p)
Definition: giaDup.c:890
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Equiv ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27551 of file abc.c.

27552 {
27553  Cec_ParSim_t Pars, * pPars = &Pars;
27554  int c;
27555  Cec_ManSimSetDefaultParams( pPars );
27557  while ( ( c = Extra_UtilGetopt( argc, argv, "WFRSTsmdvh" ) ) != EOF )
27558  {
27559  switch ( c )
27560  {
27561  case 'W':
27562  if ( globalUtilOptind >= argc )
27563  {
27564  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
27565  goto usage;
27566  }
27567  pPars->nWords = atoi(argv[globalUtilOptind]);
27568  globalUtilOptind++;
27569  if ( pPars->nWords < 0 )
27570  goto usage;
27571  break;
27572  case 'F':
27573  if ( globalUtilOptind >= argc )
27574  {
27575  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
27576  goto usage;
27577  }
27578  pPars->nFrames = atoi(argv[globalUtilOptind]);
27579  globalUtilOptind++;
27580  if ( pPars->nFrames < 0 )
27581  goto usage;
27582  break;
27583  case 'R':
27584  if ( globalUtilOptind >= argc )
27585  {
27586  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
27587  goto usage;
27588  }
27589  pPars->nRounds = atoi(argv[globalUtilOptind]);
27590  globalUtilOptind++;
27591  if ( pPars->nRounds < 0 )
27592  goto usage;
27593  break;
27594  case 'S':
27595  if ( globalUtilOptind >= argc )
27596  {
27597  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
27598  goto usage;
27599  }
27600  pPars->nNonRefines = atoi(argv[globalUtilOptind]);
27601  globalUtilOptind++;
27602  if ( pPars->nNonRefines < 0 )
27603  goto usage;
27604  break;
27605  case 'T':
27606  if ( globalUtilOptind >= argc )
27607  {
27608  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
27609  goto usage;
27610  }
27611  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
27612  globalUtilOptind++;
27613  if ( pPars->TimeLimit < 0 )
27614  goto usage;
27615  break;
27616  case 's':
27617  pPars->fSeqSimulate ^= 1;
27618  break;
27619  case 'm':
27620  pPars->fCheckMiter ^= 1;
27621  break;
27622  case 'd':
27623  pPars->fDualOut ^= 1;
27624  break;
27625  case 'v':
27626  pPars->fVerbose ^= 1;
27627  break;
27628  case 'h':
27629  goto usage;
27630  default:
27631  goto usage;
27632  }
27633  }
27634  if ( pAbc->pGia == NULL )
27635  {
27636  Abc_Print( -1, "Abc_CommandAbc9Equiv(): There is no AIG.\n" );
27637  return 1;
27638  }
27639  Cec_ManSimulation( pAbc->pGia, pPars );
27640  return 0;
27641 
27642 usage:
27643  Abc_Print( -2, "usage: &equiv [-WFRST num] [-smdvh]\n" );
27644  Abc_Print( -2, "\t computes candidate equivalence classes\n" );
27645  Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
27646  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nFrames );
27647  Abc_Print( -2, "\t-R num : the max number of simulation rounds [default = %d]\n", pPars->nRounds );
27648  Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
27649  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
27650  Abc_Print( -2, "\t-s : toggle seq vs. comb simulation [default = %s]\n", pPars->fSeqSimulate? "yes": "no" );
27651  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
27652  Abc_Print( -2, "\t-d : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
27653  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
27654  Abc_Print( -2, "\t-h : print the command usage\n");
27655  return 1;
27656 }
int fVerbose
Definition: cec.h:73
int TimeLimit
Definition: cec.h:65
int fSeqSimulate
Definition: cec.h:69
int fCheckMiter
Definition: cec.h:67
void Cec_ManSimSetDefaultParams(Cec_ParSim_t *p)
Definition: cecCore.c:70
void Cec_ManSimulation(Gia_Man_t *pAig, Cec_ParSim_t *pPars)
Definition: cecCore.c:284
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nFrames
Definition: cec.h:62
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int nNonRefines
Definition: cec.h:64
int fDualOut
Definition: cec.h:66
int nRounds
Definition: cec.h:63
int nWords
Definition: cec.h:61
int Abc_CommandAbc9Equiv2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27669 of file abc.c.

27670 {
27671  extern void Ssw_SignalFilterGia( Gia_Man_t * p, int nFramesMax, int nConfMax, int nRounds, int TimeLimit, int TimeLimit2, Abc_Cex_t * pCex, int fLatchOnly, int fVerbose );
27672  int nFramesMax = 20;
27673  int nConfMax = 500;
27674  int nRounds = 10;
27675  int TimeLimit = 0;
27676  int TimeLimit2 = 0;
27677  int fUseCex = 0;
27678  int fLatchOnly = 0;
27679  int fVerbose = 0;
27680  int c;
27682  while ( ( c = Extra_UtilGetopt( argc, argv, "FCRTSxlvh" ) ) != EOF )
27683  {
27684  switch ( c )
27685  {
27686  case 'F':
27687  if ( globalUtilOptind >= argc )
27688  {
27689  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
27690  goto usage;
27691  }
27692  nFramesMax = atoi(argv[globalUtilOptind]);
27693  globalUtilOptind++;
27694  if ( nFramesMax < 0 )
27695  goto usage;
27696  break;
27697  case 'C':
27698  if ( globalUtilOptind >= argc )
27699  {
27700  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
27701  goto usage;
27702  }
27703  nConfMax = atoi(argv[globalUtilOptind]);
27704  globalUtilOptind++;
27705  if ( nConfMax < 0 )
27706  goto usage;
27707  break;
27708  case 'R':
27709  if ( globalUtilOptind >= argc )
27710  {
27711  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
27712  goto usage;
27713  }
27714  nRounds = atoi(argv[globalUtilOptind]);
27715  globalUtilOptind++;
27716  if ( nRounds < 0 )
27717  goto usage;
27718  break;
27719  case 'T':
27720  if ( globalUtilOptind >= argc )
27721  {
27722  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
27723  goto usage;
27724  }
27725  TimeLimit = atoi(argv[globalUtilOptind]);
27726  globalUtilOptind++;
27727  if ( TimeLimit < 0 )
27728  goto usage;
27729  break;
27730  case 'S':
27731  if ( globalUtilOptind >= argc )
27732  {
27733  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
27734  goto usage;
27735  }
27736  TimeLimit2 = atoi(argv[globalUtilOptind]);
27737  globalUtilOptind++;
27738  if ( TimeLimit2 < 0 )
27739  goto usage;
27740  break;
27741  case 'x':
27742  fUseCex ^= 1;
27743  break;
27744  case 'l':
27745  fLatchOnly ^= 1;
27746  break;
27747  case 'v':
27748  fVerbose ^= 1;
27749  break;
27750  case 'h':
27751  goto usage;
27752  default:
27753  goto usage;
27754  }
27755  }
27756  if ( pAbc->pGia == NULL )
27757  {
27758  Abc_Print( -1, "Abc_CommandAbc9Equiv2(): There is no AIG.\n" );
27759  return 1;
27760  }
27761  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
27762  {
27763  Abc_Print( 0, "Abc_CommandAbc9Equiv2(): There is no flops. Nothing is done.\n" );
27764  return 0;
27765  }
27766  if ( fUseCex )
27767  {
27768  if ( pAbc->pCex == NULL )
27769  {
27770  Abc_Print( 0, "Abc_CommandAbc9Equiv2(): Counter-example is not available.\n" );
27771  return 0;
27772  }
27773  if ( pAbc->pCex->nPis != Gia_ManPiNum(pAbc->pGia) )
27774  {
27775  Abc_Print( -1, "Abc_CommandAbc9Equiv2(): The number of PIs differs in cex (%d) and in AIG (%d).\n",
27776  pAbc->pCex->nPis, Gia_ManPiNum(pAbc->pGia) );
27777  return 1;
27778  }
27779  }
27780  Ssw_SignalFilterGia( pAbc->pGia, nFramesMax, nConfMax, nRounds, TimeLimit, TimeLimit2, fUseCex? pAbc->pCex: NULL, fLatchOnly, fVerbose );
27781  pAbc->Status = -1;
27782 // pAbc->nFrames = pAbc->pCex->iFrame;
27783 // Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
27784  return 0;
27785 
27786 usage:
27787  Abc_Print( -2, "usage: &equiv2 [-FCRTS num] [-xlvh]\n" );
27788  Abc_Print( -2, "\t computes candidate equivalence classes\n" );
27789  Abc_Print( -2, "\t-F num : the max number of frames for BMC [default = %d]\n", nFramesMax );
27790  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
27791  Abc_Print( -2, "\t-R num : the max number of BMC rounds [default = %d]\n", nRounds );
27792  Abc_Print( -2, "\t-T num : runtime limit in seconds for all rounds [default = %d]\n", TimeLimit );
27793  Abc_Print( -2, "\t-S num : runtime limit in seconds for one round [default = %d]\n", TimeLimit2 );
27794  Abc_Print( -2, "\t-x : toggle using the current cex to perform refinement [default = %s]\n", fUseCex? "yes": "no" );
27795  Abc_Print( -2, "\t-l : toggle considering only latch output equivalences [default = %s]\n", fLatchOnly? "yes": "no" );
27796  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
27797  Abc_Print( -2, "\t-h : print the command usage\n");
27798  return 1;
27799 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Ssw_SignalFilterGia(Gia_Man_t *p, int nFramesMax, int nConfMax, int nRounds, int TimeLimit, int TimeLimit2, Abc_Cex_t *pCex, int fLatchOnly, int fVerbose)
Definition: sswFilter.c:473
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Equiv3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27812 of file abc.c.

27813 {
27814  extern int Ssw_RarSignalFilterGia( Gia_Man_t * p, Ssw_RarPars_t * pPars );
27815  Ssw_RarPars_t Pars, * pPars = &Pars;
27816  int c;
27817  Ssw_RarSetDefaultParams( pPars );
27819  while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTmxlvh" ) ) != EOF )
27820  {
27821  switch ( c )
27822  {
27823  case 'F':
27824  if ( globalUtilOptind >= argc )
27825  {
27826  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
27827  goto usage;
27828  }
27829  pPars->nFrames = atoi(argv[globalUtilOptind]);
27830  globalUtilOptind++;
27831  if ( pPars->nFrames < 0 )
27832  goto usage;
27833  break;
27834  case 'W':
27835  if ( globalUtilOptind >= argc )
27836  {
27837  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
27838  goto usage;
27839  }
27840  pPars->nWords = atoi(argv[globalUtilOptind]);
27841  globalUtilOptind++;
27842  if ( pPars->nWords < 0 )
27843  goto usage;
27844  break;
27845  case 'B':
27846  if ( globalUtilOptind >= argc )
27847  {
27848  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
27849  goto usage;
27850  }
27851  pPars->nBinSize = atoi(argv[globalUtilOptind]);
27852  globalUtilOptind++;
27853  if ( pPars->nBinSize < 0 )
27854  goto usage;
27855  break;
27856  case 'R':
27857  if ( globalUtilOptind >= argc )
27858  {
27859  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
27860  goto usage;
27861  }
27862  pPars->nRounds = atoi(argv[globalUtilOptind]);
27863  globalUtilOptind++;
27864  if ( pPars->nRounds < 0 )
27865  goto usage;
27866  break;
27867  case 'S':
27868  if ( globalUtilOptind >= argc )
27869  {
27870  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
27871  goto usage;
27872  }
27873  pPars->nRestart = atoi(argv[globalUtilOptind]);
27874  globalUtilOptind++;
27875  if ( pPars->nRestart < 0 )
27876  goto usage;
27877  break;
27878  case 'N':
27879  if ( globalUtilOptind >= argc )
27880  {
27881  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
27882  goto usage;
27883  }
27884  pPars->nRandSeed = atoi(argv[globalUtilOptind]);
27885  globalUtilOptind++;
27886  if ( pPars->nRandSeed < 0 )
27887  goto usage;
27888  break;
27889  case 'T':
27890  if ( globalUtilOptind >= argc )
27891  {
27892  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
27893  goto usage;
27894  }
27895  pPars->TimeOut = atoi(argv[globalUtilOptind]);
27896  globalUtilOptind++;
27897  if ( pPars->TimeOut < 0 )
27898  goto usage;
27899  break;
27900  case 'm':
27901  pPars->fMiter ^= 1;
27902  break;
27903  case 'x':
27904  pPars->fUseCex ^= 1;
27905  break;
27906  case 'l':
27907  pPars->fLatchOnly ^= 1;
27908  break;
27909  case 'v':
27910  pPars->fVerbose ^= 1;
27911  break;
27912  case 'h':
27913  goto usage;
27914  default:
27915  goto usage;
27916  }
27917  }
27918  if ( pAbc->pGia == NULL )
27919  {
27920  Abc_Print( -1, "Abc_CommandAbc9Equiv3(): There is no AIG.\n" );
27921  return 1;
27922  }
27923  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
27924  {
27925  Abc_Print( 0, "Abc_CommandAbc9Equiv3(): There is no flops. Nothing is done.\n" );
27926  return 0;
27927  }
27928  if ( pPars->fUseCex )
27929  {
27930  if ( pPars->fMiter )
27931  {
27932  Abc_Print( 0, "Abc_CommandAbc9Equiv3(): Considering the miter as a circuit because the CEX is given.\n" );
27933  pPars->fMiter = 0;
27934  }
27935  if ( pAbc->pCex == NULL )
27936  {
27937  Abc_Print( 0, "Abc_CommandAbc9Equiv3(): Counter-example is not available.\n" );
27938  return 0;
27939  }
27940  if ( pAbc->pCex->nPis != Gia_ManPiNum(pAbc->pGia) )
27941  {
27942  Abc_Print( -1, "Abc_CommandAbc9Equiv3(): The number of PIs differs in cex (%d) and in AIG (%d).\n",
27943  pAbc->pCex->nPis, Gia_ManPiNum(pAbc->pGia) );
27944  return 1;
27945  }
27946  pPars->pCex = pAbc->pCex;
27947  }
27948  pAbc->Status = Ssw_RarSignalFilterGia( pAbc->pGia, pPars );
27949 // pAbc->nFrames = pAbc->pGia->pCexSeq->iFrame;
27950  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
27951  return 0;
27952 
27953 usage:
27954  Abc_Print( -2, "usage: &equiv3 [-FWRSNT num] [-mxlvh]\n" );
27955  Abc_Print( -2, "\t computes candidate equivalence classes\n" );
27956  Abc_Print( -2, "\t-F num : the max number of frames for BMC [default = %d]\n", pPars->nFrames );
27957  Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
27958  Abc_Print( -2, "\t-R num : the max number of simulation rounds [default = %d]\n", pPars->nRounds );
27959  Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n", pPars->nRestart );
27960  Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n", pPars->nRandSeed );
27961  Abc_Print( -2, "\t-T num : runtime limit in seconds for all rounds [default = %d]\n", pPars->TimeOut );
27962  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fMiter? "miter": "circuit" );
27963  Abc_Print( -2, "\t-x : toggle using the current CEX to perform refinement [default = %s]\n", pPars->fUseCex? "yes": "no" );
27964  Abc_Print( -2, "\t-l : toggle considering only latch output equivalences [default = %s]\n", pPars->fLatchOnly? "yes": "no" );
27965  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
27966  Abc_Print( -2, "\t-h : print the command usage\n");
27967  return 1;
27968 }
int nFrames
Definition: ssw.h:92
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
Abc_Cex_t * pCex
Definition: ssw.h:111
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fVerbose
Definition: ssw.h:102
int TimeOut
Definition: ssw.h:98
int nRestart
Definition: ssw.h:96
int globalUtilOptind
Definition: extraUtilUtil.c:45
int fLatchOnly
Definition: ssw.h:108
int fUseCex
Definition: ssw.h:107
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nWords
Definition: ssw.h:93
int Ssw_RarSignalFilterGia(Gia_Man_t *p, Ssw_RarPars_t *pPars)
Definition: sswRarity.c:1359
Definition: gia.h:95
void Ssw_RarSetDefaultParams(Ssw_RarPars_t *p)
FUNCTION DEFINITIONS ///.
Definition: sswRarity.c:102
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int nRandSeed
Definition: ssw.h:97
int fMiter
Definition: ssw.h:106
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
int nRounds
Definition: ssw.h:95
int nBinSize
Definition: ssw.h:94
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9EquivFilter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30765 of file abc.c.

30766 {
30767  extern void Gia_ManEquivFilter( Gia_Man_t * p, Vec_Int_t * vPoIds, int fVerbose );
30768  int c, fVerbose = 0;
30770  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
30771  {
30772  switch ( c )
30773  {
30774  case 'v':
30775  fVerbose ^= 1;
30776  break;
30777  case 'h':
30778  goto usage;
30779  default:
30780  goto usage;
30781  }
30782  }
30783  if ( pAbc->pGia == NULL )
30784  {
30785  Abc_Print( -1, "Abc_CommandAbc9EquivFilter(): There is no AIG.\n" );
30786  return 1;
30787  }
30788  Gia_ManEquivFilter( pAbc->pGia, pAbc->vAbcObjIds, fVerbose );
30789  return 0;
30790 
30791 usage:
30792  Abc_Print( -2, "usage: &equiv_filter [-vh]\n" );
30793  Abc_Print( -2, "\t filters equivalence candidates after disproving some SRM outputs\n" );
30794  Abc_Print( -2, "\t (the array of disproved outputs should be given as pAbc->vAbcObjIds)\n" );
30795  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
30796  Abc_Print( -2, "\t-h : print the command usage\n");
30797  return 1;
30798 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Gia_ManEquivFilter(Gia_Man_t *p, Vec_Int_t *vPoIds, int fVerbose)
Definition: giaEquiv.c:1273
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9EquivMark ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30700 of file abc.c.

30701 {
30702  extern void Gia_ManEquivMark( Gia_Man_t * p, char * pFileName, int fSkipSome, int fVerbose );
30703  char * pFileName;
30704  int c, fVerbose = 0;
30705  int fSkipSome = 0;
30707  while ( ( c = Extra_UtilGetopt( argc, argv, "fvh" ) ) != EOF )
30708  {
30709  switch ( c )
30710  {
30711  case 'f':
30712  fSkipSome ^= 1;
30713  break;
30714  case 'v':
30715  fVerbose ^= 1;
30716  break;
30717  case 'h':
30718  goto usage;
30719  default:
30720  goto usage;
30721  }
30722  }
30723  if ( pAbc->pGia == NULL )
30724  {
30725  Abc_Print( -1, "Abc_CommandAbc9EquivMark(): There is no AIG.\n" );
30726  return 1;
30727  }
30728  if ( argc != globalUtilOptind + 1 )
30729  goto usage;
30730  // get the input file name
30731  pFileName = argv[globalUtilOptind];
30732  // mark equivalences
30733  Gia_ManEquivMark( pAbc->pGia, pFileName, fSkipSome, fVerbose );
30734  return 0;
30735 
30736 usage:
30737  Abc_Print( -2, "usage: &equiv_mark [-fvh] <miter.aig>\n" );
30738  Abc_Print( -2, "\t marks equivalences using an external miter\n" );
30739  Abc_Print( -2, "\t-f : toggle the use of filtered equivalences [default = %s]\n", fSkipSome? "yes": "no" );
30740  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
30741  Abc_Print( -2, "\t-h : print the command usage\n");
30742  Abc_Print( -2, "\t<miter.aig> : file with the external miter to read\n");
30743  Abc_Print( -2, "\t \n" );
30744  Abc_Print( -2, "\t The external miter should be generated by &srm -s\n" );
30745  Abc_Print( -2, "\t and (partially) solved by any verification engine(s).\n" );
30746  Abc_Print( -2, "\t The external miter should have as many POs as\n" );
30747  Abc_Print( -2, "\t the number of POs in the current AIG plus\n" );
30748  Abc_Print( -2, "\t the number of equivalences in the current AIG.\n" );
30749  Abc_Print( -2, "\t If some POs are proved, the corresponding equivs\n" );
30750  Abc_Print( -2, "\t are marked as proved, to be reduced by &reduce.\n" );
30751  return 1;
30752 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Gia_ManEquivMark(Gia_Man_t *p, char *pFileName, int fSkipSome, int fVerbose)
Definition: giaEquiv.c:1175
int Abc_CommandAbc9Era ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33667 of file abc.c.

33668 {
33669 // Gia_Man_t * pTemp = NULL;
33670  int c, fVerbose = 0;
33671  int fUseCubes = 1;
33672  int fDumpFile = 0;
33673  int fMiter = 0;
33674  int nStatesMax = 1000000000;
33675  extern int Gia_ManCollectReachable( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fDumpFile, int fVerbose );
33676  extern int Gia_ManArePerform( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbose );
33677 
33679  while ( ( c = Extra_UtilGetopt( argc, argv, "Smcdvh" ) ) != EOF )
33680  {
33681  switch ( c )
33682  {
33683  case 'S':
33684  if ( globalUtilOptind >= argc )
33685  {
33686  Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
33687  goto usage;
33688  }
33689  nStatesMax = atoi(argv[globalUtilOptind]);
33690  globalUtilOptind++;
33691  if ( nStatesMax < 0 )
33692  goto usage;
33693  break;
33694  case 'm':
33695  fMiter ^= 1;
33696  break;
33697  case 'c':
33698  fUseCubes ^= 1;
33699  break;
33700  case 'd':
33701  fDumpFile ^= 1;
33702  break;
33703  case 'v':
33704  fVerbose ^= 1;
33705  break;
33706  case 'h':
33707  goto usage;
33708  default:
33709  goto usage;
33710  }
33711  }
33712  if ( pAbc->pGia == NULL )
33713  {
33714  Abc_Print( -1, "Abc_CommandAbc9Era(): There is no AIG.\n" );
33715  return 1;
33716  }
33717  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
33718  {
33719  Abc_Print( -1, "Abc_CommandAbc9Era(): The network is combinational.\n" );
33720  return 1;
33721  }
33722  if ( !fUseCubes && Gia_ManPiNum(pAbc->pGia) > 12 )
33723  {
33724  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) );
33725  return 1;
33726  }
33727  if ( fUseCubes && !fDumpFile )
33728  pAbc->Status = Gia_ManArePerform( pAbc->pGia, nStatesMax, fMiter, fVerbose );
33729  else
33730  pAbc->Status = Gia_ManCollectReachable( pAbc->pGia, nStatesMax, fMiter, fDumpFile, fVerbose );
33731  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
33732  return 0;
33733 
33734 usage:
33735  Abc_Print( -2, "usage: &era [-S num] [-mcdvh]\n" );
33736  Abc_Print( -2, "\t explicit reachability analysis for small sequential AIGs\n" );
33737  Abc_Print( -2, "\t-S num : the max number of states (num > 0) [default = %d]\n", nStatesMax );
33738  Abc_Print( -2, "\t-m : stop when the miter output is 1 [default = %s]\n", fMiter? "yes": "no" );
33739  Abc_Print( -2, "\t-c : use state cubes instead of state minterms [default = %s]\n", fUseCubes? "yes": "no" );
33740  Abc_Print( -2, "\t-d : toggle dumping STG into a file [default = %s]\n", fDumpFile? "yes": "no" );
33741  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
33742  Abc_Print( -2, "\t-h : print the command usage\n");
33743  return 1;
33744 }
int Gia_ManArePerform(Gia_Man_t *pAig, int nStatesMax, int fMiter, int fVerbose)
Definition: giaEra2.c:1710
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
int Gia_ManCollectReachable(Gia_Man_t *pAig, int nStatesMax, int fMiter, int fDumpFile, int fVerbose)
Definition: giaEra.c:527
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Fadds ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36887 of file abc.c.

36888 {
36889  extern Gia_Man_t * Gia_ManDupWithNaturalBoxes( Gia_Man_t * p, int nFaddMin, int fVerbose );
36890  extern Gia_Man_t * Gia_ManDupWithArtificialBoxes( Gia_Man_t * p, int DelayC, int nPathMin, int nPathMax, int nPathLimit, int fUseFanout, int fIgnoreBoxDelays, int fVerbose );
36891  Gia_Man_t * pTemp, * pTemp2;
36892  int c, nFaddMin = 3, fUseNat = 0, fUseArt = 0, fVerbose = 0;
36893  int DelayC = 0, nPathMin = 3, nPathMax = 32, nPathLimit = 50, fUseFanout = 0, fIgnoreBoxDelays = 0;
36895  while ( ( c = Extra_UtilGetopt( argc, argv, "NBSLPnafbvh" ) ) != EOF )
36896  {
36897  switch ( c )
36898  {
36899  case 'N':
36900  if ( globalUtilOptind >= argc )
36901  {
36902  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
36903  goto usage;
36904  }
36905  nFaddMin = atoi(argv[globalUtilOptind]);
36906  globalUtilOptind++;
36907  if ( nFaddMin < 0 )
36908  goto usage;
36909  break;
36910  case 'B':
36911  if ( globalUtilOptind >= argc )
36912  {
36913  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
36914  goto usage;
36915  }
36916  DelayC = atoi(argv[globalUtilOptind]);
36917  globalUtilOptind++;
36918  if ( DelayC < 0 )
36919  goto usage;
36920  break;
36921  case 'S':
36922  if ( globalUtilOptind >= argc )
36923  {
36924  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
36925  goto usage;
36926  }
36927  nPathMin = atoi(argv[globalUtilOptind]);
36928  globalUtilOptind++;
36929  if ( nPathMin < 0 )
36930  goto usage;
36931  break;
36932  case 'L':
36933  if ( globalUtilOptind >= argc )
36934  {
36935  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
36936  goto usage;
36937  }
36938  nPathMax = atoi(argv[globalUtilOptind]);
36939  globalUtilOptind++;
36940  if ( nPathMax < 0 )
36941  goto usage;
36942  break;
36943  case 'P':
36944  if ( globalUtilOptind >= argc )
36945  {
36946  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
36947  goto usage;
36948  }
36949  nPathLimit = atoi(argv[globalUtilOptind]);
36950  globalUtilOptind++;
36951  if ( nPathLimit < 0 )
36952  goto usage;
36953  break;
36954  case 'n':
36955  fUseNat ^= 1;
36956  break;
36957  case 'a':
36958  fUseArt ^= 1;
36959  break;
36960  case 'f':
36961  fUseFanout ^= 1;
36962  break;
36963  case 'b':
36964  fIgnoreBoxDelays ^= 1;
36965  break;
36966  case 'v':
36967  fVerbose ^= 1;
36968  break;
36969  case 'h':
36970  goto usage;
36971  default:
36972  goto usage;
36973  }
36974  }
36975  if ( pAbc->pGia == NULL )
36976  {
36977  Abc_Print( -1, "Abc_CommandAbc9Fadds(): There is no AIG.\n" );
36978  return 0;
36979  }
36980  if ( fUseNat )
36981  pTemp = Gia_ManDupWithNaturalBoxes( pAbc->pGia, nFaddMin, fVerbose );
36982  else
36983  {
36984  pTemp = Gia_ManDup( pAbc->pGia );
36985  Gia_ManTransferTiming( pTemp, pAbc->pGia );
36986  }
36987  if ( fUseArt )
36988  pTemp2 = Gia_ManDupWithArtificialBoxes( pTemp, DelayC, nPathMin, nPathMax, nPathLimit, fUseFanout, fIgnoreBoxDelays, fVerbose );
36989  else
36990  {
36991  pTemp2 = Gia_ManDup( pTemp );
36992  Gia_ManTransferTiming( pTemp2, pTemp );
36993  }
36994  Gia_ManStop( pTemp );
36995  Abc_FrameUpdateGia( pAbc, pTemp2 );
36996  return 0;
36997 usage:
36998  Abc_Print( -2, "usage: &fadds [-NBSLP num] [-nafvh]\n" );
36999  Abc_Print( -2, "\t detects full-adder chains and puts them into white boxes\n" );
37000  Abc_Print( -2, "\t-n : toggles detecting natural full-adder chains [default = %s]\n", fUseNat? "yes": "no" );
37001  Abc_Print( -2, "\t-N num : minimum length of a natural full-adder chain to detect [default = %d]\n", nFaddMin );
37002  Abc_Print( -2, "\t-a : toggles detecting artificial full-adder chains [default = %s]\n", fUseArt? "yes": "no" );
37003  Abc_Print( -2, "\t-B num : full-adder box delay (percentage of AND-gate delay) [default = %d]\n", DelayC );
37004  Abc_Print( -2, "\t-S num : minimum length of an artificial full-adder chain [default = %d]\n", nPathMin );
37005  Abc_Print( -2, "\t-L num : maximum length of an artificial full-adder chain [default = %d]\n", nPathMax );
37006  Abc_Print( -2, "\t-P num : maximum number of artificial full-adder chains to detect [default = %d]\n", nPathLimit );
37007  Abc_Print( -2, "\t-f : toggles allowing external fanouts in artificial chains [default = %s]\n", fUseFanout? "yes": "no" );
37008  Abc_Print( -2, "\t-b : toggles ignoring boxes when computing delays [default = %s]\n", fIgnoreBoxDelays? "yes": "no" );
37009  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37010  Abc_Print( -2, "\t-h : print the command usage\n");
37011  return 1;
37012 }
Gia_Man_t * Gia_ManDupWithNaturalBoxes(Gia_Man_t *p, int nFaddMin, int fVerbose)
Definition: giaFadds.c:651
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition: giaDup.c:552
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Gia_ManTransferTiming(Gia_Man_t *p, Gia_Man_t *pGia)
Definition: giaIf.c:1912
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Gia_Man_t * Gia_ManDupWithArtificialBoxes(Gia_Man_t *p, int DelayC, int nPathMin, int nPathMax, int nPathLimit, int fUseFanout, int fIgnoreBoxDelays, int fVerbose)
Definition: giaFadds.c:1082
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9False ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29229 of file abc.c.

29230 {
29231  extern Gia_Man_t * Gia_ManCheckFalse( Gia_Man_t * p, int nSlackMax, int nTimeOut, int fVerbose, int fVeryVerbose );
29232  Gia_Man_t * pTemp;
29233  int nSlackMax = 0;
29234  int nTimeOut = 0;
29235  int c, fVerbose = 0;
29236  int fVeryVerbose = 0;
29238  while ( ( c = Extra_UtilGetopt( argc, argv, "STvwh" ) ) != EOF )
29239  {
29240  switch ( c )
29241  {
29242  case 'S':
29243  if ( globalUtilOptind >= argc )
29244  {
29245  Abc_Print( -1, "Command line switch \"-S\" should be followed by a char string.\n" );
29246  goto usage;
29247  }
29248  nSlackMax = atoi(argv[globalUtilOptind]);
29249  globalUtilOptind++;
29250  if ( nSlackMax < 0 )
29251  goto usage;
29252  break;
29253  case 'T':
29254  if ( globalUtilOptind >= argc )
29255  {
29256  Abc_Print( -1, "Command line switch \"-T\" should be followed by a char string.\n" );
29257  goto usage;
29258  }
29259  nTimeOut = atoi(argv[globalUtilOptind]);
29260  globalUtilOptind++;
29261  if ( nTimeOut < 0 )
29262  goto usage;
29263  break;
29264  case 'v':
29265  fVerbose ^= 1;
29266  break;
29267  case 'w':
29268  fVeryVerbose ^= 1;
29269  break;
29270  case 'h':
29271  goto usage;
29272  default:
29273  goto usage;
29274  }
29275  }
29276  if ( pAbc->pGia == NULL )
29277  {
29278  Abc_Print( -1, "Abc_CommandAbc9False(): There is no AIG.\n" );
29279  return 1;
29280  }
29281  pTemp = Gia_ManCheckFalse( pAbc->pGia, nSlackMax, nTimeOut, fVerbose, fVeryVerbose );
29282  Abc_FrameUpdateGia( pAbc, pTemp );
29283  return 0;
29284 
29285 usage:
29286  Abc_Print( -2, "usage: &false [-ST num] [-vwh]\n" );
29287  Abc_Print( -2, "\t detecting and elimintation false paths\n" );
29288  Abc_Print( -2, "\t-S num : maximum slack to identify false paths [default = %d]\n", nSlackMax );
29289  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nTimeOut );
29290  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
29291  Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
29292  Abc_Print( -2, "\t-h : print the command usage\n");
29293  return 1;
29294 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Gia_Man_t * Gia_ManCheckFalse(Gia_Man_t *p, int nSlackMax, int nTimeOut, int fVerbose, int fVeryVerbose)
Definition: giaFalse.c:497
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9FFTest ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36146 of file abc.c.

36147 {
36148  extern void Gia_ParFfSetDefault( Bmc_ParFf_t * p );
36149  extern void Gia_ManFaultTest( Gia_Man_t * p, Gia_Man_t * pG, Bmc_ParFf_t * pPars );
36150  Bmc_ParFf_t Pars, * pPars = &Pars;
36151  char * pFileName = NULL;
36152  Gia_Man_t * pGold = NULL;
36153  int c;
36154  Gia_ParFfSetDefault( pPars );
36156  while ( ( c = Extra_UtilGetopt( argc, argv, "ATNSGsbduvh" ) ) != EOF )
36157  {
36158  switch ( c )
36159  {
36160  case 'A':
36161  if ( globalUtilOptind >= argc )
36162  {
36163  Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
36164  goto usage;
36165  }
36166  pPars->Algo = atoi(argv[globalUtilOptind]);
36167  globalUtilOptind++;
36168  if ( pPars->Algo < 0 || pPars->Algo > 4 )
36169  goto usage;
36170  break;
36171  case 'T':
36172  if ( globalUtilOptind >= argc )
36173  {
36174  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
36175  goto usage;
36176  }
36177  pPars->nTimeOut = atoi(argv[globalUtilOptind]);
36178  globalUtilOptind++;
36179  if ( pPars->nTimeOut < 0 )
36180  goto usage;
36181  break;
36182  case 'N':
36183  if ( globalUtilOptind >= argc )
36184  {
36185  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
36186  goto usage;
36187  }
36188  pPars->nIterCheck = atoi(argv[globalUtilOptind]);
36189  globalUtilOptind++;
36190  if ( pPars->nIterCheck < 0 )
36191  goto usage;
36192  break;
36193  case 'S':
36194  if ( globalUtilOptind >= argc )
36195  {
36196  Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
36197  goto usage;
36198  }
36199  pPars->pFormStr = argv[globalUtilOptind];
36200  globalUtilOptind++;
36201  break;
36202  case 'G':
36203  if ( globalUtilOptind >= argc )
36204  {
36205  Abc_Print( -1, "Command line switch \"-G\" should be followed by string.\n" );
36206  goto usage;
36207  }
36208  pFileName = argv[globalUtilOptind];
36209  globalUtilOptind++;
36210  break;
36211  case 's':
36212  pPars->fStartPats ^= 1;
36213  break;
36214  case 'b':
36215  pPars->fBasic ^= 1;
36216  break;
36217  case 'd':
36218  pPars->fDump ^= 1;
36219  break;
36220  case 'u':
36221  pPars->fDumpUntest ^= 1;
36222  break;
36223  case 'v':
36224  pPars->fVerbose ^= 1;
36225  break;
36226  case 'h':
36227  goto usage;
36228  default:
36229  goto usage;
36230  }
36231  }
36232  if ( pPars->Algo == 0 && pPars->pFormStr == NULL )
36233  {
36234  Abc_Print( -1, "Formula string (-S <str>) should be selected when algorithm is 0 (-A 0).\n" );
36235  return 0;
36236  }
36237  if ( pPars->Algo != 0 && pPars->pFormStr != NULL )
36238  {
36239  Abc_Print( -1, "Algorithm should be 0 (-A 0) when formula string is selected (-S <str>).\n" );
36240  return 0;
36241  }
36242  // get the file name
36243  if ( argc == globalUtilOptind + 1 )
36244  {
36245  FILE * pFile;
36246  pPars->pFileName = argv[globalUtilOptind];
36247  pFile = fopen( pPars->pFileName, "r" );
36248  if ( pFile == NULL )
36249  {
36250  Abc_Print( -1, "Cannot open file \"%s\" with the input test patterns.\n", pPars->pFileName );
36251  return 0;
36252  }
36253  fclose( pFile );
36254  }
36255  // check other conditions
36256  if ( pAbc->pGia == NULL )
36257  {
36258  Abc_Print( -1, "Abc_CommandAbc9FFTest(): There is no AIG.\n" );
36259  return 0;
36260  }
36261  if ( Gia_ManRegNum(pAbc->pGia) == 0 && pPars->Algo == 1 )
36262  {
36263  Abc_Print( -1, "Abc_CommandAbc9FFTest(): For delay testing, AIG should be sequential.\n" );
36264  return 0;
36265  }
36266  // check if the file is valid
36267  if ( pFileName )
36268  {
36269  FILE * pFile = fopen( pFileName, "r" );
36270  if ( pFile == NULL )
36271  {
36272  Abc_Print( -1, "Abc_CommandAbc9FFTest(): File name \"%s\" with golden model is invalid.\n", pFileName );
36273  return 0;
36274  }
36275  fclose( pFile );
36276  pGold = Gia_AigerRead( pFileName, 0, 0 );
36277  if ( pGold == NULL )
36278  {
36279  Abc_Print( -1, "Abc_CommandAbc9FFTest(): Cannot read file \"%s\" with golden model.\n", pFileName );
36280  return 0;
36281  }
36282  if ( Gia_ManPiNum(pAbc->pGia) != Gia_ManPiNum(pGold) )
36283  {
36284  Gia_ManStop( pGold );
36285  Abc_Print( -1, "Abc_CommandAbc9FFTest(): Old model and gold model have different number of PIs.\n" );
36286  return 0;
36287  }
36288  if ( Gia_ManPoNum(pAbc->pGia) != Gia_ManPoNum(pGold) )
36289  {
36290  Gia_ManStop( pGold );
36291  Abc_Print( -1, "Abc_CommandAbc9FFTest(): Old model and gold model have different number of POs.\n" );
36292  return 0;
36293  }
36294  printf( "Entered spec AIG from file \"%s\".\n", pFileName );
36295  }
36296  Gia_ManFaultTest( pAbc->pGia, pGold ? pGold : pAbc->pGia, pPars );
36297  Gia_ManStopP( &pGold );
36298  return 0;
36299 
36300 usage:
36301  Abc_Print( -2, "usage: &fftest [-ATN num] [-sbduvh] <file> [-G file] [-S str]\n" );
36302  Abc_Print( -2, "\t performs functional fault test generation\n" );
36303  Abc_Print( -2, "\t-A num : selects fault model for all gates [default = %d]\n", pPars->Algo );
36304  Abc_Print( -2, "\t 0: fault model is not selected (use -S str)\n" );
36305  Abc_Print( -2, "\t 1: delay fault testing for sequential circuits\n" );
36306  Abc_Print( -2, "\t 2: traditional stuck-at fault: -S (((a&b)&~p)|q)\n" );
36307  Abc_Print( -2, "\t 3: complement fault: -S ((a&b)^p)\n" );
36308  Abc_Print( -2, "\t 4: functionally observable fault\n" );
36309  Abc_Print( -2, "\t-T num : specifies approximate runtime limit in seconds [default = %d]\n", pPars->nTimeOut );
36310  Abc_Print( -2, "\t-N num : specifies iteration to check for fixed parameters [default = %d]\n", pPars->nIterCheck );
36311  Abc_Print( -2, "\t-s : toggles starting with the all-0 and all-1 patterns [default = %s]\n", pPars->fStartPats? "yes": "no" );
36312  Abc_Print( -2, "\t-b : toggles testing for single faults only [default = %s]\n", pPars->fBasic? "yes": "no" );
36313  Abc_Print( -2, "\t-d : toggles dumping test patterns into file \"tests.txt\" [default = %s]\n", pPars->fDump? "yes": "no" );
36314  Abc_Print( -2, "\t-u : toggles dumping untestable faults into \"untest.txt\" [default = %s]\n", pPars->fDumpUntest? "yes": "no" );
36315  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
36316  Abc_Print( -2, "\t-h : print the command usage\n");
36317  Abc_Print( -2, "\t<file> : (optional) file name with input test patterns\n\n");
36318  Abc_Print( -2, "\t-G file : (optional) file name with the golden model\n\n");
36319  Abc_Print( -2, "\t-S str : (optional) string representing the fault model\n");
36320  Abc_Print( -2, "\t The following notations are used:\n");
36321  Abc_Print( -2, "\t Functional variables: {a,b} (both a and b are always present)\n");
36322  Abc_Print( -2, "\t Parameter variables: {p,q,r,s,t,u,v,w} (any number from 1 to 8)\n");
36323  Abc_Print( -2, "\t Boolean operators: AND(&), OR(|), XOR(^), MUX(?:), NOT(~)\n");
36324  Abc_Print( -2, "\t Parantheses should be used around each operator. Spaces not allowed.\n");
36325  Abc_Print( -2, "\t Complement (~) is only allowed before variables (use DeMorgan law).\n");
36326  Abc_Print( -2, "\t Examples:\n");
36327  Abc_Print( -2, "\t (((a&b)&~p)|q) stuck-at-0/1 at the output\n");
36328  Abc_Print( -2, "\t (((a&~p)|q)&b) stuck-at-0/1 at input a\n");
36329  Abc_Print( -2, "\t (((a|p)&(b|q))&~r) stuck-at-1 at the inputs and stuck-at-0 at the output\n");
36330  Abc_Print( -2, "\t (((a&~p)&(b&~q))|r) stuck-at-0 at the inputs and stuck-at-1 at the output\n");
36331  Abc_Print( -2, "\t ((a&b)^p) complement at the output\n");
36332  Abc_Print( -2, "\t (((a^p)&(b^q))^r) complement at the inputs and at the output\n");
36333  Abc_Print( -2, "\t (a?(b?~s:r):(b?q:p)) functionally observable fault at the output\n");
36334  Abc_Print( -2, "\t (p?(a|b):(a&b)) replace AND by OR\n");
36335  return 1;
36336 }
int fBasic
Definition: bmc.h:133
int Algo
Definition: bmc.h:128
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nIterCheck
Definition: bmc.h:132
void Gia_ParFfSetDefault(Bmc_ParFf_t *p)
FUNCTION DEFINITIONS ///.
Definition: bmcFault.c:51
int fDumpUntest
Definition: bmc.h:135
int nTimeOut
Definition: bmc.h:131
void Gia_ManStopP(Gia_Man_t **p)
Definition: giaMan.c:177
int fVerbose
Definition: bmc.h:136
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Gia_ManFaultTest(Gia_Man_t *p, Gia_Man_t *pG, Bmc_ParFf_t *pPars)
Definition: bmcFault.c:1068
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fStartPats
Definition: bmc.h:130
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
char * pFileName
Definition: bmc.h:126
char * pFormStr
Definition: bmc.h:127
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
int fDump
Definition: bmc.h:134
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Filter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30555 of file abc.c.

30556 {
30557  char * pFileName1 = NULL, * pFileName2 = NULL;
30558  int fFlopsOnly = 0, fFlopsWith = 0, fUseRiDrivers = 0;
30559  int c, fVerbose = 0;
30561  while ( ( c = Extra_UtilGetopt( argc, argv, "fgivh" ) ) != EOF )
30562  {
30563  switch ( c )
30564  {
30565  case 'f':
30566  fFlopsOnly ^= 1;
30567  break;
30568  case 'g':
30569  fFlopsWith ^= 1;
30570  break;
30571  case 'i':
30572  fUseRiDrivers ^= 1;
30573  break;
30574  case 'v':
30575  fVerbose ^= 1;
30576  break;
30577  case 'h':
30578  goto usage;
30579  default:
30580  goto usage;
30581  }
30582  }
30583  if ( pAbc->pGia == NULL )
30584  {
30585  Abc_Print( -1, "Abc_CommandAbc9Srm2(): There is no AIG.\n" );
30586  return 1;
30587  }
30588  if ( pAbc->pGia->pReprs == NULL || pAbc->pGia->pNexts == NULL )
30589  {
30590  Abc_Print( -1, "Equivalences are not defined.\n" );
30591  return 0;
30592  }
30593  if ( argc != globalUtilOptind && argc != globalUtilOptind + 2 )
30594  {
30595  Abc_Print( -1, "Abc_CommandAbc9Srm2(): Expecting two file names on the command line.\n" );
30596  return 1;
30597  }
30598  // filter using one of the choices
30599  if ( fFlopsOnly ^ fFlopsWith )
30600  Gia_ManFilterEquivsUsingLatches( pAbc->pGia, fFlopsOnly, fFlopsWith, fUseRiDrivers );
30601  // get the input file name
30602  if ( argc == globalUtilOptind + 2 )
30603  {
30604  pFileName1 = argv[globalUtilOptind];
30605  pFileName2 = argv[globalUtilOptind+1];
30606  if ( !Gia_ManFilterEquivsUsingParts( pAbc->pGia, pFileName1, pFileName2 ) )
30607  {
30608  Abc_Print( -1, "Filtering equivalences using PartA and PartB has failed.\n" );
30609  return 1;
30610  }
30611  }
30612  return 0;
30613 
30614 usage:
30615  Abc_Print( -2, "usage: &filter [-fgivh] <PartA_FileName> <PartB_FileName>\n" );
30616  Abc_Print( -2, "\t performs filtering of equivalence classes\n" );
30617  Abc_Print( -2, "\t (if Parts A/B are given, removes classes composed of one part)\n" );
30618  Abc_Print( -2, "\t-f : toggle removing all elements except flops [default = %s]\n", fFlopsOnly? "yes": "no" );
30619  Abc_Print( -2, "\t-g : toggle removing classes without flops [default = %s]\n", fFlopsWith? "yes": "no" );
30620  Abc_Print( -2, "\t-i : toggle using flop inputs instead of flop outputs [default = %s]\n", fUseRiDrivers? "yes": "no" );
30621  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
30622  Abc_Print( -2, "\t-h : print the command usage\n");
30623  return 1;
30624 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Gia_ManFilterEquivsUsingLatches(Gia_Man_t *pGia, int fFlopsOnly, int fFlopsWith, int fUseRiDrivers)
Definition: giaEquiv.c:2147
int Gia_ManFilterEquivsUsingParts(Gia_Man_t *pGia, char *pName1, char *pName2)
Definition: giaEquiv.c:1999
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Fla2Gla ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 38360 of file abc.c.

38361 {
38362  int c, fVerbose = 0;
38364  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
38365  {
38366  switch ( c )
38367  {
38368  case 'v':
38369  fVerbose ^= 1;
38370  break;
38371  case 'h':
38372  goto usage;
38373  default:
38374  goto usage;
38375  }
38376  }
38377  if ( pAbc->pGia == NULL )
38378  {
38379  Abc_Print( -1, "Abc_CommandAbc9Fla2Gla(): There is no AIG.\n" );
38380  return 0;
38381  }
38382  if ( pAbc->pGia->vFlopClasses == NULL )
38383  {
38384  Abc_Print( -1, "Abc_CommandAbc9Fla2Gla(): There is no gate-level abstraction is defined.\n" );
38385  return 0;
38386  }
38387  Vec_IntFreeP( &pAbc->pGia->vGateClasses );
38388  pAbc->pGia->vGateClasses = Gia_FlaConvertToGla( pAbc->pGia, pAbc->pGia->vFlopClasses );
38389  Vec_IntFreeP( &pAbc->pGia->vFlopClasses );
38390  return 0;
38391 
38392 usage:
38393  Abc_Print( -2, "usage: &fla_gla [-vh]\n" );
38394  Abc_Print( -2, "\t maps flop-level into gate-level abstraction\n" );
38395  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
38396  Abc_Print( -2, "\t-h : print the command usage\n");
38397  return 1;
38398 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Vec_Int_t * Gia_FlaConvertToGla(Gia_Man_t *p, Vec_Int_t *vFla)
Definition: absUtil.c:173
int Abc_CommandAbc9Flow ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31526 of file abc.c.

31527 {
31528  extern void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fUseMfs, int fVerbose );
31529  int nLutSize = 6;
31530  int nCutNum = 8;
31531  int fMinAve = 0;
31532  int fUseMfs = 0;
31533  int c, fVerbose = 0;
31535  while ( ( c = Extra_UtilGetopt( argc, argv, "KCtmvh" ) ) != EOF )
31536  {
31537  switch ( c )
31538  {
31539  case 'K':
31540  if ( globalUtilOptind >= argc )
31541  {
31542  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
31543  goto usage;
31544  }
31545  nLutSize = atoi(argv[globalUtilOptind]);
31546  globalUtilOptind++;
31547  if ( nLutSize < 0 )
31548  goto usage;
31549  break;
31550  case 'C':
31551  if ( globalUtilOptind >= argc )
31552  {
31553  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
31554  goto usage;
31555  }
31556  nCutNum = atoi(argv[globalUtilOptind]);
31557  globalUtilOptind++;
31558  if ( nCutNum < 0 )
31559  goto usage;
31560  break;
31561  case 't':
31562  fMinAve ^= 1;
31563  break;
31564  case 'm':
31565  fUseMfs ^= 1;
31566  break;
31567  case 'v':
31568  fVerbose ^= 1;
31569  break;
31570  case 'h':
31571  goto usage;
31572  default:
31573  goto usage;
31574  }
31575  }
31576  if ( pAbc->pGia == NULL )
31577  {
31578  Abc_Print( -1, "Abc_CommandAbc9Flow(): There is no AIG.\n" );
31579  return 1;
31580  }
31581  Gia_ManPerformFlow( Gia_ManHasMapping(pAbc->pGia), Gia_ManAndNum(pAbc->pGia), Gia_ManLevelNum(pAbc->pGia), nLutSize, nCutNum, fMinAve, fUseMfs, fVerbose );
31582  return 0;
31583 
31584 usage:
31585  Abc_Print( -2, "usage: &flow [-KC num] [-tmvh]\n" );
31586  Abc_Print( -2, "\t integration optimization and mapping flow\n" );
31587  Abc_Print( -2, "\t-K num : the number of LUT inputs (LUT size) [default = %d]\n", nLutSize );
31588  Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
31589  Abc_Print( -2, "\t-t : toggle minimizing average rather than max delay [default = %s]\n", fMinAve? "yes": "no" );
31590  Abc_Print( -2, "\t-m : toggle using \"mfs2\" in the script [default = %s]\n", fUseMfs? "yes": "no" );
31591  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
31592  Abc_Print( -2, "\t-h : print the command usage\n");
31593  return 1;
31594 }
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Gia_ManLevelNum(Gia_Man_t *p)
Definition: giaUtil.c:505
void Gia_ManPerformFlow(int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fMinAve, int fUseMfs, int fVerbose)
Definition: giaScript.c:579
int Abc_CommandAbc9Flow2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31607 of file abc.c.

31608 {
31609  extern void Gia_ManPerformFlow2( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fBalance, int fMinAve, int fUseMfs, int fVerbose );
31610  int nLutSize = 6;
31611  int nCutNum = 8;
31612  int fBalance = 0;
31613  int fMinAve = 0;
31614  int fUseMfs = 0;
31615  int c, fVerbose = 0;
31617  while ( ( c = Extra_UtilGetopt( argc, argv, "KCbtmvh" ) ) != EOF )
31618  {
31619  switch ( c )
31620  {
31621  case 'K':
31622  if ( globalUtilOptind >= argc )
31623  {
31624  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
31625  goto usage;
31626  }
31627  nLutSize = atoi(argv[globalUtilOptind]);
31628  globalUtilOptind++;
31629  if ( nLutSize < 0 )
31630  goto usage;
31631  break;
31632  case 'C':
31633  if ( globalUtilOptind >= argc )
31634  {
31635  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
31636  goto usage;
31637  }
31638  nCutNum = atoi(argv[globalUtilOptind]);
31639  globalUtilOptind++;
31640  if ( nCutNum < 0 )
31641  goto usage;
31642  break;
31643  case 'b':
31644  fBalance ^= 1;
31645  break;
31646  case 't':
31647  fMinAve ^= 1;
31648  break;
31649  case 'm':
31650  fUseMfs ^= 1;
31651  break;
31652  case 'v':
31653  fVerbose ^= 1;
31654  break;
31655  case 'h':
31656  goto usage;
31657  default:
31658  goto usage;
31659  }
31660  }
31661  if ( pAbc->pGia == NULL )
31662  {
31663  Abc_Print( -1, "Abc_CommandAbc9Flow2(): There is no AIG.\n" );
31664  return 1;
31665  }
31666  Gia_ManPerformFlow2( Gia_ManHasMapping(pAbc->pGia), Gia_ManAndNum(pAbc->pGia), Gia_ManLevelNum(pAbc->pGia), nLutSize, nCutNum, fBalance, fMinAve, fUseMfs, fVerbose );
31667  return 0;
31668 
31669 usage:
31670  Abc_Print( -2, "usage: &flow2 [-KC num] [-btmvh]\n" );
31671  Abc_Print( -2, "\t integration optimization and mapping flow\n" );
31672  Abc_Print( -2, "\t-K num : the number of LUT inputs (LUT size) [default = %d]\n", nLutSize );
31673  Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
31674  Abc_Print( -2, "\t-b : toggle using SOP balancing during synthesis [default = %s]\n", fBalance? "yes": "no" );
31675  Abc_Print( -2, "\t-t : toggle minimizing average (not maximum) level [default = %s]\n", fMinAve? "yes": "no" );
31676  Abc_Print( -2, "\t-m : toggle using \"mfs2\" in the script [default = %s]\n", fUseMfs? "yes": "no" );
31677  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
31678  Abc_Print( -2, "\t-h : print the command usage\n");
31679  return 1;
31680 }
static int Gia_ManAndNum(Gia_Man_t *p)
Definition: gia.h:389
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Gia_ManPerformFlow2(int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int fBalance, int fMinAve, int fUseMfs, int fVerbose)
Definition: giaScript.c:610
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Gia_ManLevelNum(Gia_Man_t *p)
Definition: giaUtil.c:505
int Abc_CommandAbc9Force ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31137 of file abc.c.

31138 {
31139  int nIters = 20;
31140  int fClustered = 1;
31141  int fVerbose = 1;
31142  int c;
31144  while ( ( c = Extra_UtilGetopt( argc, argv, "Icvh" ) ) != EOF )
31145  {
31146  switch ( c )
31147  {
31148  case 'I':
31149  if ( globalUtilOptind >= argc )
31150  {
31151  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
31152  goto usage;
31153  }
31154  nIters = atoi(argv[globalUtilOptind]);
31155  globalUtilOptind++;
31156  if ( nIters < 0 )
31157  goto usage;
31158  break;
31159  case 'c':
31160  fClustered ^= 1;
31161  break;
31162  case 'v':
31163  fVerbose ^= 1;
31164  break;
31165  case 'h':
31166  goto usage;
31167  default:
31168  goto usage;
31169  }
31170  }
31171  if ( pAbc->pGia == NULL )
31172  {
31173  Abc_Print( -1, "Abc_CommandAbc9Force(): There is no AIG.\n" );
31174  return 1;
31175  }
31176  For_ManExperiment( pAbc->pGia, nIters, fClustered, fVerbose );
31177  return 0;
31178 
31179 usage:
31180  Abc_Print( -2, "usage: &force [-I <num>] [-cvh]\n" );
31181  Abc_Print( -2, "\t one-dimensional placement algorithm FORCE introduced by\n" );
31182  Abc_Print( -2, "\t F. A. Aloul, I. L. Markov, and K. A. Sakallah (GLSVLSI�03).\n" );
31183  Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", nIters );
31184  Abc_Print( -2, "\t-c : toggle clustered representation [default = %s]\n", fClustered? "yes":"no");
31185  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes":"no");
31186  Abc_Print( -2, "\t-h : print the command usage\n");
31187  return 1;
31188 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void For_ManExperiment(Gia_Man_t *pGia, int nIters, int fClustered, int fVerbose)
Definition: giaForce.c:1039
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Fraig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30133 of file abc.c.

30134 {
30135  Cec_ParFra_t ParsFra, * pPars = &ParsFra;
30136  Gia_Man_t * pTemp;
30137  int c;
30138  Cec_ManFraSetDefaultParams( pPars );
30139  pPars->fSatSweeping = 1;
30141  while ( ( c = Extra_UtilGetopt( argc, argv, "WRILDCrmdcwvh" ) ) != EOF )
30142  {
30143  switch ( c )
30144  {
30145  case 'W':
30146  if ( globalUtilOptind >= argc )
30147  {
30148  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
30149  goto usage;
30150  }
30151  pPars->nWords = atoi(argv[globalUtilOptind]);
30152  globalUtilOptind++;
30153  if ( pPars->nWords < 0 )
30154  goto usage;
30155  break;
30156  case 'R':
30157  if ( globalUtilOptind >= argc )
30158  {
30159  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
30160  goto usage;
30161  }
30162  pPars->nRounds = atoi(argv[globalUtilOptind]);
30163  globalUtilOptind++;
30164  if ( pPars->nRounds < 0 )
30165  goto usage;
30166  break;
30167  case 'I':
30168  if ( globalUtilOptind >= argc )
30169  {
30170  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
30171  goto usage;
30172  }
30173  pPars->nItersMax = atoi(argv[globalUtilOptind]);
30174  globalUtilOptind++;
30175  if ( pPars->nItersMax < 0 )
30176  goto usage;
30177  break;
30178  case 'L':
30179  if ( globalUtilOptind >= argc )
30180  {
30181  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
30182  goto usage;
30183  }
30184  pPars->nLevelMax = atoi(argv[globalUtilOptind]);
30185  globalUtilOptind++;
30186  if ( pPars->nLevelMax < 0 )
30187  goto usage;
30188  break;
30189  case 'D':
30190  if ( globalUtilOptind >= argc )
30191  {
30192  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
30193  goto usage;
30194  }
30195  pPars->nDepthMax = atoi(argv[globalUtilOptind]);
30196  globalUtilOptind++;
30197  if ( pPars->nDepthMax < 0 )
30198  goto usage;
30199  break;
30200  case 'C':
30201  if ( globalUtilOptind >= argc )
30202  {
30203  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
30204  goto usage;
30205  }
30206  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
30207  globalUtilOptind++;
30208  if ( pPars->nBTLimit < 0 )
30209  goto usage;
30210  break;
30211  case 'r':
30212  pPars->fRewriting ^= 1;
30213  break;
30214  case 'm':
30215  pPars->fCheckMiter ^= 1;
30216  break;
30217  case 'd':
30218  pPars->fDualOut ^= 1;
30219  break;
30220  case 'c':
30221  pPars->fRunCSat ^= 1;
30222  break;
30223  case 'w':
30224  pPars->fVeryVerbose ^= 1;
30225  break;
30226  case 'v':
30227  pPars->fVerbose ^= 1;
30228  break;
30229  default:
30230  goto usage;
30231  }
30232  }
30233  if ( pAbc->pGia == NULL )
30234  {
30235  Abc_Print( -1, "Abc_CommandAbc9Fraig(): There is no AIG.\n" );
30236  return 1;
30237  }
30238  pTemp = Cec_ManSatSweeping( pAbc->pGia, pPars );
30239  Abc_FrameUpdateGia( pAbc, pTemp );
30240  return 0;
30241 
30242 usage:
30243  Abc_Print( -2, "usage: &fraig [-WRILDC <num>] [-rmdcwvh]\n" );
30244  Abc_Print( -2, "\t performs combinational SAT sweeping\n" );
30245  Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
30246  Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n", pPars->nRounds );
30247  Abc_Print( -2, "\t-I num : the number of sweeping iterations [default = %d]\n", pPars->nItersMax );
30248  Abc_Print( -2, "\t-L num : the max number of levels of nodes to consider [default = %d]\n", pPars->nLevelMax );
30249  Abc_Print( -2, "\t-D num : the max number of steps of speculative reduction [default = %d]\n", pPars->nDepthMax );
30250  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
30251  Abc_Print( -2, "\t-r : toggle the use of AIG rewriting [default = %s]\n", pPars->fRewriting? "yes": "no" );
30252  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
30253  Abc_Print( -2, "\t-d : toggle using double output miters [default = %s]\n", pPars->fDualOut? "yes": "no" );
30254  Abc_Print( -2, "\t-c : toggle using circuit-based solver [default = %s]\n", pPars->fRunCSat? "yes": "no" );
30255  Abc_Print( -2, "\t-w : toggle printing even more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
30256  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
30257  Abc_Print( -2, "\t-h : print the command usage\n");
30258  return 1;
30259 }
Gia_Man_t * Cec_ManSatSweeping(Gia_Man_t *pAig, Cec_ParFra_t *pPars)
Definition: cecCore.c:337
int fRunCSat
Definition: cec.h:110
int fVerbose
Definition: cec.h:112
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fDualOut
Definition: cec.h:107
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nWords
Definition: cec.h:97
int nRounds
Definition: cec.h:98
int nBTLimit
Definition: cec.h:100
int nItersMax
Definition: cec.h:99
Definition: gia.h:95
int fCheckMiter
Definition: cec.h:105
int nDepthMax
Definition: cec.h:103
int nLevelMax
Definition: cec.h:102
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Cec_ManFraSetDefaultParams(Cec_ParFra_t *p)
Definition: cecCore.c:125
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int fSatSweeping
Definition: cec.h:109
int fRewriting
Definition: cec.h:104
int fVeryVerbose
Definition: cec.h:111
int Abc_CommandAbc9Frames ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28179 of file abc.c.

28180 {
28181  extern Gia_Man_t * Gia_ManFrames2( Gia_Man_t * pAig, Gia_ParFra_t * pPars );
28182 
28183  Gia_Man_t * pTemp;
28184  Gia_ParFra_t Pars, * pPars = &Pars;
28185  int c;
28186  int nCofFanLit = 0;
28187  int fNewAlgo = 0;
28188  int fInitSpecial = 0;
28189  Gia_ManFraSetDefaultParams( pPars );
28191  while ( ( c = Extra_UtilGetopt( argc, argv, "FLsoibavh" ) ) != EOF )
28192  {
28193  switch ( c )
28194  {
28195  case 'F':
28196  if ( globalUtilOptind >= argc )
28197  {
28198  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
28199  goto usage;
28200  }
28201  pPars->nFrames = atoi(argv[globalUtilOptind]);
28202  globalUtilOptind++;
28203  if ( pPars->nFrames < 0 )
28204  goto usage;
28205  break;
28206  case 'L':
28207  if ( globalUtilOptind >= argc )
28208  {
28209  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
28210  goto usage;
28211  }
28212  nCofFanLit = atoi(argv[globalUtilOptind]);
28213  globalUtilOptind++;
28214  if ( nCofFanLit < 0 )
28215  goto usage;
28216  break;
28217  case 's':
28218  pPars->fDisableSt ^= 1;
28219  break;
28220  case 'o':
28221  pPars->fOrPos ^= 1;
28222  break;
28223  case 'i':
28224  pPars->fInit ^= 1;
28225  break;
28226  case 'b':
28227  fInitSpecial ^= 1;
28228  break;
28229  case 'a':
28230  fNewAlgo ^= 1;
28231  break;
28232  case 'v':
28233  pPars->fVerbose ^= 1;
28234  break;
28235  case 'h':
28236  goto usage;
28237  default:
28238  goto usage;
28239  }
28240  }
28241  if ( pAbc->pGia == NULL )
28242  {
28243  Abc_Print( -1, "Abc_CommandAbc9Frames(): There is no AIG.\n" );
28244  return 1;
28245  }
28246  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
28247  {
28248  Abc_Print( -1, "The network is combinational.\n" );
28249  return 0;
28250  }
28251  if ( fInitSpecial )
28252  pTemp = Gia_ManFramesInitSpecial( pAbc->pGia, pPars->nFrames, pPars->fVerbose );
28253  else if ( nCofFanLit )
28254  pTemp = Gia_ManUnrollAndCofactor( pAbc->pGia, pPars->nFrames, nCofFanLit, pPars->fVerbose );
28255  else if ( fNewAlgo )
28256  pTemp = Gia_ManFrames2( pAbc->pGia, pPars );
28257  else
28258  pTemp = Gia_ManFrames( pAbc->pGia, pPars );
28259  Abc_FrameUpdateGia( pAbc, pTemp );
28260  return 0;
28261 
28262 usage:
28263  Abc_Print( -2, "usage: &frames [-FL <num>] [-soibavh]\n" );
28264  Abc_Print( -2, "\t unrolls the design for several timeframes\n" );
28265  Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", pPars->nFrames );
28266  Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
28267  Abc_Print( -2, "\t-s : toggle disabling structural hashing [default = %s]\n", pPars->fDisableSt? "yes": "no" );
28268  Abc_Print( -2, "\t-o : toggle ORing corresponding POs [default = %s]\n", pPars->fOrPos? "yes": "no" );
28269  Abc_Print( -2, "\t-i : toggle initializing registers [default = %s]\n", pPars->fInit? "yes": "no" );
28270  Abc_Print( -2, "\t-b : toggle computing special AIG for BMC [default = %s]\n", fInitSpecial? "yes": "no" );
28271  Abc_Print( -2, "\t-a : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
28272  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
28273  Abc_Print( -2, "\t-h : print the command usage\n");
28274  return 1;
28275 }
int nFrames
Definition: gia.h:227
Gia_Man_t * Gia_ManFrames2(Gia_Man_t *pAig, Gia_ParFra_t *pPars)
Definition: giaFrames.c:608
int fOrPos
Definition: gia.h:231
Gia_Man_t * Gia_ManFrames(Gia_Man_t *pAig, Gia_ParFra_t *pPars)
Definition: giaFrames.c:840
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManFramesInitSpecial(Gia_Man_t *pAig, int nFrames, int fVerbose)
Definition: giaFrames.c:941
Gia_Man_t * Gia_ManUnrollAndCofactor(Gia_Man_t *p, int nFrames, int nFanMax, int fVerbose)
Definition: giaEnable.c:403
int fVerbose
Definition: gia.h:232
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fInit
Definition: gia.h:228
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
void Gia_ManFraSetDefaultParams(Gia_ParFra_t *p)
Definition: giaFrames.c:631
int fDisableSt
Definition: gia.h:230
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Fx ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28644 of file abc.c.

28645 {
28646  Gia_Man_t * pTemp;
28647  int nNewNodesMax = 1000000;
28648  int LitCountMax = 0;
28649  int fReverse = 0;
28650  int c, fVerbose = 0;
28651  int fVeryVerbose = 0;
28652  // set the defaults
28654  while ( (c = Extra_UtilGetopt(argc, argv, "NMrvwh")) != EOF )
28655  {
28656  switch (c)
28657  {
28658  case 'N':
28659  if ( globalUtilOptind >= argc )
28660  {
28661  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
28662  goto usage;
28663  }
28664  nNewNodesMax = atoi(argv[globalUtilOptind]);
28665  globalUtilOptind++;
28666  if ( nNewNodesMax < 0 )
28667  goto usage;
28668  break;
28669  case 'M':
28670  if ( globalUtilOptind >= argc )
28671  {
28672  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
28673  goto usage;
28674  }
28675  LitCountMax = atoi(argv[globalUtilOptind]);
28676  globalUtilOptind++;
28677  if ( LitCountMax < 0 )
28678  goto usage;
28679  break;
28680  case 'r':
28681  fReverse ^= 1;
28682  break;
28683  case 'v':
28684  fVerbose ^= 1;
28685  break;
28686  case 'w':
28687  fVeryVerbose ^= 1;
28688  break;
28689  case 'h':
28690  goto usage;
28691  break;
28692  default:
28693  goto usage;
28694  }
28695  }
28696  if ( pAbc->pGia == NULL )
28697  {
28698  Abc_Print( -1, "Abc_CommandAbc9Shrink(): There is no AIG.\n" );
28699  return 1;
28700  }
28701  if ( !Gia_ManHasMapping(pAbc->pGia) )
28702  {
28703  Abc_Print( -1, "Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.\n" );
28704  return 1;
28705  }
28706  pTemp = Gia_ManPerformFx( pAbc->pGia, nNewNodesMax, LitCountMax, fReverse, fVerbose, fVeryVerbose );
28707  if ( pTemp != NULL )
28708  Abc_FrameUpdateGia( pAbc, pTemp );
28709  else
28710  Abc_Print( -1, "Abc_CommandAbc9Fx(): Command has failed.\n" );
28711  return 0;
28712 
28713 usage:
28714  Abc_Print( -2, "usage: &fx [-NM <num>] [-vh]\n");
28715  Abc_Print( -2, "\t extract shared logic using the classical \"fast_extract\" algorithm\n");
28716  Abc_Print( -2, "\t-N <num> : max number of divisors to extract during this run [default = %d]\n", nNewNodesMax );
28717  Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", LitCountMax );
28718  Abc_Print( -2, "\t-r : reversing variable order during ISOP computation [default = %s]\n", fReverse? "yes": "no" );
28719  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
28720  Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
28721  Abc_Print( -2, "\t-h : print the command usage\n");
28722  return 1;
28723 }
Gia_Man_t * Gia_ManPerformFx(Gia_Man_t *p, int nNewNodesMax, int LitCountMax, int fReverse, int fVerbose, int fVeryVerbose)
Definition: giaFx.c:451
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Get ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25776 of file abc.c.

25777 {
25778  extern Aig_Man_t * Abc_NtkToDarChoices( Abc_Ntk_t * pNtk );
25779  extern Vec_Ptr_t * Abc_NtkCollectCiNames( Abc_Ntk_t * pNtk );
25780  extern Vec_Ptr_t * Abc_NtkCollectCoNames( Abc_Ntk_t * pNtk );
25781  Abc_Ntk_t * pStrash;
25782  Aig_Man_t * pAig;
25783  Gia_Man_t * pGia, * pTemp;
25784  char * pInits;
25785  int c, fMapped = 0, fNames = 0, fVerbose = 0;
25787  while ( ( c = Extra_UtilGetopt( argc, argv, "mnvh" ) ) != EOF )
25788  {
25789  switch ( c )
25790  {
25791  case 'm':
25792  fMapped ^= 1;
25793  break;
25794  case 'n':
25795  fNames ^= 1;
25796  break;
25797  case 'v':
25798  fVerbose ^= 1;
25799  break;
25800  default:
25801  goto usage;
25802  }
25803  }
25804  if ( pAbc->pNtkCur == NULL )
25805  {
25806  Abc_Print( -1, "There is no current network\n" );
25807  return 1;
25808  }
25809  if ( !Abc_NtkIsStrash( pAbc->pNtkCur ) )
25810  {
25811  if ( fMapped )
25812  {
25813  assert( Abc_NtkIsLogic(pAbc->pNtkCur) );
25814  Abc_NtkToAig( pAbc->pNtkCur );
25815  pGia = Abc_NtkAigToGia( pAbc->pNtkCur );
25816  }
25817  else
25818  {
25819  // derive comb GIA
25820  pStrash = Abc_NtkStrash( pAbc->pNtkCur, 0, 1, 0 );
25821  pAig = Abc_NtkToDar( pStrash, 0, 0 );
25822  Abc_NtkDelete( pStrash );
25823  pGia = Gia_ManFromAig( pAig );
25824  Aig_ManStop( pAig );
25825  // perform undc/zero
25826  pInits = Abc_NtkCollectLatchValuesStr( pAbc->pNtkCur );
25827  pGia = Gia_ManDupZeroUndc( pTemp = pGia, pInits, fVerbose );
25828  Gia_ManStop( pTemp );
25829  ABC_FREE( pInits );
25830  }
25831  }
25832  else
25833  {
25834  if ( Abc_NtkGetChoiceNum(pAbc->pNtkCur) )
25835  pAig = Abc_NtkToDarChoices( pAbc->pNtkCur );
25836  else
25837  pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
25838  pGia = Gia_ManFromAig( pAig );
25839  Aig_ManStop( pAig );
25840  }
25841  // replace
25842  if ( fNames )
25843  {
25844  pGia->vNamesIn = Abc_NtkCollectCiNames( pAbc->pNtkCur );
25845  pGia->vNamesOut = Abc_NtkCollectCoNames( pAbc->pNtkCur );
25846  }
25847  Abc_FrameUpdateGia( pAbc, pGia );
25848  return 0;
25849 
25850 usage:
25851  Abc_Print( -2, "usage: &get [-mnvh] <file>\n" );
25852  Abc_Print( -2, "\t converts the current network into GIA and moves it to the &-space\n" );
25853  Abc_Print( -2, "\t (if the network is a sequential logic network, normalizes the flops\n" );
25854  Abc_Print( -2, "\t to have const-0 initial values, equivalent to \"undc; st; zero\")\n" );
25855  Abc_Print( -2, "\t-m : toggles preserving the current mapping [default = %s]\n", fMapped? "yes": "no" );
25856  Abc_Print( -2, "\t-n : toggles saving CI/CO names of the AIG [default = %s]\n", fNames? "yes": "no" );
25857  Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
25858  Abc_Print( -2, "\t-h : print the command usage\n");
25859  Abc_Print( -2, "\t<file> : the file name\n");
25860  return 1;
25861 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Vec_Ptr_t * Abc_NtkCollectCiNames(Abc_Ntk_t *pNtk)
Definition: abcDar.c:1243
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL char * Abc_NtkCollectLatchValuesStr(Abc_Ntk_t *pNtk)
Definition: abcLatch.c:209
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
Gia_Man_t * Gia_ManDupZeroUndc(Gia_Man_t *p, char *pInit, int fVerbose)
Definition: giaDup.c:2390
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition: giaAig.c:73
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDarChoices(Abc_Ntk_t *pNtk)
Definition: abcDar.c:354
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
Vec_Ptr_t * Abc_NtkCollectCoNames(Abc_Ntk_t *pNtk)
Definition: abcDar.c:1265
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Vec_Ptr_t * vNamesOut
Definition: gia.h:156
#define ABC_FREE(obj)
Definition: abc_global.h:232
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
ABC_DLL Gia_Man_t * Abc_NtkAigToGia(Abc_Ntk_t *p)
Definition: abcFunc.c:935
#define assert(ex)
Definition: util_old.h:213
Vec_Ptr_t * vNamesIn
Definition: gia.h:155
int Abc_CommandAbc9Gla ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37767 of file abc.c.

37768 {
37769  Abs_Par_t Pars, * pPars = &Pars;
37770  int c, fNewAlgo = 1;
37771  Abs_ParSetDefaults( pPars );
37773  while ( ( c = Extra_UtilGetopt( argc, argv, "FSCLDETRQPBAtfardmnscbpquwvh" ) ) != EOF )
37774  {
37775  switch ( c )
37776  {
37777  case 'F':
37778  if ( globalUtilOptind >= argc )
37779  {
37780  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
37781  goto usage;
37782  }
37783  pPars->nFramesMax = atoi(argv[globalUtilOptind]);
37784  globalUtilOptind++;
37785  if ( pPars->nFramesMax < 0 )
37786  goto usage;
37787  break;
37788  case 'S':
37789  if ( globalUtilOptind >= argc )
37790  {
37791  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
37792  goto usage;
37793  }
37794  pPars->nFramesStart = atoi(argv[globalUtilOptind]);
37795  globalUtilOptind++;
37796  if ( pPars->nFramesStart < 0 )
37797  goto usage;
37798  break;
37799  case 'C':
37800  if ( globalUtilOptind >= argc )
37801  {
37802  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
37803  goto usage;
37804  }
37805  pPars->nConfLimit = atoi(argv[globalUtilOptind]);
37806  globalUtilOptind++;
37807  if ( pPars->nConfLimit < 0 )
37808  goto usage;
37809  break;
37810  case 'L':
37811  if ( globalUtilOptind >= argc )
37812  {
37813  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
37814  goto usage;
37815  }
37816  pPars->nLearnedStart = atoi(argv[globalUtilOptind]);
37817  globalUtilOptind++;
37818  if ( pPars->nLearnedStart < 0 )
37819  goto usage;
37820  break;
37821  case 'D':
37822  if ( globalUtilOptind >= argc )
37823  {
37824  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
37825  goto usage;
37826  }
37827  pPars->nLearnedDelta = atoi(argv[globalUtilOptind]);
37828  globalUtilOptind++;
37829  if ( pPars->nLearnedDelta < 0 )
37830  goto usage;
37831  break;
37832  case 'E':
37833  if ( globalUtilOptind >= argc )
37834  {
37835  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
37836  goto usage;
37837  }
37838  pPars->nLearnedPerce = atoi(argv[globalUtilOptind]);
37839  globalUtilOptind++;
37840  if ( pPars->nLearnedPerce < 0 )
37841  goto usage;
37842  break;
37843  case 'T':
37844  if ( globalUtilOptind >= argc )
37845  {
37846  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
37847  goto usage;
37848  }
37849  pPars->nTimeOut = atoi(argv[globalUtilOptind]);
37850  globalUtilOptind++;
37851  if ( pPars->nTimeOut < 0 )
37852  goto usage;
37853  break;
37854  case 'R':
37855  if ( globalUtilOptind >= argc )
37856  {
37857  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
37858  goto usage;
37859  }
37860  pPars->nRatioMin = atoi(argv[globalUtilOptind]);
37861  globalUtilOptind++;
37862  if ( pPars->nRatioMin < 0 )
37863  goto usage;
37864  break;
37865  case 'Q':
37866  if ( globalUtilOptind >= argc )
37867  {
37868  Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
37869  goto usage;
37870  }
37871  pPars->nRatioMin2 = atoi(argv[globalUtilOptind]);
37872  globalUtilOptind++;
37873  if ( pPars->nRatioMin2 < 0 )
37874  goto usage;
37875  break;
37876  case 'P':
37877  if ( globalUtilOptind >= argc )
37878  {
37879  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
37880  goto usage;
37881  }
37882  pPars->nRatioMax = atoi(argv[globalUtilOptind]);
37883  globalUtilOptind++;
37884  if ( pPars->nRatioMax < 0 )
37885  goto usage;
37886  break;
37887  case 'B':
37888  if ( globalUtilOptind >= argc )
37889  {
37890  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
37891  goto usage;
37892  }
37893  pPars->nFramesNoChangeLim = atoi(argv[globalUtilOptind]);
37894  globalUtilOptind++;
37895  if ( pPars->nFramesNoChangeLim < 0 )
37896  goto usage;
37897  break;
37898  case 'A':
37899  if ( globalUtilOptind >= argc )
37900  {
37901  Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
37902  goto usage;
37903  }
37904  pPars->pFileVabs = argv[globalUtilOptind];
37905  globalUtilOptind++;
37906  break;
37907  case 't':
37908  pPars->fUseTermVars ^= 1;
37909  break;
37910  case 'f':
37911  pPars->fPropFanout ^= 1;
37912  break;
37913  case 'a':
37914  pPars->fAddLayer ^= 1;
37915  break;
37916  case 'r':
37917  pPars->fNewRefine ^= 1;
37918  break;
37919  case 'd':
37920  pPars->fDumpVabs ^= 1;
37921  break;
37922  case 'm':
37923  pPars->fDumpMabs ^= 1;
37924  break;
37925  case 'n':
37926  fNewAlgo ^= 1;
37927  break;
37928  case 's':
37929  pPars->fUseSkip ^= 1;
37930  break;
37931  case 'c':
37932  pPars->fUseSimple ^= 1;
37933  break;
37934  case 'b':
37935  pPars->fSkipHash ^= 1;
37936  break;
37937  case 'p':
37938  pPars->fUseFullProof ^= 1;
37939  break;
37940  case 'q':
37941  pPars->fCallProver ^= 1;
37942  break;
37943  case 'u':
37944  pPars->fSimpProver ^= 1;
37945  break;
37946  case 'v':
37947  pPars->fVerbose ^= 1;
37948  break;
37949  case 'w':
37950  pPars->fVeryVerbose ^= 1;
37951  break;
37952  case 'h':
37953  goto usage;
37954  default:
37955  goto usage;
37956  }
37957  }
37958  if ( pAbc->pGia == NULL )
37959  {
37960  Abc_Print( -1, "There is no AIG.\n" );
37961  return 0;
37962  }
37963 /*
37964  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
37965  {
37966  Abc_Print( -1, "The network is combinational.\n" );
37967  return 0;
37968  }
37969 */
37970  if ( Gia_ManPoNum(pAbc->pGia) > 1 )
37971  {
37972  Abc_Print( 1, "The network is more than one PO (run \"orpos\").\n" );
37973  return 0;
37974  }
37975  if ( pPars->nFramesMax < 0 )
37976  {
37977  Abc_Print( 1, "The number of starting frames should be a positive integer.\n" );
37978  return 0;
37979  }
37980  if ( pPars->nFramesMax && pPars->nFramesStart > pPars->nFramesMax )
37981  {
37982  Abc_Print( 1, "The starting frame is larger than the max number of frames.\n" );
37983  return 0;
37984  }
37985  if ( fNewAlgo )
37986  pAbc->Status = Gia_ManPerformGla( pAbc->pGia, pPars );
37987  else
37988  pAbc->Status = Gia_ManPerformGlaOld( pAbc->pGia, pPars, 0 );
37989  pAbc->nFrames = pPars->iFrame;
37990  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
37991  return 0;
37992 
37993 usage:
37994  Abc_Print( -2, "usage: &gla [-FSCLDETRQPB num] [-A file] [-fardmnscbpquwvh]\n" );
37995  Abc_Print( -2, "\t fixed-time-frame gate-level proof- and cex-based abstraction\n" );
37996  Abc_Print( -2, "\t-F num : the max number of timeframes to unroll [default = %d]\n", pPars->nFramesMax );
37997  Abc_Print( -2, "\t-S num : the starting time frame (0=unused) [default = %d]\n", pPars->nFramesStart );
37998  Abc_Print( -2, "\t-C num : the max number of SAT solver conflicts (0=unused) [default = %d]\n", pPars->nConfLimit );
37999  Abc_Print( -2, "\t-L num : the max number of learned clauses to keep (0=unused) [default = %d]\n", pPars->nLearnedStart );
38000  Abc_Print( -2, "\t-D num : delta value for learned clause removal [default = %d]\n", pPars->nLearnedDelta );
38001  Abc_Print( -2, "\t-E num : ratio percentage for learned clause removal [default = %d]\n", pPars->nLearnedPerce );
38002  Abc_Print( -2, "\t-T num : an approximate timeout, in seconds [default = %d]\n", pPars->nTimeOut );
38003  Abc_Print( -2, "\t-R num : stop when abstraction size exceeds num %% (0<=num<=100) [default = %d]\n", pPars->nRatioMin );
38004  Abc_Print( -2, "\t-Q num : stop when abstraction size exceeds num %% during refinement (0<=num<=100) [default = %d]\n", pPars->nRatioMin2 );
38005  Abc_Print( -2, "\t-P num : maximum percentage of added objects before a restart (0<=num<=100) [default = %d]\n", pPars->nRatioMax );
38006  Abc_Print( -2, "\t-B num : the number of stable frames to call prover or dump abstraction [default = %d]\n", pPars->nFramesNoChangeLim );
38007  Abc_Print( -2, "\t-A file : file name for dumping abstrated model [default = \"glabs.aig\"]\n" );
38008  Abc_Print( -2, "\t-f : toggle propagating fanout implications [default = %s]\n", pPars->fPropFanout? "yes": "no" );
38009  Abc_Print( -2, "\t-a : toggle refinement by adding one layers of gates [default = %s]\n", pPars->fAddLayer? "yes": "no" );
38010  Abc_Print( -2, "\t-r : toggle using improved refinement heuristics [default = %s]\n", pPars->fNewRefine? "yes": "no" );
38011  Abc_Print( -2, "\t-d : toggle dumping abstracted model into a file [default = %s]\n", pPars->fDumpVabs? "yes": "no" );
38012  Abc_Print( -2, "\t-m : toggle dumping abstraction map into a file [default = %s]\n", pPars->fDumpMabs? "yes": "no" );
38013  Abc_Print( -2, "\t-n : toggle using new algorithms [default = %s]\n", fNewAlgo? "yes": "no" );
38014  Abc_Print( -2, "\t-s : toggle skipping previously proved timeframes [default = %s]\n", pPars->fUseSkip? "yes": "no" );
38015  Abc_Print( -2, "\t-c : toggle using naive (2-input AND node) CNF encoding [default = %s]\n", pPars->fUseSimple? "yes": "no" );
38016  Abc_Print( -2, "\t-b : toggle CNF construction without hashing [default = %s]\n", pPars->fSkipHash? "yes": "no" );
38017  Abc_Print( -2, "\t-p : toggle using full-proof for UNSAT cores [default = %s]\n", pPars->fUseFullProof? "yes": "no" );
38018  Abc_Print( -2, "\t-q : toggle calling the prover [default = %s]\n", pPars->fCallProver? "yes": "no" );
38019  Abc_Print( -2, "\t-u : toggle enabling simplifation before calling the prover [default = %s]\n", pPars->fSimpProver? "yes": "no" );
38020  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
38021  Abc_Print( -2, "\t-w : toggle printing more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
38022  Abc_Print( -2, "\t-h : print the command usage\n");
38023  return 1;
38024 }
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
int Gia_ManPerformGla(Gia_Man_t *p, Abs_Par_t *pPars)
Definition: absGla.c:1500
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
void Abs_ParSetDefaults(Abs_Par_t *p)
DECLARATIONS ///.
Definition: absUtil.c:44
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Gia_ManPerformGlaOld(Gia_Man_t *p, Abs_Par_t *pPars, int fStartVta)
Definition: absGlaOld.c:1638
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t
INCLUDES ///.
Definition: abs.h:46
int Abc_CommandAbc9Gla2Fla ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 38411 of file abc.c.

38412 {
38413  int c, fVerbose = 0;
38415  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
38416  {
38417  switch ( c )
38418  {
38419  case 'v':
38420  fVerbose ^= 1;
38421  break;
38422  case 'h':
38423  goto usage;
38424  default:
38425  goto usage;
38426  }
38427  }
38428  if ( pAbc->pGia == NULL )
38429  {
38430  Abc_Print( -1, "Abc_CommandAbc9Gla2Fla(): There is no AIG.\n" );
38431  return 0;
38432  }
38433  if ( pAbc->pGia->vGateClasses == NULL )
38434  {
38435  Abc_Print( -1, "Abc_CommandAbc9Gla2Fla(): There is no gate-level abstraction is defined.\n" );
38436  return 0;
38437  }
38438  Vec_IntFreeP( &pAbc->pGia->vFlopClasses );
38439  pAbc->pGia->vFlopClasses = Gia_GlaConvertToFla( pAbc->pGia, pAbc->pGia->vGateClasses );
38440  Vec_IntFreeP( &pAbc->pGia->vGateClasses );
38441  return 0;
38442 
38443 usage:
38444  Abc_Print( -2, "usage: &gla_fla [-vh]\n" );
38445  Abc_Print( -2, "\t maps gate-level into flop-level abstraction\n" );
38446  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
38447  Abc_Print( -2, "\t-h : print the command usage\n");
38448  return 1;
38449 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Vec_Int_t * Gia_GlaConvertToFla(Gia_Man_t *p, Vec_Int_t *vGla)
Definition: absUtil.c:208
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Gla2Vta ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 38291 of file abc.c.

38292 {
38293  int c, fVerbose = 0;
38294  int nFrames = pAbc->nFrames;
38296  while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
38297  {
38298  switch ( c )
38299  {
38300  case 'F':
38301  if ( globalUtilOptind >= argc )
38302  {
38303  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
38304  goto usage;
38305  }
38306  nFrames = atoi(argv[globalUtilOptind]);
38307  globalUtilOptind++;
38308  if ( nFrames < 0 )
38309  goto usage;
38310  break;
38311  case 'v':
38312  fVerbose ^= 1;
38313  break;
38314  case 'h':
38315  goto usage;
38316  default:
38317  goto usage;
38318  }
38319  }
38320  if ( pAbc->pGia == NULL )
38321  {
38322  Abc_Print( -1, "Abc_CommandAbc9Gla2Vta(): There is no AIG.\n" );
38323  return 0;
38324  }
38325  if ( pAbc->pGia->vGateClasses == NULL )
38326  {
38327  Abc_Print( -1, "Abc_CommandAbc9Gla2Vta(): There is no gate-level abstraction is defined.\n" );
38328  return 0;
38329  }
38330  if ( pAbc->nFrames < 1 )
38331  {
38332  Abc_Print( -1, "Abc_CommandAbc9Gla2Vta(): The number of timeframes (%d) should be a positive integer.\n", nFrames );
38333  return 0;
38334  }
38335  Vec_IntFreeP( &pAbc->pGia->vObjClasses );
38336  pAbc->pGia->vObjClasses = Gia_VtaConvertFromGla( pAbc->pGia, pAbc->pGia->vGateClasses, nFrames );
38337  Vec_IntFreeP( &pAbc->pGia->vGateClasses );
38338  return 0;
38339 
38340 usage:
38341  Abc_Print( -2, "usage: &gla_vta [-F num] [-vh]\n" );
38342  Abc_Print( -2, "\t maps fixed- into variable-time-frame gate-level abstraction\n" );
38343  Abc_Print( -2, "\t-F num : timeframes in the resulting variable-time-frame abstraction [default = %d]\n", nFrames );
38344  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
38345  Abc_Print( -2, "\t-h : print the command usage\n");
38346  return 1;
38347 }
Vec_Int_t * Gia_VtaConvertFromGla(Gia_Man_t *p, Vec_Int_t *vGla, int nFrames)
Definition: absUtil.c:111
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9GlaDerive ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37528 of file abc.c.

37529 {
37530  Gia_Man_t * pTemp = NULL;
37531  int c, fVerbose = 0;
37533  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
37534  {
37535  switch ( c )
37536  {
37537  case 'v':
37538  fVerbose ^= 1;
37539  break;
37540  case 'h':
37541  goto usage;
37542  default:
37543  goto usage;
37544  }
37545  }
37546  if ( pAbc->pGia == NULL )
37547  {
37548  Abc_Print( -1, "Abc_CommandAbc9GlaDerive(): There is no AIG.\n" );
37549  return 1;
37550  }
37551 /*
37552  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
37553  {
37554  Abc_Print( -1, "The network is combinational.\n" );
37555  return 0;
37556  }
37557 */
37558  if ( pAbc->pGia->vGateClasses == NULL )
37559  {
37560  Abc_Print( -1, "Abstraction gate map is missing.\n" );
37561  return 0;
37562  }
37563  pTemp = Gia_ManDupAbsGates( pAbc->pGia, pAbc->pGia->vGateClasses );
37564  Gia_ManStop( pTemp );
37565  pTemp = Gia_ManDupAbsGates( pAbc->pGia, pAbc->pGia->vGateClasses );
37566  Abc_FrameUpdateGia( pAbc, pTemp );
37567 // Abc_Print( 1,"This command is currently not enabled.\n" );
37568  return 0;
37569 
37570 usage:
37571  Abc_Print( -2, "usage: &gla_derive [-vh]\n" );
37572  Abc_Print( -2, "\t derives abstracted model using the pre-computed gate map\n" );
37573  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37574  Abc_Print( -2, "\t-h : print the command usage\n");
37575  return 1;
37576 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * Gia_ManDupAbsGates(Gia_Man_t *p, Vec_Int_t *vGateClasses)
Definition: absDup.c:220
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9GlaRefine ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37589 of file abc.c.

37590 {
37591  extern int Gia_ManNewRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int iFrameExtra, int fVerbose );
37592  int iFrameStart = 0;
37593  int iFrameExtra = 0;
37594  int fMinCut = 1;
37595  int c, fVerbose = 0;
37597  while ( ( c = Extra_UtilGetopt( argc, argv, "FGmvh" ) ) != EOF )
37598  {
37599  switch ( c )
37600  {
37601  case 'F':
37602  if ( globalUtilOptind >= argc )
37603  {
37604  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
37605  goto usage;
37606  }
37607  iFrameStart = atoi(argv[globalUtilOptind]);
37608  globalUtilOptind++;
37609  if ( iFrameStart < 0 )
37610  goto usage;
37611  break;
37612  case 'G':
37613  if ( globalUtilOptind >= argc )
37614  {
37615  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
37616  goto usage;
37617  }
37618  iFrameExtra = atoi(argv[globalUtilOptind]);
37619  globalUtilOptind++;
37620  if ( iFrameExtra < 0 )
37621  goto usage;
37622  break;
37623  case 'm':
37624  fMinCut ^= 1;
37625  break;
37626  case 'v':
37627  fVerbose ^= 1;
37628  break;
37629  case 'h':
37630  goto usage;
37631  default:
37632  goto usage;
37633  }
37634  }
37635  if ( pAbc->pGia == NULL )
37636  {
37637  Abc_Print( -1, "Abc_CommandAbc9GlaRefine(): There is no AIG.\n" );
37638  return 1;
37639  }
37640  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
37641  {
37642  Abc_Print( -1, "The network is combinational.\n" );
37643  return 0;
37644  }
37645  if ( pAbc->pCex == NULL )
37646  {
37647  Abc_Print( -1, "Abc_CommandAbc9GlaRefine(): There is no counter-example.\n" );
37648  return 1;
37649  }
37650  pAbc->Status = Gia_ManNewRefine( pAbc->pGia, pAbc->pCex, iFrameStart, iFrameExtra, fVerbose );
37651  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
37652  return 0;
37653 
37654 usage:
37655  Abc_Print( -2, "usage: &gla_refine [-FG num] [-vh]\n" );
37656  Abc_Print( -2, "\t refines the pre-computed gate map using the counter-example\n" );
37657  Abc_Print( -2, "\t-F num : starting timeframe for suffix refinement [default = %d]\n", iFrameStart );
37658  Abc_Print( -2, "\t-G num : the number of additional timeframes to try [default = %d]\n", iFrameExtra );
37659 // Abc_Print( -2, "\t-m : toggle using min-cut to derive the refinements [default = %s]\n", fMinCut? "yes": "no" );
37660  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37661  Abc_Print( -2, "\t-h : print the command usage\n");
37662  return 1;
37663 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
int Gia_ManNewRefine(Gia_Man_t *p, Abc_Cex_t *pCex, int iFrameStart, int iFrameExtra, int fVerbose)
Definition: absOut.c:373
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9GlaShrink ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37676 of file abc.c.

37677 {
37678  int fUsePdr = 0;
37679  int fUseSat = 1;
37680  int fUseBdd = 0;
37681  int nFrameMax = 0;
37682  int nTimeOut = 0;
37683  int c, fVerbose = 0;
37685  while ( ( c = Extra_UtilGetopt( argc, argv, "FTpsbvh" ) ) != EOF )
37686  {
37687  switch ( c )
37688  {
37689  case 'F':
37690  if ( globalUtilOptind >= argc )
37691  {
37692  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
37693  goto usage;
37694  }
37695  nFrameMax = atoi(argv[globalUtilOptind]);
37696  globalUtilOptind++;
37697  if ( nFrameMax < 0 )
37698  goto usage;
37699  break;
37700  case 'T':
37701  if ( globalUtilOptind >= argc )
37702  {
37703  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
37704  goto usage;
37705  }
37706  nTimeOut = atoi(argv[globalUtilOptind]);
37707  globalUtilOptind++;
37708  if ( nTimeOut < 0 )
37709  goto usage;
37710  break;
37711  case 'p':
37712  fUsePdr ^= 1;
37713  break;
37714  case 's':
37715  fUseSat ^= 1;
37716  break;
37717  case 'b':
37718  fUseBdd ^= 1;
37719  break;
37720  case 'v':
37721  fVerbose ^= 1;
37722  break;
37723  case 'h':
37724  goto usage;
37725  default:
37726  goto usage;
37727  }
37728  }
37729  if ( pAbc->pGia == NULL )
37730  {
37731  Abc_Print( -1, "Abc_CommandAbc9GlaShrink(): There is no AIG.\n" );
37732  return 1;
37733  }
37734  if ( pAbc->pGia->vGateClasses == NULL )
37735  {
37736  Abc_Print( -1, "Abc_CommandAbc9GlaShrink(): There is no gate-level abstraction.\n" );
37737  return 0;
37738  }
37739  Gia_ManShrinkGla( pAbc->pGia, nFrameMax, nTimeOut, fUsePdr, fUseSat, fUseBdd, fVerbose );
37740  return 0;
37741 
37742 usage:
37743  Abc_Print( -2, "usage: &gla_shrink [-FT num] [-psbvh]\n" );
37744  Abc_Print( -2, "\t shrinks the abstraction by removing redundant objects\n" );
37745  Abc_Print( -2, "\t-F num : the maximum timeframe to check to [default = %d]\n", nFrameMax );
37746  Abc_Print( -2, "\t-T num : the timeout per call, in seconds [default = %d]\n", nTimeOut );
37747  Abc_Print( -2, "\t-p : toggle using PDR for checking [default = %s]\n", fUsePdr? "yes": "no" );
37748  Abc_Print( -2, "\t-s : toggle using BMC for checking [default = %s]\n", fUseSat? "yes": "no" );
37749  Abc_Print( -2, "\t-b : toggle using BDDs for checking [default = %s]\n", fUseBdd? "yes": "no" );
37750  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
37751  Abc_Print( -2, "\t-h : print the command usage\n");
37752  return 1;
37753 }
Gia_Man_t * Gia_ManShrinkGla(Gia_Man_t *p, int nFrameMax, int nTimeOut, int fUsePdr, int fUseSat, int fUseBdd, int fVerbose)
Definition: absIter.c:67
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9GroupProve ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35345 of file abc.c.

35346 {
35347  extern Vec_Int_t * Gia_ManGroupProve( Gia_Man_t * p, char * pCommLine, int nGroupSize, int fVerbose );
35348  Vec_Int_t * vStatus;
35349  char * pCommLine = NULL;
35350  int c, nGroupSize = 1, fVerbose = 0;
35352  while ( ( c = Extra_UtilGetopt( argc, argv, "GSvh" ) ) != EOF )
35353  {
35354  switch ( c )
35355  {
35356  case 'G':
35357  if ( globalUtilOptind >= argc )
35358  {
35359  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
35360  goto usage;
35361  }
35362  nGroupSize = atoi(argv[globalUtilOptind]);
35363  globalUtilOptind++;
35364  if ( nGroupSize <= 0 )
35365  goto usage;
35366  break;
35367  case 'S':
35368  if ( globalUtilOptind >= argc )
35369  {
35370  Abc_Print( -1, "Command line switch \"-S\" should be followed by a file name.\n" );
35371  goto usage;
35372  }
35373  pCommLine = argv[globalUtilOptind];
35374  globalUtilOptind++;
35375  case 'v':
35376  fVerbose ^= 1;
35377  break;
35378  case 'h':
35379  goto usage;
35380  default:
35381  goto usage;
35382  }
35383  }
35384  if ( pAbc->pGia == NULL )
35385  {
35386  Abc_Print( -1, "Abc_CommandAbc9GroupProve(): There is no AIG.\n" );
35387  return 1;
35388  }
35389  if ( pCommLine == NULL )
35390  {
35391  Abc_Print( -1, "Abc_CommandAbc9GroupProve(): Command line is not given.\n" );
35392  return 1;
35393  }
35394  vStatus = Gia_ManGroupProve( pAbc->pGia, pCommLine, nGroupSize, fVerbose );
35395  Vec_IntFree( vStatus );
35396  return 0;
35397 
35398 usage:
35399  Abc_Print( -2, "usage: &gprove [-GS num] [-vh]\n" );
35400  Abc_Print( -2, "\t proves multi-output testcase by splitting outputs into groups\n" );
35401  Abc_Print( -2, "\t (currently, group size more than one works only for \"bmc3\" and \"pdr\")\n" );
35402  Abc_Print( -2, "\t-G num : the size of one group [default = %d]\n", nGroupSize );
35403  Abc_Print( -2, "\t-S str : the command line to be executed for each group [default = %s]\n", pCommLine ? pCommLine : "none" );
35404  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
35405  Abc_Print( -2, "\t-h : print the command usage\n");
35406  return 1;
35407 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Vec_Int_t * Gia_ManGroupProve(Gia_Man_t *pInit, char *pCommLine, int nGroupSize, int fVerbose)
Definition: giaUtil.c:1763
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
int Abc_CommandAbc9ICheck ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36003 of file abc.c.

36004 {
36005  int c, nFramesMax = 1, nTimeOut = 0, fEmpty = 0, fSearch = 1, fReverse = 0, fDump = 0, fVerbose = 0;
36007  while ( ( c = Extra_UtilGetopt( argc, argv, "MTesrdvh" ) ) != EOF )
36008  {
36009  switch ( c )
36010  {
36011  case 'M':
36012  if ( globalUtilOptind >= argc )
36013  {
36014  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
36015  goto usage;
36016  }
36017  nFramesMax = atoi(argv[globalUtilOptind]);
36018  globalUtilOptind++;
36019  if ( nFramesMax <= 0 )
36020  goto usage;
36021  break;
36022  case 'T':
36023  if ( globalUtilOptind >= argc )
36024  {
36025  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
36026  goto usage;
36027  }
36028  nTimeOut = atoi(argv[globalUtilOptind]);
36029  globalUtilOptind++;
36030  if ( nTimeOut < 0 )
36031  goto usage;
36032  break;
36033  case 'e':
36034  fEmpty ^= 1;
36035  break;
36036  case 's':
36037  fSearch ^= 1;
36038  break;
36039  case 'r':
36040  fReverse ^= 1;
36041  break;
36042  case 'd':
36043  fDump ^= 1;
36044  break;
36045  case 'v':
36046  fVerbose ^= 1;
36047  break;
36048  case 'h':
36049  goto usage;
36050  default:
36051  goto usage;
36052  }
36053  }
36054  if ( pAbc->pGia == NULL )
36055  {
36056  Abc_Print( -1, "Abc_CommandAbc9ICheck(): There is no AIG.\n" );
36057  return 0;
36058  }
36059  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
36060  {
36061  Abc_Print( -1, "Abc_CommandAbc9ICheck(): The AIG is combinational.\n" );
36062  return 0;
36063  }
36064  Vec_IntFreeP( &pAbc->vIndFlops );
36065  if ( fSearch )
36066  pAbc->vIndFlops = Bmc_PerformISearch( pAbc->pGia, nFramesMax, nTimeOut, fReverse, fDump, fVerbose );
36067  else
36068  Bmc_PerformICheck( pAbc->pGia, nFramesMax, nTimeOut, fEmpty, fVerbose );
36069  pAbc->nIndFrames = pAbc->vIndFlops ? nFramesMax : 0;
36070  return 0;
36071 
36072 usage:
36073  Abc_Print( -2, "usage: &icheck [-MT num] [-esrdvh]\n" );
36074  Abc_Print( -2, "\t performs specialized induction check\n" );
36075  Abc_Print( -2, "\t-M num : the number of timeframes used for induction [default = %d]\n", nFramesMax );
36076  Abc_Print( -2, "\t-T num : approximate global runtime limit in seconds [default = %d]\n", nTimeOut );
36077  Abc_Print( -2, "\t-e : toggle using empty set of next-state functions [default = %s]\n", fEmpty? "yes": "no" );
36078  Abc_Print( -2, "\t-s : toggle searching for a minimal subset [default = %s]\n", fSearch? "yes": "no" );
36079  Abc_Print( -2, "\t-r : toggle searching in the reverse order [default = %s]\n", fReverse? "yes": "no" );
36080  Abc_Print( -2, "\t-d : toggle printing out the resulting set [default = %s]\n", fDump? "yes": "no" );
36081  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
36082  Abc_Print( -2, "\t-h : print the command usage\n");
36083  return 1;
36084 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Vec_Int_t * Bmc_PerformISearch(Gia_Man_t *p, int nFramesMax, int nTimeOut, int fReverse, int fDump, int fVerbose)
Definition: bmcICheck.c:417
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Bmc_PerformICheck(Gia_Man_t *p, int nFramesMax, int nTimeOut, int fEmpty, int fVerbose)
Definition: bmcICheck.c:196
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9If ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31693 of file abc.c.

31694 {
31695  char Buffer[200];
31696  char LutSize[200];
31697  Gia_Man_t * pNew;
31698  If_Par_t Pars, * pPars = &Pars;
31699  int c;
31700  // set defaults
31701  Gia_ManSetIfParsDefault( pPars );
31702  if ( pAbc->pLibLut == NULL )
31703  {
31704  Abc_Print( -1, "LUT library is not given. Using default LUT library.\n" );
31705  pAbc->pLibLut = If_LibLutSetSimple( 6 );
31706  }
31707  pPars->pLutLib = (If_LibLut_t *)pAbc->pLibLut;
31709  while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRDEWSTqalepmrsdbgxyojfuikztncvh" ) ) != EOF )
31710  {
31711  switch ( c )
31712  {
31713  case 'K':
31714  if ( globalUtilOptind >= argc )
31715  {
31716  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
31717  goto usage;
31718  }
31719  pPars->nLutSize = atoi(argv[globalUtilOptind]);
31720  globalUtilOptind++;
31721  if ( pPars->nLutSize < 0 )
31722  goto usage;
31723  // if the LUT size is specified, disable library
31724  pPars->pLutLib = NULL;
31725  break;
31726  case 'C':
31727  if ( globalUtilOptind >= argc )
31728  {
31729  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
31730  goto usage;
31731  }
31732  pPars->nCutsMax = atoi(argv[globalUtilOptind]);
31733  globalUtilOptind++;
31734  if ( pPars->nCutsMax < 0 )
31735  goto usage;
31736  break;
31737  case 'F':
31738  if ( globalUtilOptind >= argc )
31739  {
31740  Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
31741  goto usage;
31742  }
31743  pPars->nFlowIters = atoi(argv[globalUtilOptind]);
31744  globalUtilOptind++;
31745  if ( pPars->nFlowIters < 0 )
31746  goto usage;
31747  break;
31748  case 'A':
31749  if ( globalUtilOptind >= argc )
31750  {
31751  Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
31752  goto usage;
31753  }
31754  pPars->nAreaIters = atoi(argv[globalUtilOptind]);
31755  globalUtilOptind++;
31756  if ( pPars->nAreaIters < 0 )
31757  goto usage;
31758  break;
31759  case 'G':
31760  if ( globalUtilOptind >= argc )
31761  {
31762  Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer no less than 3.\n" );
31763  goto usage;
31764  }
31765  pPars->nGateSize = atoi(argv[globalUtilOptind]);
31766  globalUtilOptind++;
31767  if ( pPars->nGateSize < 2 )
31768  goto usage;
31769  break;
31770  case 'R':
31771  if ( globalUtilOptind >= argc )
31772  {
31773  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
31774  return 0;
31775  }
31776  pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
31777  globalUtilOptind++;
31778  if ( pPars->nRelaxRatio < 0 )
31779  goto usage;
31780  break;
31781  case 'T':
31782  if ( globalUtilOptind >= argc )
31783  {
31784  Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer 0,1,or 2.\n" );
31785  goto usage;
31786  }
31787  pPars->nStructType = atoi(argv[globalUtilOptind]);
31788  globalUtilOptind++;
31789  if ( pPars->nStructType < 0 || pPars->nStructType > 2 )
31790  goto usage;
31791  break;
31792  case 'D':
31793  if ( globalUtilOptind >= argc )
31794  {
31795  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
31796  goto usage;
31797  }
31798  pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
31799  globalUtilOptind++;
31800  if ( pPars->DelayTarget <= 0.0 )
31801  goto usage;
31802  break;
31803  case 'E':
31804  if ( globalUtilOptind >= argc )
31805  {
31806  Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
31807  goto usage;
31808  }
31809  pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
31810  globalUtilOptind++;
31811  if ( pPars->Epsilon < 0.0 || pPars->Epsilon > 1.0 )
31812  goto usage;
31813  break;
31814  case 'W':
31815  if ( globalUtilOptind >= argc )
31816  {
31817  Abc_Print( -1, "Command line switch \"-W\" should be followed by a floating point number.\n" );
31818  goto usage;
31819  }
31820  pPars->WireDelay = (float)atof(argv[globalUtilOptind]);
31821  globalUtilOptind++;
31822  if ( pPars->WireDelay < 0.0 )
31823  goto usage;
31824  break;
31825  case 'S':
31826  if ( globalUtilOptind >= argc )
31827  {
31828  Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
31829  goto usage;
31830  }
31831  pPars->pLutStruct = argv[globalUtilOptind];
31832  globalUtilOptind++;
31833  if ( strlen(pPars->pLutStruct) != 2 && strlen(pPars->pLutStruct) != 3 )
31834  {
31835  Abc_Print( -1, "Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
31836  goto usage;
31837  }
31838  break;
31839  case 'q':
31840  pPars->fPreprocess ^= 1;
31841  break;
31842  case 'a':
31843  pPars->fArea ^= 1;
31844  break;
31845  case 'r':
31846  pPars->fExpRed ^= 1;
31847  break;
31848  case 'l':
31849  pPars->fLatchPaths ^= 1;
31850  break;
31851  case 'e':
31852  pPars->fEdge ^= 1;
31853  break;
31854  case 'p':
31855  pPars->fPower ^= 1;
31856  break;
31857  case 'm':
31858  pPars->fCutMin ^= 1;
31859  break;
31860  case 's':
31861  pPars->fDelayOptLut ^= 1;
31862  break;
31863  case 'd':
31864  pPars->fBidec ^= 1;
31865  break;
31866  case 'b':
31867  pPars->fUseBat ^= 1;
31868  break;
31869  case 'g':
31870  pPars->fDelayOpt ^= 1;
31871  break;
31872  case 'x':
31873  pPars->fDsdBalance ^= 1;
31874  break;
31875  case 'y':
31876  pPars->fUserRecLib ^= 1;
31877  break;
31878  case 'o':
31879  pPars->fUseBuffs ^= 1;
31880  break;
31881  case 'j':
31882  pPars->fEnableCheck07 ^= 1;
31883  break;
31884  case 'f':
31885  pPars->fEnableCheck75 ^= 1;
31886  break;
31887  case 'u':
31888  pPars->fEnableCheck75u ^= 1;
31889  break;
31890  case 'i':
31891  pPars->fUseCofVars ^= 1;
31892  break;
31893  case 'k':
31894  pPars->fUseDsdTune ^= 1;
31895  break;
31896  case 'z':
31897  pPars->fDeriveLuts ^= 1;
31898  break;
31899  case 't':
31900  pPars->fDoAverage ^= 1;
31901  break;
31902  case 'n':
31903  pPars->fUseDsd ^= 1;
31904  break;
31905  case 'c':
31906  pPars->fUseTtPerm ^= 1;
31907  break;
31908  case 'v':
31909  pPars->fVerbose ^= 1;
31910  break;
31911  case 'h':
31912  default:
31913  goto usage;
31914  }
31915  }
31916 
31917  if ( pAbc->pGia == NULL )
31918  {
31919  Abc_Print( -1, "Empty GIA network.\n" );
31920  return 1;
31921  }
31922  if ( Gia_ManBufNum(pAbc->pGia) )
31923  {
31924  Abc_Print( -1, "This command does not work with barrier buffers.\n" );
31925  return 1;
31926  }
31927  if ( Gia_ManHasMapping(pAbc->pGia) )
31928  {
31929  Abc_Print( -1, "Current AIG has mapping. Run \"&st\".\n" );
31930  return 1;
31931  }
31932 
31933  if ( pPars->nLutSize == -1 )
31934  {
31935  if ( pPars->pLutLib == NULL )
31936  {
31937  Abc_Print( -1, "The LUT library is not given.\n" );
31938  return 1;
31939  }
31940  // get LUT size from the library
31941  pPars->nLutSize = pPars->pLutLib->LutMax;
31942  // if variable pin delay, force truth table computation
31943 // if ( pPars->pLutLib->fVarPinDelays )
31944 // pPars->fTruth = 1;
31945  }
31946 
31947  if ( pPars->nLutSize < 2 || pPars->nLutSize > IF_MAX_LUTSIZE )
31948  {
31949  Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
31950  return 1;
31951  }
31952 
31953  if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
31954  {
31955  Abc_Print( -1, "Incorrect number of cuts.\n" );
31956  return 1;
31957  }
31958 
31959  // enable truth table computation if choices are selected
31960  if ( Gia_ManHasChoices(pAbc->pGia) )
31961  {
31962 // if ( !Abc_FrameReadFlag("silentmode") )
31963 // Abc_Print( 0, "Performing LUT mapping with choices.\n" );
31964  pPars->fExpRed = 0;
31965  }
31966 
31967  if ( pPars->fUseBat )
31968  {
31969  if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
31970  {
31971  Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
31972  return 1;
31973  }
31974  pPars->fCutMin = 1;
31975  }
31976 
31977  if ( pPars->fEnableCheck07 + pPars->fUseCofVars + pPars->fUseDsdTune + pPars->fEnableCheck75 + pPars->fEnableCheck75u + (pPars->pLutStruct != NULL) > 1 )
31978  {
31979  Abc_Print( -1, "Only one additional check can be performed at the same time.\n" );
31980  return 1;
31981  }
31982  if ( pPars->fEnableCheck07 )
31983  {
31984  if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
31985  {
31986  Abc_Print( -1, "This feature only works for {6,7}-LUTs.\n" );
31987  return 1;
31988  }
31990  pPars->fCutMin = 1;
31991  }
31992  if ( pPars->fUseCofVars )
31993  {
31994  if ( !(pPars->nLutSize & 1) )
31995  {
31996  Abc_Print( -1, "This feature only works for odd-sized LUTs.\n" );
31997  return 1;
31998  }
31999  pPars->fCutMin = 1;
32000  }
32001  if ( pPars->fUseDsdTune )
32002  {
32003  If_DsdMan_t * pDsdMan = (If_DsdMan_t *)Abc_FrameReadManDsd();
32004  if ( pDsdMan == NULL )
32005  {
32006  Abc_Print( -1, "DSD manager is not available.\n" );
32007  return 1;
32008  }
32009  if ( pPars->nLutSize > If_DsdManVarNum(pDsdMan) )
32010  {
32011  Abc_Print( -1, "LUT size (%d) is more than the number of variables in the DSD manager (%d).\n", pPars->nLutSize, If_DsdManVarNum(pDsdMan) );
32012  return 1;
32013  }
32014  if ( pPars->fDeriveLuts && If_DsdManGetCellStr(pDsdMan) == NULL )
32015  {
32016  Abc_Print( -1, "DSD manager is not matched with any particular cell.\n" );
32017  return 1;
32018  }
32019  pPars->fCutMin = 1;
32020  pPars->fUseDsd = 1;
32021  If_DsdManSetNewAsUseless( pDsdMan );
32022  }
32023  if ( pPars->fEnableCheck75 || pPars->fEnableCheck75u )
32024  {
32025  if ( pPars->fEnableCheck75 && pPars->fEnableCheck75u )
32026  {
32027  Abc_Print( -1, "Switches -f and -u are not compatible.\n" );
32028  return 1;
32029  }
32030  if ( pPars->nLutSize < 5 || pPars->nLutSize > 8 )
32031  {
32032  Abc_Print( -1, "This feature only works for {6,7,8}-LUTs.\n" );
32033  return 1;
32034  }
32036  pPars->fCutMin = 1;
32037  }
32038  if ( pPars->pLutStruct )
32039  {
32040  if ( pPars->fDsdBalance )
32041  {
32042  Abc_Print( -1, "Incompatible options (-S and -x).\n" );
32043  return 1;
32044  }
32045  if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
32046  {
32047  Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
32048  return 1;
32049  }
32050  pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
32051  pPars->fCutMin = 1;
32052  }
32053 
32054  // enable truth table computation if cut minimization is selected
32055  if ( pPars->fCutMin || pPars->fDeriveLuts )
32056  {
32057  pPars->fTruth = 1;
32058  pPars->fExpRed = 0;
32059  if ( pPars->pLutStruct == NULL && !pPars->fUseDsdTune )
32060  pPars->fDeriveLuts = 1;
32061  }
32062  // modify the subgraph recording
32063  if ( pPars->fUserRecLib )
32064  {
32065  pPars->fTruth = 1;
32066  pPars->fCutMin = 1;
32067  pPars->fExpRed = 0;
32068  pPars->fUsePerm = 1;
32069  pPars->pLutLib = NULL;
32070  }
32071  // modify for delay optimization
32072  if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
32073  {
32074  pPars->fTruth = 1;
32075  pPars->fCutMin = 1;
32076  pPars->fExpRed = 0;
32077  pPars->fUseDsd = pPars->fDsdBalance || pPars->fDelayOptLut;
32078  pPars->pLutLib = NULL;
32079  }
32080  // modify for delay optimization
32081  if ( pPars->nGateSize > 0 )
32082  {
32083  pPars->fTruth = 1;
32084  pPars->fCutMin = 1;
32085  pPars->fExpRed = 0;
32086  pPars->fUsePerm = 1;
32087  pPars->pLutLib = NULL;
32088  pPars->nLutSize = pPars->nGateSize;
32089  }
32090 
32091  if ( pPars->fUseDsd || pPars->fUseTtPerm )
32092  {
32093  pPars->fTruth = 1;
32094  pPars->fCutMin = 1;
32095  pPars->fExpRed = 0;
32096  }
32097 
32098  if ( pPars->fUseDsd )
32099  {
32100  int LutSize = (pPars->pLutStruct && pPars->pLutStruct[2] == 0)? pPars->pLutStruct[0] - '0' : 0;
32102  if ( pPars->pLutStruct && pPars->pLutStruct[2] != 0 )
32103  {
32104  printf( "DSD only works for LUT structures XY.\n" );
32105  return 0;
32106  }
32107  if ( p && pPars->nLutSize > If_DsdManVarNum(p) )
32108  {
32109  printf( "DSD manager has incompatible number of variables.\n" );
32110  return 0;
32111  }
32112  if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
32113  {
32114  printf( "DSD manager has different LUT size.\n" );
32115  return 0;
32116  }
32117  if ( p == NULL )
32118  {
32119  if ( LutSize > DAU_MAX_VAR || pPars->nLutSize > DAU_MAX_VAR )
32120  {
32121  printf( "Size of required DSD manager (%d) exceeds the precompiled limit (%d) (change parameter DAU_MAX_VAR).\n", LutSize, DAU_MAX_VAR );
32122  return 0;
32123  }
32124  Abc_FrameSetManDsd( If_DsdManAlloc(pPars->nLutSize, LutSize) );
32125  }
32126  }
32127 
32128  if ( pPars->fUserRecLib )
32129  {
32130  if ( !Abc_NtkRecIsRunning3() )
32131  {
32132  printf( "LMS manager is not running (use \"rec_start3\").\n" );
32133  return 0;
32134  }
32135  if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
32136  {
32137  printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
32138  return 0;
32139  }
32140  }
32141 
32142  // complain if truth tables are requested but the cut size is too large
32143  if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
32144  {
32145  Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
32146  return 1;
32147  }
32148  if ( pAbc->pGia->pManTime && pAbc->pLibBox == NULL )
32149  {
32150  Abc_Print( -1, "Design has boxes but box library is not entered.\n" );
32151  return 1;
32152  }
32153 
32154  // perform mapping
32155  pNew = Gia_ManPerformMapping( pAbc->pGia, pPars );
32156  if ( pNew == NULL )
32157  {
32158  Abc_Print( -1, "Abc_CommandAbc9If(): Mapping of GIA has failed.\n" );
32159  return 1;
32160  }
32161  Abc_FrameUpdateGia( pAbc, pNew );
32162  return 0;
32163 
32164 usage:
32165  if ( pPars->DelayTarget == -1 )
32166  sprintf(Buffer, "best possible" );
32167  else
32168  sprintf(Buffer, "%.2f", pPars->DelayTarget );
32169  if ( pPars->nLutSize == -1 )
32170  sprintf(LutSize, "library" );
32171  else
32172  sprintf(LutSize, "%d", pPars->nLutSize );
32173  Abc_Print( -2, "usage: &if [-KCFAGRT num] [-DEW float] [-S str] [-qarlepmsdbgxyojfuikztncvh]\n" );
32174  Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
32175  Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
32176  Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
32177  Abc_Print( -2, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
32178  Abc_Print( -2, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
32179  Abc_Print( -2, "\t-G num : the max AND/OR gate size for mapping (0 = unused) [default = %d]\n", pPars->nGateSize );
32180  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
32181  Abc_Print( -2, "\t-T num : the type of LUT structures [default = any]\n", pPars->nStructType );
32182  Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
32183  Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
32184  Abc_Print( -2, "\t-W float : sets wire delay between adjects LUTs [default = %f]\n", pPars->WireDelay );
32185  Abc_Print( -2, "\t-S str : string representing the LUT structure [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
32186  Abc_Print( -2, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
32187  Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
32188  Abc_Print( -2, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
32189  Abc_Print( -2, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
32190  Abc_Print( -2, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
32191  Abc_Print( -2, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
32192  Abc_Print( -2, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
32193  Abc_Print( -2, "\t-s : toggles delay-oriented mapping used with -S <NN> [default = %s]\n", pPars->fDelayOptLut? "yes": "no" );
32194  Abc_Print( -2, "\t-d : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
32195  Abc_Print( -2, "\t-b : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
32196  Abc_Print( -2, "\t-g : toggles delay optimization by SOP balancing [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
32197  Abc_Print( -2, "\t-x : toggles delay optimization by DSD balancing [default = %s]\n", pPars->fDsdBalance? "yes": "no" );
32198  Abc_Print( -2, "\t-y : toggles delay optimization with recorded library [default = %s]\n", pPars->fUserRecLib? "yes": "no" );
32199  Abc_Print( -2, "\t-o : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
32200  Abc_Print( -2, "\t-j : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
32201  Abc_Print( -2, "\t-f : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75? "yes": "no" );
32202  Abc_Print( -2, "\t-u : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75u? "yes": "no" );
32203  Abc_Print( -2, "\t-i : toggles using cofactoring variables [default = %s]\n", pPars->fUseCofVars? "yes": "no" );
32204  Abc_Print( -2, "\t-k : toggles matching based on precomputed DSD manager [default = %s]\n", pPars->fUseDsdTune? "yes": "no" );
32205  Abc_Print( -2, "\t-z : toggles deriving LUTs when mapping into LUT structures [default = %s]\n", pPars->fDeriveLuts? "yes": "no" );
32206  Abc_Print( -2, "\t-t : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
32207  Abc_Print( -2, "\t-n : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
32208  Abc_Print( -2, "\t-c : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
32209  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
32210  Abc_Print( -2, "\t-h : prints the command usage\n");
32211  return 1;
32212 }
int nLutSize
Definition: if.h:103
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Definition: if.h:100
int fDeriveLuts
Definition: if.h:138
int fDelayOptLut
Definition: if.h:122
ABC_DLL int Abc_NtkRecInputNum3()
Definition: abcRec3.c:1391
int fVerbose
Definition: if.h:140
int LutMax
Definition: if.h:173
char * pLutStruct
Definition: if.h:141
int fDoAverage
Definition: if.h:139
Gia_Man_t * Gia_ManPerformMapping(Gia_Man_t *p, void *pIfPars)
Definition: giaIf.c:1986
int If_CutPerformCheck07(If_Man_t *p, unsigned *pTruth, int nVars, int nLeaves, char *pStr)
Definition: ifDec07.c:1071
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
float WireDelay
Definition: if.h:142
int fUseCofVars
Definition: if.h:135
void Gia_ManSetIfParsDefault(void *pIfPars)
FUNCTION DEFINITIONS ///.
Definition: giaIf.c:57
int fExpRed
Definition: if.h:116
int fEnableCheck75u
Definition: if.h:132
int nFlowIters
Definition: if.h:105
static int Gia_ManHasChoices(Gia_Man_t *p)
Definition: gia.h:397
int nGateSize
Definition: if.h:107
int fEnableCheck75
Definition: if.h:131
int fEdge
Definition: if.h:118
int fUsePerm
Definition: if.h:147
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fPreprocess
Definition: if.h:113
int fDsdBalance
Definition: if.h:123
ABC_DLL void Abc_FrameSetManDsd(void *pMan)
Definition: mainFrame.c:89
#define DAU_MAX_VAR
INCLUDES ///.
Definition: dau.h:42
int fTruth
Definition: if.h:146
int fLatchPaths
Definition: if.h:117
#define IF_MAX_LUTSIZE
INCLUDES ///.
Definition: if.h:52
int fEnableCheck07
Definition: if.h:128
int globalUtilOptind
Definition: extraUtilUtil.c:45
#define IF_MAX_FUNC_LUTSIZE
Definition: if.h:54
int If_DsdManVarNum(If_DsdMan_t *p)
Definition: ifDsd.c:165
char * sprintf()
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
int fBidec
Definition: if.h:125
float Epsilon
Definition: if.h:110
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
double atof()
int fUseDsd
Definition: if.h:133
int nRelaxRatio
Definition: if.h:111
float DelayTarget
Definition: if.h:109
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
If_DsdMan_t * If_DsdManAlloc(int nVars, int nLutSize)
Definition: ifDsd.c:248
int(* pFuncCell)(If_Man_t *, unsigned *, int, int, char *)
Definition: if.h:165
int fUseDsdTune
Definition: if.h:134
int nAreaIters
Definition: if.h:106
int If_DsdManLutSize(If_DsdMan_t *p)
Definition: ifDsd.c:173
Definition: gia.h:95
int fUserRecLib
Definition: if.h:124
static int Gia_ManBufNum(Gia_Man_t *p)
Definition: gia.h:392
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fPower
Definition: if.h:119
int fDelayOpt
Definition: if.h:121
int fUseBuffs
Definition: if.h:127
int fUseBat
Definition: if.h:126
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int fCutMin
Definition: if.h:120
char * If_DsdManGetCellStr(If_DsdMan_t *p)
Definition: ifDsd.c:203
int fUseTtPerm
Definition: if.h:137
int nCutsMax
Definition: if.h:104
int strlen()
int If_CutPerformCheck75(If_Man_t *p, unsigned *pTruth, int nVars, int nLeaves, char *pStr)
Definition: ifDec75.c:303
If_LibLut_t * If_LibLutSetSimple(int nLutSize)
Definition: ifLibLut.c:279
void If_DsdManSetNewAsUseless(If_DsdMan_t *p)
Definition: ifDsd.c:193
int fArea
Definition: if.h:114
int nStructType
Definition: if.h:112
int If_CutPerformCheck16(If_Man_t *p, unsigned *pTruth, int nVars, int nLeaves, char *pStr)
Definition: ifDec16.c:2216
If_LibLut_t * pLutLib
Definition: if.h:160
int Abc_CommandAbc9If2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 32280 of file abc.c.

32281 {
32282  extern Abc_Ntk_t * Mpm_ManCellMapping( Gia_Man_t * p, Mpm_Par_t * pPars, void * pMio );
32283  extern Gia_Man_t * Mpm_ManLutMapping( Gia_Man_t * p, Mpm_Par_t * pPars );
32284  char Buffer[200];
32285  Abc_Ntk_t * pTemp;
32286  Gia_Man_t * pNew;
32287  Mpm_Par_t Pars, * pPars = &Pars;
32288  int c, nLutSize = 6;
32289  // set defaults
32290  Mpm_ManSetParsDefault( pPars );
32292  while ( ( c = Extra_UtilGetopt( argc, argv, "KCDtmzrcuxvwh" ) ) != EOF )
32293  {
32294  switch ( c )
32295  {
32296  case 'K':
32297  if ( globalUtilOptind >= argc )
32298  {
32299  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
32300  goto usage;
32301  }
32302  nLutSize = atoi(argv[globalUtilOptind]);
32303  globalUtilOptind++;
32304  if ( nLutSize < 2 || nLutSize > 16 )
32305  {
32306  Abc_Print( -1, "LUT size %d is not supported.\n", nLutSize );
32307  goto usage;
32308  }
32309  break;
32310  case 'C':
32311  if ( globalUtilOptind >= argc )
32312  {
32313  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
32314  goto usage;
32315  }
32316  pPars->nNumCuts = atoi(argv[globalUtilOptind]);
32317  globalUtilOptind++;
32318  if ( pPars->nNumCuts < 0 )
32319  goto usage;
32320  break;
32321  case 'D':
32322  if ( globalUtilOptind >= argc )
32323  {
32324  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
32325  goto usage;
32326  }
32327  pPars->DelayTarget = atoi(argv[globalUtilOptind]);
32328  globalUtilOptind++;
32329  if ( pPars->DelayTarget <= 0.0 )
32330  goto usage;
32331  break;
32332  case 't':
32333  pPars->fUseGates ^= 1;
32334  break;
32335  case 'm':
32336  pPars->fCutMin ^= 1;
32337  break;
32338  case 'z':
32339  pPars->fDeriveLuts ^= 1;
32340  break;
32341  case 'r':
32342  pPars->fOneRound ^= 1;
32343  break;
32344  case 'c':
32345  pPars->fMap4Cnf ^= 1;
32346  break;
32347  case 'u':
32348  pPars->fMap4Aig ^= 1;
32349  break;
32350  case 'x':
32351  pPars->fMap4Gates ^= 1;
32352  break;
32353  case 'v':
32354  pPars->fVerbose ^= 1;
32355  break;
32356  case 'w':
32357  pPars->fVeryVerbose ^= 1;
32358  break;
32359  case 'h':
32360  default:
32361  goto usage;
32362  }
32363  }
32364 
32365  if ( pAbc->pGia == NULL )
32366  {
32367  Abc_Print( -1, "Empty GIA network.\n" );
32368  return 1;
32369  }
32370 
32371  if ( pPars->fMap4Cnf )
32372  pPars->fUseDsd = 1;
32373  if ( pPars->fCutMin )
32374  pPars->fUseDsd = 1;
32375 // pPars->fUseTruth = 1;
32376  if ( pPars->fMap4Gates )
32377  {
32378  pPars->fUseDsd = 1;
32379  if ( pAbc->pLibScl == NULL )
32380  {
32381  Abc_Print( -1, "There is no SCL library available.\n" );
32382  return 1;
32383  }
32384  pPars->pScl = pAbc->pLibScl;
32385  }
32386  if ( pPars->fUseDsd || pPars->fUseTruth )
32387  pPars->fDeriveLuts = 1;
32388  if ( pPars->fUseDsd && nLutSize != 6 )
32389  {
32390  Abc_Print( -1, "Currently DSD can only be used with 6-input cuts.\n" );
32391  return 1;
32392  }
32393  // perform mapping
32394  assert( pPars->pLib == NULL );
32395  if ( pPars->fMap4Gates )
32396  {
32397  if ( Abc_FrameReadLibGen() == NULL )
32398  {
32399  Abc_Print( -1, "There is no GENLIB library available.\n" );
32400  return 1;
32401  }
32402  pPars->pLib = Mpm_LibLutSetSimple( nLutSize );
32403  pTemp = Mpm_ManCellMapping( pAbc->pGia, pPars, Abc_FrameReadLibGen() );
32404  Mpm_LibLutFree( pPars->pLib );
32405  if ( pTemp == NULL )
32406  {
32407  Abc_Print( -1, "Abc_CommandAbc9If2(): Mapping into standard cells has failed.\n" );
32408  return 1;
32409  }
32410  Abc_FrameReplaceCurrentNetwork( pAbc, pTemp );
32411  }
32412  else
32413  {
32414  pPars->pLib = Mpm_LibLutSetSimple( nLutSize );
32415  pNew = Mpm_ManLutMapping( pAbc->pGia, pPars );
32416  Mpm_LibLutFree( pPars->pLib );
32417  if ( pNew == NULL )
32418  {
32419  Abc_Print( -1, "Abc_CommandAbc9If2(): Mapping into LUTs has failed.\n" );
32420  return 1;
32421  }
32422  Abc_FrameUpdateGia( pAbc, pNew );
32423  }
32424  return 0;
32425 
32426 usage:
32427  if ( pPars->DelayTarget == -1 )
32428  sprintf(Buffer, "best possible" );
32429  else
32430  sprintf(Buffer, "%d", pPars->DelayTarget );
32431  Abc_Print( -2, "usage: &if2 [-KCD num] [-tmzrcuxvwh]\n" );
32432  Abc_Print( -2, "\t performs technology mapping of the network\n" );
32433  Abc_Print( -2, "\t-K num : sets the LUT size for the mapping [default = %d]\n", nLutSize );
32434  Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nNumCuts );
32435  Abc_Print( -2, "\t-D num : sets the delay constraint for the mapping [default = %s]\n", Buffer );
32436  Abc_Print( -2, "\t-t : enables using AND/XOR/MUX nodes instead of simple AIG [default = %s]\n", pPars->fUseGates? "yes": "no" );
32437  Abc_Print( -2, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
32438  Abc_Print( -2, "\t-z : toggles deriving LUTs when mapping into LUT structures [default = %s]\n", pPars->fDeriveLuts? "yes": "no" );
32439  Abc_Print( -2, "\t-r : toggles using one round of mapping [default = %s]\n", pPars->fOneRound? "yes": "no" );
32440  Abc_Print( -2, "\t-c : toggles mapping for CNF computation [default = %s]\n", pPars->fMap4Cnf? "yes": "no" );
32441  Abc_Print( -2, "\t-u : toggles mapping for AIG computation [default = %s]\n", pPars->fMap4Aig? "yes": "no" );
32442  Abc_Print( -2, "\t-x : toggles mapping for standard cells [default = %s]\n", pPars->fMap4Gates? "yes": "no" );
32443  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
32444  Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
32445  Abc_Print( -2, "\t-h : prints the command usage\n");
32446  return 1;
32447 }
void Mpm_ManSetParsDefault(Mpm_Par_t *p)
MACRO DEFINITIONS ///.
Definition: mpmCore.c:46
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void * Abc_FrameReadLibGen()
Definition: mainFrame.c:56
int DelayTarget
Definition: mpm.h:62
int fCutMin
Definition: mpm.h:66
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int fOneRound
Definition: mpm.h:67
Gia_Man_t * Mpm_ManLutMapping(Gia_Man_t *pGia, Mpm_Par_t *pPars)
Definition: mpmCore.c:90
int nNumCuts
Definition: mpm.h:61
Mpm_LibLut_t * Mpm_LibLutSetSimple(int nLutSize)
DECLARATIONS ///.
Definition: mpmLib.c:45
int fVerbose
Definition: mpm.h:72
Abc_Ntk_t * Mpm_ManCellMapping(Gia_Man_t *pGia, Mpm_Par_t *pPars, void *pMio)
Definition: mpmGates.c:281
void * pScl
Definition: mpm.h:60
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fUseGates
Definition: mpm.h:63
int fMap4Cnf
Definition: mpm.h:69
int globalUtilOptind
Definition: extraUtilUtil.c:45
int fMap4Gates
Definition: mpm.h:71
char * sprintf()
int fMap4Aig
Definition: mpm.h:70
Definition: mpm.h:57
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fDeriveLuts
Definition: mpm.h:68
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Mpm_LibLut_t * pLib
Definition: mpm.h:59
void Mpm_LibLutFree(Mpm_LibLut_t *pLib)
Definition: mpmLib.c:60
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
#define assert(ex)
Definition: util_old.h:213
int fUseTruth
Definition: mpm.h:64
int fVeryVerbose
Definition: mpm.h:73
int fUseDsd
Definition: mpm.h:65
int Abc_CommandAbc9Iff ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 32225 of file abc.c.

32226 {
32227  extern void Gia_ManIffTest( Gia_Man_t * pGia, If_LibLut_t * pLib, int fVerbose );
32228  int c, fVerbose = 0;
32230  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
32231  {
32232  switch ( c )
32233  {
32234  case 'v':
32235  fVerbose ^= 1;
32236  break;
32237  case 'h':
32238  goto usage;
32239  default:
32240  goto usage;
32241  }
32242  }
32243  if ( pAbc->pGia == NULL )
32244  {
32245  Abc_Print( -1, "Abc_CommandAbc9Iff(): There is no AIG to map.\n" );
32246  return 1;
32247  }
32248  if ( !Gia_ManHasMapping(pAbc->pGia) )
32249  {
32250  Abc_Print( -1, "Abc_CommandAbc9Iff(): Mapping of the AIG is not defined.\n" );
32251  return 1;
32252  }
32253  if ( pAbc->pLibLut == NULL )
32254  {
32255  Abc_Print( -1, "Abc_CommandAbc9Iff(): LUT library is not defined.\n" );
32256  return 1;
32257  }
32258  Gia_ManIffTest( pAbc->pGia, (If_LibLut_t *)pAbc->pLibLut, fVerbose );
32259  return 0;
32260 
32261 usage:
32262  Abc_Print( -2, "usage: &iff [-vh]\n" );
32263  Abc_Print( -2, "\t performs structural mapping into LUT structures\n" );
32264  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
32265  Abc_Print( -2, "\t-h : print the command usage\n");
32266  return 1;
32267 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_ManIffTest(Gia_Man_t *pGia, If_LibLut_t *pLib, int fVerbose)
Definition: giaIff.c:387
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Inse ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36488 of file abc.c.

36489 {
36490  extern Vec_Int_t * Gia_ManInseTest( Gia_Man_t * p, Vec_Int_t * vInit, int nFrames, int nWords, int nTimeOut, int fSim, int fVerbose );
36491  int c, nFrames = 10, nWords = 1000, nTimeOut = 0, fSim = 0, fVerbose = 0;
36493  while ( ( c = Extra_UtilGetopt( argc, argv, "FWTsvh" ) ) != EOF )
36494  {
36495  switch ( c )
36496  {
36497  case 'F':
36498  if ( globalUtilOptind >= argc )
36499  {
36500  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
36501  goto usage;
36502  }
36503  nFrames = atoi(argv[globalUtilOptind]);
36504  globalUtilOptind++;
36505  if ( nFrames < 0 )
36506  goto usage;
36507  break;
36508  case 'W':
36509  if ( globalUtilOptind >= argc )
36510  {
36511  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
36512  goto usage;
36513  }
36514  nWords = atoi(argv[globalUtilOptind]);
36515  globalUtilOptind++;
36516  if ( nWords < 0 )
36517  goto usage;
36518  break;
36519  case 'T':
36520  if ( globalUtilOptind >= argc )
36521  {
36522  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
36523  goto usage;
36524  }
36525  nTimeOut = atoi(argv[globalUtilOptind]);
36526  globalUtilOptind++;
36527  if ( nTimeOut < 0 )
36528  goto usage;
36529  break;
36530  case 's':
36531  fSim ^= 1;
36532  break;
36533  case 'v':
36534  fVerbose ^= 1;
36535  break;
36536  case 'h':
36537  goto usage;
36538  default:
36539  goto usage;
36540  }
36541  }
36542  if ( pAbc->pGia == NULL )
36543  {
36544  Abc_Print( -1, "Abc_CommandAbc9Inse(): There is no AIG.\n" );
36545  return 0;
36546  }
36547  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
36548  {
36549  Abc_Print( -1, "Abc_CommandAbc9Inse(): AIG is combinational.\n" );
36550  return 0;
36551  }
36552  if ( pAbc->pGia->vInitClasses != NULL )
36553  {
36554  Abc_Print( 1, "Abc_CommandAbc9Inse(): All-0 initial state is assumed.\n" );
36555  Vec_IntFreeP( &pAbc->pGia->vInitClasses );
36556  }
36557  pAbc->pGia->vInitClasses = Gia_ManInseTest( pAbc->pGia, NULL, nFrames, nWords, nTimeOut, fSim, fVerbose );
36558  return 0;
36559 
36560 usage:
36561  Abc_Print( -2, "usage: &inse [-FWT num] [-svh]\n" );
36562  Abc_Print( -2, "\t experimental procedure\n" );
36563  Abc_Print( -2, "\t-F num : the number of timeframes [default = %d]\n", nFrames );
36564  Abc_Print( -2, "\t-W num : the number of machine words [default = %d]\n", nWords );
36565  Abc_Print( -2, "\t-T num : approximate global runtime limit in seconds [default = %d]\n", nTimeOut );
36566  Abc_Print( -2, "\t-s : toggles using ternary simulation [default = %s]\n", fSim? "yes": "no" );
36567  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
36568  Abc_Print( -2, "\t-h : print the command usage\n");
36569  return 1;
36570 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int nWords
Definition: abcNpn.c:127
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Vec_Int_t * Gia_ManInseTest(Gia_Man_t *p, Vec_Int_t *vInit0, int nFrames, int nWords, int nTimeOut, int fSim, int fVerbose)
Definition: bmcInse.c:328
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Iso ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34758 of file abc.c.

34759 {
34760  Gia_Man_t * pAig;
34761  Vec_Ptr_t * vPosEquivs;
34762 // Vec_Ptr_t * vPiPerms;
34763  int c, fNewAlgo = 1, fEstimate = 0, fBetterQual = 0, fDualOut = 0, fVerbose = 0, fVeryVerbose = 0;
34765  while ( ( c = Extra_UtilGetopt( argc, argv, "neqdvwh" ) ) != EOF )
34766  {
34767  switch ( c )
34768  {
34769  case 'n':
34770  fNewAlgo ^= 1;
34771  break;
34772  case 'e':
34773  fEstimate ^= 1;
34774  break;
34775  case 'q':
34776  fBetterQual ^= 1;
34777  break;
34778  case 'd':
34779  fDualOut ^= 1;
34780  break;
34781  case 'v':
34782  fVerbose ^= 1;
34783  break;
34784  case 'w':
34785  fVeryVerbose ^= 1;
34786  break;
34787  case 'h':
34788  goto usage;
34789  default:
34790  goto usage;
34791  }
34792  }
34793  if ( pAbc->pGia == NULL )
34794  {
34795  Abc_Print( -1, "Abc_CommandAbc9Iso(): There is no AIG.\n" );
34796  return 1;
34797  }
34798  if ( Gia_ManPoNum(pAbc->pGia) == 1 )
34799  {
34800  Abc_Print( -1, "Abc_CommandAbc9Iso(): The AIG has only one PO. Isomorphism detection is not performed.\n" );
34801  return 1;
34802  }
34803  if ( fNewAlgo )
34804  pAig = Gia_ManIsoReduce2( pAbc->pGia, &vPosEquivs, NULL, fEstimate, fBetterQual, fDualOut, fVerbose, fVeryVerbose );
34805  else
34806  pAig = Gia_ManIsoReduce( pAbc->pGia, &vPosEquivs, NULL, fEstimate, fDualOut, fVerbose, fVeryVerbose );
34807 // pAig = Gia_ManIsoReduce( pAbc->pGia, &vPosEquivs, &vPiPerms, 0, fDualOut, fVerbose, fVeryVerbose );
34808 // Vec_VecFree( (Vec_Vec_t *)vPiPerms );
34809  if ( pAig == NULL )
34810  {
34811  Abc_Print( -1, "Abc_CommandAbc9Iso(): Transformation has failed.\n" );
34812  return 1;
34813  }
34814  // update the internal storage of PO equivalences
34815  Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
34816  // update the AIG
34817  Abc_FrameUpdateGia( pAbc, pAig );
34818  return 0;
34819 
34820 usage:
34821  Abc_Print( -2, "usage: &iso [-neqdvwh]\n" );
34822  Abc_Print( -2, "\t removes POs with isomorphic sequential COI\n" );
34823  Abc_Print( -2, "\t-n : toggle using new fast algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
34824  Abc_Print( -2, "\t-e : toggle computing lower bound on equivalence classes [default = %s]\n", fEstimate? "yes": "no" );
34825  Abc_Print( -2, "\t-q : toggle improving quality at the expense of runtime [default = %s]\n", fBetterQual? "yes": "no" );
34826  Abc_Print( -2, "\t-d : toggle treating the current AIG as a dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
34827  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
34828  Abc_Print( -2, "\t-w : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
34829  Abc_Print( -2, "\t-h : print the command usage\n");
34830  return 1;
34831 }
void Abc_FrameReplacePoEquivs(Abc_Frame_t *pAbc, Vec_Ptr_t **pvPoEquivs)
Definition: abc.c:537
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Gia_Man_t * Gia_ManIsoReduce(Gia_Man_t *p, Vec_Ptr_t **pvPosEquivs, Vec_Ptr_t **pvPiPerms, int fEstimate, int fDualOut, int fVerbose, int fVeryVerbose)
Definition: giaIso.c:1075
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
Gia_Man_t * Gia_ManIsoReduce2(Gia_Man_t *p, Vec_Ptr_t **pvPosEquivs, Vec_Ptr_t **pvPiPerms, int fEstimate, int fBetterQual, int fDualOut, int fVerbose, int fVeryVerbose)
Definition: giaIso2.c:718
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Jf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 32461 of file abc.c.

32462 {
32463  char Buffer[200];
32464  Jf_Par_t Pars, * pPars = &Pars;
32465  Gia_Man_t * pNew; int c;
32466  Jf_ManSetDefaultPars( pPars );
32468  while ( ( c = Extra_UtilGetopt( argc, argv, "KCDWaekmdcgvwh" ) ) != EOF )
32469  {
32470  switch ( c )
32471  {
32472  case 'K':
32473  if ( globalUtilOptind >= argc )
32474  {
32475  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
32476  goto usage;
32477  }
32478  pPars->nLutSize = atoi(argv[globalUtilOptind]);
32479  globalUtilOptind++;
32480  if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
32481  {
32482  Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
32483  goto usage;
32484  }
32485  break;
32486  case 'C':
32487  if ( globalUtilOptind >= argc )
32488  {
32489  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
32490  goto usage;
32491  }
32492  pPars->nCutNum = atoi(argv[globalUtilOptind]);
32493  globalUtilOptind++;
32494  if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
32495  {
32496  Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
32497  goto usage;
32498  }
32499  break;
32500  case 'D':
32501  if ( globalUtilOptind >= argc )
32502  {
32503  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
32504  goto usage;
32505  }
32506  pPars->DelayTarget = atoi(argv[globalUtilOptind]);
32507  globalUtilOptind++;
32508  if ( pPars->DelayTarget <= 0.0 )
32509  goto usage;
32510  break;
32511  case 'W':
32512  if ( globalUtilOptind >= argc )
32513  {
32514  Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
32515  goto usage;
32516  }
32517  pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
32518  globalUtilOptind++;
32519  if ( pPars->nVerbLimit < 0 )
32520  goto usage;
32521  break;
32522  case 'a':
32523  pPars->fAreaOnly ^= 1;
32524  break;
32525  case 'e':
32526  pPars->fOptEdge ^= 1;
32527  break;
32528  case 'k':
32529  pPars->fCoarsen ^= 1;
32530  break;
32531  case 'm':
32532  pPars->fCutMin ^= 1;
32533  break;
32534  case 'd':
32535  pPars->fFuncDsd ^= 1;
32536  break;
32537  case 'c':
32538  pPars->fGenCnf ^= 1;
32539  break;
32540  case 'g':
32541  pPars->fPureAig ^= 1;
32542  break;
32543  case 'v':
32544  pPars->fVerbose ^= 1;
32545  break;
32546  case 'w':
32547  pPars->fVeryVerbose ^= 1;
32548  break;
32549  case 'h':
32550  default:
32551  goto usage;
32552  }
32553  }
32554 
32555  if ( pAbc->pGia == NULL )
32556  {
32557  Abc_Print( -1, "Empty GIA network.\n" );
32558  return 1;
32559  }
32560  if ( Gia_ManBufNum(pAbc->pGia) )
32561  {
32562  Abc_Print( -1, "Abc_CommandAbc9Jf(): This command does not work with barrier buffers.\n" );
32563  return 1;
32564  }
32565  if ( (pPars->fFuncDsd || pPars->fGenCnf) && pPars->nLutSize > 6 )
32566  {
32567  Abc_Print( -1, "Abc_CommandAbc9Jf(): DSD computation works for LUT6 or less.\n" );
32568  return 1;
32569  }
32570 
32571  if ( (pPars->fFuncDsd || pPars->fGenCnf) && !Sdm_ManCanRead() )
32572  {
32573  Abc_Print( -1, "Abc_CommandAbc9Jf(): Cannot input DSD data from file.\n" );
32574  return 1;
32575  }
32576 
32577  pNew = Jf_ManPerformMapping( pAbc->pGia, pPars );
32578  if ( pNew == NULL )
32579  {
32580  Abc_Print( -1, "Abc_CommandAbc9Jf(): Mapping into LUTs has failed.\n" );
32581  return 1;
32582  }
32583  Abc_FrameUpdateGia( pAbc, pNew );
32584  return 0;
32585 
32586 usage:
32587  if ( pPars->DelayTarget == -1 )
32588  sprintf(Buffer, "best possible" );
32589  else
32590  sprintf(Buffer, "%d", pPars->DelayTarget );
32591  Abc_Print( -2, "usage: &jf [-KCDW num] [-akmdcgvwh]\n" );
32592  Abc_Print( -2, "\t performs technology mapping of the network\n" );
32593  Abc_Print( -2, "\t-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
32594  Abc_Print( -2, "\t-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
32595  Abc_Print( -2, "\t-D num : sets the delay constraint for the mapping [default = %s]\n", Buffer );
32596  Abc_Print( -2, "\t-W num : min frequency when printing functions with \"-w\" [default = %d]\n", pPars->nVerbLimit );
32597  Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
32598  Abc_Print( -2, "\t-e : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
32599  Abc_Print( -2, "\t-k : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
32600  Abc_Print( -2, "\t-m : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
32601  Abc_Print( -2, "\t-d : toggles using DSD to represent cut functions [default = %s]\n", pPars->fFuncDsd? "yes": "no" );
32602  Abc_Print( -2, "\t-c : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
32603  Abc_Print( -2, "\t-g : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
32604  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
32605  Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
32606  Abc_Print( -2, "\t-h : prints the command usage\n");
32607  return 1;
32608 }
Gia_Man_t * Jf_ManPerformMapping(Gia_Man_t *pGia, Jf_Par_t *pPars)
Definition: giaJf.c:1712
int nCutNum
Definition: gia.h:268
int nLutSize
Definition: gia.h:267
int nCutNumMax
Definition: gia.h:294
int fAreaOnly
Definition: gia.h:277
int nVerbLimit
Definition: gia.h:275
int fVeryVerbose
Definition: gia.h:292
int fOptEdge
Definition: gia.h:278
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Definition: gia.h:265
void Jf_ManSetDefaultPars(Jf_Par_t *pPars)
Definition: giaJf.c:1679
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Sdm_ManCanRead()
Definition: gia.h:95
static int Gia_ManBufNum(Gia_Man_t *p)
Definition: gia.h:392
int fPureAig
Definition: gia.h:287
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fCutMin
Definition: gia.h:282
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int fFuncDsd
Definition: gia.h:283
int fGenCnf
Definition: gia.h:284
int nLutSizeMax
Definition: gia.h:293
int DelayTarget
Definition: gia.h:276
int fVerbose
Definition: gia.h:291
int fCoarsen
Definition: gia.h:281
int Abc_CommandAbc9Kf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 32621 of file abc.c.

32622 {
32623  extern void Kf_ManSetDefaultPars( Jf_Par_t * pPars );
32624  extern Gia_Man_t * Kf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars );
32625  char Buffer[200];
32626  Jf_Par_t Pars, * pPars = &Pars;
32627  Gia_Man_t * pNew; int c;
32628  Kf_ManSetDefaultPars( pPars );
32630  while ( ( c = Extra_UtilGetopt( argc, argv, "KCPDWaekmdcgtsvwh" ) ) != EOF )
32631  {
32632  switch ( c )
32633  {
32634  case 'K':
32635  if ( globalUtilOptind >= argc )
32636  {
32637  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
32638  goto usage;
32639  }
32640  pPars->nLutSize = atoi(argv[globalUtilOptind]);
32641  globalUtilOptind++;
32642  if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
32643  {
32644  Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
32645  goto usage;
32646  }
32647  break;
32648  case 'C':
32649  if ( globalUtilOptind >= argc )
32650  {
32651  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
32652  goto usage;
32653  }
32654  pPars->nCutNum = atoi(argv[globalUtilOptind]);
32655  globalUtilOptind++;
32656  if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
32657  {
32658  Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
32659  goto usage;
32660  }
32661  break;
32662  case 'P':
32663  if ( globalUtilOptind >= argc )
32664  {
32665  Abc_Print( -1, "Command line switch \"-P\" should be followed by a positive integer.\n" );
32666  goto usage;
32667  }
32668  pPars->nProcNum = atoi(argv[globalUtilOptind]);
32669  globalUtilOptind++;
32670  if ( pPars->nProcNum < 0 )
32671  goto usage;
32672  break;
32673  case 'D':
32674  if ( globalUtilOptind >= argc )
32675  {
32676  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
32677  goto usage;
32678  }
32679  pPars->DelayTarget = atoi(argv[globalUtilOptind]);
32680  globalUtilOptind++;
32681  if ( pPars->DelayTarget <= 0.0 )
32682  goto usage;
32683  break;
32684  case 'W':
32685  if ( globalUtilOptind >= argc )
32686  {
32687  Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
32688  goto usage;
32689  }
32690  pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
32691  globalUtilOptind++;
32692  if ( pPars->nVerbLimit < 0 )
32693  goto usage;
32694  break;
32695  case 'a':
32696  pPars->fAreaOnly ^= 1;
32697  break;
32698  case 'e':
32699  pPars->fOptEdge ^= 1;
32700  break;
32701  case 'k':
32702  pPars->fCoarsen ^= 1;
32703  break;
32704  case 'm':
32705  pPars->fCutMin ^= 1;
32706  break;
32707  case 'd':
32708  pPars->fFuncDsd ^= 1;
32709  break;
32710  case 'c':
32711  pPars->fGenCnf ^= 1;
32712  break;
32713  case 'g':
32714  pPars->fPureAig ^= 1;
32715  break;
32716  case 't':
32717  pPars->fCutHashing ^= 1;
32718  break;
32719  case 's':
32720  pPars->fCutSimple ^= 1;
32721  break;
32722  case 'v':
32723  pPars->fVerbose ^= 1;
32724  break;
32725  case 'w':
32726  pPars->fVeryVerbose ^= 1;
32727  break;
32728  case 'h':
32729  default:
32730  goto usage;
32731  }
32732  }
32733 
32734  if ( pAbc->pGia == NULL )
32735  {
32736  Abc_Print( -1, "Empty GIA network.\n" );
32737  return 1;
32738  }
32739 
32740  pNew = Kf_ManPerformMapping( pAbc->pGia, pPars );
32741  if ( pNew == NULL )
32742  {
32743  Abc_Print( -1, "Abc_CommandAbc9Kf(): Mapping into LUTs has failed.\n" );
32744  return 1;
32745  }
32746  Abc_FrameUpdateGia( pAbc, pNew );
32747  return 0;
32748 
32749 usage:
32750  if ( pPars->DelayTarget == -1 )
32751  sprintf(Buffer, "best possible" );
32752  else
32753  sprintf(Buffer, "%d", pPars->DelayTarget );
32754  Abc_Print( -2, "usage: &kf [-KCPDW num] [-akmdcgtsvwh]\n" );
32755  Abc_Print( -2, "\t performs technology mapping of the network\n" );
32756  Abc_Print( -2, "\t-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
32757  Abc_Print( -2, "\t-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
32758  Abc_Print( -2, "\t-P num : the number of cut computation processes (0 <= P <= %d) [default = %d]\n", pPars->nProcNumMax, pPars->nProcNum );
32759  Abc_Print( -2, "\t-D num : sets the delay constraint for the mapping [default = %s]\n", Buffer );
32760  Abc_Print( -2, "\t-W num : min frequency when printing functions with \"-w\" [default = %d]\n", pPars->nVerbLimit );
32761  Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
32762  Abc_Print( -2, "\t-e : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
32763  Abc_Print( -2, "\t-k : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
32764  Abc_Print( -2, "\t-m : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
32765  Abc_Print( -2, "\t-d : toggles using DSD to represent cut functions [default = %s]\n", pPars->fFuncDsd? "yes": "no" );
32766  Abc_Print( -2, "\t-c : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
32767  Abc_Print( -2, "\t-g : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
32768  Abc_Print( -2, "\t-t : toggles cut computation using hash table [default = %s]\n", pPars->fCutHashing? "yes": "no" );
32769  Abc_Print( -2, "\t-s : toggles cut computation using a simple method [default = %s]\n", pPars->fCutSimple? "yes": "no" );
32770  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
32771  Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
32772  Abc_Print( -2, "\t-h : prints the command usage\n");
32773  return 1;
32774 }
int nCutNum
Definition: gia.h:268
int nLutSize
Definition: gia.h:267
int nProcNum
Definition: gia.h:269
int nCutNumMax
Definition: gia.h:294
int fCutSimple
Definition: gia.h:290
int fAreaOnly
Definition: gia.h:277
int nVerbLimit
Definition: gia.h:275
int fCutHashing
Definition: gia.h:289
int fVeryVerbose
Definition: gia.h:292
int fOptEdge
Definition: gia.h:278
ABC_NAMESPACE_IMPL_START void Kf_ManSetDefaultPars(Jf_Par_t *pPars)
DECLARATIONS ///.
Definition: giaKf.c:43
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Definition: gia.h:265
Gia_Man_t * Kf_ManPerformMapping(Gia_Man_t *pGia, Jf_Par_t *pPars)
Definition: giaKf.c:44
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
int nProcNumMax
Definition: gia.h:295
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int fPureAig
Definition: gia.h:287
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fCutMin
Definition: gia.h:282
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int fFuncDsd
Definition: gia.h:283
int fGenCnf
Definition: gia.h:284
int nLutSizeMax
Definition: gia.h:293
int DelayTarget
Definition: gia.h:276
int fVerbose
Definition: gia.h:291
int fCoarsen
Definition: gia.h:281
int Abc_CommandAbc9Lcorr ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29660 of file abc.c.

29661 {
29662  Cec_ParCor_t Pars, * pPars = &Pars;
29663  Gia_Man_t * pTemp;
29664  int c;
29665  Cec_ManCorSetDefaultParams( pPars );
29666  pPars->fLatchCorr = 1;
29668  while ( ( c = Extra_UtilGetopt( argc, argv, "FCPrcvh" ) ) != EOF )
29669  {
29670  switch ( c )
29671  {
29672  case 'F':
29673  if ( globalUtilOptind >= argc )
29674  {
29675  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
29676  goto usage;
29677  }
29678  pPars->nFrames = atoi(argv[globalUtilOptind]);
29679  globalUtilOptind++;
29680  if ( pPars->nFrames < 0 )
29681  goto usage;
29682  break;
29683  case 'C':
29684  if ( globalUtilOptind >= argc )
29685  {
29686  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
29687  goto usage;
29688  }
29689  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
29690  globalUtilOptind++;
29691  if ( pPars->nBTLimit < 0 )
29692  goto usage;
29693  break;
29694  case 'P':
29695  if ( globalUtilOptind >= argc )
29696  {
29697  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
29698  goto usage;
29699  }
29700  pPars->nPrefix = atoi(argv[globalUtilOptind]);
29701  globalUtilOptind++;
29702  if ( pPars->nPrefix < 0 )
29703  goto usage;
29704  break;
29705  case 'r':
29706  pPars->fUseRings ^= 1;
29707  break;
29708  case 'c':
29709  pPars->fUseCSat ^= 1;
29710  break;
29711  case 'v':
29712  pPars->fVerbose ^= 1;
29713  break;
29714  default:
29715  goto usage;
29716  }
29717  }
29718  if ( pAbc->pGia == NULL )
29719  {
29720  Abc_Print( -1, "Abc_CommandAbc9Lcorr(): There is no AIG.\n" );
29721  return 1;
29722  }
29723  if ( Gia_ManBoxNum(pAbc->pGia) && Gia_ManRegBoxNum(pAbc->pGia) )
29724  {
29725  if ( pAbc->pGia->pAigExtra == NULL )
29726  {
29727  printf( "Timing manager is given but there is no GIA of boxes.\n" );
29728  return 0;
29729  }
29730  pTemp = Gia_ManSweepWithBoxes( pAbc->pGia, NULL, pPars, 0, 0, pPars->fVerbose );
29731  Abc_FrameUpdateGia( pAbc, pTemp );
29732  return 0;
29733  }
29734  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
29735  {
29736  Abc_Print( -1, "The network is combinational.\n" );
29737  return 0;
29738  }
29739  pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
29740  Abc_FrameUpdateGia( pAbc, pTemp );
29741  return 0;
29742 
29743 usage:
29744  Abc_Print( -2, "usage: &lcorr [-FCP num] [-rcvh]\n" );
29745  Abc_Print( -2, "\t performs latch correpondence computation\n" );
29746  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
29747  Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
29748  Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
29749  Abc_Print( -2, "\t-r : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
29750  Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
29751  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
29752  Abc_Print( -2, "\t-h : print the command usage\n");
29753  return 1;
29754 }
void Cec_ManCorSetDefaultParams(Cec_ParCor_t *p)
Definition: cecCore.c:181
int fUseCSat
Definition: cec.h:146
int Gia_ManRegBoxNum(Gia_Man_t *p)
Definition: giaTim.c:53
int nPrefix
Definition: cec.h:138
int fUseRings
Definition: cec.h:144
int fLatchCorr
Definition: cec.h:142
int fVerbose
Definition: cec.h:152
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Gia_ManBoxNum(Gia_Man_t *p)
DECLARATIONS ///.
Definition: giaTim.c:49
int nFrames
Definition: cec.h:137
Gia_Man_t * Cec_ManLSCorrespondence(Gia_Man_t *pAig, Cec_ParCor_t *pPars)
Definition: cecCorr.c:1147
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nBTLimit
Definition: cec.h:139
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManSweepWithBoxes(Gia_Man_t *p, void *pParsC, void *pParsS, int fConst, int fEquiv, int fVerbose)
Definition: giaSweep.c:683
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Lf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 32787 of file abc.c.

32788 {
32789  char Buffer[200];
32790  Jf_Par_t Pars, * pPars = &Pars;
32791  Gia_Man_t * pNew; int c;
32792  Lf_ManSetDefaultPars( pPars );
32794  while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWMaekmupgtvwh" ) ) != EOF )
32795  {
32796  switch ( c )
32797  {
32798  case 'K':
32799  if ( globalUtilOptind >= argc )
32800  {
32801  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
32802  goto usage;
32803  }
32804  pPars->nLutSize = atoi(argv[globalUtilOptind]);
32805  globalUtilOptind++;
32806  if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
32807  {
32808  Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
32809  goto usage;
32810  }
32811  break;
32812  case 'C':
32813  if ( globalUtilOptind >= argc )
32814  {
32815  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
32816  goto usage;
32817  }
32818  pPars->nCutNum = atoi(argv[globalUtilOptind]);
32819  globalUtilOptind++;
32820  if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
32821  {
32822  Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
32823  goto usage;
32824  }
32825  break;
32826  case 'F':
32827  if ( globalUtilOptind >= argc )
32828  {
32829  Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
32830  goto usage;
32831  }
32832  pPars->nRounds = atoi(argv[globalUtilOptind]);
32833  globalUtilOptind++;
32834  if ( pPars->nRounds < 0 )
32835  goto usage;
32836  break;
32837  case 'A':
32838  if ( globalUtilOptind >= argc )
32839  {
32840  Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
32841  goto usage;
32842  }
32843  pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
32844  globalUtilOptind++;
32845  if ( pPars->nRoundsEla < 0 )
32846  goto usage;
32847  break;
32848  case 'R':
32849  if ( globalUtilOptind >= argc )
32850  {
32851  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
32852  return 0;
32853  }
32854  pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
32855  globalUtilOptind++;
32856  if ( pPars->nRelaxRatio < 0 )
32857  goto usage;
32858  break;
32859  case 'L':
32860  if ( globalUtilOptind >= argc )
32861  {
32862  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
32863  return 0;
32864  }
32865  pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
32866  globalUtilOptind++;
32867  if ( pPars->nCoarseLimit < 0 )
32868  goto usage;
32869  break;
32870  case 'E':
32871  if ( globalUtilOptind >= argc )
32872  {
32873  Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
32874  return 0;
32875  }
32876  pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
32877  globalUtilOptind++;
32878  if ( pPars->nAreaTuner < 0 )
32879  goto usage;
32880  break;
32881  case 'D':
32882  if ( globalUtilOptind >= argc )
32883  {
32884  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
32885  goto usage;
32886  }
32887  pPars->DelayTarget = atoi(argv[globalUtilOptind]);
32888  globalUtilOptind++;
32889  if ( pPars->DelayTarget <= 0.0 )
32890  goto usage;
32891  break;
32892  case 'W':
32893  if ( globalUtilOptind >= argc )
32894  {
32895  Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
32896  goto usage;
32897  }
32898  pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
32899  globalUtilOptind++;
32900  if ( pPars->nVerbLimit < 0 )
32901  goto usage;
32902  break;
32903  case 'M':
32904  if ( globalUtilOptind >= argc )
32905  {
32906  Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
32907  goto usage;
32908  }
32909  pPars->nLutSizeMux = atoi(argv[globalUtilOptind]);
32910  globalUtilOptind++;
32911  if ( pPars->nLutSizeMux < 2 || pPars->nLutSizeMux > pPars->nLutSizeMax )
32912  {
32913  Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSizeMux );
32914  goto usage;
32915  }
32916  break;
32917  case 'a':
32918  pPars->fAreaOnly ^= 1;
32919  break;
32920  case 'e':
32921  pPars->fOptEdge ^= 1;
32922  break;
32923  case 'k':
32924  pPars->fCoarsen ^= 1;
32925  break;
32926  case 'm':
32927  pPars->fCutMin ^= 1;
32928  break;
32929  case 'u':
32930  pPars->fUseMux7 ^= 1;
32931  break;
32932  case 'p':
32933  pPars->fPower ^= 1;
32934  break;
32935  case 'g':
32936  pPars->fPureAig ^= 1;
32937  break;
32938  case 't':
32939  pPars->fDoAverage ^= 1;
32940  break;
32941  case 'v':
32942  pPars->fVerbose ^= 1;
32943  break;
32944  case 'w':
32945  pPars->fVeryVerbose ^= 1;
32946  break;
32947  case 'h':
32948  default:
32949  goto usage;
32950  }
32951  }
32952 
32953  if ( pAbc->pGia == NULL )
32954  {
32955  Abc_Print( -1, "Empty GIA network.\n" );
32956  return 1;
32957  }
32958  if ( Gia_ManHasMapping(pAbc->pGia) )
32959  {
32960  Abc_Print( -1, "Current AIG has mapping. Run \"&st\".\n" );
32961  return 1;
32962  }
32963  if ( pPars->nLutSizeMux && pPars->fUseMux7 )
32964  {
32965  Abc_Print( -1, "Flags \"-M\" and \"-u\" are incompatible.\n" );
32966  return 1;
32967  }
32968 
32969  pNew = Lf_ManPerformMapping( pAbc->pGia, pPars );
32970  if ( pNew == NULL )
32971  {
32972  Abc_Print( -1, "Abc_CommandAbc9Lf(): Mapping into LUTs has failed.\n" );
32973  return 1;
32974  }
32975  Abc_FrameUpdateGia( pAbc, pNew );
32976  return 0;
32977 
32978 usage:
32979  if ( pPars->DelayTarget == -1 )
32980  sprintf(Buffer, "best possible" );
32981  else
32982  sprintf(Buffer, "%d", pPars->DelayTarget );
32983  Abc_Print( -2, "usage: &lf [-KCFARLEDM num] [-kmupgtvwh]\n" );
32984  Abc_Print( -2, "\t performs technology mapping of the network\n" );
32985  Abc_Print( -2, "\t-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
32986  Abc_Print( -2, "\t-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
32987  Abc_Print( -2, "\t-F num : the number of area flow rounds [default = %d]\n", pPars->nRounds );
32988  Abc_Print( -2, "\t-A num : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
32989  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
32990  Abc_Print( -2, "\t-L num : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
32991  Abc_Print( -2, "\t-E num : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
32992  Abc_Print( -2, "\t-D num : sets the delay constraint for the mapping [default = %s]\n", Buffer );
32993  Abc_Print( -2, "\t-M num : LUT size when cofactoring is performed (0 <= num <= 100) [default = %d]\n", pPars->nLutSizeMux );
32994 // Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
32995  Abc_Print( -2, "\t-e : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
32996  Abc_Print( -2, "\t-k : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
32997  Abc_Print( -2, "\t-m : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
32998  Abc_Print( -2, "\t-u : toggles using additional MUXes [default = %s]\n", pPars->fUseMux7? "yes": "no" );
32999  Abc_Print( -2, "\t-p : toggles power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
33000  Abc_Print( -2, "\t-g : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
33001  Abc_Print( -2, "\t-t : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
33002  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
33003  Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
33004  Abc_Print( -2, "\t-h : prints the command usage\n");
33005  return 1;
33006 }
void Lf_ManSetDefaultPars(Jf_Par_t *pPars)
Definition: giaLf.c:1981
int nCutNum
Definition: gia.h:268
int nLutSize
Definition: gia.h:267
int nLutSizeMux
Definition: gia.h:296
Gia_Man_t * Lf_ManPerformMapping(Gia_Man_t *pGia, Jf_Par_t *pPars)
Definition: giaLf.c:2193
int nAreaTuner
Definition: gia.h:274
int nCutNumMax
Definition: gia.h:294
int fAreaOnly
Definition: gia.h:277
int nVerbLimit
Definition: gia.h:275
int fPower
Definition: gia.h:280
int fVeryVerbose
Definition: gia.h:292
int nRelaxRatio
Definition: gia.h:272
int fOptEdge
Definition: gia.h:278
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Definition: gia.h:265
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fDoAverage
Definition: gia.h:288
int nRounds
Definition: gia.h:270
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int fPureAig
Definition: gia.h:287
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fCutMin
Definition: gia.h:282
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int nLutSizeMax
Definition: gia.h:293
int nRoundsEla
Definition: gia.h:271
int fUseMux7
Definition: gia.h:279
int DelayTarget
Definition: gia.h:276
int nCoarseLimit
Definition: gia.h:273
int fVerbose
Definition: gia.h:291
int fCoarsen
Definition: gia.h:281
int Abc_CommandAbc9Load ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26067 of file abc.c.

26068 {
26069  int c;
26071  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
26072  {
26073  switch ( c )
26074  {
26075  case 'h':
26076  goto usage;
26077  default:
26078  goto usage;
26079  }
26080  }
26081  // restore from best
26082  if ( pAbc->pGiaBest == NULL )
26083  {
26084  Abc_Print( -1, "Abc_CommandAbc9Load(): There is no best design saved.\n" );
26085  return 1;
26086  }
26087  Gia_ManStopP( &pAbc->pGia );
26088  pAbc->pGia = Gia_ManDupWithAttributes( pAbc->pGiaBest );
26089  return 0;
26090 
26091 usage:
26092  Abc_Print( -2, "usage: &load [-h]\n" );
26093  Abc_Print( -2, "\t loads previously saved AIG with mapping" );
26094  Abc_Print( -2, "\t-h : print the command usage\n");
26095  return 1;
26096 }
void Gia_ManStopP(Gia_Man_t **p)
Definition: giaMan.c:177
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManDupWithAttributes(Gia_Man_t *p)
Definition: giaDup.c:583
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Maxi ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36583 of file abc.c.

36584 {
36585  extern Vec_Int_t * Gia_ManMaxiTest( Gia_Man_t * p, Vec_Int_t * vInit, int nFrames, int nWords, int nTimeOut, int fSim, int fVerbose );
36586  Vec_Int_t * vTemp;
36587  int c, nFrames = 5, nWords = 1000, nTimeOut = 0, fSim = 0, fVerbose = 0;
36589  while ( ( c = Extra_UtilGetopt( argc, argv, "FWTsvh" ) ) != EOF )
36590  {
36591  switch ( c )
36592  {
36593  case 'F':
36594  if ( globalUtilOptind >= argc )
36595  {
36596  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
36597  goto usage;
36598  }
36599  nFrames = atoi(argv[globalUtilOptind]);
36600  globalUtilOptind++;
36601  if ( nFrames < 0 )
36602  goto usage;
36603  break;
36604  case 'W':
36605  if ( globalUtilOptind >= argc )
36606  {
36607  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
36608  goto usage;
36609  }
36610  nWords = atoi(argv[globalUtilOptind]);
36611  globalUtilOptind++;
36612  if ( nWords < 0 )
36613  goto usage;
36614  break;
36615  case 'T':
36616  if ( globalUtilOptind >= argc )
36617  {
36618  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
36619  goto usage;
36620  }
36621  nTimeOut = atoi(argv[globalUtilOptind]);
36622  globalUtilOptind++;
36623  if ( nTimeOut < 0 )
36624  goto usage;
36625  break;
36626  case 's':
36627  fSim ^= 1;
36628  break;
36629  case 'v':
36630  fVerbose ^= 1;
36631  break;
36632  case 'h':
36633  goto usage;
36634  default:
36635  goto usage;
36636  }
36637  }
36638  if ( pAbc->pGia == NULL )
36639  {
36640  Abc_Print( -1, "Abc_CommandAbc9Maxi(): There is no AIG.\n" );
36641  return 0;
36642  }
36643  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
36644  {
36645  Abc_Print( -1, "Abc_CommandAbc9Maxi(): AIG is combinational.\n" );
36646  return 0;
36647  }
36648  pAbc->pGia->vInitClasses = Gia_ManMaxiTest( pAbc->pGia, vTemp = pAbc->pGia->vInitClasses, nFrames, nWords, nTimeOut, fSim, fVerbose );
36649  Vec_IntFreeP( &vTemp );
36650  return 0;
36651 
36652 usage:
36653  Abc_Print( -2, "usage: &maxi [-FWT num] [-svh]\n" );
36654  Abc_Print( -2, "\t experimental procedure\n" );
36655  Abc_Print( -2, "\t-F num : the number of timeframes [default = %d]\n", nFrames );
36656  Abc_Print( -2, "\t-W num : the number of machine words [default = %d]\n", nWords );
36657  Abc_Print( -2, "\t-T num : approximate global runtime limit in seconds [default = %d]\n", nTimeOut );
36658  Abc_Print( -2, "\t-s : toggles using ternary simulation [default = %s]\n", fSim? "yes": "no" );
36659  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
36660  Abc_Print( -2, "\t-h : print the command usage\n");
36661  return 1;
36662 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Vec_Int_t * Gia_ManMaxiTest(Gia_Man_t *p, Vec_Int_t *vInit0, int nFrames, int nWords, int nTimeOut, int fSim, int fVerbose)
Definition: bmcMaxi.c:266
int nWords
Definition: abcNpn.c:127
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Mf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33019 of file abc.c.

33020 {
33021  char Buffer[200];
33022  Jf_Par_t Pars, * pPars = &Pars;
33023  Gia_Man_t * pNew; int c;
33024  Mf_ManSetDefaultPars( pPars );
33026  while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWaekmcgvwh" ) ) != EOF )
33027  {
33028  switch ( c )
33029  {
33030  case 'K':
33031  if ( globalUtilOptind >= argc )
33032  {
33033  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
33034  goto usage;
33035  }
33036  pPars->nLutSize = atoi(argv[globalUtilOptind]);
33037  globalUtilOptind++;
33038  if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
33039  {
33040  Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
33041  goto usage;
33042  }
33043  break;
33044  case 'C':
33045  if ( globalUtilOptind >= argc )
33046  {
33047  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
33048  goto usage;
33049  }
33050  pPars->nCutNum = atoi(argv[globalUtilOptind]);
33051  globalUtilOptind++;
33052  if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
33053  {
33054  Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
33055  goto usage;
33056  }
33057  break;
33058  case 'F':
33059  if ( globalUtilOptind >= argc )
33060  {
33061  Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
33062  goto usage;
33063  }
33064  pPars->nRounds = atoi(argv[globalUtilOptind]);
33065  globalUtilOptind++;
33066  if ( pPars->nRounds < 0 )
33067  goto usage;
33068  break;
33069  case 'A':
33070  if ( globalUtilOptind >= argc )
33071  {
33072  Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
33073  goto usage;
33074  }
33075  pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
33076  globalUtilOptind++;
33077  if ( pPars->nRoundsEla < 0 )
33078  goto usage;
33079  break;
33080  case 'R':
33081  if ( globalUtilOptind >= argc )
33082  {
33083  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
33084  return 0;
33085  }
33086  pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
33087  globalUtilOptind++;
33088  if ( pPars->nRelaxRatio < 0 )
33089  goto usage;
33090  break;
33091  case 'L':
33092  if ( globalUtilOptind >= argc )
33093  {
33094  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
33095  return 0;
33096  }
33097  pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
33098  globalUtilOptind++;
33099  if ( pPars->nCoarseLimit < 0 )
33100  goto usage;
33101  break;
33102  case 'E':
33103  if ( globalUtilOptind >= argc )
33104  {
33105  Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
33106  return 0;
33107  }
33108  pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
33109  globalUtilOptind++;
33110  if ( pPars->nAreaTuner < 0 )
33111  goto usage;
33112  break;
33113  case 'D':
33114  if ( globalUtilOptind >= argc )
33115  {
33116  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
33117  goto usage;
33118  }
33119  pPars->DelayTarget = atoi(argv[globalUtilOptind]);
33120  globalUtilOptind++;
33121  if ( pPars->DelayTarget <= 0.0 )
33122  goto usage;
33123  break;
33124  case 'W':
33125  if ( globalUtilOptind >= argc )
33126  {
33127  Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
33128  goto usage;
33129  }
33130  pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
33131  globalUtilOptind++;
33132  if ( pPars->nVerbLimit < 0 )
33133  goto usage;
33134  break;
33135  case 'a':
33136  pPars->fAreaOnly ^= 1;
33137  break;
33138  case 'e':
33139  pPars->fOptEdge ^= 1;
33140  break;
33141  case 'k':
33142  pPars->fCoarsen ^= 1;
33143  break;
33144  case 'm':
33145  pPars->fCutMin ^= 1;
33146  break;
33147  case 'c':
33148  pPars->fGenCnf ^= 1;
33149  break;
33150  case 'g':
33151  pPars->fPureAig ^= 1;
33152  break;
33153  case 'v':
33154  pPars->fVerbose ^= 1;
33155  break;
33156  case 'w':
33157  pPars->fVeryVerbose ^= 1;
33158  break;
33159  case 'h':
33160  default:
33161  goto usage;
33162  }
33163  }
33164 
33165  if ( pAbc->pGia == NULL )
33166  {
33167  Abc_Print( -1, "Empty GIA network.\n" );
33168  return 1;
33169  }
33170 
33171  pNew = Mf_ManPerformMapping( pAbc->pGia, pPars );
33172  if ( pNew == NULL )
33173  {
33174  Abc_Print( -1, "Abc_CommandAbc9Lf(): Mapping into LUTs has failed.\n" );
33175  return 1;
33176  }
33177  if ( pPars->fGenCnf )
33178  Cnf_DataFree( pAbc->pGia->pData ), pAbc->pGia->pData = NULL;
33179  Abc_FrameUpdateGia( pAbc, pNew );
33180  return 0;
33181 
33182 usage:
33183  if ( pPars->DelayTarget == -1 )
33184  sprintf(Buffer, "best possible" );
33185  else
33186  sprintf(Buffer, "%d", pPars->DelayTarget );
33187  Abc_Print( -2, "usage: &mf [-KCFARLED num] [-akmcgvwh]\n" );
33188  Abc_Print( -2, "\t performs technology mapping of the network\n" );
33189  Abc_Print( -2, "\t-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
33190  Abc_Print( -2, "\t-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
33191  Abc_Print( -2, "\t-F num : the number of area flow rounds [default = %d]\n", pPars->nRounds );
33192  Abc_Print( -2, "\t-A num : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
33193  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
33194  Abc_Print( -2, "\t-L num : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
33195  Abc_Print( -2, "\t-E num : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
33196  Abc_Print( -2, "\t-D num : sets the delay constraint for the mapping [default = %s]\n", Buffer );
33197  Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
33198  Abc_Print( -2, "\t-e : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
33199  Abc_Print( -2, "\t-k : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
33200  Abc_Print( -2, "\t-m : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
33201  Abc_Print( -2, "\t-c : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
33202  Abc_Print( -2, "\t-g : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
33203  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
33204  Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
33205  Abc_Print( -2, "\t-h : prints the command usage\n");
33206  return 1;
33207 }
int nCutNum
Definition: gia.h:268
int nLutSize
Definition: gia.h:267
void Mf_ManSetDefaultPars(Jf_Par_t *pPars)
Definition: giaMf.c:1380
int nAreaTuner
Definition: gia.h:274
int nCutNumMax
Definition: gia.h:294
Gia_Man_t * Mf_ManPerformMapping(Gia_Man_t *pGia, Jf_Par_t *pPars)
Definition: giaMf.c:1575
int fAreaOnly
Definition: gia.h:277
int nVerbLimit
Definition: gia.h:275
int fVeryVerbose
Definition: gia.h:292
int nRelaxRatio
Definition: gia.h:272
int fOptEdge
Definition: gia.h:278
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Definition: gia.h:265
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nRounds
Definition: gia.h:270
Definition: gia.h:95
int fPureAig
Definition: gia.h:287
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fCutMin
Definition: gia.h:282
void Cnf_DataFree(Cnf_Dat_t *p)
Definition: cnfMan.c:180
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int fGenCnf
Definition: gia.h:284
int nLutSizeMax
Definition: gia.h:293
int nRoundsEla
Definition: gia.h:271
int DelayTarget
Definition: gia.h:276
int nCoarseLimit
Definition: gia.h:273
int fVerbose
Definition: gia.h:291
int fCoarsen
Definition: gia.h:281
int Abc_CommandAbc9Mfs ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 37025 of file abc.c.

37026 {
37027  extern Gia_Man_t * Gia_ManPerformMfs( Gia_Man_t * p, Sfm_Par_t * pPars );
37028  Gia_Man_t * pTemp; int c;
37029  Sfm_Par_t Pars, * pPars = &Pars;
37030  Sfm_ParSetDefault( pPars );
37031  pPars->nTfoLevMax = 5;
37032  pPars->nDepthMax = 100;
37033  pPars->nWinSizeMax = 2000;
37035  while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCNdaevwh" ) ) != EOF )
37036  {
37037  switch ( c )
37038  {
37039  case 'W':
37040  if ( globalUtilOptind >= argc )
37041  {
37042  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
37043  goto usage;
37044  }
37045  pPars->nTfoLevMax = atoi(argv[globalUtilOptind]);
37046  globalUtilOptind++;
37047  if ( pPars->nTfoLevMax < 0 )
37048  goto usage;
37049  break;
37050  case 'F':
37051  if ( globalUtilOptind >= argc )
37052  {
37053  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
37054  goto usage;
37055  }
37056  pPars->nFanoutMax = atoi(argv[globalUtilOptind]);
37057  globalUtilOptind++;
37058  if ( pPars->nFanoutMax < 0 )
37059  goto usage;
37060  break;
37061  case 'D':
37062  if ( globalUtilOptind >= argc )
37063  {
37064  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
37065  goto usage;
37066  }
37067  pPars->nDepthMax = atoi(argv[globalUtilOptind]);
37068  globalUtilOptind++;
37069  if ( pPars->nDepthMax < 0 )
37070  goto usage;
37071  break;
37072  case 'M':
37073  if ( globalUtilOptind >= argc )
37074  {
37075  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
37076  goto usage;
37077  }
37078  pPars->nWinSizeMax = atoi(argv[globalUtilOptind]);
37079  globalUtilOptind++;
37080  if ( pPars->nWinSizeMax < 0 )
37081  goto usage;
37082  break;
37083  case 'L':
37084  if ( globalUtilOptind >= argc )
37085  {
37086  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
37087  goto usage;
37088  }
37089  pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
37090  globalUtilOptind++;
37091  if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
37092  goto usage;
37093  break;
37094  case 'C':
37095  if ( globalUtilOptind >= argc )
37096  {
37097  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
37098  goto usage;
37099  }
37100  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
37101  globalUtilOptind++;
37102  if ( pPars->nBTLimit < 0 )
37103  goto usage;
37104  break;
37105  case 'N':
37106  if ( globalUtilOptind >= argc )
37107  {
37108  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
37109  goto usage;
37110  }
37111  pPars->nNodesMax = atoi(argv[globalUtilOptind]);
37112  globalUtilOptind++;
37113  if ( pPars->nNodesMax < 0 )
37114  goto usage;
37115  break;
37116  case 'd':
37117  pPars->fRrOnly ^= 1;
37118  break;
37119  case 'a':
37120  pPars->fArea ^= 1;
37121  break;
37122  case 'e':
37123  pPars->fMoreEffort ^= 1;
37124  break;
37125  case 'v':
37126  pPars->fVerbose ^= 1;
37127  break;
37128  case 'w':
37129  pPars->fVeryVerbose ^= 1;
37130  break;
37131  case 'h':
37132  goto usage;
37133  default:
37134  goto usage;
37135  }
37136  }
37137  if ( pAbc->pGia == NULL )
37138  {
37139  Abc_Print( -1, "Abc_CommandAbc9Mfs(): There is no AIG.\n" );
37140  return 0;
37141  }
37142  if ( Gia_ManBufNum(pAbc->pGia) )
37143  {
37144  Abc_Print( -1, "Abc_CommandAbc9Mfs(): This command does not work with barrier buffers.\n" );
37145  return 1;
37146  }
37147  if ( !Gia_ManHasMapping(pAbc->pGia) )
37148  {
37149  Abc_Print( -1, "Abc_CommandAbc9Mfs(): The current AIG has no mapping.\n" );
37150  return 0;
37151  }
37152  pTemp = Gia_ManPerformMfs( pAbc->pGia, pPars );
37153  Abc_FrameUpdateGia( pAbc, pTemp );
37154  return 0;
37155 
37156 usage:
37157  Abc_Print( -2, "usage: &mfs [-WFDMLCN <num>] [-daevwh]\n" );
37158  Abc_Print( -2, "\t performs don't-care-based optimization of logic networks\n" );
37159  Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nTfoLevMax );
37160  Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutMax );
37161  Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
37162  Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax );
37163  Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
37164  Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
37165  Abc_Print( -2, "\t-N <num> : the max number of nodes to try (0 = all) [default = %d]\n", pPars->nNodesMax );
37166  Abc_Print( -2, "\t-d : toggle performing redundancy removal [default = %s]\n", pPars->fRrOnly? "yes": "no" );
37167  Abc_Print( -2, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
37168  Abc_Print( -2, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
37169  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
37170  Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
37171  Abc_Print( -2, "\t-h : print the command usage\n");
37172  return 1;
37173 }
int fRrOnly
Definition: sfm.h:53
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nNodesMax
Definition: sfm.h:51
int nBTLimit
Definition: sfm.h:50
Definition: sfm.h:43
int fArea
Definition: sfm.h:54
void Sfm_ParSetDefault(Sfm_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: sfmCore.c:45
Gia_Man_t * Gia_ManPerformMfs(Gia_Man_t *p, Sfm_Par_t *pPars)
Definition: giaMfs.c:372
int fMoreEffort
Definition: sfm.h:55
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int nDepthMax
Definition: sfm.h:47
int nGrowthLevel
Definition: sfm.h:49
int globalUtilOptind
Definition: extraUtilUtil.c:45
int nTfoLevMax
Definition: sfm.h:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fVerbose
Definition: sfm.h:56
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int fVeryVerbose
Definition: sfm.h:57
static int Gia_ManBufNum(Gia_Man_t *p)
Definition: gia.h:392
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
int nWinSizeMax
Definition: sfm.h:48
int nFanoutMax
Definition: sfm.h:46
int Abc_CommandAbc9Miter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29307 of file abc.c.

29308 {
29309  FILE * pFile;
29310  Gia_Man_t * pAux;
29311  Gia_Man_t * pSecond;
29312  char * FileName, * pTemp;
29313  char ** pArgvNew;
29314  int nArgcNew;
29315  int c;
29316  int nInsDup = 0;
29317  int fDualOut = 0;
29318  int fSeq = 0;
29319  int fTrans = 0;
29320  int fVerbose = 0;
29322  while ( ( c = Extra_UtilGetopt( argc, argv, "Idstvh" ) ) != EOF )
29323  {
29324  switch ( c )
29325  {
29326  case 'I':
29327  if ( globalUtilOptind >= argc )
29328  {
29329  Abc_Print( -1, "Command line switch \"-I\" should be followed by a char string.\n" );
29330  goto usage;
29331  }
29332  nInsDup = atoi(argv[globalUtilOptind]);
29333  globalUtilOptind++;
29334  if ( nInsDup < 0 )
29335  goto usage;
29336  break;
29337  case 'd':
29338  fDualOut ^= 1;
29339  break;
29340  case 's':
29341  fSeq ^= 1;
29342  break;
29343  case 't':
29344  fTrans ^= 1;
29345  break;
29346  case 'v':
29347  fVerbose ^= 1;
29348  break;
29349  case 'h':
29350  goto usage;
29351  default:
29352  goto usage;
29353  }
29354  }
29355  if ( fTrans )
29356  {
29357  if ( (Gia_ManPoNum(pAbc->pGia) & 1) == 1 )
29358  {
29359  Abc_Print( -1, "Abc_CommandAbc9Miter(): The number of outputs should be even.\n" );
29360  return 0;
29361  }
29362  if ( pAbc->pGia == NULL )
29363  {
29364  Abc_Print( -1, "Abc_CommandAbc9Miter(): There is no AIG.\n" );
29365  return 1;
29366  }
29367  pAux = Gia_ManTransformMiter( pAbc->pGia );
29368  Abc_FrameUpdateGia( pAbc, pAux );
29369  Abc_Print( 1, "The miter (current AIG) is transformed by XORing POs pair-wise.\n" );
29370  return 0;
29371  }
29372 
29373  pArgvNew = argv + globalUtilOptind;
29374  nArgcNew = argc - globalUtilOptind;
29375  if ( nArgcNew != 1 )
29376  {
29377  Abc_Print( -1, "File name is not given on the command line.\n" );
29378  return 1;
29379  }
29380 
29381  // get the input file name
29382  FileName = pArgvNew[0];
29383  // fix the wrong symbol
29384  for ( pTemp = FileName; *pTemp; pTemp++ )
29385  if ( *pTemp == '>' )
29386  *pTemp = '\\';
29387  if ( (pFile = fopen( FileName, "r" )) == NULL )
29388  {
29389  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
29390  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
29391  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
29392  Abc_Print( 1, "\n" );
29393  return 1;
29394  }
29395  fclose( pFile );
29396  pSecond = Gia_AigerRead( FileName, 0, 0 );
29397  if ( pSecond == NULL )
29398  {
29399  Abc_Print( -1, "Reading AIGER has failed.\n" );
29400  return 0;
29401  }
29402  // compute the miter
29403  pAux = Gia_ManMiter( pAbc->pGia, pSecond, nInsDup, fDualOut, fSeq, 0, fVerbose );
29404  Gia_ManStop( pSecond );
29405  Abc_FrameUpdateGia( pAbc, pAux );
29406  return 0;
29407 
29408 usage:
29409  Abc_Print( -2, "usage: &miter [-I num] [-dstvh] <file>\n" );
29410  Abc_Print( -2, "\t creates miter of two designs (current AIG vs. <file>)\n" );
29411  Abc_Print( -2, "\t-I num : the number of last PIs to replicate [default = %d]\n", nInsDup );
29412  Abc_Print( -2, "\t-d : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
29413  Abc_Print( -2, "\t-s : toggle creating sequential miter [default = %s]\n", fSeq? "yes": "no" );
29414  Abc_Print( -2, "\t-t : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
29415  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
29416  Abc_Print( -2, "\t-h : print the command usage\n");
29417  Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
29418  return 1;
29419 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * Gia_ManTransformMiter(Gia_Man_t *p)
Definition: giaDup.c:2324
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
Definition: giaDup.c:2128
int Abc_CommandAbc9Miter2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29432 of file abc.c.

29433 {
29434  FILE * pFile;
29435  Gia_Man_t * pAux;
29436  char * FileName, * pTemp, * pInit;
29437  char ** pArgvNew;
29438  int nArgcNew;
29439  int c, fVerbose = 0;
29441  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
29442  {
29443  switch ( c )
29444  {
29445  case 'v':
29446  fVerbose ^= 1;
29447  break;
29448  case 'h':
29449  goto usage;
29450  default:
29451  goto usage;
29452  }
29453  }
29454  pArgvNew = argv + globalUtilOptind;
29455  nArgcNew = argc - globalUtilOptind;
29456  if ( nArgcNew != 1 )
29457  {
29458  Abc_Print( -1, "File name is not given on the command line.\n" );
29459  return 1;
29460  }
29461  // get the input file name
29462  FileName = pArgvNew[0];
29463  // fix the wrong symbol
29464  for ( pTemp = FileName; *pTemp; pTemp++ )
29465  if ( *pTemp == '>' )
29466  *pTemp = '\\';
29467  if ( (pFile = fopen( FileName, "r" )) == NULL )
29468  {
29469  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
29470  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
29471  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
29472  Abc_Print( 1, "\n" );
29473  return 1;
29474  }
29475  fclose( pFile );
29476  // extract string
29477  pInit = Extra_FileReadContents( FileName );
29478  Extra_StringClean( pInit, "01xX" );
29479  if ( (int)strlen(pInit) != Gia_ManCiNum(pAbc->pGia) )
29480  {
29481  Abc_Print( -1, "Init string length (%d) differs from PI and flop count (%d).\n", strlen(pInit), Gia_ManCiNum(pAbc->pGia) );
29482  ABC_FREE( pInit );
29483  return 1;
29484  }
29485  // compute the miter
29486  pAux = Gia_ManMiter2( pAbc->pGia, pInit, fVerbose );
29487  ABC_FREE( pInit );
29488  Abc_FrameUpdateGia( pAbc, pAux );
29489  return 0;
29490 
29491 usage:
29492  Abc_Print( -2, "usage: &miter2 [-vh] <file>\n" );
29493  Abc_Print( -2, "\t creates miter of two copies of the design\n" );
29494  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
29495  Abc_Print( -2, "\t-h : print the command usage\n");
29496  Abc_Print( -2, "\t<file> : file name with flop initial values (0/1/x/X) [default = required]\n" );
29497  return 1;
29498 }
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Extra_StringClean(char *pStrGiven, char *pCharKeep)
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
#define ABC_FREE(obj)
Definition: abc_global.h:232
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int strlen()
char * Extra_FileReadContents(char *pFileName)
Gia_Man_t * Gia_ManMiter2(Gia_Man_t *p, char *pInit, int fVerbose)
Definition: giaDup.c:2462
int Abc_CommandAbc9MultiProve ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35420 of file abc.c.

35421 {
35422  extern int Gia_ManMultiProve( Gia_Man_t * p, Bmc_MulPar_t * pPars );
35423  Vec_Int_t * vStatuses; int c;
35424  Bmc_MulPar_t Pars, * pPars = &Pars;
35425  memset( pPars, 0, sizeof(Bmc_MulPar_t) );
35426  pPars->TimeOutGlo = 30;
35427  pPars->TimeOutLoc = 2;
35428  pPars->TimeOutInc = 100;
35429  pPars->TimeOutGap = 0;
35430  pPars->TimePerOut = 0;
35432  while ( ( c = Extra_UtilGetopt( argc, argv, "TLMGHsdvwh" ) ) != EOF )
35433  {
35434  switch ( c )
35435  {
35436  case 'T':
35437  if ( globalUtilOptind >= argc )
35438  {
35439  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
35440  goto usage;
35441  }
35442  pPars->TimeOutGlo = atoi(argv[globalUtilOptind]);
35443  globalUtilOptind++;
35444  if ( pPars->TimeOutGlo < 0 )
35445  goto usage;
35446  break;
35447  case 'L':
35448  if ( globalUtilOptind >= argc )
35449  {
35450  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
35451  goto usage;
35452  }
35453  pPars->TimeOutLoc = atoi(argv[globalUtilOptind]);
35454  globalUtilOptind++;
35455  if ( pPars->TimeOutLoc <= 0 )
35456  goto usage;
35457  break;
35458  case 'M':
35459  if ( globalUtilOptind >= argc )
35460  {
35461  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
35462  goto usage;
35463  }
35464  pPars->TimeOutInc = atoi(argv[globalUtilOptind]);
35465  globalUtilOptind++;
35466  if ( pPars->TimeOutInc <= 0 )
35467  goto usage;
35468  break;
35469  case 'G':
35470  if ( globalUtilOptind >= argc )
35471  {
35472  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
35473  goto usage;
35474  }
35475  pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
35476  globalUtilOptind++;
35477  if ( pPars->TimeOutGap <= 0 )
35478  goto usage;
35479  break;
35480  case 'H':
35481  if ( globalUtilOptind >= argc )
35482  {
35483  Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
35484  goto usage;
35485  }
35486  pPars->TimePerOut = atoi(argv[globalUtilOptind]);
35487  globalUtilOptind++;
35488  if ( pPars->TimePerOut <= 0 )
35489  goto usage;
35490  break;
35491  case 's':
35492  pPars->fUseSyn ^= 1;
35493  break;
35494  case 'd':
35495  pPars->fDumpFinal ^= 1;
35496  break;
35497  case 'v':
35498  pPars->fVerbose ^= 1;
35499  break;
35500  case 'w':
35501  pPars->fVeryVerbose ^= 1;
35502  break;
35503  case 'h':
35504  goto usage;
35505  default:
35506  goto usage;
35507  }
35508  }
35509  if ( pAbc->pGia == NULL )
35510  {
35511  Abc_Print( -1, "Abc_CommandAbc9MultiProve(): There is no AIG.\n" );
35512  return 1;
35513  }
35514  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
35515  {
35516  Abc_Print( -1, "Abc_CommandAbc9MultiProve(): The problem is combinational.\n" );
35517  return 1;
35518  }
35519  pAbc->Status = Gia_ManMultiProve( pAbc->pGia, pPars );
35520  vStatuses = Abc_FrameDeriveStatusArray( pAbc->pGia->vSeqModelVec );
35521  Abc_FrameReplacePoStatuses( pAbc, &vStatuses );
35522  Abc_FrameReplaceCexVec( pAbc, &pAbc->pGia->vSeqModelVec );
35523  return 0;
35524 
35525 usage:
35526  Abc_Print( -2, "usage: &mprove [-TLMGH num] [-sdvwh]\n" );
35527  Abc_Print( -2, "\t proves multi-output testcase by applying several engines\n" );
35528  Abc_Print( -2, "\t-T num : approximate global runtime limit in seconds [default = %d]\n", pPars->TimeOutGlo );
35529  Abc_Print( -2, "\t-L num : approximate local runtime limit in seconds [default = %d]\n", pPars->TimeOutLoc );
35530  Abc_Print( -2, "\t-M num : percentage of local runtime limit increase [default = %d]\n", pPars->TimeOutInc );
35531  Abc_Print( -2, "\t-G num : approximate gap runtime limit in seconds [default = %d]\n", pPars->TimeOutGap );
35532  Abc_Print( -2, "\t-H num : timeout per output in miliseconds [default = %d]\n", pPars->TimePerOut );
35533  Abc_Print( -2, "\t-s : toggle using combinational synthesis [default = %s]\n", pPars->fUseSyn? "yes": "no" );
35534  Abc_Print( -2, "\t-d : toggle dumping invariant into a file [default = %s]\n", pPars->fDumpFinal? "yes": "no" );
35535  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
35536  Abc_Print( -2, "\t-w : toggle printing additional verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
35537  Abc_Print( -2, "\t-h : print the command usage\n");
35538  return 1;
35539 }
char * memset()
int fVerbose
Definition: bmc.h:119
void Abc_FrameReplaceCexVec(Abc_Frame_t *pAbc, Vec_Ptr_t **pvCexVec)
Definition: abc.c:515
int fVeryVerbose
Definition: bmc.h:120
int TimeOutGap
Definition: bmc.h:115
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int fUseSyn
Definition: bmc.h:117
int Gia_ManMultiProve(Gia_Man_t *p, Bmc_MulPar_t *pPars)
Definition: bmcMulti.c:279
int TimeOutGlo
Definition: bmc.h:112
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int TimeOutInc
Definition: bmc.h:114
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fDumpFinal
Definition: bmc.h:118
Definition: gia.h:95
int TimeOutLoc
Definition: bmc.h:113
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int TimePerOut
Definition: bmc.h:116
Vec_Int_t * Abc_FrameDeriveStatusArray(Vec_Ptr_t *vCexes)
Definition: abc.c:575
void Abc_FrameReplacePoStatuses(Abc_Frame_t *pAbc, Vec_Int_t **pvStatuses)
Definition: abc.c:556
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9MuxProfile ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26508 of file abc.c.

26509 {
26510  extern void Gia_ManMuxProfiling( Gia_Man_t * p );
26511  int c;
26513  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
26514  {
26515  switch ( c )
26516  {
26517  case 'h':
26518  goto usage;
26519  default:
26520  goto usage;
26521  }
26522  }
26523  if ( pAbc->pGia == NULL )
26524  {
26525  Abc_Print( -1, "Abc_CommandAbc9MuxProfile(): There is no AIG.\n" );
26526  return 1;
26527  }
26528  Gia_ManMuxProfiling( pAbc->pGia );
26529  return 0;
26530 
26531 usage:
26532  Abc_Print( -2, "usage: &mux_profile [-h]\n" );
26533  Abc_Print( -2, "\t profile MUXes appearing in the design\n" );
26534  Abc_Print( -2, "\t-h : print the command usage\n");
26535  return 1;
26536 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Gia_ManMuxProfiling(Gia_Man_t *p)
Definition: giaMuxes.c:513
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Nf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33220 of file abc.c.

33221 {
33222  extern void Nf_ManSetDefaultPars( Jf_Par_t * pPars );
33223  extern Gia_Man_t * Nf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars );
33224  char Buffer[200];
33225  Jf_Par_t Pars, * pPars = &Pars;
33226  Gia_Man_t * pNew; int c;
33227  Nf_ManSetDefaultPars( pPars );
33229  while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWakvwh" ) ) != EOF )
33230  {
33231  switch ( c )
33232  {
33233  case 'K':
33234  if ( globalUtilOptind >= argc )
33235  {
33236  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
33237  goto usage;
33238  }
33239  pPars->nLutSize = atoi(argv[globalUtilOptind]);
33240  globalUtilOptind++;
33241  if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
33242  {
33243  Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
33244  goto usage;
33245  }
33246  break;
33247  case 'C':
33248  if ( globalUtilOptind >= argc )
33249  {
33250  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
33251  goto usage;
33252  }
33253  pPars->nCutNum = atoi(argv[globalUtilOptind]);
33254  globalUtilOptind++;
33255  if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
33256  {
33257  Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
33258  goto usage;
33259  }
33260  break;
33261  case 'F':
33262  if ( globalUtilOptind >= argc )
33263  {
33264  Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
33265  goto usage;
33266  }
33267  pPars->nRounds = atoi(argv[globalUtilOptind]);
33268  globalUtilOptind++;
33269  if ( pPars->nRounds < 0 )
33270  goto usage;
33271  break;
33272  case 'A':
33273  if ( globalUtilOptind >= argc )
33274  {
33275  Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
33276  goto usage;
33277  }
33278  pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
33279  globalUtilOptind++;
33280  if ( pPars->nRoundsEla < 0 )
33281  goto usage;
33282  break;
33283  case 'R':
33284  if ( globalUtilOptind >= argc )
33285  {
33286  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
33287  return 0;
33288  }
33289  pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
33290  globalUtilOptind++;
33291  if ( pPars->nRelaxRatio < 0 )
33292  goto usage;
33293  break;
33294  case 'L':
33295  if ( globalUtilOptind >= argc )
33296  {
33297  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
33298  return 0;
33299  }
33300  pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
33301  globalUtilOptind++;
33302  if ( pPars->nCoarseLimit < 0 )
33303  goto usage;
33304  break;
33305  case 'E':
33306  if ( globalUtilOptind >= argc )
33307  {
33308  Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
33309  return 0;
33310  }
33311  pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
33312  globalUtilOptind++;
33313  if ( pPars->nAreaTuner < 0 )
33314  goto usage;
33315  break;
33316  case 'D':
33317  if ( globalUtilOptind >= argc )
33318  {
33319  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
33320  goto usage;
33321  }
33322  pPars->DelayTarget = atoi(argv[globalUtilOptind]);
33323  globalUtilOptind++;
33324  if ( pPars->DelayTarget <= 0.0 )
33325  goto usage;
33326  break;
33327  case 'W':
33328  if ( globalUtilOptind >= argc )
33329  {
33330  Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
33331  goto usage;
33332  }
33333  pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
33334  globalUtilOptind++;
33335  if ( pPars->nVerbLimit < 0 )
33336  goto usage;
33337  break;
33338  case 'a':
33339  pPars->fAreaOnly ^= 1;
33340  break;
33341  case 'k':
33342  pPars->fCoarsen ^= 1;
33343  break;
33344  case 'v':
33345  pPars->fVerbose ^= 1;
33346  break;
33347  case 'w':
33348  pPars->fVeryVerbose ^= 1;
33349  break;
33350  case 'h':
33351  default:
33352  goto usage;
33353  }
33354  }
33355  if ( pAbc->pGia == NULL )
33356  {
33357  Abc_Print( -1, "Empty GIA network.\n" );
33358  return 1;
33359  }
33360  if ( Abc_FrameReadLibGen() == NULL )
33361  {
33362  Abc_Print( -1, "Current library is not available.\n" );
33363  return 1;
33364  }
33365  pNew = Nf_ManPerformMapping( pAbc->pGia, pPars );
33366  if ( pNew == NULL )
33367  {
33368  Abc_Print( -1, "Abc_CommandAbc9Nf(): Mapping into LUTs has failed.\n" );
33369  return 1;
33370  }
33371  Abc_FrameUpdateGia( pAbc, pNew );
33372  return 0;
33373 
33374 usage:
33375  if ( pPars->DelayTarget == -1 )
33376  sprintf(Buffer, "best possible" );
33377  else
33378  sprintf(Buffer, "%d", pPars->DelayTarget );
33379  Abc_Print( -2, "usage: &nf [-KCFARLED num] [-akvwh]\n" );
33380  Abc_Print( -2, "\t performs technology mapping of the network\n" );
33381  Abc_Print( -2, "\t-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
33382  Abc_Print( -2, "\t-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
33383  Abc_Print( -2, "\t-F num : the number of area flow rounds [default = %d]\n", pPars->nRounds );
33384  Abc_Print( -2, "\t-A num : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
33385  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
33386  Abc_Print( -2, "\t-L num : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
33387  Abc_Print( -2, "\t-E num : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
33388  Abc_Print( -2, "\t-D num : sets the delay constraint for the mapping [default = %s]\n", Buffer );
33389  Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
33390  Abc_Print( -2, "\t-k : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
33391  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
33392  Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
33393  Abc_Print( -2, "\t-h : prints the command usage\n");
33394  return 1;
33395 }
ABC_DLL void * Abc_FrameReadLibGen()
Definition: mainFrame.c:56
int nCutNum
Definition: gia.h:268
int nLutSize
Definition: gia.h:267
int nAreaTuner
Definition: gia.h:274
int nCutNumMax
Definition: gia.h:294
int fAreaOnly
Definition: gia.h:277
int nVerbLimit
Definition: gia.h:275
int fVeryVerbose
Definition: gia.h:292
int nRelaxRatio
Definition: gia.h:272
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Definition: gia.h:265
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Nf_ManSetDefaultPars(Jf_Par_t *pPars)
Definition: giaNf.c:2476
int nRounds
Definition: gia.h:270
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Nf_ManPerformMapping(Gia_Man_t *pGia, Jf_Par_t *pPars)
Definition: giaNf.c:2502
int nLutSizeMax
Definition: gia.h:293
int nRoundsEla
Definition: gia.h:271
int DelayTarget
Definition: gia.h:276
int nCoarseLimit
Definition: gia.h:273
int fVerbose
Definition: gia.h:291
int fCoarsen
Definition: gia.h:281
int Abc_CommandAbc9PFan ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26365 of file abc.c.

26366 {
26367  int c;
26368  int nNodes = 0;
26370  while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
26371  {
26372  switch ( c )
26373  {
26374  case 'N':
26375  if ( globalUtilOptind >= argc )
26376  {
26377  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
26378  goto usage;
26379  }
26380  nNodes = atoi(argv[globalUtilOptind]);
26381  globalUtilOptind++;
26382  if ( nNodes < 0 )
26383  goto usage;
26384  break;
26385  case 'h':
26386  goto usage;
26387  default:
26388  goto usage;
26389  }
26390  }
26391  if ( pAbc->pGia == NULL )
26392  {
26393  Abc_Print( -1, "Abc_CommandAbc9PFan(): There is no AIG.\n" );
26394  return 1;
26395  }
26396  Gia_ManPrintFanio( pAbc->pGia, nNodes );
26397  return 0;
26398 
26399 usage:
26400  Abc_Print( -2, "usage: &pfan [-N num] [-h]\n" );
26401  Abc_Print( -2, "\t prints fanin/fanout statistics\n" );
26402  Abc_Print( -2, "\t-N num : the number of high-fanout nodes to explore [default = %d]\n", nNodes );
26403  Abc_Print( -2, "\t-h : print the command usage\n");
26404  return 1;
26405 }
void Gia_ManPrintFanio(Gia_Man_t *pGia, int nNodes)
Definition: giaCof.c:746
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9PoPart ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35172 of file abc.c.

35173 {
35174  extern Gia_Man_t * Gia_ManFindPoPartition( Gia_Man_t * p, int SelectShift, int fOnlyCis, int fSetLargest, int fVerbose, Vec_Ptr_t ** pvPosEquivs );
35175  Gia_Man_t * pTemp;
35176  Vec_Ptr_t * vPosEquivs = NULL;
35177  int c, SelectShift = 0, fOnlyCis = 0, fSetLargest = 0, fVerbose = 0;
35179  while ( ( c = Extra_UtilGetopt( argc, argv, "Simvh" ) ) != EOF )
35180  {
35181  switch ( c )
35182  {
35183  case 'S':
35184  if ( globalUtilOptind >= argc )
35185  {
35186  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
35187  goto usage;
35188  }
35189  SelectShift = atoi(argv[globalUtilOptind]);
35190  globalUtilOptind++;
35191  if ( SelectShift < 0 )
35192  goto usage;
35193  break;
35194  case 'i':
35195  fOnlyCis ^= 1;
35196  break;
35197  case 'm':
35198  fSetLargest ^= 1;
35199  break;
35200  case 'v':
35201  fVerbose ^= 1;
35202  break;
35203  case 'h':
35204  goto usage;
35205  default:
35206  goto usage;
35207  }
35208  }
35209  if ( pAbc->pGia == NULL )
35210  {
35211  Abc_Print( -1, "Abc_CommandAbc9PoPart(): There is no AIG.\n" );
35212  return 1;
35213  }
35214  pTemp = Gia_ManFindPoPartition( pAbc->pGia, SelectShift, fOnlyCis, fSetLargest, fVerbose, &vPosEquivs );
35215  if ( pTemp )
35216  Abc_FrameUpdateGia( pAbc, pTemp );
35217  Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
35218  return 0;
35219 
35220 usage:
35221  Abc_Print( -2, "usage: &popart [-S num] [-imvh]\n" );
35222  Abc_Print( -2, "\t partitioning of POs into equivalence classes\n" );
35223  Abc_Print( -2, "\t-S num : random seed to select the set of pivot nodes [default = %d]\n", SelectShift );
35224  Abc_Print( -2, "\t : (if the seed is 0, the nodes with max fanout counts are used)\n" );
35225  Abc_Print( -2, "\t-i : toggle allowing only CIs to be the pivots [default = %s]\n", fOnlyCis? "yes": "no" );
35226  Abc_Print( -2, "\t-m : toggle using the largest part as the current network [default = %s]\n", fSetLargest? "yes": "no" );
35227  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
35228  Abc_Print( -2, "\t-h : print the command usage\n");
35229  return 1;
35230 }
void Abc_FrameReplacePoEquivs(Abc_Frame_t *pAbc, Vec_Ptr_t **pvPoEquivs)
Definition: abc.c:537
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Gia_Man_t * Gia_ManFindPoPartition(Gia_Man_t *p, int SelectShift, int fOnlyCis, int fSetLargest, int fVerbose, Vec_Ptr_t **pvPosEquivs)
Definition: giaCone.c:555
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9PoPart2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35243 of file abc.c.

35244 {
35245  extern Gia_Man_t * Gia_ManFindPoPartition2( Gia_Man_t * p, int iStartNum, int nDelta, int nOutsMin, int nOutsMax, int fSetLargest, int fVerbose, Vec_Ptr_t ** pvPosEquivs );
35246  Gia_Man_t * pTemp = NULL;
35247  Vec_Ptr_t * vPosEquivs = NULL;
35248  int c, iStartNum = 0, nDelta = 10, nOutsMin = 100, nOutsMax = 1000, fSetLargest = 0, fVerbose = 0;
35250  while ( ( c = Extra_UtilGetopt( argc, argv, "SDLUmvh" ) ) != EOF )
35251  {
35252  switch ( c )
35253  {
35254  case 'S':
35255  if ( globalUtilOptind >= argc )
35256  {
35257  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
35258  goto usage;
35259  }
35260  iStartNum = atoi(argv[globalUtilOptind]);
35261  globalUtilOptind++;
35262  if ( iStartNum < 0 )
35263  goto usage;
35264  break;
35265  case 'D':
35266  if ( globalUtilOptind >= argc )
35267  {
35268  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
35269  goto usage;
35270  }
35271  nDelta = atoi(argv[globalUtilOptind]);
35272  globalUtilOptind++;
35273  if ( nDelta < 0 )
35274  goto usage;
35275  break;
35276  case 'L':
35277  if ( globalUtilOptind >= argc )
35278  {
35279  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
35280  goto usage;
35281  }
35282  nOutsMin = atoi(argv[globalUtilOptind]);
35283  globalUtilOptind++;
35284  if ( nOutsMin < 0 )
35285  goto usage;
35286  break;
35287  case 'U':
35288  if ( globalUtilOptind >= argc )
35289  {
35290  Abc_Print( -1, "Command line switch \"-U\" should be followed by an integer.\n" );
35291  goto usage;
35292  }
35293  nOutsMax = atoi(argv[globalUtilOptind]);
35294  globalUtilOptind++;
35295  if ( nOutsMax < 0 )
35296  goto usage;
35297  break;
35298  case 'm':
35299  fSetLargest ^= 1;
35300  break;
35301  case 'v':
35302  fVerbose ^= 1;
35303  break;
35304  case 'h':
35305  goto usage;
35306  default:
35307  goto usage;
35308  }
35309  }
35310  if ( pAbc->pGia == NULL )
35311  {
35312  Abc_Print( -1, "Abc_CommandAbc9PoPart(): There is no AIG.\n" );
35313  return 1;
35314  }
35315  pTemp = Gia_ManFindPoPartition2( pAbc->pGia, iStartNum, nDelta, nOutsMin, nOutsMax, fSetLargest, fVerbose, &vPosEquivs );
35316  if ( pTemp )
35317  Abc_FrameUpdateGia( pAbc, pTemp );
35318  Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
35319  return 0;
35320 
35321 usage:
35322  Abc_Print( -2, "usage: &popart2 [-SDLU num] [-mvh]\n" );
35323  Abc_Print( -2, "\t extracting multi-output sequential logic cones\n" );
35324  Abc_Print( -2, "\t-S num : the index of the PO to start the cluster [default = %d]\n", iStartNum );
35325  Abc_Print( -2, "\t-D num : the max increase in flop count after adding one PO [default = %d]\n", nDelta );
35326  Abc_Print( -2, "\t-L num : the minimum number of POs in a cluster [default = %d]\n", nOutsMin );
35327  Abc_Print( -2, "\t-U num : the maximum number of POs in a cluster [default = %d]\n", nOutsMax );
35328  Abc_Print( -2, "\t-m : toggle selecting the largest cluster [default = %s]\n", fSetLargest? "yes": "no" );
35329  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
35330  Abc_Print( -2, "\t-h : print the command usage\n");
35331  return 1;
35332 }
void Abc_FrameReplacePoEquivs(Abc_Frame_t *pAbc, Vec_Ptr_t **pvPoEquivs)
Definition: abc.c:537
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManFindPoPartition2(Gia_Man_t *p, int iStartNum, int nDelta, int nOutsMin, int nOutsMax, int fSetLargest, int fVerbose, Vec_Ptr_t **pvPosEquivs)
Definition: giaCone.c:538
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Posplit ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34028 of file abc.c.

34029 {
34030  extern Aig_Man_t * Aig_ManSplit( Aig_Man_t * p, int nVars, int fVerbose );
34031  Aig_Man_t * pMan, * pAux;
34032  Gia_Man_t * pTemp = NULL;
34033  int c, nVars = 5, fVerbose = 0;
34035  while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
34036  {
34037  switch ( c )
34038  {
34039  case 'N':
34040  if ( globalUtilOptind >= argc )
34041  {
34042  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
34043  goto usage;
34044  }
34045  nVars = atoi(argv[globalUtilOptind]);
34046  globalUtilOptind++;
34047  if ( nVars < 0 )
34048  goto usage;
34049  break;
34050  case 'v':
34051  fVerbose ^= 1;
34052  break;
34053  case 'h':
34054  goto usage;
34055  default:
34056  goto usage;
34057  }
34058  }
34059  if ( pAbc->pGia == NULL )
34060  {
34061  Abc_Print( -1, "Abc_CommandAbc9Posplit(): There is no AIG.\n" );
34062  return 1;
34063  }
34064  pMan = Gia_ManToAigSimple( pAbc->pGia );
34065  pMan = Aig_ManSplit( pAux = pMan, nVars, fVerbose );
34066  Aig_ManStop( pAux );
34067  if ( pMan != NULL )
34068  {
34069  pTemp = Gia_ManFromAigSimple( pMan );
34070  Aig_ManStop( pMan );
34071  Abc_FrameUpdateGia( pAbc, pTemp );
34072  }
34073  return 0;
34074 
34075 usage:
34076  Abc_Print( -2, "usage: &posplit [-N num] [-vh]\n" );
34077  Abc_Print( -2, "\t cofactors the property output w.r.t. a support subset\n" );
34078  Abc_Print( -2, "\t (the OR of new PO functions is equal to the original property)\n" );
34079  Abc_Print( -2, "\t-N num : the number of random cofactoring variables [default = %d]\n", nVars );
34080  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
34081  Abc_Print( -2, "\t-h : print the command usage\n");
34082  return 1;
34083 }
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Aig_Man_t * Aig_ManSplit(Aig_Man_t *p, int nVars, int fVerbose)
Definition: aigSplit.c:254
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Definition: giaAig.c:171
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9PoXsim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36770 of file abc.c.

36771 {
36772  extern Vec_Int_t * Gia_ManPoXSim( Gia_Man_t * p, int nFrames, int fVerbose );
36773  int c, nFrames = 1000, fVerbose = 0;
36775  while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
36776  {
36777  switch ( c )
36778  {
36779  case 'F':
36780  if ( globalUtilOptind >= argc )
36781  {
36782  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
36783  goto usage;
36784  }
36785  nFrames = atoi(argv[globalUtilOptind]);
36786  globalUtilOptind++;
36787  if ( nFrames < 0 )
36788  goto usage;
36789  break;
36790  case 'v':
36791  fVerbose ^= 1;
36792  break;
36793  case 'h':
36794  goto usage;
36795  default:
36796  goto usage;
36797  }
36798  }
36799  if ( pAbc->pGia == NULL )
36800  {
36801  Abc_Print( -1, "Abc_CommandAbc9Bmci(): There is no AIG.\n" );
36802  return 0;
36803  }
36804  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
36805  {
36806  Abc_Print( -1, "Abc_CommandAbc9Bmci(): AIG is combinational.\n" );
36807  return 0;
36808  }
36809  Vec_IntFreeP( &pAbc->vAbcObjIds );
36810  pAbc->vAbcObjIds = Gia_ManPoXSim( pAbc->pGia, nFrames, fVerbose );
36811  return 0;
36812 
36813 usage:
36814  Abc_Print( -2, "usage: &poxsim [-F num] [-vh]\n" );
36815  Abc_Print( -2, "\t X-valued simulation of the multi-output sequential miter\n" );
36816  Abc_Print( -2, "\t-F num : the number of timeframes [default = %d]\n", nFrames );
36817  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
36818  Abc_Print( -2, "\t-h : print the command usage\n");
36819  return 1;
36820 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Vec_Int_t * Gia_ManPoXSim(Gia_Man_t *p, int nFrames, int fVerbose)
Definition: giaUtil.c:1849
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Ps ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26265 of file abc.c.

26266 {
26267  Gps_Par_t Pars, * pPars = &Pars;
26268  int c, fBest = 0;
26269  memset( pPars, 0, sizeof(Gps_Par_t) );
26271  while ( ( c = Extra_UtilGetopt( argc, argv, "Dtpcnlmasbh" ) ) != EOF )
26272  {
26273  switch ( c )
26274  {
26275  case 't':
26276  pPars->fTents ^= 1;
26277  break;
26278  case 'p':
26279  pPars->fSwitch ^= 1;
26280  break;
26281  case 'c':
26282  pPars->fCut ^= 1;
26283  break;
26284  case 'n':
26285  pPars->fNpn ^= 1;
26286  break;
26287  case 'l':
26288  pPars->fLutProf ^= 1;
26289  break;
26290  case 'm':
26291  pPars->fMuxXor ^= 1;
26292  break;
26293  case 'a':
26294  pPars->fMiter ^= 1;
26295  break;
26296  case 's':
26297  pPars->fSkipMap ^= 1;
26298  break;
26299  case 'D':
26300  if ( globalUtilOptind >= argc )
26301  {
26302  Abc_Print( -1, "Command line switch \"-D\" should be followed by a file name.\n" );
26303  goto usage;
26304  }
26305  pPars->pDumpFile = argv[globalUtilOptind];
26306  globalUtilOptind++;
26307  break;
26308  case 'b':
26309  fBest ^= 1;
26310  break;
26311  case 'h':
26312  goto usage;
26313  default:
26314  goto usage;
26315  }
26316  }
26317  if ( fBest )
26318  {
26319  if ( pAbc->pGiaBest == NULL )
26320  {
26321  Abc_Print( -1, "Abc_CommandAbc9Ps(): There is no AIG.\n" );
26322  return 1;
26323  }
26324  Gia_ManPrintStats( pAbc->pGiaBest, pPars );
26325  }
26326  else
26327  {
26328  if ( pAbc->pGia == NULL )
26329  {
26330  Abc_Print( -1, "Abc_CommandAbc9Ps(): There is no AIG.\n" );
26331  return 1;
26332  }
26333  Gia_ManPrintStats( pAbc->pGia, pPars );
26334  }
26335  return 0;
26336 
26337 usage:
26338  Abc_Print( -2, "usage: &ps [-tpcnlmasbh] [-D file]\n" );
26339  Abc_Print( -2, "\t prints stats of the current AIG\n" );
26340  Abc_Print( -2, "\t-t : toggle printing BMC tents [default = %s]\n", pPars->fTents? "yes": "no" );
26341  Abc_Print( -2, "\t-p : toggle printing switching activity [default = %s]\n", pPars->fSwitch? "yes": "no" );
26342  Abc_Print( -2, "\t-c : toggle printing the size of frontier cut [default = %s]\n", pPars->fCut? "yes": "no" );
26343  Abc_Print( -2, "\t-n : toggle printing NPN classes of functions [default = %s]\n", pPars->fNpn? "yes": "no" );
26344  Abc_Print( -2, "\t-l : toggle printing LUT size profile [default = %s]\n", pPars->fLutProf? "yes": "no" );
26345  Abc_Print( -2, "\t-m : toggle printing MUX/XOR statistics [default = %s]\n", pPars->fMuxXor? "yes": "no" );
26346  Abc_Print( -2, "\t-a : toggle printing miter statistics [default = %s]\n", pPars->fMiter? "yes": "no" );
26347  Abc_Print( -2, "\t-s : skip mapping statistics even if mapped [default = %s]\n", pPars->fSkipMap? "yes": "no" );
26348  Abc_Print( -2, "\t-b : toggle printing saved AIG statistics [default = %s]\n", fBest? "yes": "no" );
26349  Abc_Print( -2, "\t-D file : file name to dump statistics [default = none]\n" );
26350  Abc_Print( -2, "\t-h : print the command usage\n");
26351  return 1;
26352 }
char * memset()
int fCut
Definition: gia.h:199
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition: giaMan.c:389
int fLutProf
Definition: gia.h:201
char * pDumpFile
Definition: gia.h:205
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int fTents
Definition: gia.h:197
int fNpn
Definition: gia.h:200
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fMuxXor
Definition: gia.h:202
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fSwitch
Definition: gia.h:198
int fSkipMap
Definition: gia.h:204
int fMiter
Definition: gia.h:203
int Abc_CommandAbc9PSig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26418 of file abc.c.

26419 {
26420  int c;
26421  int fSetReset = 1;
26423  while ( ( c = Extra_UtilGetopt( argc, argv, "rh" ) ) != EOF )
26424  {
26425  switch ( c )
26426  {
26427  case 'r':
26428  fSetReset ^= 1;
26429  break;
26430  case 'h':
26431  goto usage;
26432  default:
26433  goto usage;
26434  }
26435  }
26436  if ( pAbc->pGia == NULL )
26437  {
26438  Abc_Print( -1, "Abc_CommandAbc9PSigs(): There is no AIG.\n" );
26439  return 1;
26440  }
26441  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
26442  {
26443  Abc_Print( -1, "Abc_CommandAbc9PSigs(): Works only for sequential circuits.\n" );
26444  return 1;
26445  }
26446  Gia_ManDetectSeqSignals( pAbc->pGia, fSetReset, 1 );
26447  return 0;
26448 
26449 usage:
26450  Abc_Print( -2, "usage: &psig [-rh]\n" );
26451  Abc_Print( -2, "\t prints enable/set/reset statistics\n" );
26452  Abc_Print( -2, "\t-r : toggle printing set/reset signals [default = %s]\n", fSetReset? "yes": "no" );
26453  Abc_Print( -2, "\t-h : print the command usage\n");
26454  return 1;
26455 }
void Gia_ManDetectSeqSignals(Gia_Man_t *p, int fSetReset, int fVerbose)
Definition: giaEnable.c:130
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Put ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25874 of file abc.c.

25875 {
25876  extern Abc_Ntk_t * Abc_NtkFromDarChoices( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan );
25877  Aig_Man_t * pMan;
25878  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
25879  int c, fVerbose = 0;
25880  int fStatusClear = 1;
25881 
25883  while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
25884  {
25885  switch ( c )
25886  {
25887  case 's':
25888  fStatusClear ^= 1;
25889  break;
25890  case 'v':
25891  fVerbose ^= 1;
25892  break;
25893  case 'h':
25894  goto usage;
25895  default:
25896  goto usage;
25897  }
25898  }
25899  if ( pAbc->pGia == NULL )
25900  {
25901  Abc_Print( -1, "Empty network.\n" );
25902  return 1;
25903  }
25904  if ( Gia_ManHasMapping(pAbc->pGia) || pAbc->pGia->pMuxes )
25905  {
25906  extern Abc_Ntk_t * Abc_NtkFromMappedGia( Gia_Man_t * p );
25907  pNtk = Abc_NtkFromMappedGia( pAbc->pGia );
25908  }
25909  else if ( Gia_ManHasCellMapping(pAbc->pGia) )
25910  {
25912  pNtk = Abc_NtkFromCellMappedGia( pAbc->pGia );
25913  }
25914  else if ( Gia_ManHasDangling(pAbc->pGia) == 0 )
25915  {
25916  pMan = Gia_ManToAig( pAbc->pGia, 0 );
25917  pNtk = Abc_NtkFromAigPhase( pMan );
25918  pNtk->pName = Extra_UtilStrsav(pMan->pName);
25919  Aig_ManStop( pMan );
25920  }
25921  else
25922  {
25923  Abc_Ntk_t * pNtkNoCh;
25924 // Abc_Print( -1, "Transforming AIG with %d choice nodes.\n", Gia_ManEquivCountClasses(pAbc->pGia) );
25925  // create network without choices
25926  pMan = Gia_ManToAig( pAbc->pGia, 0 );
25927  pNtkNoCh = Abc_NtkFromAigPhase( pMan );
25928  pNtkNoCh->pName = Extra_UtilStrsav(pMan->pName);
25929  Aig_ManStop( pMan );
25930  // derive network with choices
25931  pMan = Gia_ManToAig( pAbc->pGia, 1 );
25932  pNtk = Abc_NtkFromDarChoices( pNtkNoCh, pMan );
25933  Abc_NtkDelete( pNtkNoCh );
25934  Aig_ManStop( pMan );
25935  }
25936  // transfer PI names to pNtk
25937  if ( pAbc->pGia->vNamesIn )
25938  {
25939  Abc_Obj_t * pObj;
25940  int i;
25941  Abc_NtkForEachCi( pNtk, pObj, i ) {
25942  if (i < Vec_PtrSize(pAbc->pGia->vNamesIn)) {
25943  Nm_ManDeleteIdName(pNtk->pManName, pObj->Id);
25944  Abc_ObjAssignName( pObj, (char *)Vec_PtrEntry(pAbc->pGia->vNamesIn, i), NULL );
25945  }
25946  }
25947  }
25948  // transfer PO names to pNtk
25949  if ( pAbc->pGia->vNamesOut )
25950  {
25951  Abc_Obj_t * pObj;
25952  int i;
25953  Abc_NtkForEachCo( pNtk, pObj, i ) {
25954  if (i < Vec_PtrSize(pAbc->pGia->vNamesOut)) {
25955  Nm_ManDeleteIdName(pNtk->pManName, pObj->Id);
25956  Abc_ObjAssignName( pObj, (char *)Vec_PtrEntry(pAbc->pGia->vNamesOut, i), NULL );
25957  }
25958  }
25959  }
25960  // replace the current network
25961  Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
25962  if ( fStatusClear )
25963  Abc_FrameClearVerifStatus( pAbc );
25964  return 0;
25965 
25966 usage:
25967  Abc_Print( -2, "usage: &put [-svh]\n" );
25968  Abc_Print( -2, "\t transfer the current network into the old ABC\n" );
25969  Abc_Print( -2, "\t-s : toggle clearning verification status [default = %s]\n", fStatusClear? "yes": "no" );
25970  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
25971  Abc_Print( -2, "\t-h : print the command usage\n");
25972  return 1;
25973 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
void Nm_ManDeleteIdName(Nm_Man_t *p, int ObjId)
Definition: nmApi.c:149
Nm_Man_t * pManName
Definition: abc.h:160
Abc_Ntk_t * Abc_NtkFromMappedGia(Gia_Man_t *p)
Definition: abcDar.c:714
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
int Gia_ManHasDangling(Gia_Man_t *p)
Definition: giaUtil.c:1155
char * Extra_UtilStrsav(const char *s)
Abc_Ntk_t * Abc_NtkFromDarChoices(Abc_Ntk_t *pNtkOld, Aig_Man_t *pMan)
Definition: abcDar.c:1109
ABC_DLL void Abc_FrameClearVerifStatus(Abc_Frame_t *p)
Definition: mainFrame.c:247
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Gia_ManToAig(Gia_Man_t *p, int fChoices)
Definition: giaAig.c:277
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
Abc_Ntk_t * Abc_NtkFromCellMappedGia(Gia_Man_t *p)
Definition: abcDar.c:872
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
int Id
Definition: abc.h:132
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManHasCellMapping(Gia_Man_t *p)
Definition: gia.h:959
char * pName
Definition: abc.h:158
int Abc_CommandAbc9Qbf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36349 of file abc.c.

36350 {
36351  extern Gia_Man_t * Gia_QbfQuantify( Gia_Man_t * p, int nPars );
36352  extern void Gia_QbfDumpFile( Gia_Man_t * pGia, int nPars );
36353  extern int Gia_QbfSolve( Gia_Man_t * pGia, int nPars, int nIterLimit, int nConfLimit, int nTimeOut, int fVerbose );
36354  int c, nPars = -1;
36355  int nIterLimit = 0;
36356  int nConfLimit = 0;
36357  int nTimeOut = 0;
36358  int fDumpCnf = 0;
36359  int fQuantX = 0;
36360  int fVerbose = 0;
36362  while ( ( c = Extra_UtilGetopt( argc, argv, "PICTdqvh" ) ) != EOF )
36363  {
36364  switch ( c )
36365  {
36366  case 'P':
36367  if ( globalUtilOptind >= argc )
36368  {
36369  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
36370  goto usage;
36371  }
36372  nPars = atoi(argv[globalUtilOptind]);
36373  globalUtilOptind++;
36374  if ( nPars < 0 )
36375  goto usage;
36376  break;
36377  case 'I':
36378  if ( globalUtilOptind >= argc )
36379  {
36380  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
36381  goto usage;
36382  }
36383  nIterLimit = atoi(argv[globalUtilOptind]);
36384  globalUtilOptind++;
36385  if ( nIterLimit < 0 )
36386  goto usage;
36387  break;
36388  case 'C':
36389  if ( globalUtilOptind >= argc )
36390  {
36391  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
36392  goto usage;
36393  }
36394  nConfLimit = atoi(argv[globalUtilOptind]);
36395  globalUtilOptind++;
36396  if ( nConfLimit < 0 )
36397  goto usage;
36398  break;
36399  case 'T':
36400  if ( globalUtilOptind >= argc )
36401  {
36402  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
36403  goto usage;
36404  }
36405  nTimeOut = atoi(argv[globalUtilOptind]);
36406  globalUtilOptind++;
36407  if ( nTimeOut < 0 )
36408  goto usage;
36409  break;
36410  case 'd':
36411  fDumpCnf ^= 1;
36412  break;
36413  case 'q':
36414  fQuantX ^= 1;
36415  break;
36416  case 'v':
36417  fVerbose ^= 1;
36418  break;
36419  case 'h':
36420  goto usage;
36421  default:
36422  goto usage;
36423  }
36424  }
36425  if ( pAbc->pGia == NULL )
36426  {
36427  Abc_Print( -1, "There is no current GIA.\n" );
36428  return 1;
36429  }
36430  if ( Gia_ManRegNum(pAbc->pGia) )
36431  {
36432  Abc_Print( -1, "Works only for combinational networks.\n" );
36433  return 1;
36434  }
36435  if ( Gia_ManPoNum(pAbc->pGia) != 1 )
36436  {
36437  Abc_Print( -1, "The miter should have one primary output.\n" );
36438  return 1;
36439  }
36440  if ( !(nPars > 0 && nPars < Gia_ManPiNum(pAbc->pGia)) )
36441  {
36442  Abc_Print( -1, "The number of parameter variables is invalid (should be > 0 and < PI num).\n" );
36443  return 1;
36444  }
36445  if ( fQuantX )
36446  {
36447  Gia_Man_t * pTemp;
36448  if ( Gia_ManPiNum(pAbc->pGia) - nPars > 16 )
36449  {
36450  Abc_Print( -1, "Cannot quantify more than 16 variables.\n" );
36451  return 1;
36452  }
36453  pTemp = Gia_QbfQuantify( pAbc->pGia, nPars );
36454  Abc_FrameUpdateGia( pAbc, pTemp );
36455  return 0;
36456  }
36457  if ( fDumpCnf )
36458  Gia_QbfDumpFile( pAbc->pGia, nPars );
36459  else
36460  Gia_QbfSolve( pAbc->pGia, nPars, nIterLimit, nConfLimit, nTimeOut, fVerbose );
36461  return 0;
36462 
36463 usage:
36464  Abc_Print( -2, "usage: &qbf [-PICT num] [-dqvh]\n" );
36465  Abc_Print( -2, "\t solves QBF problem EpVxM(p,x)\n" );
36466  Abc_Print( -2, "\t-P num : number of parameters p (should be the first PIs) [default = %d]\n", nPars );
36467  Abc_Print( -2, "\t-I num : quit after the given iteration even if unsolved [default = %d]\n", nIterLimit );
36468  Abc_Print( -2, "\t-C num : conflict limit per problem [default = %d]\n", nConfLimit );
36469  Abc_Print( -2, "\t-T num : global timeout [default = %d]\n", nTimeOut );
36470  Abc_Print( -2, "\t-d : toggle dumping QDIMACS file instead of solving [default = %s]\n", fDumpCnf? "yes": "no" );
36471  Abc_Print( -2, "\t-q : toggle quantifying functions variables [default = %s]\n", fQuantX? "yes": "no" );
36472  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
36473  Abc_Print( -2, "\t-h : print the command usage\n");
36474  return 1;
36475 }
int Gia_QbfSolve(Gia_Man_t *pGia, int nPars, int nIterLimit, int nConfLimit, int nTimeOut, int fVerbose)
Definition: giaQbf.c:419
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
Gia_Man_t * Gia_QbfQuantify(Gia_Man_t *p, int nPars)
Definition: giaQbf.c:214
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Gia_QbfDumpFile(Gia_Man_t *pGia, int nPars)
Definition: giaQbf.c:127
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9ReachM ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34096 of file abc.c.

34097 {
34098 // Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
34099  Gia_ParLlb_t Pars, * pPars = &Pars;
34100  char * pLogFileName = NULL;
34101  int c;
34102  extern int Llb_ManModelCheckGia( Gia_Man_t * pGia, Gia_ParLlb_t * pPars );
34103 
34104  // set defaults
34105  Llb_ManSetDefaultParams( pPars );
34107  while ( ( c = Extra_UtilGetopt( argc, argv, "TBFCHSLripcsyzvwh" ) ) != EOF )
34108  {
34109  switch ( c )
34110  {
34111  case 'T':
34112  if ( globalUtilOptind >= argc )
34113  {
34114  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
34115  goto usage;
34116  }
34117  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
34118  globalUtilOptind++;
34119  if ( pPars->TimeLimit < 0 )
34120  goto usage;
34121  break;
34122  case 'B':
34123  if ( globalUtilOptind >= argc )
34124  {
34125  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
34126  goto usage;
34127  }
34128  pPars->nBddMax = atoi(argv[globalUtilOptind]);
34129  globalUtilOptind++;
34130  if ( pPars->nBddMax < 0 )
34131  goto usage;
34132  break;
34133  case 'F':
34134  if ( globalUtilOptind >= argc )
34135  {
34136  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
34137  goto usage;
34138  }
34139  pPars->nIterMax = atoi(argv[globalUtilOptind]);
34140  globalUtilOptind++;
34141  if ( pPars->nIterMax < 0 )
34142  goto usage;
34143  break;
34144  case 'C':
34145  if ( globalUtilOptind >= argc )
34146  {
34147  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
34148  goto usage;
34149  }
34150  pPars->nClusterMax = atoi(argv[globalUtilOptind]);
34151  globalUtilOptind++;
34152  if ( pPars->nClusterMax < 0 )
34153  goto usage;
34154  break;
34155  case 'H':
34156  if ( globalUtilOptind >= argc )
34157  {
34158  Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
34159  goto usage;
34160  }
34161  pPars->nHintDepth = atoi(argv[globalUtilOptind]);
34162  globalUtilOptind++;
34163  if ( pPars->nHintDepth < 0 )
34164  goto usage;
34165  break;
34166  case 'S':
34167  if ( globalUtilOptind >= argc )
34168  {
34169  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
34170  goto usage;
34171  }
34172  pPars->HintFirst = atoi(argv[globalUtilOptind]);
34173  globalUtilOptind++;
34174  if ( pPars->HintFirst < 0 )
34175  goto usage;
34176  break;
34177  case 'L':
34178  if ( globalUtilOptind >= argc )
34179  {
34180  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
34181  goto usage;
34182  }
34183  pLogFileName = argv[globalUtilOptind];
34184  globalUtilOptind++;
34185  break;
34186  case 'r':
34187  pPars->fReorder ^= 1;
34188  break;
34189  case 'i':
34190  pPars->fIndConstr ^= 1;
34191  break;
34192  case 'p':
34193  pPars->fUsePivots ^= 1;
34194  break;
34195  case 'c':
34196  pPars->fCluster ^= 1;
34197  break;
34198  case 's':
34199  pPars->fSchedule ^= 1;
34200  break;
34201  case 'y':
34202  pPars->fSkipOutCheck ^= 1;
34203  break;
34204  case 'z':
34205  pPars->fSkipReach ^= 1;
34206  break;
34207  case 'v':
34208  pPars->fVerbose ^= 1;
34209  break;
34210  case 'w':
34211  pPars->fVeryVerbose ^= 1;
34212  break;
34213  case 'h':
34214  goto usage;
34215  default:
34216  goto usage;
34217  }
34218  }
34219  if ( pAbc->pGia == NULL )
34220  {
34221  Abc_Print( -1, "Abc_CommandAbc9ReachM(): There is no AIG.\n" );
34222  return 1;
34223  }
34224  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
34225  {
34226  Abc_Print( -1, "Abc_CommandAbc9ReachM(): The current AIG has no latches.\n" );
34227  return 0;
34228  }
34229  if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
34230  {
34231  Abc_Print( -1, "Abc_CommandAbc9ReachM(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
34232  return 0;
34233  }
34234  pAbc->Status = Llb_ManModelCheckGia( pAbc->pGia, pPars );
34235  pAbc->nFrames = pPars->iFrame;
34236  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
34237  if ( pLogFileName )
34238  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachm" );
34239  return 0;
34240 
34241 usage:
34242  Abc_Print( -2, "usage: &reachm [-TBFCHS num] [-L file] [-ripcsyzvwh]\n" );
34243  Abc_Print( -2, "\t model checking via BDD-based reachability (dependence-matrix-based)\n" );
34244  Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
34245  Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
34246  Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
34247  Abc_Print( -2, "\t-C num : max number of variables in a cluster [default = %d]\n", pPars->nClusterMax );
34248  Abc_Print( -2, "\t-H num : max number of hints to use [default = %d]\n", pPars->nHintDepth );
34249  Abc_Print( -2, "\t-S num : the number of the starting hint [default = %d]\n", pPars->HintFirst );
34250  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
34251  Abc_Print( -2, "\t-r : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
34252  Abc_Print( -2, "\t-i : enable extraction of inductive constraints [default = %s]\n", pPars->fIndConstr? "yes": "no" );
34253  Abc_Print( -2, "\t-p : enable partitions for internal cut-points [default = %s]\n", pPars->fUsePivots? "yes": "no" );
34254  Abc_Print( -2, "\t-c : enable clustering of partitions [default = %s]\n", pPars->fCluster? "yes": "no" );
34255  Abc_Print( -2, "\t-s : enable scheduling of clusters [default = %s]\n", pPars->fSchedule? "yes": "no" );
34256  Abc_Print( -2, "\t-y : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
34257  Abc_Print( -2, "\t-z : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
34258  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
34259  Abc_Print( -2, "\t-w : prints dependency matrix [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
34260  Abc_Print( -2, "\t-h : print the command usage\n");
34261  return 1;
34262 }
void Llb_ManSetDefaultParams(Gia_ParLlb_t *pPars)
MACRO DEFINITIONS ///.
Definition: llb1Core.c:46
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
typedefABC_NAMESPACE_HEADER_START struct Gia_ParLlb_t_ Gia_ParLlb_t
INCLUDES ///.
Definition: llb.h:41
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Llb_ManModelCheckGia(Gia_Man_t *pGia, Gia_ParLlb_t *pPars)
Definition: llb1Core.c:197
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9ReachN ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34425 of file abc.c.

34426 {
34427 // Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
34428  Gia_ParLlb_t Pars, * pPars = &Pars;
34429  Aig_Man_t * pMan;
34430  char * pLogFileName = NULL;
34431  int c;
34432  extern int Llb_NonlinCoreReach( Aig_Man_t * pAig, Gia_ParLlb_t * pPars );
34433 
34434  // set defaults
34435  Llb_ManSetDefaultParams( pPars );
34437  while ( ( c = Extra_UtilGetopt( argc, argv, "BFTLryzvwh" ) ) != EOF )
34438  {
34439  switch ( c )
34440  {
34441  case 'B':
34442  if ( globalUtilOptind >= argc )
34443  {
34444  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
34445  goto usage;
34446  }
34447  pPars->nBddMax = atoi(argv[globalUtilOptind]);
34448  globalUtilOptind++;
34449  if ( pPars->nBddMax < 0 )
34450  goto usage;
34451  break;
34452  case 'F':
34453  if ( globalUtilOptind >= argc )
34454  {
34455  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
34456  goto usage;
34457  }
34458  pPars->nIterMax = atoi(argv[globalUtilOptind]);
34459  globalUtilOptind++;
34460  if ( pPars->nIterMax < 0 )
34461  goto usage;
34462  break;
34463  case 'T':
34464  if ( globalUtilOptind >= argc )
34465  {
34466  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
34467  goto usage;
34468  }
34469  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
34470  globalUtilOptind++;
34471  if ( pPars->TimeLimit < 0 )
34472  goto usage;
34473  break;
34474  case 'L':
34475  if ( globalUtilOptind >= argc )
34476  {
34477  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
34478  goto usage;
34479  }
34480  pLogFileName = argv[globalUtilOptind];
34481  globalUtilOptind++;
34482  break;
34483  case 'r':
34484  pPars->fReorder ^= 1;
34485  break;
34486  case 'y':
34487  pPars->fSkipOutCheck ^= 1;
34488  break;
34489  case 'z':
34490  pPars->fSkipReach ^= 1;
34491  break;
34492  case 'v':
34493  pPars->fVerbose ^= 1;
34494  break;
34495  case 'w':
34496  pPars->fVeryVerbose ^= 1;
34497  break;
34498  case 'h':
34499  goto usage;
34500  default:
34501  goto usage;
34502  }
34503  }
34504  if ( pAbc->pGia == NULL )
34505  {
34506  Abc_Print( -1, "Abc_CommandAbc9ReachN(): There is no AIG.\n" );
34507  return 1;
34508  }
34509  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
34510  {
34511  Abc_Print( -1, "Abc_CommandAbc9ReachN(): The current AIG has no latches.\n" );
34512  return 0;
34513  }
34514  if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
34515  {
34516  Abc_Print( -1, "Abc_CommandAbc9ReachN(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
34517  return 0;
34518  }
34519  pMan = Gia_ManToAigSimple( pAbc->pGia );
34520  pAbc->Status = Llb_NonlinCoreReach( pMan, pPars );
34521  pAbc->nFrames = pPars->iFrame;
34522  Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
34523  if ( pLogFileName )
34524  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachn" );
34525  Aig_ManStop( pMan );
34526  return 0;
34527 
34528 usage:
34529  Abc_Print( -2, "usage: &reachn [-BFT num] [-L file] [-ryzvh]\n" );
34530  Abc_Print( -2, "\t model checking via BDD-based reachability (non-linear-QS-based)\n" );
34531  Abc_Print( -2, "\t-B num : the BDD node increase when hints kick in [default = %d]\n", pPars->nBddMax );
34532  Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
34533  Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
34534  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
34535  Abc_Print( -2, "\t-r : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
34536  Abc_Print( -2, "\t-y : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
34537  Abc_Print( -2, "\t-z : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
34538  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
34539 // Abc_Print( -2, "\t-w : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
34540  Abc_Print( -2, "\t-h : print the command usage\n");
34541  return 1;
34542 }
int Llb_NonlinCoreReach(Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
Definition: llb3Nonlin.c:840
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
void Llb_ManSetDefaultParams(Gia_ParLlb_t *pPars)
MACRO DEFINITIONS ///.
Definition: llb1Core.c:46
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
typedefABC_NAMESPACE_HEADER_START struct Gia_ParLlb_t_ Gia_ParLlb_t
INCLUDES ///.
Definition: llb.h:41
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9ReachP ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34275 of file abc.c.

34276 {
34277 // Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
34278  Gia_ParLlb_t Pars, * pPars = &Pars;
34279  Aig_Man_t * pMan;
34280  char * pLogFileName = NULL;
34281  int c;
34282  extern int Llb_ManReachMinCut( Aig_Man_t * pAig, Gia_ParLlb_t * pPars );
34283 
34284  // set defaults
34285  Llb_ManSetDefaultParams( pPars );
34287  while ( ( c = Extra_UtilGetopt( argc, argv, "NBFTLrbyzdvwh" ) ) != EOF )
34288  {
34289  switch ( c )
34290  {
34291  case 'N':
34292  if ( globalUtilOptind >= argc )
34293  {
34294  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
34295  goto usage;
34296  }
34297  pPars->nPartValue = atoi(argv[globalUtilOptind]);
34298  globalUtilOptind++;
34299  if ( pPars->nPartValue < 0 )
34300  goto usage;
34301  break;
34302  case 'B':
34303  if ( globalUtilOptind >= argc )
34304  {
34305  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
34306  goto usage;
34307  }
34308  pPars->nBddMax = atoi(argv[globalUtilOptind]);
34309  globalUtilOptind++;
34310  if ( pPars->nBddMax < 0 )
34311  goto usage;
34312  break;
34313  case 'F':
34314  if ( globalUtilOptind >= argc )
34315  {
34316  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
34317  goto usage;
34318  }
34319  pPars->nIterMax = atoi(argv[globalUtilOptind]);
34320  globalUtilOptind++;
34321  if ( pPars->nIterMax < 0 )
34322  goto usage;
34323  break;
34324  case 'T':
34325  if ( globalUtilOptind >= argc )
34326  {
34327  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
34328  goto usage;
34329  }
34330  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
34331  globalUtilOptind++;
34332  if ( pPars->TimeLimit < 0 )
34333  goto usage;
34334  break;
34335  case 'L':
34336  if ( globalUtilOptind >= argc )
34337  {
34338  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
34339  goto usage;
34340  }
34341  pLogFileName = argv[globalUtilOptind];
34342  globalUtilOptind++;
34343  break;
34344  case 'r':
34345  pPars->fReorder ^= 1;
34346  break;
34347  case 'b':
34348  pPars->fBackward ^= 1;
34349  break;
34350  case 'y':
34351  pPars->fSkipOutCheck ^= 1;
34352  break;
34353  case 'z':
34354  pPars->fSkipReach ^= 1;
34355  break;
34356  case 'd':
34357  pPars->fDumpReached ^= 1;
34358  break;
34359  case 'v':
34360  pPars->fVerbose ^= 1;
34361  break;
34362  case 'w':
34363  pPars->fVeryVerbose ^= 1;
34364  break;
34365  case 'h':
34366  goto usage;
34367  default:
34368  goto usage;
34369  }
34370  }
34371  if ( pAbc->pGia == NULL )
34372  {
34373  Abc_Print( -1, "Abc_CommandAbc9ReachP(): There is no AIG.\n" );
34374  return 1;
34375  }
34376  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
34377  {
34378  Abc_Print( -1, "Abc_CommandAbc9ReachP(): The current AIG has no latches.\n" );
34379  return 0;
34380  }
34381  if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
34382  {
34383  Abc_Print( -1, "Abc_CommandAbc9ReachP(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
34384  return 0;
34385  }
34386  pMan = Gia_ManToAigSimple( pAbc->pGia );
34387  pAbc->Status = Llb_ManReachMinCut( pMan, pPars );
34388  pAbc->nFrames = pPars->iFrame;
34389  Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
34390  if ( pLogFileName )
34391  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachp" );
34392  Aig_ManStop( pMan );
34393  return 0;
34394 
34395 usage:
34396  Abc_Print( -2, "usage: &reachp [-NFT num] [-L file] [-rbyzdvwh]\n" );
34397  Abc_Print( -2, "\t model checking via BDD-based reachability (partitioning-based)\n" );
34398  Abc_Print( -2, "\t-N num : partitioning value (MinVol=nANDs/N/2; MaxVol=nANDs/N) [default = %d]\n", pPars->nPartValue );
34399 // Abc_Print( -2, "\t-B num : the BDD node increase when hints kick in [default = %d]\n", pPars->nBddMax );
34400  Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
34401  Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
34402  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
34403  Abc_Print( -2, "\t-r : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
34404  Abc_Print( -2, "\t-b : perform backward reachability analysis [default = %s]\n", pPars->fBackward? "yes": "no" );
34405  Abc_Print( -2, "\t-y : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
34406  Abc_Print( -2, "\t-z : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
34407  Abc_Print( -2, "\t-d : dump BDD of reached states into file \"reached.blif\" [default = %s]\n", pPars->fDumpReached? "yes": "no" );
34408  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
34409  Abc_Print( -2, "\t-w : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
34410  Abc_Print( -2, "\t-h : print the command usage\n");
34411  return 1;
34412 }
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
void Llb_ManSetDefaultParams(Gia_ParLlb_t *pPars)
MACRO DEFINITIONS ///.
Definition: llb1Core.c:46
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
typedefABC_NAMESPACE_HEADER_START struct Gia_ParLlb_t_ Gia_ParLlb_t
INCLUDES ///.
Definition: llb.h:41
int Llb_ManReachMinCut(Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
Definition: llb2Core.c:725
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9ReachY ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34555 of file abc.c.

34556 {
34557 // Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
34558  Gia_ParLlb_t Pars, * pPars = &Pars;
34559  Aig_Man_t * pMan;
34560  char * pLogFileName = NULL;
34561  int c;
34562 
34563  // set defaults
34564  Llb_ManSetDefaultParams( pPars );
34565  pPars->fCluster = 0;
34566  pPars->fReorder = 0;
34567  pPars->nBddMax = 100;
34568  pPars->nClusterMax = 500;
34570  while ( ( c = Extra_UtilGetopt( argc, argv, "BCFTLbcryzvwh" ) ) != EOF )
34571  {
34572  switch ( c )
34573  {
34574  case 'B':
34575  if ( globalUtilOptind >= argc )
34576  {
34577  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
34578  goto usage;
34579  }
34580  pPars->nBddMax = atoi(argv[globalUtilOptind]);
34581  globalUtilOptind++;
34582  if ( pPars->nBddMax < 0 )
34583  goto usage;
34584  break;
34585  case 'C':
34586  if ( globalUtilOptind >= argc )
34587  {
34588  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
34589  goto usage;
34590  }
34591  pPars->nClusterMax = atoi(argv[globalUtilOptind]);
34592  globalUtilOptind++;
34593  if ( pPars->nClusterMax < 0 )
34594  goto usage;
34595  break;
34596  case 'F':
34597  if ( globalUtilOptind >= argc )
34598  {
34599  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
34600  goto usage;
34601  }
34602  pPars->nIterMax = atoi(argv[globalUtilOptind]);
34603  globalUtilOptind++;
34604  if ( pPars->nIterMax < 0 )
34605  goto usage;
34606  break;
34607  case 'T':
34608  if ( globalUtilOptind >= argc )
34609  {
34610  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
34611  goto usage;
34612  }
34613  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
34614  globalUtilOptind++;
34615  if ( pPars->TimeLimit < 0 )
34616  goto usage;
34617  break;
34618  case 'L':
34619  if ( globalUtilOptind >= argc )
34620  {
34621  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
34622  goto usage;
34623  }
34624  pLogFileName = argv[globalUtilOptind];
34625  globalUtilOptind++;
34626  break;
34627  case 'b':
34628  pPars->fBackward ^= 1;
34629  break;
34630  case 'c':
34631  pPars->fCluster ^= 1;
34632  break;
34633  case 'r':
34634  pPars->fReorder ^= 1;
34635  break;
34636  case 'y':
34637  pPars->fSkipOutCheck ^= 1;
34638  break;
34639  case 'z':
34640  pPars->fSkipReach ^= 1;
34641  break;
34642  case 'v':
34643  pPars->fVerbose ^= 1;
34644  break;
34645  case 'w':
34646  pPars->fVeryVerbose ^= 1;
34647  break;
34648  case 'h':
34649  goto usage;
34650  default:
34651  goto usage;
34652  }
34653  }
34654  if ( pAbc->pGia == NULL )
34655  {
34656  Abc_Print( -1, "Abc_CommandAbc9ReachN(): There is no AIG.\n" );
34657  return 1;
34658  }
34659  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
34660  {
34661  Abc_Print( -1, "Abc_CommandAbc9ReachN(): The current AIG has no latches.\n" );
34662  return 0;
34663  }
34664 /*
34665  if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
34666  {
34667  Abc_Print( -1, "Abc_CommandAbc9ReachN(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
34668  return 0;
34669  }
34670 */
34671  pMan = Gia_ManToAigSimple( pAbc->pGia );
34672  pAbc->Status = Llb_Nonlin4CoreReach( pMan, pPars );
34673  pAbc->nFrames = pPars->iFrame;
34674  Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
34675  if ( pLogFileName )
34676  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachy" );
34677  Aig_ManStop( pMan );
34678  return 0;
34679 
34680 usage:
34681  Abc_Print( -2, "usage: &reachy [-BCFT num] [-L file] [-bcryzvh]\n" );
34682  Abc_Print( -2, "\t model checking via BDD-based reachability (non-linear-QS-based)\n" );
34683  Abc_Print( -2, "\t-B num : the max BDD size to introduce cut points [default = %d]\n", pPars->nBddMax );
34684  Abc_Print( -2, "\t-C num : the max BDD size to reparameterize/cluster [default = %d]\n", pPars->nClusterMax );
34685  Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
34686  Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
34687  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
34688  Abc_Print( -2, "\t-b : enable using backward enumeration [default = %s]\n", pPars->fBackward? "yes": "no" );
34689  Abc_Print( -2, "\t-c : enable reparametrization clustering [default = %s]\n", pPars->fCluster? "yes": "no" );
34690  Abc_Print( -2, "\t-r : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
34691  Abc_Print( -2, "\t-y : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
34692  Abc_Print( -2, "\t-z : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
34693  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
34694 // Abc_Print( -2, "\t-w : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
34695  Abc_Print( -2, "\t-h : print the command usage\n");
34696  return 1;
34697 }
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
void Llb_ManSetDefaultParams(Gia_ParLlb_t *pPars)
MACRO DEFINITIONS ///.
Definition: llb1Core.c:46
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
int Llb_Nonlin4CoreReach(Aig_Man_t *pAig, Gia_ParLlb_t *pPars)
Definition: llb4Nonlin.c:1067
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
typedefABC_NAMESPACE_HEADER_START struct Gia_ParLlb_t_ Gia_ParLlb_t
INCLUDES ///.
Definition: llb.h:41
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Read ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25392 of file abc.c.

25393 {
25394  extern void Abc3_ReadShowHie( char * pFileName, int fFlat );
25395  Gia_Man_t * pAig = NULL;
25396  FILE * pFile;
25397  char ** pArgvNew;
25398  char * FileName, * pTemp;
25399  int c, nArgcNew;
25400  int fUseMini = 0;
25401  int fVerbose = 0;
25402  int fSkipStrash = 0;
25404  while ( ( c = Extra_UtilGetopt( argc, argv, "smvh" ) ) != EOF )
25405  {
25406  switch ( c )
25407  {
25408  case 's':
25409  fSkipStrash ^= 1;
25410  break;
25411  case 'm':
25412  fUseMini ^= 1;
25413  break;
25414  case 'v':
25415  fVerbose ^= 1;
25416  break;
25417  default:
25418  goto usage;
25419  }
25420  }
25421  pArgvNew = argv + globalUtilOptind;
25422  nArgcNew = argc - globalUtilOptind;
25423  if ( nArgcNew != 1 )
25424  {
25425  Abc_Print( -1, "There is no file name.\n" );
25426  return 1;
25427  }
25428 
25429  // get the input file name
25430  FileName = pArgvNew[0];
25431  // fix the wrong symbol
25432  for ( pTemp = FileName; *pTemp; pTemp++ )
25433  if ( *pTemp == '>' )
25434  *pTemp = '\\';
25435  if ( (pFile = fopen( FileName, "r" )) == NULL )
25436  {
25437  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
25438  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", ".blif", ".pla", ".eqn", ".bench" )) )
25439  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
25440  Abc_Print( 1, "\n" );
25441  return 1;
25442  }
25443  fclose( pFile );
25444 
25445  if ( fUseMini )
25446  pAig = Gia_ManReadMiniAig( FileName );
25447 // else if ( Extra_FileIsType( FileName, ".v", NULL, NULL ) )
25448 // Abc3_ReadShowHie( FileName, fSkipStrash );
25449  else
25450  pAig = Gia_AigerRead( FileName, fSkipStrash, 0 );
25451  if ( pAig )
25452  Abc_FrameUpdateGia( pAbc, pAig );
25453  return 0;
25454 
25455 usage:
25456  Abc_Print( -2, "usage: &r [-smvh] <file>\n" );
25457  Abc_Print( -2, "\t reads the current AIG from the AIGER file\n" );
25458  Abc_Print( -2, "\t-s : toggles structural hashing while reading [default = %s]\n", !fSkipStrash? "yes": "no" );
25459  Abc_Print( -2, "\t-m : toggles reading MiniAIG rather than AIGER file [default = %s]\n", fUseMini? "yes": "no" );
25460  Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
25461  Abc_Print( -2, "\t-h : print the command usage\n");
25462  Abc_Print( -2, "\t<file> : the file name\n");
25463  return 1;
25464 }
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
Gia_Man_t * Gia_ManReadMiniAig(char *pFileName)
Definition: giaMini.c:167
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9ReadBlif ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25477 of file abc.c.

25478 {
25479  extern Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose );
25480  Gia_Man_t * pAig;
25481  FILE * pFile;
25482  char ** pArgvNew;
25483  char * FileName, * pTemp;
25484  int nArgcNew;
25485  int c, fVerbose = 0;
25487  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
25488  {
25489  switch ( c )
25490  {
25491  case 'v':
25492  fVerbose ^= 1;
25493  break;
25494  default:
25495  goto usage;
25496  }
25497  }
25498  pArgvNew = argv + globalUtilOptind;
25499  nArgcNew = argc - globalUtilOptind;
25500  if ( nArgcNew != 1 )
25501  {
25502  Abc_Print( -1, "There is no file name.\n" );
25503  return 1;
25504  }
25505 
25506  // get the input file name
25507  FileName = pArgvNew[0];
25508  // fix the wrong symbol
25509  for ( pTemp = FileName; *pTemp; pTemp++ )
25510  if ( *pTemp == '>' )
25511  *pTemp = '\\';
25512  if ( (pFile = fopen( FileName, "r" )) == NULL )
25513  {
25514  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
25515  if ( (FileName = Extra_FileGetSimilarName( FileName, ".blif", NULL, NULL, NULL, NULL )) )
25516  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
25517  Abc_Print( 1, "\n" );
25518  return 1;
25519  }
25520  fclose( pFile );
25521 
25522  pAig = Abc_NtkHieCecTest( FileName, fVerbose );
25523  Abc_FrameUpdateGia( pAbc, pAig );
25524  return 0;
25525 
25526 usage:
25527  Abc_Print( -2, "usage: &read_blif [-vh] <file>\n" );
25528  Abc_Print( -2, "\t a specialized reader for hierarchical BLIF files\n" );
25529  Abc_Print( -2, "\t (for general-purpose BLIFs, please use \"read_blif\")\n" );
25530  Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
25531  Abc_Print( -2, "\t-h : print the command usage\n");
25532  Abc_Print( -2, "\t<file> : the file name\n");
25533  return 1;
25534 }
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
Gia_Man_t * Abc_NtkHieCecTest(char *pFileName, int fVerbose)
Definition: abcHieCec.c:664
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9ReadCBlif ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25547 of file abc.c.

25548 {
25549  extern Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, char * pModelName, int fVerbose );
25550  Gia_Man_t * pAig;
25551  FILE * pFile;
25552  char ** pArgvNew;
25553  char * FileName, * pTemp;
25554  char * pModelName = NULL;
25555  int nArgcNew;
25556  int c, fVerbose = 0;
25558  while ( ( c = Extra_UtilGetopt( argc, argv, "Mvh" ) ) != EOF )
25559  {
25560  switch ( c )
25561  {
25562  case 'M':
25563  if ( globalUtilOptind >= argc )
25564  {
25565  Abc_Print( -1, "Command line switch \"-M\" should be followed by a file name.\n" );
25566  goto usage;
25567  }
25568  pModelName = argv[globalUtilOptind];
25569  globalUtilOptind++;
25570  break;
25571  case 'v':
25572  fVerbose ^= 1;
25573  break;
25574  default:
25575  goto usage;
25576  }
25577  }
25578  pArgvNew = argv + globalUtilOptind;
25579  nArgcNew = argc - globalUtilOptind;
25580  if ( nArgcNew != 1 )
25581  {
25582  Abc_Print( -1, "There is no file name.\n" );
25583  return 1;
25584  }
25585 
25586  // get the input file name
25587  FileName = pArgvNew[0];
25588  // fix the wrong symbol
25589  for ( pTemp = FileName; *pTemp; pTemp++ )
25590  if ( *pTemp == '>' )
25591  *pTemp = '\\';
25592  if ( (pFile = fopen( FileName, "r" )) == NULL )
25593  {
25594  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
25595  if ( (FileName = Extra_FileGetSimilarName( FileName, ".cblif", NULL, NULL, NULL, NULL )) )
25596  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
25597  Abc_Print( 1, "\n" );
25598  return 1;
25599  }
25600  fclose( pFile );
25601 
25602  pAig = Abc_NtkHieCecTest2( FileName, pModelName, fVerbose );
25603  Abc_FrameUpdateGia( pAbc, pAig );
25604  return 0;
25605 
25606 usage:
25607  Abc_Print( -2, "usage: &read_cblif [-M name] [-vh] <file>\n" );
25608  Abc_Print( -2, "\t reads CBLIF file and collapse it into an AIG\n" );
25609  Abc_Print( -2, "\t-M name: module name to collapse [default = <root_module>]\n" );
25610  Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
25611  Abc_Print( -2, "\t-h : print the command usage\n");
25612  Abc_Print( -2, "\t<file> : the file name\n");
25613  return 1;
25614 }
Gia_Man_t * Abc_NtkHieCecTest2(char *pFileName, char *pModelName, int fVerbose)
Definition: abcHieNew.c:1571
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9ReadStg ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25627 of file abc.c.

25628 {
25629  Gia_Man_t * pAig;
25630  FILE * pFile;
25631  char * FileName, ** pArgvNew;
25632  int c, nArgcNew;
25633  int kHot = 1;
25634  int fVerbose = 0;
25636  while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != EOF )
25637  {
25638  switch ( c )
25639  {
25640  case 'K':
25641  if ( globalUtilOptind >= argc )
25642  {
25643  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
25644  goto usage;
25645  }
25646  kHot = atoi(argv[globalUtilOptind]);
25647  globalUtilOptind++;
25648  if ( kHot < 1 || kHot > 5 )
25649  goto usage;
25650  break;
25651  case 'v':
25652  fVerbose ^= 1;
25653  break;
25654  default:
25655  goto usage;
25656  }
25657  }
25658  pArgvNew = argv + globalUtilOptind;
25659  nArgcNew = argc - globalUtilOptind;
25660  if ( nArgcNew != 1 )
25661  {
25662  Abc_Print( -1, "There is no file name.\n" );
25663  return 1;
25664  }
25665 
25666  // get the input file name
25667  FileName = pArgvNew[0];
25668  if ( (pFile = fopen( FileName, "r" )) == NULL )
25669  {
25670  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
25671  return 1;
25672  }
25673  fclose( pFile );
25674 
25675  pAig = Gia_ManStgRead( FileName, kHot, fVerbose );
25676  Abc_FrameUpdateGia( pAbc, pAig );
25677  return 0;
25678 
25679 usage:
25680  Abc_Print( -2, "usage: &read_stg [-K <num>] [-vh] <file>\n" );
25681  Abc_Print( -2, "\t reads STG file and generates K-hot-encoded AIG\n" );
25682  Abc_Print( -2, "\t-K num : the K parameter for hotness of the encoding (1 <= K <= 5) [default = %d]\n", kHot );
25683  Abc_Print( -2, "\t-v : toggles printing state codes [default = %s]\n", fVerbose? "yes": "no" );
25684  Abc_Print( -2, "\t-h : print the command usage\n");
25685  Abc_Print( -2, "\t<file> : the file name\n");
25686  return 1;
25687 }
Gia_Man_t * Gia_ManStgRead(char *pFileName, int kHot, int fVerbose)
Definition: giaStg.c:508
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9ReadVer ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25700 of file abc.c.

25701 {
25702  Abc_Ntk_t * pNtk;
25703  Gia_Man_t * pAig;
25704  FILE * pFile;
25705  char ** pArgvNew;
25706  char * pFileName, * pTemp;
25707  int nArgcNew;
25708  int c, fVerbose = 0;
25710  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
25711  {
25712  switch ( c )
25713  {
25714  case 'v':
25715  fVerbose ^= 1;
25716  break;
25717  default:
25718  goto usage;
25719  }
25720  }
25721  pArgvNew = argv + globalUtilOptind;
25722  nArgcNew = argc - globalUtilOptind;
25723  if ( nArgcNew != 1 )
25724  {
25725  Abc_Print( -1, "There is no file name.\n" );
25726  return 1;
25727  }
25728 
25729  // get the input file name
25730  pFileName = pArgvNew[0];
25731  // fix the wrong symbol
25732  for ( pTemp = pFileName; *pTemp; pTemp++ )
25733  if ( *pTemp == '>' )
25734  *pTemp = '\\';
25735  if ( (pFile = fopen( pFileName, "r" )) == NULL )
25736  {
25737  Abc_Print( -1, "Cannot open input file \"%s\". ", pFileName );
25738  if ( (pFileName = Extra_FileGetSimilarName( pFileName, ".v", ".blif", NULL, NULL, NULL )) )
25739  Abc_Print( 1, "Did you mean \"%s\"?", pFileName );
25740  Abc_Print( 1, "\n" );
25741  return 1;
25742  }
25743  fclose( pFile );
25744  // read hierarchical Verilog
25745  pNtk = Io_ReadNetlist( pFileName, Io_ReadFileType(pFileName), 0 );
25746  if ( pNtk == NULL )
25747  {
25748  Abc_Print( -1, "Reading hierarchical Verilog has failed.\n" );
25749  return 1;
25750  }
25751  pAig = Abc_NtkFlattenHierarchyGia( pNtk, NULL, fVerbose );
25752  Abc_NtkDelete( pNtk );
25753  Abc_FrameUpdateGia( pAbc, pAig );
25754  return 0;
25755 
25756 usage:
25757  Abc_Print( -2, "usage: &read_ver [-vh] <file>\n" );
25758  Abc_Print( -2, "\t a specialized reader for hierarchical Verilog files\n" );
25759  Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
25760  Abc_Print( -2, "\t-h : print the command usage\n");
25761  Abc_Print( -2, "\t<file> : the file name\n");
25762  return 1;
25763 }
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
Abc_Ntk_t * Io_ReadNetlist(char *pFileName, Io_FileType_t FileType, int fCheck)
Definition: ioUtil.c:98
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL Gia_Man_t * Abc_NtkFlattenHierarchyGia(Abc_Ntk_t *pNtk, Vec_Ptr_t **pvBuffers, int fVerbose)
Definition: abcHieGia.c:277
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Reduce ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30637 of file abc.c.

30638 {
30639  Gia_Man_t * pTemp, * pTemp2;
30640  int c, fVerbose = 0;
30641  int fUseAll = 0;
30642  int fDualOut = 0;
30644  while ( ( c = Extra_UtilGetopt( argc, argv, "advh" ) ) != EOF )
30645  {
30646  switch ( c )
30647  {
30648  case 'a':
30649  fUseAll ^= 1;
30650  break;
30651  case 'd':
30652  fDualOut ^= 1;
30653  break;
30654  case 'v':
30655  fVerbose ^= 1;
30656  break;
30657  case 'h':
30658  goto usage;
30659  default:
30660  goto usage;
30661  }
30662  }
30663  if ( pAbc->pGia == NULL )
30664  {
30665  Abc_Print( -1, "Abc_CommandAbc9Reduce(): There is no AIG.\n" );
30666  return 1;
30667  }
30668  if ( fUseAll )
30669  {
30670  pTemp = Gia_ManEquivReduce( pAbc->pGia, fUseAll, fDualOut, 0, fVerbose );
30671  pTemp = Gia_ManSeqStructSweep( pTemp2 = pTemp, 1, 1, 0 );
30672  Gia_ManStop( pTemp2 );
30673  }
30674  else
30675  pTemp = Gia_ManEquivReduceAndRemap( pAbc->pGia, 1, fDualOut );
30676  Abc_FrameUpdateGia( pAbc, pTemp );
30677  return 0;
30678 
30679 usage:
30680  Abc_Print( -2, "usage: &reduce [-advh]\n" );
30681  Abc_Print( -2, "\t reduces the circuit using equivalence classes\n" );
30682  Abc_Print( -2, "\t-a : toggle merging all equivalences [default = %s]\n", fUseAll? "yes": "no" );
30683  Abc_Print( -2, "\t-d : toggle using dual-output merging [default = %s]\n", fDualOut? "yes": "no" );
30684  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
30685  Abc_Print( -2, "\t-h : print the command usage\n");
30686  return 1;
30687 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * Gia_ManEquivReduceAndRemap(Gia_Man_t *p, int fSeq, int fMiterPairs)
Definition: giaEquiv.c:638
Gia_Man_t * Gia_ManEquivReduce(Gia_Man_t *p, int fUseAll, int fDualOut, int fSkipPhase, int fVerbose)
Definition: giaEquiv.c:417
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManSeqStructSweep(Gia_Man_t *p, int fConst, int fEquiv, int fVerbose)
Definition: giaScl.c:258
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Resim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27402 of file abc.c.

27403 {
27404  Cec_ParSim_t Pars, * pPars = &Pars;
27405  int c, RetValue;
27406  Cec_ManSimSetDefaultParams( pPars );
27408  while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
27409  {
27410  switch ( c )
27411  {
27412  case 'F':
27413  if ( globalUtilOptind >= argc )
27414  {
27415  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
27416  goto usage;
27417  }
27418  pPars->nFrames = atoi(argv[globalUtilOptind]);
27419  globalUtilOptind++;
27420  if ( pPars->nFrames < 0 )
27421  goto usage;
27422  break;
27423  case 'm':
27424  pPars->fCheckMiter ^= 1;
27425  break;
27426  case 'v':
27427  pPars->fVerbose ^= 1;
27428  break;
27429  case 'h':
27430  goto usage;
27431  default:
27432  goto usage;
27433  }
27434  }
27435  if ( pAbc->pGia == NULL )
27436  {
27437  Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
27438  return 1;
27439  }
27440  RetValue = Cec_ManSeqResimulateCounter( pAbc->pGia, pPars, pAbc->pCex );
27441  pAbc->Status = RetValue ? 0 : -1;
27442  pAbc->nFrames = pAbc->pCex->iFrame;
27443 // Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
27444  return 0;
27445 
27446 usage:
27447  Abc_Print( -2, "usage: &resim [-F num] [-mvh]\n" );
27448  Abc_Print( -2, "\t resimulates equivalence classes using counter-example\n" );
27449  Abc_Print( -2, "\t-F num : the number of additinal frames to simulate [default = %d]\n", pPars->nFrames );
27450  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
27451  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
27452  Abc_Print( -2, "\t-h : print the command usage\n");
27453  return 1;
27454 }
int fVerbose
Definition: cec.h:73
int fCheckMiter
Definition: cec.h:67
void Cec_ManSimSetDefaultParams(Cec_ParSim_t *p)
Definition: cecCore.c:70
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Cec_ManSeqResimulateCounter(Gia_Man_t *pAig, Cec_ParSim_t *pPars, Abc_Cex_t *pCex)
Definition: cecSeq.c:215
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nFrames
Definition: cec.h:62
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Retime ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28288 of file abc.c.

28289 {
28290  Gia_Man_t * pTemp;
28291  int c;
28292  int nMaxIters = 100;
28293  int fVerbose = 0;
28295  while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
28296  {
28297  switch ( c )
28298  {
28299  case 'N':
28300  if ( globalUtilOptind >= argc )
28301  {
28302  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
28303  goto usage;
28304  }
28305  nMaxIters = atoi(argv[globalUtilOptind]);
28306  globalUtilOptind++;
28307  if ( nMaxIters < 0 )
28308  goto usage;
28309  break;
28310  case 'v':
28311  fVerbose ^= 1;
28312  break;
28313  case 'h':
28314  goto usage;
28315  default:
28316  goto usage;
28317  }
28318  }
28319  if ( pAbc->pGia == NULL )
28320  {
28321  Abc_Print( -1, "Abc_CommandAbc9Retime(): There is no AIG.\n" );
28322  return 1;
28323  }
28324  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
28325  {
28326  Abc_Print( -1, "The network is combinational.\n" );
28327  return 0;
28328  }
28329  pTemp = Gia_ManRetimeForward( pAbc->pGia, nMaxIters, fVerbose );
28330  Abc_FrameUpdateGia( pAbc, pTemp );
28331  return 0;
28332 
28333 usage:
28334  Abc_Print( -2, "usage: &retime [-N <num>] [-vh]\n" );
28335  Abc_Print( -2, "\t performs most-forward retiming\n" );
28336  Abc_Print( -2, "\t-N num : the number of incremental iterations [default = %d]\n", nMaxIters );
28337  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28338  Abc_Print( -2, "\t-h : print the command usage\n");
28339  return 1;
28340 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManRetimeForward(Gia_Man_t *p, int nMaxIters, int fVerbose)
Definition: giaRetime.c:267
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Rpm ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33864 of file abc.c.

33865 {
33866  Gia_Man_t * pTemp;
33867  int c, nCutMax = 16;
33868  int fUseOldAlgo = 0;
33869  int fVerbose = 0;
33870  int fVeryVerbose = 0;
33872  while ( ( c = Extra_UtilGetopt( argc, argv, "Cavwh" ) ) != EOF )
33873  {
33874  switch ( c )
33875  {
33876  case 'C':
33877  if ( globalUtilOptind >= argc )
33878  {
33879  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
33880  goto usage;
33881  }
33882  nCutMax = atoi(argv[globalUtilOptind]);
33883  globalUtilOptind++;
33884  if ( nCutMax < 0 )
33885  goto usage;
33886  break;
33887  case 'a':
33888  fUseOldAlgo ^= 1;
33889  break;
33890  case 'v':
33891  fVerbose ^= 1;
33892  break;
33893  case 'w':
33894  fVeryVerbose ^= 1;
33895  break;
33896  case 'h':
33897  goto usage;
33898  default:
33899  goto usage;
33900  }
33901  }
33902  if ( pAbc->pGia == NULL )
33903  {
33904  Abc_Print( -1, "Abc_CommandAbc9Rpm(): There is no AIG.\n" );
33905  return 0;
33906  }
33907  if ( fUseOldAlgo )
33908  pTemp = Abs_RpmPerformOld( pAbc->pGia, fVerbose );
33909  else
33910  pTemp = Abs_RpmPerform( pAbc->pGia, nCutMax, fVerbose, fVeryVerbose );
33911  Abc_FrameUpdateGia( pAbc, pTemp );
33912  return 0;
33913 
33914 usage:
33915  Abc_Print( -2, "usage: &rpm [-C num] [-avwh]\n" );
33916  Abc_Print( -2, "\t performs structural reparametrization\n" );
33917  Abc_Print( -2, "\t-C num : max cut size for testing range equivalence [default = %d]\n", nCutMax );
33918  Abc_Print( -2, "\t-a : toggle using old algorithm [default = %s]\n", fUseOldAlgo? "yes": "no" );
33919  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
33920  Abc_Print( -2, "\t-w : toggle printing more verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
33921  Abc_Print( -2, "\t-h : print the command usage\n");
33922  return 1;
33923 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Abs_RpmPerform(Gia_Man_t *p, int nCutMax, int fVerbose, int fVeryVerbose)
Definition: absRpm.c:772
int globalUtilOptind
Definition: extraUtilUtil.c:45
Gia_Man_t * Abs_RpmPerformOld(Gia_Man_t *p, int fVerbose)
Definition: absRpmOld.c:141
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Sat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29951 of file abc.c.

29952 {
29953  Cec_ParSat_t ParsSat, * pPars = &ParsSat;
29954  Gia_Man_t * pTemp;
29955  int c;
29956  int fCSat = 0;
29957  Cec_ManSatSetDefaultParams( pPars );
29959  while ( ( c = Extra_UtilGetopt( argc, argv, "CSNnmtcvh" ) ) != EOF )
29960  {
29961  switch ( c )
29962  {
29963  case 'C':
29964  if ( globalUtilOptind >= argc )
29965  {
29966  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
29967  goto usage;
29968  }
29969  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
29970  globalUtilOptind++;
29971  if ( pPars->nBTLimit < 0 )
29972  goto usage;
29973  break;
29974  case 'S':
29975  if ( globalUtilOptind >= argc )
29976  {
29977  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
29978  goto usage;
29979  }
29980  pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
29981  globalUtilOptind++;
29982  if ( pPars->nSatVarMax < 0 )
29983  goto usage;
29984  break;
29985  case 'N':
29986  if ( globalUtilOptind >= argc )
29987  {
29988  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
29989  goto usage;
29990  }
29991  pPars->nCallsRecycle = atoi(argv[globalUtilOptind]);
29992  globalUtilOptind++;
29993  if ( pPars->nCallsRecycle < 0 )
29994  goto usage;
29995  break;
29996  case 'n':
29997  pPars->fNonChrono ^= 1;
29998  break;
29999  case 'm':
30000  pPars->fCheckMiter ^= 1;
30001  break;
30002  case 't':
30003  pPars->fLearnCls ^= 1;
30004  break;
30005  case 'c':
30006  fCSat ^= 1;
30007  break;
30008  case 'v':
30009  pPars->fVerbose ^= 1;
30010  break;
30011  default:
30012  goto usage;
30013  }
30014  }
30015  if ( pAbc->pGia == NULL )
30016  {
30017  Abc_Print( -1, "Abc_CommandAbc9Sat(): There is no AIG.\n" );
30018  return 1;
30019  }
30020  if ( fCSat )
30021  {
30022  Vec_Int_t * vCounters;
30023  Vec_Str_t * vStatus;
30024  if ( pPars->fLearnCls )
30025  vCounters = Tas_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
30026  else if ( pPars->fNonChrono )
30027  vCounters = Cbs_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
30028  else
30029  vCounters = Cbs_ManSolveMiter( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
30030  Vec_IntFree( vCounters );
30031  Vec_StrFree( vStatus );
30032  }
30033  else
30034  {
30035  pTemp = Cec_ManSatSolving( pAbc->pGia, pPars );
30036  Abc_FrameUpdateGia( pAbc, pTemp );
30037  }
30038  return 0;
30039 
30040 usage:
30041  Abc_Print( -2, "usage: &sat [-CSN <num>] [-nmctvh]\n" );
30042  Abc_Print( -2, "\t performs SAT solving for the combinational outputs\n" );
30043  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
30044  Abc_Print( -2, "\t-S num : the min number of variables to recycle the solver [default = %d]\n", pPars->nSatVarMax );
30045  Abc_Print( -2, "\t-N num : the min number of calls to recycle the solver [default = %d]\n", pPars->nCallsRecycle );
30046  Abc_Print( -2, "\t-n : toggle using non-chronological backtracking [default = %s]\n", pPars->fNonChrono? "yes": "no" );
30047  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
30048  Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", fCSat? "yes": "no" );
30049  Abc_Print( -2, "\t-t : toggle using learning in curcuit-based solver [default = %s]\n", pPars->fLearnCls? "yes": "no" );
30050  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
30051  Abc_Print( -2, "\t-h : print the command usage\n");
30052  return 1;
30053 }
Vec_Int_t * Cbs_ManSolveMiter(Gia_Man_t *pGia, int nConfs, Vec_Str_t **pvStatus, int fVerbose)
Definition: giaCSatOld.c:708
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Vec_Int_t * Cbs_ManSolveMiterNc(Gia_Man_t *pGia, int nConfs, Vec_Str_t **pvStatus, int fVerbose)
Definition: giaCSat.c:998
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Cec_ManSatSolving(Gia_Man_t *pAig, Cec_ParSat_t *pPars)
Definition: cecCore.c:234
static void Vec_StrFree(Vec_Str_t *p)
Definition: bblif.c:616
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
typedefABC_NAMESPACE_HEADER_START struct Cec_ParSat_t_ Cec_ParSat_t
INCLUDES ///.
Definition: cec.h:43
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Cec_ManSatSetDefaultParams(Cec_ParSat_t *p)
DECLARATIONS ///.
Definition: cecCore.c:45
Vec_Int_t * Tas_ManSolveMiterNc(Gia_Man_t *pGia, int nConfs, Vec_Str_t **pvStatus, int fVerbose)
Definition: giaCTas.c:1517
int Abc_CommandAbc9SatEnum ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30066 of file abc.c.

30067 {
30068  extern int Gia_ManSatEnum( Gia_Man_t * p, int nConfLimit, int nTimeOut, int fVerbose );
30069  int c, nConfLimit = 0, nTimeOut = 0, fVerbose = 0;
30071  while ( ( c = Extra_UtilGetopt( argc, argv, "CTvh" ) ) != EOF )
30072  {
30073  switch ( c )
30074  {
30075  case 'C':
30076  if ( globalUtilOptind >= argc )
30077  {
30078  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
30079  goto usage;
30080  }
30081  nConfLimit = atoi(argv[globalUtilOptind]);
30082  globalUtilOptind++;
30083  if ( nConfLimit < 0 )
30084  goto usage;
30085  break;
30086  case 'T':
30087  if ( globalUtilOptind >= argc )
30088  {
30089  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
30090  goto usage;
30091  }
30092  nTimeOut = atoi(argv[globalUtilOptind]);
30093  globalUtilOptind++;
30094  if ( nTimeOut < 0 )
30095  goto usage;
30096  break;
30097  case 'v':
30098  fVerbose ^= 1;
30099  break;
30100  default:
30101  goto usage;
30102  }
30103  }
30104  if ( pAbc->pGia == NULL )
30105  {
30106  Abc_Print( -1, "Abc_CommandAbc9SatEnum(): There is no AIG.\n" );
30107  return 1;
30108  }
30109  Gia_ManSatEnum( pAbc->pGia, nConfLimit, nTimeOut, fVerbose );
30110  return 0;
30111 
30112 usage:
30113  Abc_Print( -2, "usage: &satenum [-CT <num>] [-vh]\n" );
30114  Abc_Print( -2, "\t enumerates solutions of the combinational miter\n" );
30115  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfLimit );
30116  Abc_Print( -2, "\t-T num : global timeout [default = %d]\n", nTimeOut );
30117  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
30118  Abc_Print( -2, "\t-h : print the command usage\n");
30119  return 1;
30120 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Gia_ManSatEnum(Gia_Man_t *pGia, int nConfLimit, int nTimeOut, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: giaQbf.c:68
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9SatTest ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 36097 of file abc.c.

36098 {
36099  extern void Bmc_LoadTest( Gia_Man_t * pGia, int fLoadCnf, int fVerbose );
36100  int c, fLoadCnf = 0, fVerbose = 0;
36102  while ( ( c = Extra_UtilGetopt( argc, argv, "cvh" ) ) != EOF )
36103  {
36104  switch ( c )
36105  {
36106  case 'c':
36107  fLoadCnf ^= 1;
36108  break;
36109  case 'v':
36110  fVerbose ^= 1;
36111  break;
36112  case 'h':
36113  goto usage;
36114  default:
36115  goto usage;
36116  }
36117  }
36118  if ( pAbc->pGia == NULL )
36119  {
36120  Abc_Print( -1, "Abc_CommandAbc9SatTest(): There is no AIG.\n" );
36121  return 0;
36122  }
36123  Bmc_LoadTest( pAbc->pGia, fLoadCnf, fVerbose );
36124  return 0;
36125 
36126 usage:
36127  Abc_Print( -2, "usage: &sattest [-cvh]\n" );
36128  Abc_Print( -2, "\t performs testing of dynamic CNF loading\n" );
36129  Abc_Print( -2, "\t-c : toggle dynamic CNF loading [default = %s]\n", fLoadCnf? "yes": "no" );
36130  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
36131  Abc_Print( -2, "\t-h : print the command usage\n");
36132  return 1;
36133 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Bmc_LoadTest(Gia_Man_t *pGia, int fLoadCnf, int fVerbose)
Definition: bmcLoad.c:161
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Save ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26018 of file abc.c.

26019 {
26020  int c;
26022  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
26023  {
26024  switch ( c )
26025  {
26026  case 'h':
26027  goto usage;
26028  default:
26029  goto usage;
26030  }
26031  }
26032  if ( pAbc->pGia == NULL )
26033  {
26034  Abc_Print( -1, "Empty network.\n" );
26035  return 1;
26036  }
26037  if ( !Gia_ManHasMapping(pAbc->pGia) )
26038  {
26039  Abc_Print( -1, "GIA has no mapping.\n" );
26040  return 1;
26041  }
26042  if ( !Gia_ManCompareWithBest( pAbc->pGiaBest, pAbc->pGia, &pAbc->nBestLuts, &pAbc->nBestEdges, &pAbc->nBestLevels ) )
26043  return 0;
26044  // save the design as best
26045  Gia_ManStopP( &pAbc->pGiaBest );
26046  pAbc->pGiaBest = Gia_ManDupWithAttributes( pAbc->pGia );
26047  return 0;
26048 
26049 usage:
26050  Abc_Print( -2, "usage: &save [-h]\n" );
26051  Abc_Print( -2, "\t compares and possibly saves AIG with mapping\n" );
26052  Abc_Print( -2, "\t-h : print the command usage\n");
26053  return 1;
26054 }
void Gia_ManStopP(Gia_Man_t **p)
Definition: giaMan.c:177
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static int Gia_ManCompareWithBest(Gia_Man_t *pBest, Gia_Man_t *p, int *pnBestLuts, int *pnBestEdges, int *pnBestLevels)
Definition: abc.c:25987
Gia_Man_t * Gia_ManDupWithAttributes(Gia_Man_t *p)
Definition: giaDup.c:583
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Scl ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29589 of file abc.c.

29590 {
29591  Gia_Man_t * pTemp;
29592  int c;
29593  int fConst = 1;
29594  int fEquiv = 1;
29595  int fVerbose = 0;
29597  while ( ( c = Extra_UtilGetopt( argc, argv, "cevh" ) ) != EOF )
29598  {
29599  switch ( c )
29600  {
29601  case 'c':
29602  fConst ^= 1;
29603  break;
29604  case 'e':
29605  fEquiv ^= 1;
29606  break;
29607  case 'v':
29608  fVerbose ^= 1;
29609  break;
29610  default:
29611  goto usage;
29612  }
29613  }
29614  if ( pAbc->pGia == NULL )
29615  {
29616  Abc_Print( -1, "Abc_CommandAbc9Scl(): There is no AIG.\n" );
29617  return 1;
29618  }
29619  if ( Gia_ManBoxNum(pAbc->pGia) && Gia_ManRegBoxNum(pAbc->pGia) )
29620  {
29621  if ( pAbc->pGia->pAigExtra == NULL )
29622  {
29623  printf( "Timing manager is given but there is no GIA of boxes.\n" );
29624  return 0;
29625  }
29626  pTemp = Gia_ManSweepWithBoxes( pAbc->pGia, NULL, NULL, fConst, fEquiv, fVerbose );
29627  Abc_FrameUpdateGia( pAbc, pTemp );
29628  return 0;
29629  }
29630  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
29631  {
29632  Abc_Print( -1, "The network is combinational.\n" );
29633  return 0;
29634  }
29635  pTemp = Gia_ManSeqStructSweep( pAbc->pGia, fConst, fEquiv, fVerbose );
29636  Abc_FrameUpdateGia( pAbc, pTemp );
29637  return 0;
29638 
29639 usage:
29640  Abc_Print( -2, "usage: &scl [-cevh]\n" );
29641  Abc_Print( -2, "\t performs structural sequential cleanup\n" );
29642  Abc_Print( -2, "\t-c : toggle removing stuck-at constant registers [default = %s]\n", fConst? "yes": "no" );
29643  Abc_Print( -2, "\t-e : toggle removing equivalent-driver registers [default = %s]\n", fEquiv? "yes": "no" );
29644  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
29645  Abc_Print( -2, "\t-h : print the command usage\n");
29646  return 1;
29647 }
int Gia_ManRegBoxNum(Gia_Man_t *p)
Definition: giaTim.c:53
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Gia_ManBoxNum(Gia_Man_t *p)
DECLARATIONS ///.
Definition: giaTim.c:49
Gia_Man_t * Gia_ManSeqStructSweep(Gia_Man_t *p, int fConst, int fEquiv, int fVerbose)
Definition: giaScl.c:258
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManSweepWithBoxes(Gia_Man_t *p, void *pParsC, void *pParsS, int fConst, int fEquiv, int fVerbose)
Definition: giaSweep.c:683
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Scorr ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29767 of file abc.c.

29768 {
29769  Cec_ParCor_t Pars, * pPars = &Pars;
29770  Gia_Man_t * pTemp;
29771  int c;
29772  Cec_ManCorSetDefaultParams( pPars );
29774  while ( ( c = Extra_UtilGetopt( argc, argv, "FCPkrecqwvh" ) ) != EOF )
29775  {
29776  switch ( c )
29777  {
29778  case 'F':
29779  if ( globalUtilOptind >= argc )
29780  {
29781  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
29782  goto usage;
29783  }
29784  pPars->nFrames = atoi(argv[globalUtilOptind]);
29785  globalUtilOptind++;
29786  if ( pPars->nFrames < 0 )
29787  goto usage;
29788  break;
29789  case 'C':
29790  if ( globalUtilOptind >= argc )
29791  {
29792  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
29793  goto usage;
29794  }
29795  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
29796  globalUtilOptind++;
29797  if ( pPars->nBTLimit < 0 )
29798  goto usage;
29799  break;
29800  case 'P':
29801  if ( globalUtilOptind >= argc )
29802  {
29803  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
29804  goto usage;
29805  }
29806  pPars->nPrefix = atoi(argv[globalUtilOptind]);
29807  globalUtilOptind++;
29808  if ( pPars->nPrefix < 0 )
29809  goto usage;
29810  break;
29811  case 'k':
29812  pPars->fConstCorr ^= 1;
29813  break;
29814  case 'r':
29815  pPars->fUseRings ^= 1;
29816  break;
29817  case 'e':
29818  pPars->fMakeChoices ^= 1;
29819  break;
29820  case 'c':
29821  pPars->fUseCSat ^= 1;
29822  break;
29823  case 'q':
29824  pPars->fStopWhenGone ^= 1;
29825  break;
29826  case 'w':
29827  pPars->fVerboseFlops ^= 1;
29828  break;
29829  case 'v':
29830  pPars->fVerbose ^= 1;
29831  break;
29832  default:
29833  goto usage;
29834  }
29835  }
29836  if ( pAbc->pGia == NULL )
29837  {
29838  Abc_Print( -1, "Abc_CommandAbc9Scorr(): There is no AIG.\n" );
29839  return 1;
29840  }
29841  if ( Gia_ManBoxNum(pAbc->pGia) && Gia_ManRegBoxNum(pAbc->pGia) )
29842  {
29843  if ( pAbc->pGia->pAigExtra == NULL )
29844  {
29845  printf( "Timing manager is given but there is no GIA of boxes.\n" );
29846  return 0;
29847  }
29848  pTemp = Gia_ManSweepWithBoxes( pAbc->pGia, NULL, pPars, 0, 0, pPars->fVerbose );
29849  Abc_FrameUpdateGia( pAbc, pTemp );
29850  return 0;
29851  }
29852  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
29853  {
29854  Abc_Print( -1, "The network is combinational.\n" );
29855  return 0;
29856  }
29857  pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
29858  Abc_FrameUpdateGia( pAbc, pTemp );
29859  return 0;
29860 
29861 usage:
29862  Abc_Print( -2, "usage: &scorr [-FCP num] [-krecqwvh]\n" );
29863  Abc_Print( -2, "\t performs signal correpondence computation\n" );
29864  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
29865  Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
29866  Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
29867  Abc_Print( -2, "\t-k : toggle using constant correspondence [default = %s]\n", pPars->fConstCorr? "yes": "no" );
29868  Abc_Print( -2, "\t-r : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
29869  Abc_Print( -2, "\t-e : toggle using equivalences as choices [default = %s]\n", pPars->fMakeChoices? "yes": "no" );
29870  Abc_Print( -2, "\t-c : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
29871  Abc_Print( -2, "\t-q : toggle quitting when PO is not a constant candidate [default = %s]\n", pPars->fStopWhenGone? "yes": "no" );
29872  Abc_Print( -2, "\t-w : toggle printing verbose info about equivalent flops [default = %s]\n", pPars->fVerboseFlops? "yes": "no" );
29873  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
29874  Abc_Print( -2, "\t-h : print the command usage\n");
29875  return 1;
29876 }
void Cec_ManCorSetDefaultParams(Cec_ParCor_t *p)
Definition: cecCore.c:181
int fUseCSat
Definition: cec.h:146
int Gia_ManRegBoxNum(Gia_Man_t *p)
Definition: giaTim.c:53
int nPrefix
Definition: cec.h:138
int fUseRings
Definition: cec.h:144
int fConstCorr
Definition: cec.h:143
int fVerboseFlops
Definition: cec.h:150
int fVerbose
Definition: cec.h:152
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Gia_ManBoxNum(Gia_Man_t *p)
DECLARATIONS ///.
Definition: giaTim.c:49
int nFrames
Definition: cec.h:137
Gia_Man_t * Cec_ManLSCorrespondence(Gia_Man_t *pAig, Cec_ParCor_t *pPars)
Definition: cecCorr.c:1147
int fMakeChoices
Definition: cec.h:145
int globalUtilOptind
Definition: extraUtilUtil.c:45
int fStopWhenGone
Definition: cec.h:149
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nBTLimit
Definition: cec.h:139
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManSweepWithBoxes(Gia_Man_t *p, void *pParsC, void *pParsS, int fConst, int fEquiv, int fVerbose)
Definition: giaSweep.c:683
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Semi ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27982 of file abc.c.

27983 {
27984  Cec_ParSmf_t Pars, * pPars = &Pars;
27985  int c;
27986  Cec_ManSmfSetDefaultParams( pPars );
27988  while ( ( c = Extra_UtilGetopt( argc, argv, "WRFSMCTmdvh" ) ) != EOF )
27989  {
27990  switch ( c )
27991  {
27992  case 'W':
27993  if ( globalUtilOptind >= argc )
27994  {
27995  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
27996  goto usage;
27997  }
27998  pPars->nWords = atoi(argv[globalUtilOptind]);
27999  globalUtilOptind++;
28000  if ( pPars->nWords < 0 )
28001  goto usage;
28002  break;
28003  case 'R':
28004  if ( globalUtilOptind >= argc )
28005  {
28006  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
28007  goto usage;
28008  }
28009  pPars->nRounds = atoi(argv[globalUtilOptind]);
28010  globalUtilOptind++;
28011  if ( pPars->nRounds < 0 )
28012  goto usage;
28013  break;
28014  case 'F':
28015  if ( globalUtilOptind >= argc )
28016  {
28017  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
28018  goto usage;
28019  }
28020  pPars->nFrames = atoi(argv[globalUtilOptind]);
28021  globalUtilOptind++;
28022  if ( pPars->nFrames < 0 )
28023  goto usage;
28024  break;
28025  case 'S':
28026  if ( globalUtilOptind >= argc )
28027  {
28028  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
28029  goto usage;
28030  }
28031  pPars->nNonRefines = atoi(argv[globalUtilOptind]);
28032  globalUtilOptind++;
28033  if ( pPars->nNonRefines < 0 )
28034  goto usage;
28035  break;
28036  case 'M':
28037  if ( globalUtilOptind >= argc )
28038  {
28039  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
28040  goto usage;
28041  }
28042  pPars->nMinOutputs = atoi(argv[globalUtilOptind]);
28043  globalUtilOptind++;
28044  if ( pPars->nMinOutputs < 0 )
28045  goto usage;
28046  break;
28047  case 'C':
28048  if ( globalUtilOptind >= argc )
28049  {
28050  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
28051  goto usage;
28052  }
28053  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
28054  globalUtilOptind++;
28055  if ( pPars->nBTLimit < 0 )
28056  goto usage;
28057  break;
28058  case 'T':
28059  if ( globalUtilOptind >= argc )
28060  {
28061  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
28062  goto usage;
28063  }
28064  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
28065  globalUtilOptind++;
28066  if ( pPars->TimeLimit < 0 )
28067  goto usage;
28068  break;
28069  case 'm':
28070  pPars->fCheckMiter ^= 1;
28071  break;
28072  case 'd':
28073  pPars->fDualOut ^= 1;
28074  break;
28075  case 'v':
28076  pPars->fVerbose ^= 1;
28077  break;
28078  case 'h':
28079  goto usage;
28080  default:
28081  goto usage;
28082  }
28083  }
28084  if ( pAbc->pGia == NULL )
28085  {
28086  Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
28087  return 1;
28088  }
28089  Cec_ManSeqSemiformal( pAbc->pGia, pPars );
28090  return 0;
28091 
28092 usage:
28093  Abc_Print( -2, "usage: &semi [-WRFSMCT num] [-mdvh]\n" );
28094  Abc_Print( -2, "\t performs semiformal refinement of equivalence classes\n" );
28095  Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
28096  Abc_Print( -2, "\t-R num : the max number of rounds to simulate [default = %d]\n", pPars->nRounds );
28097  Abc_Print( -2, "\t-F num : the max number of frames to unroll [default = %d]\n", pPars->nFrames );
28098  Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
28099  Abc_Print( -2, "\t-M num : the min number of outputs of bounded SRM [default = %d]\n", pPars->nMinOutputs );
28100  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
28101  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
28102  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
28103  Abc_Print( -2, "\t-d : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
28104  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
28105  Abc_Print( -2, "\t-h : print the command usage\n");
28106  return 1;
28107 }
int nFrames
Definition: cec.h:82
int nRounds
Definition: cec.h:81
void Cec_ManSmfSetDefaultParams(Cec_ParSmf_t *p)
Definition: cecCore.c:98
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int nBTLimit
Definition: cec.h:85
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Cec_ManSeqSemiformal(Gia_Man_t *pAig, Cec_ParSmf_t *pPars)
Definition: cecSeq.c:328
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fVerbose
Definition: cec.h:90
int fCheckMiter
Definition: cec.h:88
int TimeLimit
Definition: cec.h:86
int nWords
Definition: cec.h:80
int fDualOut
Definition: cec.h:87
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int nMinOutputs
Definition: cec.h:84
int nNonRefines
Definition: cec.h:83
int Abc_CommandAbc9SetRegNum ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26597 of file abc.c.

26598 {
26599  int c, nRegNum = 0;
26601  while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
26602  {
26603  switch ( c )
26604  {
26605  case 'N':
26606  if ( globalUtilOptind >= argc )
26607  {
26608  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
26609  goto usage;
26610  }
26611  nRegNum = atoi(argv[globalUtilOptind]);
26612  globalUtilOptind++;
26613  if ( nRegNum < 0 )
26614  goto usage;
26615  break;
26616  case 'h':
26617  goto usage;
26618  default:
26619  goto usage;
26620  }
26621  }
26622  if ( pAbc->pGia == NULL )
26623  {
26624  Abc_Print( -1, "Abc_CommandAbc9SetRegNum(): There is no AIG.\n" );
26625  return 1;
26626  }
26627  if ( nRegNum >= Gia_ManCiNum(pAbc->pGia) )
26628  {
26629  Abc_Print( -1, "Abc_CommandAbc9SetRegNum(): The number of registers should be less than the number of CIs.\n" );
26630  return 1;
26631  }
26632  if ( nRegNum >= Gia_ManCoNum(pAbc->pGia) )
26633  {
26634  Abc_Print( -1, "Abc_CommandAbc9SetRegNum(): The number of registers should be less than the number of COs.\n" );
26635  return 1;
26636  }
26637  pAbc->pGia->nRegs = nRegNum;
26638  return 0;
26639 
26640 usage:
26641  Abc_Print( -2, "usage: &setregnum [-N num] [-h]\n" );
26642  Abc_Print( -2, "\t manually sets the number of registers to combine the last PI/PO pairs\n" );
26643  Abc_Print( -2, "\t-N num : set the number of registers to be the given number [default = %d]\n", nRegNum );
26644  Abc_Print( -2, "\t-h : print the command usage\n");
26645  return 1;
26646 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
int Abc_CommandAbc9Show ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26549 of file abc.c.

26550 {
26551  Aig_Man_t * pMan;
26552  int c;
26554  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
26555  {
26556  switch ( c )
26557  {
26558  case 'h':
26559  goto usage;
26560  default:
26561  goto usage;
26562  }
26563  }
26564  if ( pAbc->pGia == NULL )
26565  {
26566  Abc_Print( -1, "Abc_CommandAbc9Show(): There is no AIG.\n" );
26567  return 1;
26568  }
26569  if ( Gia_ManBufNum(pAbc->pGia) )
26570  {
26571  Abc_Print( -1, "Abc_CommandAbc9Show(): Cannot show GIA with barrier buffers.\n" );
26572  return 1;
26573  }
26574  pMan = Gia_ManToAigSimple( pAbc->pGia );
26575  Aig_ManShow( pMan, 0, NULL );
26576  Aig_ManStop( pMan );
26577  return 0;
26578 
26579 usage:
26580  Abc_Print( -2, "usage: &show [-h]\n" );
26581  Abc_Print( -2, "\t shows the current AIG using GSView\n" );
26582  Abc_Print( -2, "\t-h : print the command usage\n");
26583  return 1;
26584 }
void Aig_ManShow(Aig_Man_t *pMan, int fHaig, Vec_Ptr_t *vBold)
Definition: aigShow.c:340
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManBufNum(Gia_Man_t *p)
Definition: gia.h:392
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Shrink ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28567 of file abc.c.

28568 {
28569  Gia_Man_t * pTemp = NULL;
28570  int nLutSize;
28571  int c,fVerbose = 0;
28572  int fKeepLevel = 0;
28573  int nFanoutMax = 50;
28575  while ( ( c = Extra_UtilGetopt( argc, argv, "Nlvh" ) ) != EOF )
28576  {
28577  switch ( c )
28578  {
28579  case 'N':
28580  if ( globalUtilOptind >= argc )
28581  {
28582  Abc_Print( -1, "Command line switch \"-N\" should be followed by a char string.\n" );
28583  goto usage;
28584  }
28585  nFanoutMax = atoi(argv[globalUtilOptind]);
28586  globalUtilOptind++;
28587  if ( nFanoutMax < 0 )
28588  goto usage;
28589  break;
28590  case 'l':
28591  fKeepLevel ^= 1;
28592  break;
28593  case 'v':
28594  fVerbose ^= 1;
28595  break;
28596  case 'h':
28597  goto usage;
28598  default:
28599  goto usage;
28600  }
28601  }
28602  if ( pAbc->pGia == NULL )
28603  {
28604  Abc_Print( -1, "Abc_CommandAbc9Shrink(): There is no AIG.\n" );
28605  return 1;
28606  }
28607  if ( !Gia_ManHasMapping(pAbc->pGia) )
28608  {
28609  Abc_Print( -1, "Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.\n" );
28610  return 1;
28611  }
28612  nLutSize = Gia_ManLutSizeMax( pAbc->pGia );
28613  if ( nLutSize <= 4 )
28614  pTemp = Gia_ManMapShrink4( pAbc->pGia, fKeepLevel, fVerbose );
28615  else if ( nLutSize <= 6 )
28616  pTemp = Gia_ManMapShrink6( pAbc->pGia, nFanoutMax, fKeepLevel, fVerbose );
28617  else
28618  Abc_Print( -1, "Abc_CommandAbc9Shrink(): Works only for 4-LUTs and 6-LUTs.\n" );
28619  if ( pTemp )
28620  Abc_FrameUpdateGia( pAbc, pTemp );
28621  return 0;
28622 
28623 usage:
28624  Abc_Print( -2, "usage: &shrink [-N num] [-lvh]\n" );
28625  Abc_Print( -2, "\t performs fast shrinking using current mapping\n" );
28626  Abc_Print( -2, "\t-N num : the max fanout count to skip a divisor [default = %d]\n", nFanoutMax );
28627  Abc_Print( -2, "\t-l : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
28628  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28629  Abc_Print( -2, "\t-h : print the command usage\n");
28630  return 1;
28631 }
Gia_Man_t * Gia_ManMapShrink4(Gia_Man_t *p, int fKeepLevel, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: giaShrink.c:49
Gia_Man_t * Gia_ManMapShrink6(Gia_Man_t *p, int nFanoutMax, int fKeepLevel, int fVerbose)
Definition: giaShrink6.c:401
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Gia_ManLutSizeMax(Gia_Man_t *p)
Definition: giaIf.c:125
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Sim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27112 of file abc.c.

27113 {
27114  Gia_ParSim_t Pars, * pPars = &Pars;
27115  char * pFileName = NULL;
27116  int c;
27117  Gia_ManSimSetDefaultParams( pPars );
27119  while ( ( c = Extra_UtilGetopt( argc, argv, "FWNTImvh" ) ) != EOF )
27120  {
27121  switch ( c )
27122  {
27123  case 'F':
27124  if ( globalUtilOptind >= argc )
27125  {
27126  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
27127  goto usage;
27128  }
27129  pPars->nIters = atoi(argv[globalUtilOptind]);
27130  globalUtilOptind++;
27131  if ( pPars->nIters < 0 )
27132  goto usage;
27133  break;
27134  case 'W':
27135  if ( globalUtilOptind >= argc )
27136  {
27137  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
27138  goto usage;
27139  }
27140  pPars->nWords = atoi(argv[globalUtilOptind]);
27141  globalUtilOptind++;
27142  if ( pPars->nWords < 0 )
27143  goto usage;
27144  break;
27145  case 'N':
27146  if ( globalUtilOptind >= argc )
27147  {
27148  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
27149  goto usage;
27150  }
27151  pPars->RandSeed = atoi(argv[globalUtilOptind]);
27152  globalUtilOptind++;
27153  if ( pPars->RandSeed < 0 )
27154  goto usage;
27155  break;
27156  case 'T':
27157  if ( globalUtilOptind >= argc )
27158  {
27159  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
27160  goto usage;
27161  }
27162  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
27163  globalUtilOptind++;
27164  if ( pPars->TimeLimit < 0 )
27165  goto usage;
27166  break;
27167  case 'I':
27168  if ( globalUtilOptind >= argc )
27169  {
27170  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
27171  goto usage;
27172  }
27173  pFileName = argv[globalUtilOptind];
27174  globalUtilOptind++;
27175  if ( pFileName == NULL )
27176  goto usage;
27177  break;
27178  case 'm':
27179  pPars->fCheckMiter ^= 1;
27180  break;
27181  case 'v':
27182  pPars->fVerbose ^= 1;
27183  break;
27184  case 'h':
27185  goto usage;
27186  default:
27187  goto usage;
27188  }
27189  }
27190  if ( pAbc->pGia == NULL )
27191  {
27192  Abc_Print( -1, "Abc_CommandAbc9Sim(): There is no AIG.\n" );
27193  return 1;
27194  }
27195  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
27196  {
27197  Abc_Print( -1, "The network is combinational.\n" );
27198  return 0;
27199  }
27200  if ( pFileName != NULL )
27201  {
27202  extern void Gia_ManSimSimulatePattern( Gia_Man_t * p, char * pFileIn, char * pFileOut );
27203  char pFileNameOut[1000];
27204  char * pNameGeneric = Extra_FileNameGeneric(pFileName);
27205  assert( strlen(pNameGeneric) < 900 );
27206  sprintf( pFileNameOut, "%s_out.%s", pNameGeneric, Extra_FileNameExtension(pFileName) );
27207  ABC_FREE( pNameGeneric );
27208  Gia_ManSimSimulatePattern( pAbc->pGia, pFileName, pFileNameOut );
27209  return 1;
27210  }
27211 
27212  pAbc->nFrames = -1;
27213  if ( Gia_ManSimSimulate( pAbc->pGia, pPars ) )
27214  pAbc->Status = 0;
27215  else
27216  pAbc->Status = -1;
27217  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
27218 // if ( pLogFileName )
27219 // Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&sim" );
27220  return 0;
27221 
27222 usage:
27223  Abc_Print( -2, "usage: &sim [-FWNT num] [-mvh] -I <file>\n" );
27224  Abc_Print( -2, "\t performs random simulation of the sequential miter\n" );
27225  Abc_Print( -2, "\t (if candidate equivalences are defined, performs refinement)\n" );
27226  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nIters );
27227  Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
27228  Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n", pPars->RandSeed );
27229  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
27230  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
27231  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
27232  Abc_Print( -2, "\t-h : print the command usage\n");
27233  Abc_Print( -2, "\t-I file: (optional) file with input patterns (one line per frame, as many as PIs)\n");
27234  return 1;
27235 }
int nWords
Definition: gia.h:241
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Gia_ManSimSimulate(Gia_Man_t *pAig, Gia_ParSim_t *pPars)
Definition: giaSim.c:598
void Gia_ManSimSimulatePattern(Gia_Man_t *p, char *pFileIn, char *pFileOut)
Definition: giaSim.c:731
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
int RandSeed
Definition: gia.h:243
int fVerbose
Definition: gia.h:246
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fCheckMiter
Definition: gia.h:245
char * Extra_FileNameGeneric(char *FileName)
int globalUtilOptind
Definition: extraUtilUtil.c:45
int nIters
Definition: gia.h:242
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
#define ABC_FREE(obj)
Definition: abc_global.h:232
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Gia_ManSimSetDefaultParams(Gia_ParSim_t *p)
Definition: giaSim.c:164
#define assert(ex)
Definition: util_old.h:213
int strlen()
char * Extra_FileNameExtension(char *FileName)
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int TimeLimit
Definition: gia.h:244
int Abc_CommandAbc9Sim3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27248 of file abc.c.

27249 {
27250  extern int Ssw_RarSimulateGia( Gia_Man_t * p, Ssw_RarPars_t * pPars );
27251  Ssw_RarPars_t Pars, * pPars = &Pars;
27252  int c;
27253  Ssw_RarSetDefaultParams( pPars );
27254  // parse command line
27256  while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTGgvh" ) ) != EOF )
27257  {
27258  switch ( c )
27259  {
27260  case 'F':
27261  if ( globalUtilOptind >= argc )
27262  {
27263  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
27264  goto usage;
27265  }
27266  pPars->nFrames = atoi(argv[globalUtilOptind]);
27267  globalUtilOptind++;
27268  if ( pPars->nFrames < 0 )
27269  goto usage;
27270  break;
27271  case 'W':
27272  if ( globalUtilOptind >= argc )
27273  {
27274  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
27275  goto usage;
27276  }
27277  pPars->nWords = atoi(argv[globalUtilOptind]);
27278  globalUtilOptind++;
27279  if ( pPars->nWords < 0 )
27280  goto usage;
27281  break;
27282  case 'B':
27283  if ( globalUtilOptind >= argc )
27284  {
27285  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
27286  goto usage;
27287  }
27288  pPars->nBinSize = atoi(argv[globalUtilOptind]);
27289  globalUtilOptind++;
27290  if ( pPars->nBinSize < 0 )
27291  goto usage;
27292  break;
27293  case 'R':
27294  if ( globalUtilOptind >= argc )
27295  {
27296  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
27297  goto usage;
27298  }
27299  pPars->nRounds = atoi(argv[globalUtilOptind]);
27300  globalUtilOptind++;
27301  if ( pPars->nRounds < 0 )
27302  goto usage;
27303  break;
27304  case 'S':
27305  if ( globalUtilOptind >= argc )
27306  {
27307  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
27308  goto usage;
27309  }
27310  pPars->nRestart = atoi(argv[globalUtilOptind]);
27311  globalUtilOptind++;
27312  if ( pPars->nRestart < 0 )
27313  goto usage;
27314  break;
27315  case 'N':
27316  if ( globalUtilOptind >= argc )
27317  {
27318  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
27319  goto usage;
27320  }
27321  pPars->nRandSeed = atoi(argv[globalUtilOptind]);
27322  globalUtilOptind++;
27323  if ( pPars->nRandSeed < 0 )
27324  goto usage;
27325  break;
27326  case 'T':
27327  if ( globalUtilOptind >= argc )
27328  {
27329  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
27330  goto usage;
27331  }
27332  pPars->TimeOut = atoi(argv[globalUtilOptind]);
27333  globalUtilOptind++;
27334  if ( pPars->TimeOut < 0 )
27335  goto usage;
27336  break;
27337  case 'G':
27338  if ( globalUtilOptind >= argc )
27339  {
27340  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
27341  goto usage;
27342  }
27343  pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
27344  globalUtilOptind++;
27345  if ( pPars->TimeOutGap < 0 )
27346  goto usage;
27347  break;
27348  case 'g':
27349  pPars->fUseFfGrouping ^= 1;
27350  break;
27351  case 'v':
27352  pPars->fVerbose ^= 1;
27353  break;
27354  case 'h':
27355  goto usage;
27356  default:
27357  goto usage;
27358  }
27359  }
27360  if ( pAbc->pGia == NULL )
27361  {
27362  Abc_Print( -1, "Abc_CommandAbc9Sim3(): There is no AIG.\n" );
27363  return 1;
27364  }
27365  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
27366  {
27367  Abc_Print( -1, "Abc_CommandAbc9Sim3(): This command works only for sequential AIGs.\n" );
27368  return 0;
27369  }
27370  pAbc->Status = Ssw_RarSimulateGia( pAbc->pGia, pPars );
27371  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
27372  return 0;
27373 
27374 usage:
27375  Abc_Print( -2, "usage: &sim3 [-FWBRNT num] [-gvh]\n" );
27376  Abc_Print( -2, "\t performs random simulation of the sequential miter\n" );
27377  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nFrames );
27378  Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
27379  Abc_Print( -2, "\t-B num : the number of flops in one bin [default = %d]\n", pPars->nBinSize );
27380  Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n", pPars->nRounds );
27381  Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n", pPars->nRestart );
27382  Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n", pPars->nRandSeed );
27383  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeOut );
27384  Abc_Print( -2, "\t-g : toggle heuristic flop grouping [default = %s]\n", pPars->fUseFfGrouping? "yes": "no" );
27385  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
27386  Abc_Print( -2, "\t-h : print the command usage\n");
27387  return 1;
27388 }
int nFrames
Definition: ssw.h:92
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int TimeOutGap
Definition: ssw.h:99
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fVerbose
Definition: ssw.h:102
int TimeOut
Definition: ssw.h:98
int nRestart
Definition: ssw.h:96
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Ssw_RarSimulateGia(Gia_Man_t *p, Ssw_RarPars_t *pPars)
Definition: sswRarity.c:1186
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nWords
Definition: ssw.h:93
Definition: gia.h:95
void Ssw_RarSetDefaultParams(Ssw_RarPars_t *p)
FUNCTION DEFINITIONS ///.
Definition: sswRarity.c:102
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int nRandSeed
Definition: ssw.h:97
int fUseFfGrouping
Definition: ssw.h:109
int nRounds
Definition: ssw.h:95
int nBinSize
Definition: ssw.h:94
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Slice ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35114 of file abc.c.

35115 {
35116  Gia_Man_t * pTemp;
35117  int c, nSuppSize = 6, fVerbose = 0;
35119  while ( ( c = Extra_UtilGetopt( argc, argv, "Svh" ) ) != EOF )
35120  {
35121  switch ( c )
35122  {
35123  case 'S':
35124  if ( globalUtilOptind >= argc )
35125  {
35126  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
35127  goto usage;
35128  }
35129  nSuppSize = atoi(argv[globalUtilOptind]);
35130  globalUtilOptind++;
35131  if ( nSuppSize < 0 )
35132  goto usage;
35133  break;
35134  case 'v':
35135  fVerbose ^= 1;
35136  break;
35137  case 'h':
35138  goto usage;
35139  default:
35140  goto usage;
35141  }
35142  }
35143  if ( pAbc->pGia == NULL )
35144  {
35145  Abc_Print( -1, "Abc_CommandAbc9Slice(): There is no AIG.\n" );
35146  return 1;
35147  }
35148  pTemp = Gia_ManDupSliced( pAbc->pGia, nSuppSize );
35149  Abc_FrameUpdateGia( pAbc, pTemp );
35150  return 0;
35151 
35152 usage:
35153  Abc_Print( -2, "usage: &slice [-S num] [-vh]\n" );
35154  Abc_Print( -2, "\t cuts the lower part of the AIG with nodes using their support\n" );
35155  Abc_Print( -2, "\t-S num : the largest support size to keep in the slide [default = %d]\n", nSuppSize );
35156  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
35157  Abc_Print( -2, "\t-h : print the command usage\n");
35158  return 1;
35159 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Gia_Man_t * Gia_ManDupSliced(Gia_Man_t *p, int nSuppMax)
Definition: giaDup.c:2888
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Sopb ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31301 of file abc.c.

31302 {
31303  Gia_Man_t * pTemp;
31304  int nLevelMax = 0;
31305  int nTimeWindow = 0;
31306  int nCutNum = 8;
31307  int nRelaxRatio = 0;
31308  int c, fVerbose = 0;
31310  while ( ( c = Extra_UtilGetopt( argc, argv, "LWCRvh" ) ) != EOF )
31311  {
31312  switch ( c )
31313  {
31314  case 'L':
31315  if ( globalUtilOptind >= argc )
31316  {
31317  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
31318  goto usage;
31319  }
31320  nLevelMax = atoi(argv[globalUtilOptind]);
31321  globalUtilOptind++;
31322  if ( nLevelMax < 0 )
31323  goto usage;
31324  break;
31325  case 'W':
31326  if ( globalUtilOptind >= argc )
31327  {
31328  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
31329  goto usage;
31330  }
31331  nTimeWindow = atoi(argv[globalUtilOptind]);
31332  globalUtilOptind++;
31333  if ( nTimeWindow < 0 )
31334  goto usage;
31335  break;
31336  case 'C':
31337  if ( globalUtilOptind >= argc )
31338  {
31339  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
31340  goto usage;
31341  }
31342  nCutNum = atoi(argv[globalUtilOptind]);
31343  globalUtilOptind++;
31344  if ( nCutNum < 0 )
31345  goto usage;
31346  break;
31347  case 'R':
31348  if ( globalUtilOptind >= argc )
31349  {
31350  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
31351  goto usage;
31352  }
31353  nRelaxRatio = atoi(argv[globalUtilOptind]);
31354  globalUtilOptind++;
31355  if ( nRelaxRatio < 0 )
31356  goto usage;
31357  break;
31358  case 'v':
31359  fVerbose ^= 1;
31360  break;
31361  case 'h':
31362  goto usage;
31363  default:
31364  goto usage;
31365  }
31366  }
31367  if ( pAbc->pGia == NULL )
31368  {
31369  Abc_Print( -1, "Abc_CommandAbc9Sopb(): There is no AIG.\n" );
31370  return 1;
31371  }
31372  if ( nLevelMax || nTimeWindow )
31373  pTemp = Gia_ManPerformSopBalanceWin( pAbc->pGia, nLevelMax, nTimeWindow, nCutNum, nRelaxRatio, fVerbose );
31374  else
31375  pTemp = Gia_ManPerformSopBalance( pAbc->pGia, nCutNum, nRelaxRatio, fVerbose );
31376  Abc_FrameUpdateGia( pAbc, pTemp );
31377  return 0;
31378 
31379 usage:
31380  Abc_Print( -2, "usage: &sopb [-LWCR num] [-vh]\n" );
31381  Abc_Print( -2, "\t performs SOP balancing\n" );
31382  Abc_Print( -2, "\t-L num : optimize paths above this level [default = %d]\n", nLevelMax );
31383  Abc_Print( -2, "\t-W num : optimize paths falling into this window [default = %d]\n", nTimeWindow );
31384  Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
31385  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
31386  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
31387  Abc_Print( -2, "\t-h : print the command usage\n");
31388  return 1;
31389 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Gia_Man_t * Gia_ManPerformSopBalance(Gia_Man_t *p, int nCutNum, int nRelaxRatio, int fVerbose)
Definition: giaIf.c:2031
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManPerformSopBalanceWin(Gia_Man_t *p, int LevelMax, int nTimeWindow, int nCutNum, int nRelaxRatio, int fVerbose)
Definition: giaBalMap.c:265
int Abc_CommandAbc9SpecI ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 27467 of file abc.c.

27468 {
27469  extern int Gia_CommandSpecI( Gia_Man_t * pGia, int nFrames, int nBTLimit, int fUseStart, int fCheckMiter, int fVerbose );
27470  int nFrames = 100;
27471  int nBTLimit = 25000;
27472  int fUseStart = 1;
27473  int fCheckMiter = 1;
27474  int fVerbose = 0;
27475  int c;
27477  while ( ( c = Extra_UtilGetopt( argc, argv, "FCfmvh" ) ) != EOF )
27478  {
27479  switch ( c )
27480  {
27481  case 'F':
27482  if ( globalUtilOptind >= argc )
27483  {
27484  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
27485  goto usage;
27486  }
27487  nFrames = atoi(argv[globalUtilOptind]);
27488  globalUtilOptind++;
27489  if ( nFrames < 0 )
27490  goto usage;
27491  break;
27492  case 'C':
27493  if ( globalUtilOptind >= argc )
27494  {
27495  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
27496  goto usage;
27497  }
27498  nBTLimit = atoi(argv[globalUtilOptind]);
27499  globalUtilOptind++;
27500  if ( nBTLimit < 0 )
27501  goto usage;
27502  break;
27503  case 'f':
27504  fUseStart ^= 1;
27505  break;
27506  case 'm':
27507  fCheckMiter ^= 1;
27508  break;
27509  case 'v':
27510  fVerbose ^= 1;
27511  break;
27512  case 'h':
27513  goto usage;
27514  default:
27515  goto usage;
27516  }
27517  }
27518  if ( pAbc->pGia == NULL )
27519  {
27520  Abc_Print( -1, "Abc_CommandAbc9SpecI(): There is no AIG.\n" );
27521  return 1;
27522  }
27523  Gia_CommandSpecI( pAbc->pGia, nFrames, nBTLimit, fUseStart, fCheckMiter, fVerbose );
27524  return 0;
27525 
27526 usage:
27527  Abc_Print( -2, "usage: &speci [-FC num] [-fmvh]\n" );
27528  Abc_Print( -2, "\t refines equivalence classes using speculative reduction\n" );
27529  Abc_Print( -2, "\t-F num : the max number of time frames [default = %d]\n", nFrames );
27530  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
27531  Abc_Print( -2, "\t-f : toggle starting BMC from a later frame [default = %s]\n", fUseStart? "yes": "no" );
27532  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", fCheckMiter? "miter": "circuit" );
27533  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
27534  Abc_Print( -2, "\t-h : print the command usage\n");
27535  return 1;
27536 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Gia_CommandSpecI(Gia_Man_t *pGia, int nFramesInit, int nBTLimitInit, int fStart, int fCheckMiter, int fVerbose)
Definition: giaEquiv.c:1763
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Speedup ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33571 of file abc.c.

33572 {
33573  Gia_Man_t * pTemp;
33574  int fUseLutLib;
33575  int Percentage;
33576  int Degree;
33577  int fVerbose;
33578  int c, fVeryVerbose;
33579 
33580  // set defaults
33581  fUseLutLib = 0;
33582  Percentage = 5;
33583  Degree = 2;
33584  fVerbose = 0;
33585  fVeryVerbose = 0;
33587  while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
33588  {
33589  switch ( c )
33590  {
33591  case 'P':
33592  if ( globalUtilOptind >= argc )
33593  {
33594  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
33595  goto usage;
33596  }
33597  Percentage = atoi(argv[globalUtilOptind]);
33598  globalUtilOptind++;
33599  if ( Percentage < 1 || Percentage > 100 )
33600  goto usage;
33601  break;
33602  case 'N':
33603  if ( globalUtilOptind >= argc )
33604  {
33605  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
33606  goto usage;
33607  }
33608  Degree = atoi(argv[globalUtilOptind]);
33609  globalUtilOptind++;
33610  if ( Degree < 1 || Degree > 5 )
33611  goto usage;
33612  break;
33613  case 'l':
33614  fUseLutLib ^= 1;
33615  break;
33616  case 'v':
33617  fVerbose ^= 1;
33618  break;
33619  case 'w':
33620  fVeryVerbose ^= 1;
33621  break;
33622  case 'h':
33623  goto usage;
33624  default:
33625  goto usage;
33626  }
33627  }
33628  if ( pAbc->pGia == NULL )
33629  {
33630  Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
33631  return 1;
33632  }
33633  if ( !Gia_ManHasMapping(pAbc->pGia) )
33634  {
33635  Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
33636  return 1;
33637  }
33638  pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
33639  pTemp = Gia_ManSpeedup( pAbc->pGia, Percentage, Degree, fVerbose, fVeryVerbose );
33640  Abc_FrameUpdateGia( pAbc, pTemp );
33641  return 0;
33642 
33643 usage:
33644  Abc_Print( -2, "usage: &speedup [-P num] [-N num] [-lvwh]\n" );
33645  Abc_Print( -2, "\t transforms LUT-mapped network into an AIG with choices;\n" );
33646  Abc_Print( -2, "\t the choices are added to speedup the next round of mapping\n" );
33647  Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
33648  Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
33649  Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
33650  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
33651  Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
33652  Abc_Print( -2, "\t-h : print the command usage\n");
33653  return 1;
33654 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManSpeedup(Gia_Man_t *p, int Percentage, int Degree, int fVerbose, int fVeryVerbose)
Definition: giaSpeedup.c:628
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9SplitProve ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 35552 of file abc.c.

35553 {
35554  extern int Cec_GiaSplitTest( Gia_Man_t * p, int nProcs, int nTimeOut, int nIterMax, int LookAhead, int fVerbose, int fVeryVerbose );
35555  int c, nProcs = 1, nTimeOut = 10, nIterMax = 0, LookAhead = 1, fVerbose = 0, fVeryVerbose = 0;
35557  while ( ( c = Extra_UtilGetopt( argc, argv, "PTILvwh" ) ) != EOF )
35558  {
35559  switch ( c )
35560  {
35561  case 'P':
35562  if ( globalUtilOptind >= argc )
35563  {
35564  Abc_Print( -1, "Command line switch \"-P\" should be followed by a positive integer.\n" );
35565  goto usage;
35566  }
35567  nProcs = atoi(argv[globalUtilOptind]);
35568  globalUtilOptind++;
35569  if ( nProcs <= 0 )
35570  goto usage;
35571  break;
35572  case 'T':
35573  if ( globalUtilOptind >= argc )
35574  {
35575  Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer.\n" );
35576  goto usage;
35577  }
35578  nTimeOut = atoi(argv[globalUtilOptind]);
35579  globalUtilOptind++;
35580  if ( nTimeOut <= 0 )
35581  goto usage;
35582  break;
35583  case 'I':
35584  if ( globalUtilOptind >= argc )
35585  {
35586  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
35587  goto usage;
35588  }
35589  nIterMax = atoi(argv[globalUtilOptind]);
35590  globalUtilOptind++;
35591  if ( nIterMax < 0 )
35592  goto usage;
35593  break;
35594  case 'L':
35595  if ( globalUtilOptind >= argc )
35596  {
35597  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
35598  goto usage;
35599  }
35600  LookAhead = atoi(argv[globalUtilOptind]);
35601  globalUtilOptind++;
35602  if ( LookAhead <= 0 || LookAhead > 100 )
35603  {
35604  Abc_Print( -1, "Look-ahead value (\"-L <num>\") should be between 1 and 100.\n", LookAhead );
35605  goto usage;
35606  }
35607  break;
35608  case 'v':
35609  fVerbose ^= 1;
35610  break;
35611  case 'w':
35612  fVeryVerbose ^= 1;
35613  break;
35614  case 'h':
35615  goto usage;
35616  default:
35617  goto usage;
35618  }
35619  }
35620  if ( pAbc->pGia == NULL )
35621  {
35622  Abc_Print( -1, "Abc_CommandAbc9SplitProve(): There is no AIG.\n" );
35623  return 1;
35624  }
35625  if ( Gia_ManRegNum(pAbc->pGia) > 0 )
35626  {
35627  Abc_Print( -1, "Abc_CommandAbc9SplitProve(): The problem is sequential.\n" );
35628  return 1;
35629  }
35630  pAbc->Status = Cec_GiaSplitTest( pAbc->pGia, nProcs, nTimeOut, nIterMax, LookAhead, fVerbose, fVeryVerbose );
35631  pAbc->pCex = pAbc->pGia->pCexComb; pAbc->pGia->pCexComb = NULL;
35632  return 0;
35633 
35634 usage:
35635  Abc_Print( -2, "usage: &splitprove [-PTIL num] [-vwh]\n" );
35636  Abc_Print( -2, "\t proves CEC problem by case-splitting\n" );
35637  Abc_Print( -2, "\t-P num : the number of concurrent processes [default = %d]\n", nProcs );
35638  Abc_Print( -2, "\t-T num : runtime limit in seconds per subproblem [default = %d]\n", nTimeOut );
35639  Abc_Print( -2, "\t-I num : the max number of iterations (0 = infinity) [default = %d]\n", nIterMax );
35640  Abc_Print( -2, "\t-L num : maximum look-ahead during cofactoring [default = %d]\n", LookAhead );
35641  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
35642  Abc_Print( -2, "\t-w : toggle printing more verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
35643  Abc_Print( -2, "\t-h : print the command usage\n");
35644  return 1;
35645 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_NAMESPACE_IMPL_START int Cec_GiaSplitTest(Gia_Man_t *p, int nProcs, int nTimeOut, int nIterMax, int LookAhead, int fVerbose, int fVeryVerbose)
DECLARATIONS ///.
Definition: cecSplit.c:49
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Srm ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30352 of file abc.c.

30353 {
30354  char * pFileNameIn = NULL;
30355  char pFileName[10] = "gsrm.aig", pFileName2[10] = "gsyn.aig";
30356  Gia_Man_t * pTemp, * pAux;
30357  int c, fVerbose = 0;
30358  int fSynthesis = 0;
30359  int fSpeculate = 1;
30360  int fSkipSome = 0;
30361  int fDualOut = 0;
30363  while ( ( c = Extra_UtilGetopt( argc, argv, "Adrsfvh" ) ) != EOF )
30364  {
30365  switch ( c )
30366  {
30367  case 'A':
30368  if ( globalUtilOptind >= argc )
30369  {
30370  Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
30371  goto usage;
30372  }
30373  pFileNameIn = argv[globalUtilOptind];
30374  globalUtilOptind++;
30375  break;
30376  case 'd':
30377  fDualOut ^= 1;
30378  break;
30379  case 'r':
30380  fSynthesis ^= 1;
30381  break;
30382  case 's':
30383  fSpeculate ^= 1;
30384  break;
30385  case 'f':
30386  fSkipSome ^= 1;
30387  break;
30388  case 'v':
30389  fVerbose ^= 1;
30390  break;
30391  case 'h':
30392  goto usage;
30393  default:
30394  goto usage;
30395  }
30396  }
30397  if ( pAbc->pGia == NULL )
30398  {
30399  Abc_Print( -1, "Abc_CommandAbc9Srm(): There is no AIG.\n" );
30400  return 1;
30401  }
30402  sprintf(pFileName, "gsrm%s.aig", fSpeculate? "" : "s" );
30403  sprintf(pFileName2, "gsyn%s.aig", fSpeculate? "" : "s" );
30404  pTemp = Gia_ManSpecReduce( pAbc->pGia, fDualOut, fSynthesis, fSpeculate, fSkipSome, fVerbose );
30405  if ( pTemp )
30406  {
30407  if ( fSpeculate )
30408  {
30409  pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
30410  Gia_ManStop( pAux );
30411  }
30412  Gia_AigerWrite( pTemp, pFileNameIn ? pFileNameIn : pFileName, 0, 0 );
30413  Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
30414  Gia_ManPrintStatsShort( pTemp );
30415  Gia_ManStop( pTemp );
30416  }
30417  if ( fSynthesis )
30418  {
30419  pTemp = Gia_ManEquivReduce( pAbc->pGia, 1, fDualOut, 0, fVerbose );
30420  if ( pTemp )
30421  {
30422  pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
30423  Gia_ManStop( pAux );
30424 
30425  Gia_AigerWrite( pTemp, pFileName2, 0, 0 );
30426  Abc_Print( 1, "Reduced original network was written into file \"%s\".\n", pFileName2 );
30427  Gia_ManPrintStatsShort( pTemp );
30428  Gia_ManStop( pTemp );
30429  }
30430  }
30431  return 0;
30432 
30433 usage:
30434  Abc_Print( -2, "usage: &srm [-A file] [-drsfvh]\n" );
30435  Abc_Print( -2, "\t writes speculatively reduced model into file \"%s\"\n", pFileName );
30436  Abc_Print( -2, "\t-A file : file name for dumping speculative-reduced model [default = \"gsrm.aig\"]\n" );
30437  Abc_Print( -2, "\t-d : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
30438  Abc_Print( -2, "\t-r : toggle writing reduced network for synthesis [default = %s]\n", fSynthesis? "yes": "no" );
30439  Abc_Print( -2, "\t-s : toggle using speculation at the internal nodes [default = %s]\n", fSpeculate? "yes": "no" );
30440  Abc_Print( -2, "\t-f : toggle filtering to remove redundant equivalences [default = %s]\n", fSkipSome? "yes": "no" );
30441  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
30442  Abc_Print( -2, "\t-h : print the command usage\n");
30443  return 1;
30444 }
Gia_Man_t * Gia_ManSpecReduce(Gia_Man_t *p, int fDualOut, int fSynthesis, int fReduce, int fSkipSome, int fVerbose)
Definition: giaEquiv.c:848
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
void Gia_ManPrintStatsShort(Gia_Man_t *p)
Definition: giaMan.c:522
Gia_Man_t * Gia_ManEquivReduce(Gia_Man_t *p, int fUseAll, int fDualOut, int fSkipPhase, int fVerbose)
Definition: giaEquiv.c:417
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Gia_Man_t * Gia_ManSeqStructSweep(Gia_Man_t *p, int fConst, int fEquiv, int fVerbose)
Definition: giaScl.c:258
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
Definition: giaAiger.c:1024
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Srm2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30458 of file abc.c.

30459 {
30460  char pFileName[10], * pFileName1, * pFileName2;
30461  Gia_Man_t * pTemp, * pAux;
30462  int fLatchA = 0, fLatchB = 0;
30463  int c, fVerbose = 0;
30465  while ( ( c = Extra_UtilGetopt( argc, argv, "abvh" ) ) != EOF )
30466  {
30467  switch ( c )
30468  {
30469  case 'a':
30470  fLatchA ^= 1;
30471  break;
30472  case 'b':
30473  fLatchB ^= 1;
30474  break;
30475  case 'v':
30476  fVerbose ^= 1;
30477  break;
30478  case 'h':
30479  goto usage;
30480  default:
30481  goto usage;
30482  }
30483  }
30484  if ( pAbc->pGia == NULL )
30485  {
30486  Abc_Print( -1, "Abc_CommandAbc9Srm2(): There is no AIG.\n" );
30487  return 1;
30488  }
30489  if ( pAbc->pGia->pReprs == NULL || pAbc->pGia->pNexts == NULL )
30490  {
30491  Abc_Print( -1, "Equivalences are not defined.\n" );
30492  return 0;
30493  }
30494  if ( argc != globalUtilOptind + 2 )
30495  {
30496  Abc_Print( -1, "Abc_CommandAbc9Srm2(): Expecting two file names on the command line.\n" );
30497  return 1;
30498  }
30499  // get the input file name
30500  pFileName1 = argv[globalUtilOptind];
30501  pFileName2 = argv[globalUtilOptind+1];
30502  // create file name
30503  sprintf(pFileName, "gsrm.aig" );
30504  pTemp = Gia_ManDup( pAbc->pGia );
30505  // copy equivalences
30506  pTemp->pReprs = ABC_ALLOC( Gia_Rpr_t, Gia_ManObjNum(pTemp) );
30507  memcpy( pTemp->pReprs, pAbc->pGia->pReprs, sizeof(Gia_Rpr_t) * Gia_ManObjNum(pTemp) );
30508  pTemp->pNexts = ABC_ALLOC( int, Gia_ManObjNum(pTemp) );
30509  memcpy( pTemp->pNexts, pAbc->pGia->pNexts, sizeof(int) * Gia_ManObjNum(pTemp) );
30510 //Gia_ManPrintStats( pTemp, 0 );
30511  // filter the classes
30512  if ( !Gia_ManFilterEquivsForSpeculation( pTemp, pFileName1, pFileName2, fLatchA, fLatchB ) )
30513  {
30514  Gia_ManStop( pTemp );
30515  Abc_Print( -1, "Filtering equivalences has failed.\n" );
30516  return 1;
30517  }
30518 //Gia_ManPrintStats( pTemp, 0 );
30519  pTemp = Gia_ManSpecReduce( pAux = pTemp, 0, 0, 1, 0, 0 );
30520  Gia_ManStop( pAux );
30521  if ( pTemp )
30522  {
30523  pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
30524  Gia_ManStop( pAux );
30525 
30526  Gia_AigerWrite( pTemp, pFileName, 0, 0 );
30527  Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
30528  Gia_ManPrintStatsShort( pTemp );
30529  Gia_ManStop( pTemp );
30530  }
30531  return 0;
30532 
30533 usage:
30534  Abc_Print( -2, "usage: &srm2 [-abvh] <PartA_FileName> <PartB_FileName>\n" );
30535  Abc_Print( -2, "\t writes speculatively reduced model into file \"%s\"\n", pFileName );
30536  Abc_Print( -2, "\t only preserves equivalences across PartA and PartB\n" );
30537  Abc_Print( -2, "\t-a : toggle using latches only in PartA [default = %s]\n", fLatchA? "yes": "no" );
30538  Abc_Print( -2, "\t-b : toggle using latches only in PartB [default = %s]\n", fLatchB? "yes": "no" );
30539  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
30540  Abc_Print( -2, "\t-h : print the command usage\n");
30541  return 1;
30542 }
Gia_Man_t * Gia_ManSpecReduce(Gia_Man_t *p, int fDualOut, int fSynthesis, int fReduce, int fSkipSome, int fVerbose)
Definition: giaEquiv.c:848
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition: giaDup.c:552
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
int * pNexts
Definition: gia.h:122
char * memcpy()
void Gia_ManPrintStatsShort(Gia_Man_t *p)
Definition: giaMan.c:522
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Gia_Man_t * Gia_ManSeqStructSweep(Gia_Man_t *p, int fConst, int fEquiv, int fVerbose)
Definition: giaScl.c:258
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
Definition: giaAiger.c:1024
int Gia_ManFilterEquivsForSpeculation(Gia_Man_t *pGia, char *pName1, char *pName2, int fLatchA, int fLatchB)
Definition: giaEquiv.c:1862
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Gia_Rpr_t * pReprs
Definition: gia.h:121
Definition: gia.h:56
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
int Abc_CommandAbc9Status ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26468 of file abc.c.

26469 {
26470  int c;
26472  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
26473  {
26474  switch ( c )
26475  {
26476  case 'h':
26477  goto usage;
26478  default:
26479  goto usage;
26480  }
26481  }
26482  if ( pAbc->pGia == NULL )
26483  {
26484  Abc_Print( -1, "Abc_CommandAbc9Status(): There is no AIG.\n" );
26485  return 1;
26486  }
26487  Gia_ManPrintMiterStatus( pAbc->pGia );
26488  return 0;
26489 
26490 usage:
26491  Abc_Print( -2, "usage: &status [-h]\n" );
26492  Abc_Print( -2, "\t prints status of the miter\n" );
26493  Abc_Print( -2, "\t-h : print the command usage\n");
26494  return 1;
26495 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_ManPrintMiterStatus(Gia_Man_t *p)
Definition: giaMan.c:543
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Strash ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26659 of file abc.c.

26660 {
26661  Gia_Man_t * pTemp;
26662  int c, Limit = 2;
26663  int fAddStrash = 0;
26664  int fCollapse = 0;
26665  int fAddMuxes = 0;
26667  while ( ( c = Extra_UtilGetopt( argc, argv, "Lacmh" ) ) != EOF )
26668  {
26669  switch ( c )
26670  {
26671  case 'L':
26672  if ( globalUtilOptind >= argc )
26673  {
26674  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
26675  goto usage;
26676  }
26677  Limit = atoi(argv[globalUtilOptind]);
26678  globalUtilOptind++;
26679  if ( Limit < 0 )
26680  goto usage;
26681  break;
26682  case 'a':
26683  fAddStrash ^= 1;
26684  break;
26685  case 'c':
26686  fCollapse ^= 1;
26687  break;
26688  case 'm':
26689  fAddMuxes ^= 1;
26690  break;
26691  case 'h':
26692  goto usage;
26693  default:
26694  goto usage;
26695  }
26696  }
26697  if ( pAbc->pGia == NULL )
26698  {
26699  Abc_Print( -1, "Abc_CommandAbc9Strash(): There is no AIG.\n" );
26700  return 1;
26701  }
26702  if ( Gia_ManHasMapping(pAbc->pGia) )
26703  {
26704  pTemp = (Gia_Man_t *)Dsm_ManDeriveGia( pAbc->pGia, fAddMuxes );
26705 // if ( !Abc_FrameReadFlag("silentmode") )
26706 // printf( "Performed delay-oriented unmapping.\n" );
26707  }
26708  else if ( fAddMuxes )
26709  {
26710  if ( pAbc->pGia->pMuxes )
26711  {
26712  Abc_Print( -1, "Abc_CommandAbc9Strash(): The AIG already has MUXes.\n" );
26713  return 1;
26714  }
26715  pTemp = Gia_ManDupMuxes( pAbc->pGia, Limit );
26716  if ( !Abc_FrameReadFlag("silentmode") )
26717  printf( "Generated AND/XOR/MUX graph.\n" );
26718  }
26719  else if ( fCollapse && pAbc->pGia->pAigExtra )
26720  {
26721  assert( !Gia_ManBufNum(pAbc->pGia) );
26722  if ( Gia_ManIsSeqWithBoxes(pAbc->pGia) || Gia_ManRegBoxNum(pAbc->pGia) )
26723  {
26724  Gia_Man_t * pUnshuffled = Gia_ManDupUnshuffleInputs( pAbc->pGia );
26725  Gia_ManTransferTiming( pUnshuffled, pAbc->pGia );
26726  pTemp = Gia_ManDupCollapse( pUnshuffled, pUnshuffled->pAigExtra, NULL, Gia_ManRegBoxNum(pUnshuffled) > 0 );
26727  Gia_ManTransferTiming( pAbc->pGia, pUnshuffled );
26728  Gia_ManStop( pUnshuffled );
26729  }
26730  else
26731  pTemp = Gia_ManDupCollapse( pAbc->pGia, pAbc->pGia->pAigExtra, NULL, 0 );
26732  if ( !Abc_FrameReadFlag("silentmode") )
26733  printf( "Collapsed AIG with boxes and logic of the boxes.\n" );
26734  }
26735  else if ( pAbc->pGia->pMuxes )
26736  {
26737  pTemp = Gia_ManDupNoMuxes( pAbc->pGia );
26738  if ( !Abc_FrameReadFlag("silentmode") )
26739  printf( "Generated AIG from AND/XOR/MUX graph.\n" );
26740  }
26741  else
26742  {
26743  pTemp = Gia_ManRehash( pAbc->pGia, fAddStrash );
26744  if ( !Abc_FrameReadFlag("silentmode") )
26745  printf( "Rehashed the current AIG.\n" );
26746  }
26747  if ( !(fCollapse && pAbc->pGia->pAigExtra) )
26748  Gia_ManTransferTiming( pTemp, pAbc->pGia );
26749  Abc_FrameUpdateGia( pAbc, pTemp );
26750  return 0;
26751 
26752 usage:
26753  Abc_Print( -2, "usage: &st [-L num] [-acmh]\n" );
26754  Abc_Print( -2, "\t performs structural hashing\n" );
26755  Abc_Print( -2, "\t-a : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" );
26756  Abc_Print( -2, "\t-c : toggle collapsing hierarchical AIG [default = %s]\n", fCollapse? "yes": "no" );
26757  Abc_Print( -2, "\t-m : toggle converting to larger gates [default = %s]\n", fAddMuxes? "yes": "no" );
26758  Abc_Print( -2, "\t-L num : create MUX when sum of refs does not exceed this limit [default = %d]\n", Limit );
26759  Abc_Print( -2, "\t-h : print the command usage\n");
26760  return 1;
26761 }
Gia_Man_t * Gia_ManDupUnshuffleInputs(Gia_Man_t *p)
Definition: giaTim.c:194
int Gia_ManIsSeqWithBoxes(Gia_Man_t *p)
Definition: giaTim.c:93
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * pAigExtra
Definition: gia.h:149
int Gia_ManRegBoxNum(Gia_Man_t *p)
Definition: giaTim.c:53
Gia_Man_t * Gia_ManDupNoMuxes(Gia_Man_t *p)
Definition: giaMuxes.c:159
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManDupMuxes(Gia_Man_t *p, int Limit)
Definition: giaMuxes.c:96
int globalUtilOptind
Definition: extraUtilUtil.c:45
Gia_Man_t * Gia_ManRehash(Gia_Man_t *p, int fAddStrash)
Definition: giaHash.c:719
void Gia_ManTransferTiming(Gia_Man_t *p, Gia_Man_t *pGia)
Definition: giaIf.c:1912
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Gia_Man_t * Gia_ManDupCollapse(Gia_Man_t *p, Gia_Man_t *pBoxes, Vec_Int_t *vBoxPres, int fSeq)
Definition: giaTim.c:748
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
void * Dsm_ManDeriveGia(void *p, int fUseMuxes)
Definition: dauGia.c:471
Definition: gia.h:95
static int Gia_ManBufNum(Gia_Man_t *p)
Definition: gia.h:392
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
#define assert(ex)
Definition: util_old.h:213
ABC_DLL char * Abc_FrameReadFlag(char *pFlag)
Definition: mainFrame.c:64
int Abc_CommandAbc9Struct ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33454 of file abc.c.

33455 {
33456  extern void Gia_ManTestStruct( Gia_Man_t * p );
33457  int c, fVerbose;
33458  // set defaults
33459  fVerbose = 0;
33461  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
33462  {
33463  switch ( c )
33464  {
33465  case 'v':
33466  fVerbose ^= 1;
33467  break;
33468  case 'h':
33469  goto usage;
33470  default:
33471  goto usage;
33472  }
33473  }
33474  if ( pAbc->pGia == NULL )
33475  {
33476  Abc_Print( -1, "Abc_CommandAbc9Struct(): There is no AIG to map.\n" );
33477  return 1;
33478  }
33479  if ( !Gia_ManHasMapping(pAbc->pGia) )
33480  {
33481  Abc_Print( -1, "Abc_CommandAbc9Struct(): Mapping of the AIG is not defined.\n" );
33482  return 1;
33483  }
33484  if ( Gia_ManLutSizeMax(pAbc->pGia) >= 8 )
33485  {
33486  Abc_Print( -1, "Abc_CommandAbc9Struct(): Can only handle nodes with less than 8 inputs.\n" );
33487  return 1;
33488  }
33489  Gia_ManTestStruct( pAbc->pGia );
33490  return 0;
33491 
33492 usage:
33493  Abc_Print( -2, "usage: &struct [-vh]\n" );
33494  Abc_Print( -2, "\t checks decomposition structures of the current mapping\n" );
33495  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
33496  Abc_Print( -2, "\t-h : print the command usage\n");
33497  return 1;
33498 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Gia_ManLutSizeMax(Gia_Man_t *p)
Definition: giaIf.c:125
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Gia_ManTestStruct(Gia_Man_t *p)
Definition: giaIf.c:2103
int Abc_CommandAbc9Sweep ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 31040 of file abc.c.

31041 {
31042  Gia_Man_t * pTemp;
31043  Dch_Pars_t Pars, * pPars = &Pars;
31044  int c;
31045  Dch_ManSetDefaultParams( pPars );
31047  while ( ( c = Extra_UtilGetopt( argc, argv, "WCStvh" ) ) != EOF )
31048  {
31049  switch ( c )
31050  {
31051  case 'W':
31052  if ( globalUtilOptind >= argc )
31053  {
31054  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
31055  goto usage;
31056  }
31057  pPars->nWords = atoi(argv[globalUtilOptind]);
31058  globalUtilOptind++;
31059  if ( pPars->nWords < 0 )
31060  goto usage;
31061  break;
31062  case 'C':
31063  if ( globalUtilOptind >= argc )
31064  {
31065  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
31066  goto usage;
31067  }
31068  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
31069  globalUtilOptind++;
31070  if ( pPars->nBTLimit < 0 )
31071  goto usage;
31072  break;
31073  case 'S':
31074  if ( globalUtilOptind >= argc )
31075  {
31076  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
31077  goto usage;
31078  }
31079  pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
31080  globalUtilOptind++;
31081  if ( pPars->nSatVarMax < 0 )
31082  goto usage;
31083  break;
31084  case 't':
31085  pPars->fSimulateTfo ^= 1;
31086  break;
31087  case 'v':
31088  pPars->fVerbose ^= 1;
31089  break;
31090  case 'h':
31091  goto usage;
31092  default:
31093  goto usage;
31094  }
31095  }
31096  if ( pAbc->pGia == NULL )
31097  {
31098  Abc_Print( -1, "Abc_CommandAbc9Sweep(): There is no AIG.\n" );
31099  return 1;
31100  }
31101  if ( Gia_ManBoxNum(pAbc->pGia) && pAbc->pGia->pAigExtra == NULL )
31102  {
31103  printf( "Timing manager is given but there is no GIA of boxes.\n" );
31104  return 0;
31105  }
31106  if ( Gia_ManBoxNum(pAbc->pGia) )
31107  pTemp = Gia_ManSweepWithBoxes( pAbc->pGia, pPars, NULL, 0, 0, pPars->fVerbose );
31108  else
31109  pTemp = Gia_ManFraigSweepSimple( pAbc->pGia, pPars );
31110  Abc_FrameUpdateGia( pAbc, pTemp );
31111  return 0;
31112 
31113 usage:
31114  Abc_Print( -2, "usage: &sweep [-WCS num] [-tvh]\n" );
31115  Abc_Print( -2, "\t performs SAT sweeping for AIG with boxes\n" );
31116  Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
31117  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
31118  Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
31119  Abc_Print( -2, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
31120  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
31121  Abc_Print( -2, "\t-h : print the command usage\n");
31122  return 1;
31123 }
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition: dchCore.c:45
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition: dch.h:43
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Gia_ManBoxNum(Gia_Man_t *p)
DECLARATIONS ///.
Definition: giaTim.c:49
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Gia_Man_t * Gia_ManFraigSweepSimple(Gia_Man_t *p, void *pPars)
Definition: giaSweep.c:556
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManSweepWithBoxes(Gia_Man_t *p, void *pParsC, void *pParsS, int fConst, int fEquiv, int fVerbose)
Definition: giaSweep.c:683
int Abc_CommandAbc9Syn2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28919 of file abc.c.

28920 {
28921  Gia_Man_t * pTemp;
28922  int c, fVerbose = 0;
28923  int fOldAlgo = 0;
28924  int fCoarsen = 1;
28925  int fCutMin = 0;
28926  int nRelaxRatio = 20;
28927  int fDelayMin = 0;
28928  int fVeryVerbose = 0;
28930  while ( ( c = Extra_UtilGetopt( argc, argv, "Rakmdvwh" ) ) != EOF )
28931  {
28932  switch ( c )
28933  {
28934  case 'R':
28935  if ( globalUtilOptind >= argc )
28936  {
28937  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
28938  return 0;
28939  }
28940  nRelaxRatio = atoi(argv[globalUtilOptind]);
28941  globalUtilOptind++;
28942  if ( nRelaxRatio < 0 )
28943  goto usage;
28944  break;
28945  case 'a':
28946  fOldAlgo ^= 1;
28947  break;
28948  case 'k':
28949  fCoarsen ^= 1;
28950  break;
28951  case 'm':
28952  fCutMin ^= 1;
28953  break;
28954  case 'd':
28955  fDelayMin ^= 1;
28956  break;
28957  case 'v':
28958  fVerbose ^= 1;
28959  break;
28960  case 'w':
28961  fVeryVerbose ^= 1;
28962  break;
28963  case 'h':
28964  goto usage;
28965  default:
28966  goto usage;
28967  }
28968  }
28969  if ( pAbc->pGia == NULL )
28970  {
28971  Abc_Print( -1, "Abc_CommandAbc9Syn2(): There is no AIG.\n" );
28972  return 1;
28973  }
28974  if ( fDelayMin )
28975  {
28977  if ( p && If_DsdManVarNum(p) < 6 )
28978  {
28979  printf( "DSD manager has incompatible number of variables. Delay minimization is not performed.\n" );
28980  fDelayMin = 0;
28981  }
28982  }
28983  pTemp = Gia_ManAigSyn2( pAbc->pGia, fOldAlgo, fCoarsen, fCutMin, nRelaxRatio, fDelayMin, fVerbose, fVeryVerbose );
28984  Abc_FrameUpdateGia( pAbc, pTemp );
28985  return 0;
28986 
28987 usage:
28988  Abc_Print( -2, "usage: &syn2 [-R num] [-akmdvh]\n" );
28989  Abc_Print( -2, "\t performs AIG optimization\n" );
28990  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
28991  Abc_Print( -2, "\t-a : toggles using the old algorithm [default = %s]\n", fOldAlgo? "yes": "no" );
28992  Abc_Print( -2, "\t-k : toggles coarsening the subject graph [default = %s]\n", fCoarsen? "yes": "no" );
28993  Abc_Print( -2, "\t-m : toggles cut minimization [default = %s]\n", fCutMin? "yes": "no" );
28994  Abc_Print( -2, "\t-d : toggles additional delay optimization [default = %s]\n", fDelayMin? "yes": "no" );
28995  Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28996  Abc_Print( -2, "\t-w : toggles printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
28997  Abc_Print( -2, "\t-h : print the command usage\n");
28998  return 1;
28999 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManAigSyn2(Gia_Man_t *p, int fOldAlgo, int fCoarsen, int fCutMin, int nRelaxRatio, int fDelayMin, int fVerbose, int fVeryVerbose)
Definition: giaScript.c:69
int globalUtilOptind
Definition: extraUtilUtil.c:45
int If_DsdManVarNum(If_DsdMan_t *p)
Definition: ifDsd.c:165
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Syn3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29127 of file abc.c.

29128 {
29129  Gia_Man_t * pTemp;
29130  int c, fVerbose = 0;
29131  int fVeryVerbose = 0;
29133  while ( ( c = Extra_UtilGetopt( argc, argv, "vwh" ) ) != EOF )
29134  {
29135  switch ( c )
29136  {
29137  case 'v':
29138  fVerbose ^= 1;
29139  break;
29140  case 'w':
29141  fVeryVerbose ^= 1;
29142  break;
29143  case 'h':
29144  goto usage;
29145  default:
29146  goto usage;
29147  }
29148  }
29149  if ( pAbc->pGia == NULL )
29150  {
29151  Abc_Print( -1, "Abc_CommandAbc9Syn3(): There is no AIG.\n" );
29152  return 1;
29153  }
29154  pTemp = Gia_ManAigSyn3( pAbc->pGia, fVerbose, fVeryVerbose );
29155  Abc_FrameUpdateGia( pAbc, pTemp );
29156  return 0;
29157 
29158 usage:
29159  Abc_Print( -2, "usage: &syn3 [-lvh]\n" );
29160  Abc_Print( -2, "\t performs AIG optimization\n" );
29161  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
29162  Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
29163  Abc_Print( -2, "\t-h : print the command usage\n");
29164  return 1;
29165 }
Gia_Man_t * Gia_ManAigSyn3(Gia_Man_t *p, int fVerbose, int fVeryVerbose)
Definition: giaScript.c:152
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Syn4 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29178 of file abc.c.

29179 {
29180  Gia_Man_t * pTemp;
29181  int c, fVerbose = 0;
29182  int fVeryVerbose = 0;
29184  while ( ( c = Extra_UtilGetopt( argc, argv, "vwh" ) ) != EOF )
29185  {
29186  switch ( c )
29187  {
29188  case 'v':
29189  fVerbose ^= 1;
29190  break;
29191  case 'w':
29192  fVeryVerbose ^= 1;
29193  break;
29194  case 'h':
29195  goto usage;
29196  default:
29197  goto usage;
29198  }
29199  }
29200  if ( pAbc->pGia == NULL )
29201  {
29202  Abc_Print( -1, "Abc_CommandAbc9Syn4(): There is no AIG.\n" );
29203  return 1;
29204  }
29205  pTemp = Gia_ManAigSyn4( pAbc->pGia, fVerbose, fVeryVerbose );
29206  Abc_FrameUpdateGia( pAbc, pTemp );
29207  return 0;
29208 
29209 usage:
29210  Abc_Print( -2, "usage: &syn4 [-lvh]\n" );
29211  Abc_Print( -2, "\t performs AIG optimization\n" );
29212  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
29213  Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
29214  Abc_Print( -2, "\t-h : print the command usage\n");
29215  return 1;
29216 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManAigSyn4(Gia_Man_t *p, int fVerbose, int fVeryVerbose)
Definition: giaScript.c:184
int Abc_CommandAbc9Synch2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 29012 of file abc.c.

29013 {
29014  extern Gia_Man_t * Gia_ManAigSynch2( Gia_Man_t * p, void * pPars, int nLutSize, int nRelaxRatio );
29015  Gia_Man_t * pTemp;
29016  Dch_Pars_t Pars, * pPars = &Pars;
29017  int c, nLutSize = 6;
29018  int nRelaxRatio = 20;
29019  // set defaults
29020  Dch_ManSetDefaultParams( pPars );
29022  while ( ( c = Extra_UtilGetopt( argc, argv, "WCSKRfvh" ) ) != EOF )
29023  {
29024  switch ( c )
29025  {
29026  case 'W':
29027  if ( globalUtilOptind >= argc )
29028  {
29029  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
29030  goto usage;
29031  }
29032  pPars->nWords = atoi(argv[globalUtilOptind]);
29033  globalUtilOptind++;
29034  if ( pPars->nWords < 0 )
29035  goto usage;
29036  break;
29037  case 'C':
29038  if ( globalUtilOptind >= argc )
29039  {
29040  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
29041  goto usage;
29042  }
29043  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
29044  globalUtilOptind++;
29045  if ( pPars->nBTLimit < 0 )
29046  goto usage;
29047  break;
29048  case 'S':
29049  if ( globalUtilOptind >= argc )
29050  {
29051  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
29052  goto usage;
29053  }
29054  pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
29055  globalUtilOptind++;
29056  if ( pPars->nSatVarMax < 0 )
29057  goto usage;
29058  break;
29059  case 'K':
29060  if ( globalUtilOptind >= argc )
29061  {
29062  Abc_Print( -1, "Command line switch \"-K\" should be followed by a char string.\n" );
29063  goto usage;
29064  }
29065  nLutSize = atoi(argv[globalUtilOptind]);
29066  globalUtilOptind++;
29067  if ( nLutSize < 0 )
29068  goto usage;
29069  break;
29070  case 'R':
29071  if ( globalUtilOptind >= argc )
29072  {
29073  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
29074  return 0;
29075  }
29076  nRelaxRatio = atoi(argv[globalUtilOptind]);
29077  globalUtilOptind++;
29078  if ( nRelaxRatio < 0 )
29079  goto usage;
29080  break;
29081  case 'f':
29082  pPars->fLightSynth ^= 1;
29083  break;
29084  case 'v':
29085  pPars->fVerbose ^= 1;
29086  break;
29087  case 'h':
29088  goto usage;
29089  default:
29090  goto usage;
29091  }
29092  }
29093  if ( pAbc->pGia == NULL )
29094  {
29095  Abc_Print( -1, "Abc_CommandAbc9Dch(): There is no AIG.\n" );
29096  return 1;
29097  }
29098  pTemp = Gia_ManAigSynch2( pAbc->pGia, pPars, nLutSize, nRelaxRatio );
29099  Abc_FrameUpdateGia( pAbc, pTemp );
29100  return 0;
29101 
29102 usage:
29103  Abc_Print( -2, "usage: &synch2 [-WCSKR num] [-fvh]\n" );
29104  Abc_Print( -2, "\t computes structural choices using a new approach\n" );
29105  Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
29106  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
29107  Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
29108  Abc_Print( -2, "\t-K num : the target LUT size for downstream mapping [default = %d]\n", nLutSize );
29109  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
29110  Abc_Print( -2, "\t-f : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
29111  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
29112  Abc_Print( -2, "\t-h : print the command usage\n");
29113  return 1;
29114 }
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition: dchCore.c:45
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition: dch.h:43
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
Gia_Man_t * Gia_ManAigSynch2(Gia_Man_t *pInit, void *pPars0, int nLutSize, int nRelaxRatio)
Definition: giaScript.c:386
int Abc_CommandAbc9Test ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 38463 of file abc.c.

38464 {
38465 // Gia_Man_t * pTemp = NULL;
38466  int c, fVerbose = 0;
38467  int nFrames = 5;
38468  int fSwitch = 0;
38469  int nWords = 1000;
38470  int nProcs = 2;
38471 // extern Gia_Man_t * Gia_VtaTest( Gia_Man_t * p );
38472 // extern int Gia_ManSuppSizeTest( Gia_Man_t * p );
38473 // extern void Gia_VtaTest( Gia_Man_t * p, int nFramesStart, int nFramesMax, int nConfMax, int nTimeMax, int fVerbose );
38474 // extern void Gia_IsoTest( Gia_Man_t * p, int fVerbose );
38475 // extern void Ga2_ManComputeTest( Gia_Man_t * p );
38476 // extern void Bmc_CexTest( Gia_Man_t * p, Abc_Cex_t * pCex, int fVerbose );
38477 // extern void Gia_IsoTest( Gia_Man_t * p, Abc_Cex_t * pCex, int fVerbose );
38478 // extern void Unr_ManTest( Gia_Man_t * pGia, int nFrames );
38479 // extern int Gia_ManVerify( Gia_Man_t * pGia );
38480 // extern Gia_Man_t * Gia_ManOptimizeRing( Gia_Man_t * p );
38481 // extern void Gia_ManCollectSeqTest( Gia_Man_t * p );
38482 // extern Gia_Man_t * Gia_SweeperFraigTest( Gia_Man_t * p, int nWords, int nConfs, int fVerbose );
38483 // extern Gia_Man_t * Bmc_CexDepthTest( Gia_Man_t * p, Abc_Cex_t * pCex, int nFrames, int fVerbose );
38484 // extern Gia_Man_t * Bmc_CexTarget( Gia_Man_t * p, int nFrames );
38485 // extern void Gia_ManMuxProfiling( Gia_Man_t * p );
38486 // extern Gia_Man_t * Mig_ManTest( Gia_Man_t * pGia );
38487 // extern Gia_Man_t * Gia_ManInterTest( Gia_Man_t * p );
38488 // extern Gia_Man_t * Llb_ReachableStatesGia( Gia_Man_t * p );
38489 // extern Gia_Man_t * Unm_ManTest( Gia_Man_t * pGia );
38490 // extern void Agi_ManTest( Gia_Man_t * pGia );
38491 // extern void Gia_ManCheckFalseTest( Gia_Man_t * p, int nSlackMax );
38492 // extern void Gia_ParTest( Gia_Man_t * p, int nWords, int nProcs );
38493 // extern void Gia_ManTisTest( Gia_Man_t * pInit );
38494  extern void Gia_Iso3Test( Gia_Man_t * p );
38495 
38497  while ( ( c = Extra_UtilGetopt( argc, argv, "WPFsvh" ) ) != EOF )
38498  {
38499  switch ( c )
38500  {
38501  case 'W':
38502  if ( globalUtilOptind >= argc )
38503  {
38504  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
38505  goto usage;
38506  }
38507  nWords = atoi(argv[globalUtilOptind]);
38508  globalUtilOptind++;
38509  if ( nWords < 0 )
38510  goto usage;
38511  break;
38512  case 'P':
38513  if ( globalUtilOptind >= argc )
38514  {
38515  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
38516  goto usage;
38517  }
38518  nProcs = atoi(argv[globalUtilOptind]);
38519  globalUtilOptind++;
38520  if ( nProcs < 0 )
38521  goto usage;
38522  break;
38523  case 'F':
38524  if ( globalUtilOptind >= argc )
38525  {
38526  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
38527  goto usage;
38528  }
38529  nFrames = atoi(argv[globalUtilOptind]);
38530  globalUtilOptind++;
38531  if ( nFrames < 0 )
38532  goto usage;
38533  break;
38534  case 's':
38535  fSwitch ^= 1;
38536  break;
38537  case 'v':
38538  fVerbose ^= 1;
38539  break;
38540  case 'h':
38541  goto usage;
38542  default:
38543  goto usage;
38544  }
38545  }
38546  if ( pAbc->pGia == NULL )
38547  {
38548  Abc_Print( -1, "Abc_CommandAbc9Test(): There is no AIG.\n" );
38549  return 1;
38550  }
38551 /*
38552  if ( pAbc->pCex == NULL )
38553  {
38554  Abc_Print( -1, "Abc_CommandAbc9Test(): There is no CEX.\n" );
38555  return 1;
38556  }
38557 */
38558 // Gia_ManFrontTest( pAbc->pGia );
38559 // Gia_ManReduceConst( pAbc->pGia, 1 );
38560 // Sat_ManTest( pAbc->pGia, Gia_ManCo(pAbc->pGia, 0), 0 );
38561 // Gia_ManTestDistance( pAbc->pGia );
38562 // Gia_SatSolveTest( pAbc->pGia );
38563 // For_ManExperiment( pAbc->pGia, 20, 1, 1 );
38564 // Gia_ManUnrollSpecial( pAbc->pGia, 5, 100, 1 );
38565 // pAbc->pGia = Gia_ManDupSelf( pTemp = pAbc->pGia );
38566 // pAbc->pGia = Gia_ManRemoveEnables( pTemp = pAbc->pGia );
38567 // Cbs_ManSolveTest( pAbc->pGia );
38568 // pAbc->pGia = Gia_VtaTest( pTemp = pAbc->pGia );
38569 // Gia_ManStopP( &pTemp );
38570 // Gia_ManSuppSizeTest( pAbc->pGia );
38571 // Gia_VtaTest( pAbc->pGia, 10, 100000, 0, 0, 1 );
38572 // Gia_IsoTest( pAbc->pGia, fVerbose );
38573 // Ga2_ManComputeTest( pAbc->pGia );
38574 // Bmc_CexTest( pAbc->pGia, pAbc->pCex, fVerbose );
38575 // Gia_IsoTest( pAbc->pGia, pAbc->pCex, 0 );
38576 // Unr_ManTest( pAbc->pGia, nFrames );
38577 // Gia_ManVerifyWithBoxes( pAbc->pGia );
38578 // Gia_ManCollectSeqTest( pAbc->pGia );
38579 // pTemp = Gia_ManOptimizeRing( pAbc->pGia );
38580 // pTemp = Gia_SweeperFraigTest( pAbc->pGia, 4, 1000, 0 );
38581 // Abc_FrameUpdateGia( pAbc, pTemp );
38582 // pTemp = Bmc_CexDepthTest( pAbc->pGia, pAbc->pCex, nFrames, fVerbose );
38583 // pTemp = Bmc_CexTarget( pAbc->pGia, nFrames );
38584 // Abc_FrameUpdateGia( pAbc, pTemp );
38585 // Gia_ManMuxProfiling( pAbc->pGia );
38586 // pTemp = Mig_ManTest( pAbc->pGia );
38587 // Abc_FrameUpdateGia( pAbc, pTemp );
38588 // pTemp = Gia_ManInterTest( pAbc->pGia );
38589 // Abc_FrameUpdateGia( pAbc, pTemp );
38590 // pTemp = Llb_ReachableStatesGia( pAbc->pGia );
38591 // Abc_FrameUpdateGia( pAbc, pTemp );
38592 // Unm_ManTest( pAbc->pGia );
38593 // Agi_ManTest( pAbc->pGia );
38594 // Gia_ManResubTest( pAbc->pGia );
38595 // Jf_ManTestCnf( pAbc->pGia );
38596 // Gia_ManCheckFalseTest( pAbc->pGia, nFrames );
38597 // Gia_ParTest( pAbc->pGia, nWords, nProcs );
38598  Gia_Iso3Test( pAbc->pGia );
38599 // printf( "\nThis command is currently disabled.\n\n" );
38600 
38601  return 0;
38602 usage:
38603  Abc_Print( -2, "usage: &test [-FW num] [-svh]\n" );
38604  Abc_Print( -2, "\t testing various procedures\n" );
38605  Abc_Print( -2, "\t-F num: the number of timeframes [default = %d]\n", nFrames );
38606  Abc_Print( -2, "\t-W num: the number of machine words [default = %d]\n", nWords );
38607  Abc_Print( -2, "\t-s : toggle enable (yes) vs. disable (no) [default = %s]\n", fSwitch? "yes": "no" );
38608  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
38609  Abc_Print( -2, "\t-h : print the command usage\n");
38610  return 1;
38611 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nWords
Definition: abcNpn.c:127
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_Iso3Test(Gia_Man_t *p)
Definition: giaIso3.c:138
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Times ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 28121 of file abc.c.

28122 {
28123  Gia_Man_t * pTemp;
28124  int c, nTimes = 2, fVerbose = 0;
28126  while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
28127  {
28128  switch ( c )
28129  {
28130  case 'N':
28131  if ( globalUtilOptind >= argc )
28132  {
28133  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
28134  goto usage;
28135  }
28136  nTimes = atoi(argv[globalUtilOptind]);
28137  globalUtilOptind++;
28138  if ( nTimes < 0 )
28139  goto usage;
28140  break;
28141  case 'v':
28142  fVerbose ^= 1;
28143  break;
28144  case 'h':
28145  goto usage;
28146  default:
28147  goto usage;
28148  }
28149  }
28150  if ( pAbc->pGia == NULL )
28151  {
28152  Abc_Print( -1, "Abc_CommandAbc9Times(): There is no AIG.\n" );
28153  return 1;
28154  }
28155  pTemp = Gia_ManDupTimes( pAbc->pGia, nTimes );
28156  Abc_FrameUpdateGia( pAbc, pTemp );
28157  return 0;
28158 
28159 usage:
28160  Abc_Print( -2, "usage: &times [-N <num>] [-vh]\n" );
28161  Abc_Print( -2, "\t creates several \"parallel\" copies of the design\n" );
28162  Abc_Print( -2, "\t-N num : number of copies to create [default = %d]\n", nTimes );
28163  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
28164  Abc_Print( -2, "\t-h : print the command usage\n");
28165  return 1;
28166 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Gia_Man_t * Gia_ManDupTimes(Gia_Man_t *p, int nTimes)
Definition: giaDup.c:1078
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Topand ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26774 of file abc.c.

26775 {
26776  Gia_Man_t * pTemp;
26777  int c, fVerbose = 1;
26779  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
26780  {
26781  switch ( c )
26782  {
26783  case 'v':
26784  fVerbose ^= 1;
26785  break;
26786  case 'h':
26787  goto usage;
26788  default:
26789  goto usage;
26790  }
26791  }
26792  if ( pAbc->pGia == NULL )
26793  {
26794  Abc_Print( -1, "Abc_CommandAbc9Topand(): There is no AIG.\n" );
26795  return 1;
26796  }
26797  if ( Gia_ManRegNum(pAbc->pGia) > 0 )
26798  {
26799  Abc_Print( -1, "Abc_CommandAbc9Topand(): Can only be applied to a combinational miter.\n" );
26800  return 1;
26801  }
26802  pTemp = Gia_ManDupTopAnd( pAbc->pGia, fVerbose );
26803  Abc_FrameUpdateGia( pAbc, pTemp );
26804  return 0;
26805 
26806 usage:
26807  Abc_Print( -2, "usage: &topand [-vh]\n" );
26808  Abc_Print( -2, "\t performs AND decomposition for combinational miter\n" );
26809  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
26810  Abc_Print( -2, "\t-h : print the command usage\n");
26811  return 1;
26812 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManDupTopAnd(Gia_Man_t *p, int fVerbose)
Definition: giaDup.c:2075
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Trace ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33512 of file abc.c.

33513 {
33514  int c;
33515  int fUseLutLib;
33516  int fVerbose;
33517  // set defaults
33518  fUseLutLib = 0;
33519  fVerbose = 0;
33521  while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
33522  {
33523  switch ( c )
33524  {
33525  case 'l':
33526  fUseLutLib ^= 1;
33527  break;
33528  case 'v':
33529  fVerbose ^= 1;
33530  break;
33531  case 'h':
33532  goto usage;
33533  default:
33534  goto usage;
33535  }
33536  }
33537  if ( pAbc->pGia == NULL )
33538  {
33539  Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
33540  return 1;
33541  }
33542  if ( !Gia_ManHasMapping(pAbc->pGia) )
33543  {
33544  Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
33545  return 1;
33546  }
33547  pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
33548  Gia_ManDelayTraceLutPrint( pAbc->pGia, fVerbose );
33549  return 0;
33550 
33551 usage:
33552  Abc_Print( -2, "usage: &trace [-lvh]\n" );
33553  Abc_Print( -2, "\t performs delay trace of LUT-mapped network\n" );
33554  Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
33555  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
33556  Abc_Print( -2, "\t-h : print the command usage\n");
33557  return 1;
33558 }
float Gia_ManDelayTraceLutPrint(Gia_Man_t *p, int fVerbose)
Definition: giaSpeedup.c:443
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Gia_ManHasMapping(Gia_Man_t *p)
Definition: gia.h:951
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Trim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26957 of file abc.c.

26958 {
26959  Gia_Man_t * pTemp, * pTemp2;
26960  int c;
26961  int OutValue = -1;
26962  int fTrimCis = 1;
26963  int fTrimCos = 1;
26964  int fDualOut = 0;
26965  int fPoFedByPi = 0;
26967  while ( ( c = Extra_UtilGetopt( argc, argv, "Viocdh" ) ) != EOF )
26968  {
26969  switch ( c )
26970  {
26971  case 'V':
26972  if ( globalUtilOptind >= argc )
26973  {
26974  Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
26975  goto usage;
26976  }
26977  OutValue = atoi(argv[globalUtilOptind]);
26978  globalUtilOptind++;
26979  if ( OutValue < 0 )
26980  goto usage;
26981  break;
26982  case 'i':
26983  fTrimCis ^= 1;
26984  break;
26985  case 'o':
26986  fTrimCos ^= 1;
26987  break;
26988  case 'c':
26989  fPoFedByPi ^= 1;
26990  break;
26991  case 'd':
26992  fDualOut ^= 1;
26993  break;
26994  case 'h':
26995  goto usage;
26996  default:
26997  goto usage;
26998  }
26999  }
27000  if ( pAbc->pGia == NULL )
27001  {
27002  Abc_Print( -1, "Abc_CommandAbc9Trim(): There is no AIG.\n" );
27003  return 1;
27004  }
27005  pTemp = Gia_ManDupTrimmed( pAbc->pGia, fTrimCis, fTrimCos, fDualOut, OutValue );
27006  if ( fPoFedByPi )
27007  {
27008  extern Gia_Man_t * Gia_ManDupTrimmed2( Gia_Man_t * p );
27009  pTemp = Gia_ManDupTrimmed2( pTemp2 = pTemp );
27010  Gia_ManStop( pTemp2 );
27011  }
27012  Abc_FrameUpdateGia( pAbc, pTemp );
27013  return 0;
27014 
27015 usage:
27016  Abc_Print( -2, "usage: &trim [-V num] [-iocdh]\n" );
27017  Abc_Print( -2, "\t removes PIs without fanout and PO driven by constants\n" );
27018  Abc_Print( -2, "\t-V num : the value (0 or 1) of POs to remove [default = both]\n" );
27019  Abc_Print( -2, "\t-i : toggle removing PIs [default = %s]\n", fTrimCis? "yes": "no" );
27020  Abc_Print( -2, "\t-o : toggle removing POs [default = %s]\n", fTrimCos? "yes": "no" );
27021  Abc_Print( -2, "\t-c : toggle additionally removing POs fed by PIs [default = %s]\n", fPoFedByPi? "yes": "no" );
27022  Abc_Print( -2, "\t-d : toggle using dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
27023  Abc_Print( -2, "\t-h : print the command usage\n");
27024  return 1;
27025 }
Gia_Man_t * Gia_ManDupTrimmed(Gia_Man_t *p, int fTrimCis, int fTrimCos, int fDualOut, int OutValue)
Definition: giaDup.c:1638
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Gia_Man_t * Gia_ManDupTrimmed2(Gia_Man_t *p)
Definition: giaDup.c:1719
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Definition: abc.c:616
int Abc_CommandAbc9Undo ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 34710 of file abc.c.

34711 {
34712  int c;
34713  // set defaults
34715  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
34716  {
34717  switch ( c )
34718  {
34719  case 'h':
34720  goto usage;
34721  default:
34722  goto usage;
34723  }
34724  }
34725  if ( pAbc->pGia == NULL )
34726  {
34727  Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no design.\n" );
34728  return 1;
34729  }
34730  if ( pAbc->pGia2 == NULL )
34731  {
34732  Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no previously saved network.\n" );
34733  return 1;
34734  }
34735  Gia_ManStop( pAbc->pGia );
34736  pAbc->pGia = pAbc->pGia2;
34737  pAbc->pGia2 = NULL;
34738  return 0;
34739 
34740 usage:
34741  Abc_Print( -2, "usage: &undo [-h]\n" );
34742  Abc_Print( -2, "\t reverses the previous AIG transformation\n" );
34743  Abc_Print( -2, "\t-h : print the command usage\n");
34744  return 1;
34745 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Unmap ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 33408 of file abc.c.

33409 {
33410  extern void Gia_ManTestStruct( Gia_Man_t * p );
33411  int c, fVerbose = 0;
33413  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
33414  {
33415  switch ( c )
33416  {
33417  case 'v':
33418  fVerbose ^= 1;
33419  break;
33420  case 'h':
33421  goto usage;
33422  default:
33423  goto usage;
33424  }
33425  }
33426  if ( pAbc->pGia == NULL )
33427  {
33428  Abc_Print( -1, "Abc_CommandAbc9Struct(): There is no AIG to map.\n" );
33429  return 1;
33430  }
33431  Vec_IntFreeP( &pAbc->pGia->vMapping );
33432  Vec_IntFreeP( &pAbc->pGia->vPacking );
33433  return 0;
33434 
33435 usage:
33436  Abc_Print( -2, "usage: &unmap [-vh]\n" );
33437  Abc_Print( -2, "\t removes mapping from the current network\n" );
33438  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
33439  Abc_Print( -2, "\t-h : print the command usage\n");
33440  return 1;
33441 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Gia_ManTestStruct(Gia_Man_t *p)
Definition: giaIf.c:2103
int Abc_CommandAbc9Verify ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 30965 of file abc.c.

30966 {
30967  char * pFileSpec = NULL;
30968  int c, nBTLimit = 1000, nTimeLim = 0, fSeq = 0, fVerbose = 0;
30970  while ( ( c = Extra_UtilGetopt( argc, argv, "CTsvh" ) ) != EOF )
30971  {
30972  switch ( c )
30973  {
30974  case 'C':
30975  if ( globalUtilOptind >= argc )
30976  {
30977  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
30978  goto usage;
30979  }
30980  nBTLimit = atoi(argv[globalUtilOptind]);
30981  globalUtilOptind++;
30982  if ( nBTLimit < 0 )
30983  goto usage;
30984  break;
30985  case 'T':
30986  if ( globalUtilOptind >= argc )
30987  {
30988  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
30989  goto usage;
30990  }
30991  nTimeLim = atoi(argv[globalUtilOptind]);
30992  globalUtilOptind++;
30993  if ( nTimeLim < 0 )
30994  goto usage;
30995  break;
30996  case 's':
30997  fSeq ^= 1;
30998  break;
30999  case 'v':
31000  fVerbose ^= 1;
31001  break;
31002  case 'h':
31003  goto usage;
31004  default:
31005  goto usage;
31006  }
31007  }
31008  if ( argc == globalUtilOptind + 1 )
31009  {
31010  pFileSpec = argv[globalUtilOptind];
31011  Extra_FileNameCorrectPath( pFileSpec );
31012  printf( "Taking spec from file \"%s\".\n", pFileSpec );
31013  }
31014  Gia_ManVerifyWithBoxes( pAbc->pGia, nBTLimit, nTimeLim, fSeq, fVerbose, pFileSpec );
31015  return 0;
31016 
31017 usage:
31018  Abc_Print( -2, "usage: &verify [-CT num] [-svh] <file>\n" );
31019  Abc_Print( -2, "\t performs verification of combinational design\n" );
31020  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
31021  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nTimeLim );
31022  Abc_Print( -2, "\t-s : toggle using sequential verification [default = %s]\n", fSeq? "yes":"no");
31023  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes":"no");
31024  Abc_Print( -2, "\t-h : print the command usage\n");
31025  Abc_Print( -2, "\t<file> : optional file name with the spec [default = not used\n" );
31026  return 1;
31027 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Gia_ManVerifyWithBoxes(Gia_Man_t *pGia, int nBTLimit, int nTimeLim, int fSeq, int fVerbose, char *pFileSpec)
Definition: giaTim.c:859
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Extra_FileNameCorrectPath(char *FileName)
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Vta ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 38038 of file abc.c.

38039 {
38040  Abs_Par_t Pars, * pPars = &Pars;
38041  int c;
38042  Abs_ParSetDefaults( pPars );
38044  while ( ( c = Extra_UtilGetopt( argc, argv, "FSPCLDETRAtradvh" ) ) != EOF )
38045  {
38046  switch ( c )
38047  {
38048  case 'F':
38049  if ( globalUtilOptind >= argc )
38050  {
38051  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
38052  goto usage;
38053  }
38054  pPars->nFramesMax = atoi(argv[globalUtilOptind]);
38055  globalUtilOptind++;
38056  if ( pPars->nFramesMax < 0 )
38057  goto usage;
38058  break;
38059  case 'S':
38060  if ( globalUtilOptind >= argc )
38061  {
38062  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
38063  goto usage;
38064  }
38065  pPars->nFramesStart = atoi(argv[globalUtilOptind]);
38066  globalUtilOptind++;
38067  if ( pPars->nFramesStart < 0 )
38068  goto usage;
38069  break;
38070  case 'P':
38071  if ( globalUtilOptind >= argc )
38072  {
38073  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
38074  goto usage;
38075  }
38076  pPars->nFramesPast = atoi(argv[globalUtilOptind]);
38077  globalUtilOptind++;
38078  if ( pPars->nFramesPast < 0 )
38079  goto usage;
38080  break;
38081  case 'C':
38082  if ( globalUtilOptind >= argc )
38083  {
38084  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
38085  goto usage;
38086  }
38087  pPars->nConfLimit = atoi(argv[globalUtilOptind]);
38088  globalUtilOptind++;
38089  if ( pPars->nConfLimit < 0 )
38090  goto usage;
38091  break;
38092  case 'L':
38093  if ( globalUtilOptind >= argc )
38094  {
38095  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
38096  goto usage;
38097  }
38098  pPars->nLearnedStart = atoi(argv[globalUtilOptind]);
38099  globalUtilOptind++;
38100  if ( pPars->nLearnedStart < 0 )
38101  goto usage;
38102  break;
38103  case 'D':
38104  if ( globalUtilOptind >= argc )
38105  {
38106  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
38107  goto usage;
38108  }
38109  pPars->nLearnedDelta = atoi(argv[globalUtilOptind]);
38110  globalUtilOptind++;
38111  if ( pPars->nLearnedDelta < 0 )
38112  goto usage;
38113  break;
38114  case 'E':
38115  if ( globalUtilOptind >= argc )
38116  {
38117  Abc_Print( -1, "Command line switch \"-E\" should be followed by an integer.\n" );
38118  goto usage;
38119  }
38120  pPars->nLearnedPerce = atoi(argv[globalUtilOptind]);
38121  globalUtilOptind++;
38122  if ( pPars->nLearnedPerce < 0 )
38123  goto usage;
38124  break;
38125  case 'T':
38126  if ( globalUtilOptind >= argc )
38127  {
38128  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
38129  goto usage;
38130  }
38131  pPars->nTimeOut = atoi(argv[globalUtilOptind]);
38132  globalUtilOptind++;
38133  if ( pPars->nTimeOut < 0 )
38134  goto usage;
38135  break;
38136  case 'R':
38137  if ( globalUtilOptind >= argc )
38138  {
38139  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
38140  goto usage;
38141  }
38142  pPars->nRatioMin = atoi(argv[globalUtilOptind]);
38143  globalUtilOptind++;
38144  if ( pPars->nRatioMin < 0 )
38145  goto usage;
38146  break;
38147  case 'A':
38148  if ( globalUtilOptind >= argc )
38149  {
38150  Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
38151  goto usage;
38152  }
38153  pPars->pFileVabs = argv[globalUtilOptind];
38154  globalUtilOptind++;
38155  break;
38156  case 't':
38157  pPars->fUseTermVars ^= 1;
38158  break;
38159  case 'r':
38160  pPars->fUseRollback ^= 1;
38161  break;
38162  case 'a':
38163  pPars->fAddLayer ^= 1;
38164  break;
38165  case 'd':
38166  pPars->fDumpVabs ^= 1;
38167  break;
38168  case 'v':
38169  pPars->fVerbose ^= 1;
38170  break;
38171  case 'h':
38172  goto usage;
38173  default:
38174  goto usage;
38175  }
38176  }
38177  if ( pAbc->pGia == NULL )
38178  {
38179  Abc_Print( -1, "There is no AIG.\n" );
38180  return 0;
38181  }
38182  if ( Gia_ManRegNum(pAbc->pGia) == 0 )
38183  {
38184  Abc_Print( -1, "The network is combinational.\n" );
38185  return 0;
38186  }
38187  if ( Gia_ManPoNum(pAbc->pGia) > 1 )
38188  {
38189  Abc_Print( 1, "The network is more than one PO (run \"orpos\").\n" );
38190  return 0;
38191  }
38192  if ( pPars->nFramesMax < 0 )
38193  {
38194  Abc_Print( 1, "The number of starting frames should be a positive integer.\n" );
38195  return 0;
38196  }
38197  if ( pPars->nFramesMax && pPars->nFramesStart > pPars->nFramesMax )
38198  {
38199  Abc_Print( 1, "The starting frame is larger than the max number of frames.\n" );
38200  return 0;
38201  }
38202  pAbc->Status = Gia_VtaPerform( pAbc->pGia, pPars );
38203  pAbc->nFrames = pPars->iFrame;
38204  Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
38205  return 0;
38206 
38207 usage:
38208  Abc_Print( -2, "usage: &vta [-FSPCLDETR num] [-A file] [-tradvh]\n" );
38209  Abc_Print( -2, "\t variable-time-frame gate-level proof- and cex-based abstraction\n" );
38210  Abc_Print( -2, "\t-F num : the max number of timeframes to unroll [default = %d]\n", pPars->nFramesMax );
38211  Abc_Print( -2, "\t-S num : the starting time frame (0=unused) [default = %d]\n", pPars->nFramesStart );
38212  Abc_Print( -2, "\t-P num : the number of previous frames for UNSAT core [default = %d]\n", pPars->nFramesPast );
38213  Abc_Print( -2, "\t-C num : the max number of SAT solver conflicts (0=unused) [default = %d]\n", pPars->nConfLimit );
38214  Abc_Print( -2, "\t-L num : the max number of learned clauses to keep (0=unused) [default = %d]\n", pPars->nLearnedStart );
38215  Abc_Print( -2, "\t-D num : delta value for learned clause removal [default = %d]\n", pPars->nLearnedDelta );
38216  Abc_Print( -2, "\t-E num : ratio percentage for learned clause removal [default = %d]\n", pPars->nLearnedPerce );
38217  Abc_Print( -2, "\t-T num : an approximate timeout, in seconds [default = %d]\n", pPars->nTimeOut );
38218  Abc_Print( -2, "\t-R num : minimum percentage of abstracted objects (0<=num<=100) [default = %d]\n", pPars->nRatioMin );
38219  Abc_Print( -2, "\t-A file : file name for dumping abstrated model [default = \"vabs.aig\"]\n" );
38220  Abc_Print( -2, "\t-t : toggle using terminal variables [default = %s]\n", pPars->fUseTermVars? "yes": "no" );
38221  Abc_Print( -2, "\t-r : toggle using rollback after the starting frames [default = %s]\n", pPars->fUseRollback? "yes": "no" );
38222  Abc_Print( -2, "\t-a : toggle refinement by adding one layers of gates [default = %s]\n", pPars->fAddLayer? "yes": "no" );
38223  Abc_Print( -2, "\t-d : toggle dumping abstracted model into a file [default = %s]\n", pPars->fDumpVabs? "yes": "no" );
38224  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
38225  Abc_Print( -2, "\t-h : print the command usage\n");
38226  return 1;
38227 }
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
void Abs_ParSetDefaults(Abs_Par_t *p)
DECLARATIONS ///.
Definition: absUtil.c:44
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Gia_VtaPerform(Gia_Man_t *pAig, Abs_Par_t *pPars)
Definition: absVta.c:1743
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abs_Par_t_ Abs_Par_t
INCLUDES ///.
Definition: abs.h:46
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Abc_CommandAbc9Vta2Gla ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 38240 of file abc.c.

38241 {
38242  int c, fVerbose = 0;
38244  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
38245  {
38246  switch ( c )
38247  {
38248  case 'v':
38249  fVerbose ^= 1;
38250  break;
38251  case 'h':
38252  goto usage;
38253  default:
38254  goto usage;
38255  }
38256  }
38257  if ( pAbc->pGia == NULL )
38258  {
38259  Abc_Print( -1, "Abc_CommandAbc9Vta2Gla(): There is no AIG.\n" );
38260  return 0;
38261  }
38262  if ( pAbc->pGia->vObjClasses == NULL )
38263  {
38264  Abc_Print( -1, "Abc_CommandAbc9Vta2Gla(): There is no variable-time-frame abstraction is defined.\n" );
38265  return 0;
38266  }
38267  Vec_IntFreeP( &pAbc->pGia->vGateClasses );
38268  pAbc->pGia->vGateClasses = Gia_VtaConvertToGla( pAbc->pGia, pAbc->pGia->vObjClasses );
38269  Vec_IntFreeP( &pAbc->pGia->vObjClasses );
38270  return 0;
38271 
38272 usage:
38273  Abc_Print( -2, "usage: &vta_gla [-vh]\n" );
38274  Abc_Print( -2, "\t maps variable- into fixed-time-frame gate-level abstraction\n" );
38275  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
38276  Abc_Print( -2, "\t-h : print the command usage\n");
38277  return 1;
38278 }
Vec_Int_t * Gia_VtaConvertToGla(Gia_Man_t *p, Vec_Int_t *vVta)
Definition: absUtil.c:78
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbc9Write ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26109 of file abc.c.

26110 {
26111  char * pFileName;
26112  char ** pArgvNew;
26113  int c, nArgcNew;
26114  int fUnique = 0;
26115  int fMiniAig = 0;
26116  int fVerbose = 0;
26118  while ( ( c = Extra_UtilGetopt( argc, argv, "umvh" ) ) != EOF )
26119  {
26120  switch ( c )
26121  {
26122  case 'u':
26123  fUnique ^= 1;
26124  break;
26125  case 'm':
26126  fMiniAig ^= 1;
26127  break;
26128  case 'v':
26129  fVerbose ^= 1;
26130  break;
26131  case 'h':
26132  goto usage;
26133  default:
26134  goto usage;
26135  }
26136  }
26137  pArgvNew = argv + globalUtilOptind;
26138  nArgcNew = argc - globalUtilOptind;
26139  if ( nArgcNew != 1 )
26140  {
26141  Abc_Print( -1, "There is no file name.\n" );
26142  return 1;
26143  }
26144  if ( pAbc->pGia == NULL )
26145  {
26146  Abc_Print( -1, "Abc_CommandAbc9Write(): There is no AIG to write.\n" );
26147  return 1;
26148  }
26149  pFileName = argv[globalUtilOptind];
26150  if ( fUnique )
26151  {
26152  Gia_Man_t * pGia = Gia_ManIsoCanonicize( pAbc->pGia, fVerbose );
26153  Gia_AigerWriteSimple( pGia, pFileName );
26154  Gia_ManStop( pGia );
26155  }
26156  else if ( fMiniAig )
26157  Gia_ManWriteMiniAig( pAbc->pGia, pFileName );
26158  else
26159  Gia_AigerWrite( pAbc->pGia, pFileName, 0, 0 );
26160  return 0;
26161 
26162 usage:
26163  Abc_Print( -2, "usage: &w [-umvh] <file>\n" );
26164  Abc_Print( -2, "\t writes the current AIG into the AIGER file\n" );
26165  Abc_Print( -2, "\t-u : toggle writing canonical AIG structure [default = %s]\n", fUnique? "yes" : "no" );
26166  Abc_Print( -2, "\t-m : toggle writing MiniAIG rather than AIGER [default = %s]\n", fMiniAig? "yes" : "no" );
26167  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
26168  Abc_Print( -2, "\t-h : print the command usage\n");
26169  Abc_Print( -2, "\t<file> : the file name\n");
26170  return 1;
26171 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Gia_AigerWriteSimple(Gia_Man_t *pInit, char *pFileName)
Definition: giaAiger.c:1361
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
Definition: giaAiger.c:1024
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Gia_ManWriteMiniAig(Gia_Man_t *pGia, char *pFileName)
Definition: giaMini.c:176
Gia_Man_t * Gia_ManIsoCanonicize(Gia_Man_t *p, int fVerbose)
Definition: giaIso.c:958
int Abc_CommandAbc9WriteVer ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 26184 of file abc.c.

26185 {
26186  char * pFileSpec = NULL;
26187  Abc_Ntk_t * pNtkSpec = NULL;
26188  char * pFileName;
26189  char ** pArgvNew;
26190  int c, nArgcNew;
26191  int fVerbose = 0;
26193  while ( ( c = Extra_UtilGetopt( argc, argv, "Svh" ) ) != EOF )
26194  {
26195  switch ( c )
26196  {
26197  case 'S':
26198  if ( globalUtilOptind >= argc )
26199  {
26200  Abc_Print( -1, "Command line switch \"-S\" should be followed by a file name.\n" );
26201  goto usage;
26202  }
26203  pFileSpec = argv[globalUtilOptind];
26204  globalUtilOptind++;
26205  break;
26206  case 'v':
26207  fVerbose ^= 1;
26208  break;
26209  case 'h':
26210  goto usage;
26211  default:
26212  goto usage;
26213  }
26214  }
26215  pArgvNew = argv + globalUtilOptind;
26216  nArgcNew = argc - globalUtilOptind;
26217  if ( nArgcNew != 1 )
26218  {
26219  Abc_Print( -1, "Expecting output file name on the command line.\n" );
26220  return 1;
26221  }
26222  pFileName = argv[globalUtilOptind];
26223  if ( pAbc->pNtkCur == NULL )
26224  {
26225  Abc_Print( -1, "There is no mapped file to write.\n" );
26226  return 1;
26227  }
26228  if ( pFileSpec == NULL )
26229  {
26230  Abc_Print( -1, "The specification file is not given.\n" );
26231  return 1;
26232  }
26233  pNtkSpec = Io_ReadNetlist( pFileSpec, Io_ReadFileType(pFileSpec), 0 );
26234  if ( pNtkSpec == NULL )
26235  {
26236  Abc_Print( -1, "Reading hierarchical Verilog for the specification has failed.\n" );
26237  return 1;
26238  }
26239  Abc_NtkInsertHierarchyGia( pNtkSpec, pAbc->pNtkCur, fVerbose );
26240  Io_WriteVerilog( pNtkSpec, pFileName );
26241  Abc_NtkDelete( pNtkSpec );
26242  return 0;
26243 
26244 usage:
26245  Abc_Print( -2, "usage: &write_ver [-S <file>] [-vh] <file>\n" );
26246  Abc_Print( -2, "\t writes hierarchical Verilog after mapping\n" );
26247  Abc_Print( -2, "\t-S file : file name for the original hierarchical design (required)\n" );
26248  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
26249  Abc_Print( -2, "\t-h : print the command usage\n");
26250  Abc_Print( -2, "\t<file> : the file name\n");
26251  return 1;
26252 }
void Io_WriteVerilog(Abc_Ntk_t *pNtk, char *FileName)
FUNCTION DEFINITIONS ///.
Abc_Ntk_t * Io_ReadNetlist(char *pFileName, Io_FileType_t FileType, int fCheck)
Definition: ioUtil.c:98
ABC_DLL void Abc_NtkInsertHierarchyGia(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNew, int fVerbose)
Definition: abcHieGia.c:390
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAbcLivenessToSafety ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Definition at line 1254 of file liveness.c.

1255 {
1256  FILE * pOut, * pErr;
1257  Abc_Ntk_t * pNtk, * pNtkTemp, *pNtkNew, *pNtkOld;
1258  Aig_Man_t * pAig, *pAigNew = NULL;
1259  int c;
1260  Vec_Ptr_t * vLive, * vFair, *vAssertSafety, *vAssumeSafety;
1261  int directive = -1;
1262 
1263  pNtk = Abc_FrameReadNtk(pAbc);
1264  pOut = Abc_FrameReadOut(pAbc);
1265  pErr = Abc_FrameReadErr(pAbc);
1266 
1267  if( argc == 1 )
1268  {
1269  assert( directive == -1 );
1270  directive = FULL_BIERE_MODE;
1271  }
1272  else
1273  {
1275  while ( ( c = Extra_UtilGetopt( argc, argv, "1slh" ) ) != EOF )
1276  {
1277  switch( c )
1278  {
1279  case '1':
1280  if( directive == -1 )
1281  directive = FULL_BIERE_ONE_LOOP_MODE;
1282  else
1283  {
1285  if( directive == IGNORE_LIVENESS_KEEP_SAFETY_MODE )
1287  else
1289  }
1290  break;
1291  case 's':
1292  if( directive == -1 )
1294  else
1295  {
1296  if( directive != FULL_BIERE_ONE_LOOP_MODE )
1297  goto usage;
1298  assert(directive == FULL_BIERE_ONE_LOOP_MODE);
1300  }
1301  break;
1302  case 'l':
1303  if( directive == -1 )
1305  else
1306  {
1307  if( directive != FULL_BIERE_ONE_LOOP_MODE )
1308  goto usage;
1309  assert(directive == FULL_BIERE_ONE_LOOP_MODE);
1311  }
1312  break;
1313  case 'h':
1314  goto usage;
1315  default:
1316  goto usage;
1317  }
1318  }
1319  }
1320 
1321  if ( pNtk == NULL )
1322  {
1323  fprintf( pErr, "Empty network.\n" );
1324  return 1;
1325  }
1326  if( !Abc_NtkIsStrash( pNtk ) )
1327  {
1328  printf("The input network was not strashed, strashing....\n");
1329  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
1330  pNtkOld = pNtkTemp;
1331  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
1332  vLive = populateLivenessVector( pNtk, pAig );
1333  vFair = populateFairnessVector( pNtk, pAig );
1334  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1335  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1336  }
1337  else
1338  {
1339  pAig = Abc_NtkToDar( pNtk, 0, 1 );
1340  pNtkOld = pNtk;
1341  vLive = populateLivenessVector( pNtk, pAig );
1342  vFair = populateFairnessVector( pNtk, pAig );
1343  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1344  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1345  }
1346 
1347  switch( directive )
1348  {
1349  case FULL_BIERE_MODE:
1350  //if( Vec_PtrSize(vLive) == 0 && Vec_PtrSize(vAssertSafety) == 0 )
1351  //{
1352  // printf("Input circuit has NO safety and NO liveness property, original network is not disturbed\n");
1353  // return 1;
1354  //}
1355  //else
1356  //{
1357  pAigNew = LivenessToSafetyTransformation( FULL_BIERE_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1358  if( Aig_ManRegNum(pAigNew) != 0 )
1359  printf("A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n");
1360  break;
1361  //}
1363  //if( Vec_PtrSize(vLive) == 0 && Vec_PtrSize(vAssertSafety) == 0 )
1364  //{
1365  // printf("Input circuit has NO safety and NO liveness property, original network is not disturbed\n");
1366  // return 1;
1367  //}
1368  //else
1369  //{
1370  pAigNew = LivenessToSafetyTransformationOneStepLoop( FULL_BIERE_ONE_LOOP_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1371  if( Aig_ManRegNum(pAigNew) != 0 )
1372  printf("A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
1373  break;
1374  //}
1376  //if( Vec_PtrSize(vAssertSafety) == 0 )
1377  //{
1378  // printf("Input circuit has NO safety property, original network is not disturbed\n");
1379  // return 1;
1380  //}
1381  //else
1382  //{
1383  pAigNew = LivenessToSafetyTransformation( IGNORE_LIVENESS_KEEP_SAFETY_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1384  if( Aig_ManRegNum(pAigNew) != 0 )
1385  printf("A new circuit is produced with\n\t1 PO - only for safety property; liveness properties are ignored, if any.\n\tno additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
1386  break;
1387  //}
1389  //if( Vec_PtrSize(vLive) == 0 )
1390  //{
1391  // printf("Input circuit has NO liveness property, original network is not disturbed\n");
1392  // return 1;
1393  //}
1394  //else
1395  //{
1396  pAigNew = LivenessToSafetyTransformation( IGNORE_SAFETY_KEEP_LIVENESS_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1397  if( Aig_ManRegNum(pAigNew) != 0 )
1398  printf("A new circuit is produced with\n\t1 PO - only for liveness property; safety properties are ignored, if any.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n");
1399  break;
1400  //}
1402  //if( Vec_PtrSize(vLive) == 0 )
1403  //{
1404  // printf("Input circuit has NO liveness property, original network is not disturbed\n");
1405  // return 1;
1406  //}
1407  //else
1408  //{
1409  pAigNew = LivenessToSafetyTransformationOneStepLoop( IGNORE_SAFETY_KEEP_LIVENESS_ONE_LOOP_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1410  if( Aig_ManRegNum(pAigNew) != 0 )
1411  printf("New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nShadow registers are not created\n");
1412  break;
1413  //}
1414  }
1415 
1416 #if 0
1417  if( argc == 1 )
1418  {
1419  pAigNew = LivenessToSafetyTransformation( FULL_BIERE_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1420  if( Aig_ManRegNum(pAigNew) != 0 )
1421  printf("New circuit is produced considering all safety, liveness and fairness outputs.\nBiere's logic is created\n");
1422  }
1423  else
1424  {
1426  c = Extra_UtilGetopt( argc, argv, "1lsh" );
1427  if( c == '1' )
1428  {
1429  if ( pNtk == NULL )
1430  {
1431  fprintf( pErr, "Empty network.\n" );
1432  return 1;
1433  }
1434  if( !Abc_NtkIsStrash( pNtk ) )
1435  {
1436  printf("The input network was not strashed, strashing....\n");
1437  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
1438  pNtkOld = pNtkTemp;
1439  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
1440  vLive = populateLivenessVector( pNtk, pAig );
1441  vFair = populateFairnessVector( pNtk, pAig );
1442  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1443  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1444  }
1445  else
1446  {
1447  pAig = Abc_NtkToDar( pNtk, 0, 1 );
1448  pNtkOld = pNtk;
1449  vLive = populateLivenessVector( pNtk, pAig );
1450  vFair = populateFairnessVector( pNtk, pAig );
1451  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1452  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1453  }
1454  pAigNew = LivenessToSafetyTransformationOneStepLoop( pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1455  }
1456  else if( c == 'l' )
1457  {
1458  if ( pNtk == NULL )
1459  {
1460  fprintf( pErr, "Empty network.\n" );
1461  return 1;
1462  }
1463  if( !Abc_NtkIsStrash( pNtk ) )
1464  {
1465  printf("The input network was not strashed, strashing....\n");
1466  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
1467  pNtkOld = pNtkTemp;
1468  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
1469  vLive = populateLivenessVector( pNtk, pAig );
1470  vFair = populateFairnessVector( pNtk, pAig );
1471  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1472  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1473  }
1474  else
1475  {
1476  pAig = Abc_NtkToDar( pNtk, 0, 1 );
1477  pNtkOld = pNtk;
1478  vLive = populateLivenessVector( pNtk, pAig );
1479  vFair = populateFairnessVector( pNtk, pAig );
1480  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1481  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1482  }
1483  pAigNew = LivenessToSafetyTransformation( IGNORE_LIVENESS_KEEP_SAFETY_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1484  if( Aig_ManRegNum(pAigNew) != 0 )
1485  printf("New circuit is produced ignoring liveness outputs!\nOnly safety outputs are kept.\nBiere's logic is not created\n");
1486  }
1487  else if( c == 's' )
1488  {
1489  if ( pNtk == NULL )
1490  {
1491  fprintf( pErr, "Empty network.\n" );
1492  return 1;
1493  }
1494 
1495  if( !Abc_NtkIsStrash( pNtk ) )
1496  {
1497  printf("The input network was not strashed, strashing....\n");
1498  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
1499  pNtkOld = pNtkTemp;
1500  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
1501  vLive = populateLivenessVector( pNtk, pAig );
1502  vFair = populateFairnessVector( pNtk, pAig );
1503  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1504  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1505  }
1506  else
1507  {
1508  pAig = Abc_NtkToDar( pNtk, 0, 1 );
1509  pNtkOld = pNtk;
1510  vLive = populateLivenessVector( pNtk, pAig );
1511  vFair = populateFairnessVector( pNtk, pAig );
1512  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
1513  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
1514  }
1515  pAigNew = LivenessToSafetyTransformation( IGNORE_SAFETY_KEEP_LIVENESS_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
1516  if( Aig_ManRegNum(pAigNew) != 0 )
1517  printf("New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nBiere's logic is created\n");
1518  }
1519  else if( c == 'h' )
1520  goto usage;
1521  else
1522  goto usage;
1523  }
1524 #endif
1525 
1526 #if 0
1527  Aig_ManPrintStats( pAigNew );
1528  printf("\nDetail statistics*************************************\n");
1529  printf("Number of true primary inputs = %d\n", Saig_ManPiNum( pAigNew ));
1530  printf("Number of true primary outputs = %d\n", Saig_ManPoNum( pAigNew ));
1531  printf("Number of true latch outputs = %d\n", Saig_ManCiNum( pAigNew ) - Saig_ManPiNum( pAigNew ));
1532  printf("Number of true latch inputs = %d\n", Saig_ManCoNum( pAigNew ) - Saig_ManPoNum( pAigNew ));
1533  printf("Numer of registers = %d\n", Saig_ManRegNum( pAigNew ) );
1534  printf("\n*******************************************************\n");
1535 #endif
1536 
1537  pNtkNew = Abc_NtkFromAigPhase( pAigNew );
1538  pNtkNew->pName = Abc_UtilStrsav( pAigNew->pName );
1539 
1540  if ( !Abc_NtkCheck( pNtkNew ) )
1541  fprintf( stdout, "Abc_NtkCreateCone(): Network check has failed.\n" );
1542 
1543  updateNewNetworkNameManager( pNtkNew, pAigNew, vecPiNames, vecLoNames );
1544  Abc_FrameSetCurrentNetwork( pAbc, pNtkNew );
1545 
1546 #if 0
1547 #ifndef DUPLICATE_CKT_DEBUG
1548  Saig_ManForEachPi( pAigNew, pObj, i )
1549  assert( strcmp( (char *)Vec_PtrEntry(vecPiNames, i), retrieveTruePiName( pNtk, pAig, pAigNew, pObj ) ) == 0 );
1550  //printf("Name of %d-th Pi = %s, %s\n", i, retrieveTruePiName( pNtk, pAig, pAigNew, pObj ), (char *)Vec_PtrEntry(vecPiNames, i) );
1551 
1552  Saig_ManForEachLo( pAigNew, pObj, i )
1553  assert( strcmp( (char *)Vec_PtrEntry(vecLoNames, i), retrieveLOName( pNtk, pAig, pAigNew, pObj, vLive, vFair ) ) == 0 );
1554 #endif
1555 #endif
1556 
1557  return 0;
1558 
1559 usage:
1560  fprintf( stdout, "usage: l2s [-1lsh]\n" );
1561  fprintf( stdout, "\t performs Armin Biere's live-to-safe transformation\n" );
1562  fprintf( stdout, "\t-1 : no shadow logic, presume all loops are self loops\n");
1563  fprintf( stdout, "\t-l : ignore liveness and fairness outputs\n");
1564  fprintf( stdout, "\t-s : ignore safety assertions and assumptions\n");
1565  fprintf( stdout, "\t-h : print command usage\n");
1566  return 1;
1567 }
#define IGNORE_SAFETY_KEEP_LIVENESS_ONE_LOOP_MODE
Definition: liveness.c:37
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Vec_Ptr_t * vecLoNames
Definition: liveness.c:219
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Vec_Ptr_t * populateSafetyAssertionVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1179
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
Aig_Man_t * LivenessToSafetyTransformationOneStepLoop(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety)
Definition: liveness.c:843
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
ABC_DLL void Abc_FrameSetCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:396
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
Vec_Ptr_t * vecPiNames
Definition: liveness.c:218
Vec_Ptr_t * populateSafetyAssumptionVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1197
void Aig_ManPrintStats(Aig_Man_t *p)
Definition: aigMan.c:379
#define IGNORE_SAFETY_KEEP_LIVENESS_MODE
Definition: liveness.c:36
#define FULL_BIERE_MODE
Definition: liveness.c:34
Vec_Ptr_t * populateFairnessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1161
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
char * retrieveLOName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair)
Definition: liveness.c:137
#define FULL_BIERE_ONE_LOOP_MODE
Definition: liveness.c:38
Aig_Man_t * LivenessToSafetyTransformation(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety)
Definition: liveness.c:244
int strcmp()
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void updateNewNetworkNameManager(Abc_Ntk_t *pNtk, Aig_Man_t *pAig, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vLoNames)
Definition: liveness.c:1215
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
static int Saig_ManCiNum(Aig_Man_t *p)
Definition: saig.h:75
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
#define IGNORE_LIVENESS_KEEP_SAFETY_MODE
Definition: liveness.c:35
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Vec_Ptr_t * populateLivenessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1143
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
Definition: mainFrame.c:330
#define assert(ex)
Definition: util_old.h:213
static int Saig_ManCoNum(Aig_Man_t *p)
Definition: saig.h:76
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
Definition: mainFrame.c:314
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
char * pName
Definition: abc.h:158
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
char * retrieveTruePiName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot)
Definition: liveness.c:115
int Abc_CommandAbcLivenessToSafetySim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Definition at line 754 of file liveness_sim.c.

755 {
756  FILE * pOut, * pErr;
757  Abc_Ntk_t * pNtk, * pNtkTemp, *pNtkNew, *pNtkOld;
758  Aig_Man_t * pAig, *pAigNew;
759  int c;
760  Vec_Ptr_t * vLive, * vFair;
761 
762  pNtk = Abc_FrameReadNtk(pAbc);
763  pOut = Abc_FrameReadOut(pAbc);
764  pErr = Abc_FrameReadErr(pAbc);
765 
766  if ( pNtk == NULL )
767  {
768  fprintf( pErr, "Empty network.\n" );
769  return 1;
770  }
771 
772  if( !Abc_NtkIsStrash( pNtk ) )
773  {
774  printf("\nThe input network was not strashed, strashing....\n");
775  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
776  pNtkOld = pNtkTemp;
777  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
778  vLive = populateLivenessVector( pNtk, pAig );
779  vFair = populateFairnessVector( pNtk, pAig );
780  }
781  else
782  {
783  pAig = Abc_NtkToDar( pNtk, 0, 1 );
784  pNtkOld = pNtk;
785  vLive = populateLivenessVector( pNtk, pAig );
786  vFair = populateFairnessVector( pNtk, pAig );
787  }
788 
789 #if 0
790  Aig_ManPrintStats( pAig );
791  printf("\nDetail statistics*************************************\n");
792  printf("Number of true primary inputs = %d\n", Saig_ManPiNum( pAig ));
793  printf("Number of true primary outputs = %d\n", Saig_ManPoNum( pAig ));
794  printf("Number of true latch outputs = %d\n", Saig_ManCiNum( pAig ) - Saig_ManPiNum( pAig ));
795  printf("Number of true latch inputs = %d\n", Saig_ManCoNum( pAig ) - Saig_ManPoNum( pAig ));
796  printf("Numer of registers = %d\n", Saig_ManRegNum( pAig ) );
797  printf("\n*******************************************************\n");
798 #endif
799 
800  c = Extra_UtilGetopt( argc, argv, "1" );
801  if( c == '1' )
802  pAigNew = LivenessToSafetyTransformationOneStepLoopSim( pNtk, pAig, vLive, vFair );
803  else
804  pAigNew = LivenessToSafetyTransformationSim( pNtk, pAig, vLive, vFair );
805 
806 #if 0
807  Aig_ManPrintStats( pAigNew );
808  printf("\nDetail statistics*************************************\n");
809  printf("Number of true primary inputs = %d\n", Saig_ManPiNum( pAigNew ));
810  printf("Number of true primary outputs = %d\n", Saig_ManPoNum( pAigNew ));
811  printf("Number of true latch outputs = %d\n", Saig_ManCiNum( pAigNew ) - Saig_ManPiNum( pAigNew ));
812  printf("Number of true latch inputs = %d\n", Saig_ManCoNum( pAigNew ) - Saig_ManPoNum( pAigNew ));
813  printf("Numer of registers = %d\n", Saig_ManRegNum( pAigNew ) );
814  printf("\n*******************************************************\n");
815 #endif
816 
817  pNtkNew = Abc_NtkFromAigPhase( pAigNew );
818 
819  if ( !Abc_NtkCheck( pNtkNew ) )
820  fprintf( stdout, "Abc_NtkCreateCone(): Network check has failed.\n" );
821 
823  Abc_FrameSetCurrentNetwork( pAbc, pNtkNew );
824 
825  //Saig_ManForEachPi( pAigNew, pObj, i )
826  // printf("Name of %d-th Pi = %s\n", i, retrieveTruePiName( pNtk, pAig, pAigNew, pObj ) );
827 
828  //Saig_ManForEachLo( pAigNew, pObj, i )
829  // printf("Name of %d-th Lo = %s\n", i, retrieveLOName( pNtk, pAig, pAigNew, pObj, vLive, vFair ) );
830 
831  //printVecPtrOfString( vecPiNames );
832  //printVecPtrOfString( vecLoNames );
833 
834 #if 0
835 #ifndef DUPLICATE_CKT_DEBUG
836  Saig_ManForEachPi( pAigNew, pObj, i )
837  assert( strcmp( (char *)Vec_PtrEntry(vecPiNames, i), retrieveTruePiName( pNtk, pAig, pAigNew, pObj ) ) == 0 );
838  //printf("Name of %d-th Pi = %s, %s\n", i, retrieveTruePiName( pNtk, pAig, pAigNew, pObj ), (char *)Vec_PtrEntry(vecPiNames, i) );
839 
840  Saig_ManForEachLo( pAigNew, pObj, i )
841  assert( strcmp( (char *)Vec_PtrEntry(vecLoNames, i), retrieveLOName( pNtk, pAig, pAigNew, pObj, vLive, vFair ) ) == 0 );
842 #endif
843 #endif
844 
845  return 0;
846 
847 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static char * retrieveLOName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair)
Definition: liveness_sim.c:100
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
ABC_DLL void Abc_FrameSetCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:396
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
void Aig_ManPrintStats(Aig_Man_t *p)
Definition: aigMan.c:379
static Aig_Man_t * LivenessToSafetyTransformationOneStepLoopSim(Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair)
Definition: liveness_sim.c:480
static void updateNewNetworkNameManager(Abc_Ntk_t *pNtk, Aig_Man_t *pAig, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vLoNames)
Definition: liveness_sim.c:732
Vec_Ptr_t * vecPiNames
Definition: liveness.c:218
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
static char * retrieveTruePiName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot)
Definition: liveness_sim.c:78
int strcmp()
static Vec_Ptr_t * populateFairnessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness_sim.c:715
static Aig_Man_t * LivenessToSafetyTransformationSim(Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair)
Definition: liveness_sim.c:198
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
static int Saig_ManCiNum(Aig_Man_t *p)
Definition: saig.h:75
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static Vec_Ptr_t * populateLivenessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness_sim.c:698
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Vec_Ptr_t * vecLoNames
Definition: liveness.c:219
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
Definition: mainFrame.c:330
#define assert(ex)
Definition: util_old.h:213
static int Saig_ManCoNum(Aig_Man_t *p)
Definition: saig.h:76
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
Definition: mainFrame.c:314
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
int Abc_CommandAbcLivenessToSafetyWithLTL ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Definition at line 2268 of file liveness.c.

2269 {
2270  FILE * pOut, * pErr;
2271  Abc_Ntk_t * pNtk, * pNtkTemp, *pNtkNew, *pNtkOld;
2272  Aig_Man_t * pAig, *pAigNew = NULL;
2273  int c;
2274  Vec_Ptr_t * vLive, * vFair, *vAssertSafety, *vAssumeSafety;
2275  int directive = -1;
2276 // char *ltfFormulaString = NULL;
2277  int numOfLtlPropOutput;//, LTL_FLAG = 0;
2278  Vec_Ptr_t *ltlBuffer;
2279 
2280  pNtk = Abc_FrameReadNtk(pAbc);
2281  pOut = Abc_FrameReadOut(pAbc);
2282  pErr = Abc_FrameReadErr(pAbc);
2283 
2284  if( argc == 1 )
2285  {
2286  assert( directive == -1 );
2287  directive = FULL_BIERE_MODE;
2288  }
2289  else
2290  {
2292  while ( ( c = Extra_UtilGetopt( argc, argv, "1slhf" ) ) != EOF )
2293  {
2294  switch( c )
2295  {
2296  case '1':
2297  if( directive == -1 )
2298  directive = FULL_BIERE_ONE_LOOP_MODE;
2299  else
2300  {
2302  if( directive == IGNORE_LIVENESS_KEEP_SAFETY_MODE )
2304  else
2306  }
2307  break;
2308  case 's':
2309  if( directive == -1 )
2311  else
2312  {
2313  if( directive != FULL_BIERE_ONE_LOOP_MODE )
2314  goto usage;
2315  assert(directive == FULL_BIERE_ONE_LOOP_MODE);
2317  }
2318  break;
2319  case 'l':
2320  if( directive == -1 )
2322  else
2323  {
2324  if( directive != FULL_BIERE_ONE_LOOP_MODE )
2325  goto usage;
2326  assert(directive == FULL_BIERE_ONE_LOOP_MODE);
2328  }
2329  break;
2330  case 'f':
2331  //assert( argc >= 3 );
2332  //vecLtlFormula = Vec_PtrAlloc( argc - 2 );
2333  //if( argc >= 3 )
2334  //{
2335  // for( t=3; t<=argc; t++ )
2336  // {
2337  // printf("argv[%d] = %s\n", t-1, argv[t-1]);
2338  // Vec_PtrPush( vecLtlFormula, argv[t-1] );
2339  // }
2340  //}
2341  //printf("argv[argc] = %s\n", argv[argc-1]);
2342  //ltfFormulaString = argv[2];
2343 
2344  //LTL_FLAG = 1;
2345  printf("\nILLEGAL FLAG: aborting....\n");
2346  exit(0);
2347  break;
2348  case 'h':
2349  goto usage;
2350  default:
2351  goto usage;
2352  }
2353  }
2354  }
2355 
2356  if ( pNtk == NULL )
2357  {
2358  fprintf( pErr, "Empty network.\n" );
2359  return 1;
2360  }
2361  if( !Abc_NtkIsStrash( pNtk ) )
2362  {
2363  printf("The input network was not strashed, strashing....\n");
2364  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
2365  pNtkOld = pNtkTemp;
2366  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
2367  vLive = populateLivenessVector( pNtk, pAig );
2368  vFair = populateFairnessVector( pNtk, pAig );
2369  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2370  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2371  }
2372  else
2373  {
2374  pAig = Abc_NtkToDar( pNtk, 0, 1 );
2375  pNtkOld = pNtk;
2376  vLive = populateLivenessVector( pNtk, pAig );
2377  vFair = populateFairnessVector( pNtk, pAig );
2378  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2379  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2380  }
2381 
2382  if( pAbc->vLTLProperties_global != NULL )
2383  ltlBuffer = pAbc->vLTLProperties_global;
2384  else
2385  ltlBuffer = NULL;
2386 
2387  switch( directive )
2388  {
2389  case FULL_BIERE_MODE:
2390  pAigNew = LivenessToSafetyTransformationWithLTL( FULL_BIERE_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety, &numOfLtlPropOutput, ltlBuffer );
2391  if( Aig_ManRegNum(pAigNew) != 0 )
2392  printf("A new circuit is produced with\n\t%d POs - one for safety and %d for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n", numOfLtlPropOutput+1, numOfLtlPropOutput);
2393  break;
2394 
2396  pAigNew = LivenessToSafetyTransformationOneStepLoop( FULL_BIERE_ONE_LOOP_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
2397  if( Aig_ManRegNum(pAigNew) != 0 )
2398  printf("A new circuit is produced with\n\t2 POs - one for safety and one for liveness.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
2399  break;
2400 
2402  pAigNew = LivenessToSafetyTransformationWithLTL( IGNORE_LIVENESS_KEEP_SAFETY_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety, &numOfLtlPropOutput, ltlBuffer );
2403  assert( numOfLtlPropOutput == 0 );
2404  if( Aig_ManRegNum(pAigNew) != 0 )
2405  printf("A new circuit is produced with\n\t1 PO - only for safety property; liveness properties are ignored, if any.\n\tno additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created\n\tnon-property POs are suppressed\n");
2406  break;
2407 
2409  pAigNew = LivenessToSafetyTransformationWithLTL( IGNORE_SAFETY_KEEP_LIVENESS_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety, &numOfLtlPropOutput, ltlBuffer );
2410  if( Aig_ManRegNum(pAigNew) != 0 )
2411  printf("A new circuit is produced with\n\t%d PO - only for liveness property; safety properties are ignored, if any.\n\tone additional input is added (due to Biere's nondeterminism)\n\tshadow flops are not created if the original circuit is combinational\n\tnon-property POs are suppressed\n", numOfLtlPropOutput);
2412  break;
2413 
2415  pAigNew = LivenessToSafetyTransformationOneStepLoop( IGNORE_SAFETY_KEEP_LIVENESS_ONE_LOOP_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
2416  if( Aig_ManRegNum(pAigNew) != 0 )
2417  printf("New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nShadow registers are not created\n");
2418  break;
2419  }
2420 
2421 #if 0
2422  if( argc == 1 )
2423  {
2424  pAigNew = LivenessToSafetyTransformation( FULL_BIERE_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
2425  if( Aig_ManRegNum(pAigNew) != 0 )
2426  printf("New circuit is produced considering all safety, liveness and fairness outputs.\nBiere's logic is created\n");
2427  }
2428  else
2429  {
2431  c = Extra_UtilGetopt( argc, argv, "1lsh" );
2432  if( c == '1' )
2433  {
2434  if ( pNtk == NULL )
2435  {
2436  fprintf( pErr, "Empty network.\n" );
2437  return 1;
2438  }
2439  if( !Abc_NtkIsStrash( pNtk ) )
2440  {
2441  printf("The input network was not strashed, strashing....\n");
2442  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
2443  pNtkOld = pNtkTemp;
2444  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
2445  vLive = populateLivenessVector( pNtk, pAig );
2446  vFair = populateFairnessVector( pNtk, pAig );
2447  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2448  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2449  }
2450  else
2451  {
2452  pAig = Abc_NtkToDar( pNtk, 0, 1 );
2453  pNtkOld = pNtk;
2454  vLive = populateLivenessVector( pNtk, pAig );
2455  vFair = populateFairnessVector( pNtk, pAig );
2456  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2457  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2458  }
2459  pAigNew = LivenessToSafetyTransformationOneStepLoop( pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
2460  }
2461  else if( c == 'l' )
2462  {
2463  if ( pNtk == NULL )
2464  {
2465  fprintf( pErr, "Empty network.\n" );
2466  return 1;
2467  }
2468  if( !Abc_NtkIsStrash( pNtk ) )
2469  {
2470  printf("The input network was not strashed, strashing....\n");
2471  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
2472  pNtkOld = pNtkTemp;
2473  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
2474  vLive = populateLivenessVector( pNtk, pAig );
2475  vFair = populateFairnessVector( pNtk, pAig );
2476  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2477  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2478  }
2479  else
2480  {
2481  pAig = Abc_NtkToDar( pNtk, 0, 1 );
2482  pNtkOld = pNtk;
2483  vLive = populateLivenessVector( pNtk, pAig );
2484  vFair = populateFairnessVector( pNtk, pAig );
2485  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2486  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2487  }
2488  pAigNew = LivenessToSafetyTransformation( IGNORE_LIVENESS_KEEP_SAFETY_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
2489  if( Aig_ManRegNum(pAigNew) != 0 )
2490  printf("New circuit is produced ignoring liveness outputs!\nOnly safety outputs are kept.\nBiere's logic is not created\n");
2491  }
2492  else if( c == 's' )
2493  {
2494  if ( pNtk == NULL )
2495  {
2496  fprintf( pErr, "Empty network.\n" );
2497  return 1;
2498  }
2499 
2500  if( !Abc_NtkIsStrash( pNtk ) )
2501  {
2502  printf("The input network was not strashed, strashing....\n");
2503  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
2504  pNtkOld = pNtkTemp;
2505  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
2506  vLive = populateLivenessVector( pNtk, pAig );
2507  vFair = populateFairnessVector( pNtk, pAig );
2508  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2509  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2510  }
2511  else
2512  {
2513  pAig = Abc_NtkToDar( pNtk, 0, 1 );
2514  pNtkOld = pNtk;
2515  vLive = populateLivenessVector( pNtk, pAig );
2516  vFair = populateFairnessVector( pNtk, pAig );
2517  vAssertSafety = populateSafetyAssertionVector( pNtk, pAig );
2518  vAssumeSafety = populateSafetyAssumptionVector( pNtk, pAig );
2519  }
2520  pAigNew = LivenessToSafetyTransformation( IGNORE_SAFETY_KEEP_LIVENESS_MODE, pNtk, pAig, vLive, vFair, vAssertSafety, vAssumeSafety );
2521  if( Aig_ManRegNum(pAigNew) != 0 )
2522  printf("New circuit is produced ignoring safety outputs!\nOnly liveness and fairness outputs are considered.\nBiere's logic is created\n");
2523  }
2524  else if( c == 'h' )
2525  goto usage;
2526  else
2527  goto usage;
2528  }
2529 #endif
2530 
2531 #if 0
2532  Aig_ManPrintStats( pAigNew );
2533  printf("\nDetail statistics*************************************\n");
2534  printf("Number of true primary inputs = %d\n", Saig_ManPiNum( pAigNew ));
2535  printf("Number of true primary outputs = %d\n", Saig_ManPoNum( pAigNew ));
2536  printf("Number of true latch outputs = %d\n", Saig_ManCiNum( pAigNew ) - Saig_ManPiNum( pAigNew ));
2537  printf("Number of true latch inputs = %d\n", Saig_ManCoNum( pAigNew ) - Saig_ManPoNum( pAigNew ));
2538  printf("Numer of registers = %d\n", Saig_ManRegNum( pAigNew ) );
2539  printf("\n*******************************************************\n");
2540 #endif
2541 
2542  pNtkNew = Abc_NtkFromAigPhase( pAigNew );
2543  pNtkNew->pName = Abc_UtilStrsav( pAigNew->pName );
2544 
2545  if ( !Abc_NtkCheck( pNtkNew ) )
2546  fprintf( stdout, "Abc_NtkCreateCone(): Network check has failed.\n" );
2547 
2548  updateNewNetworkNameManager( pNtkNew, pAigNew, vecPiNames, vecLoNames );
2549  Abc_FrameSetCurrentNetwork( pAbc, pNtkNew );
2550 
2551 #if 0
2552 #ifndef DUPLICATE_CKT_DEBUG
2553  Saig_ManForEachPi( pAigNew, pObj, i )
2554  assert( strcmp( (char *)Vec_PtrEntry(vecPiNames, i), retrieveTruePiName( pNtk, pAig, pAigNew, pObj ) ) == 0 );
2555  //printf("Name of %d-th Pi = %s, %s\n", i, retrieveTruePiName( pNtk, pAig, pAigNew, pObj ), (char *)Vec_PtrEntry(vecPiNames, i) );
2556 
2557  Saig_ManForEachLo( pAigNew, pObj, i )
2558  assert( strcmp( (char *)Vec_PtrEntry(vecLoNames, i), retrieveLOName( pNtk, pAig, pAigNew, pObj, vLive, vFair ) ) == 0 );
2559 #endif
2560 #endif
2561 
2562  return 0;
2563 
2564 usage:
2565  fprintf( stdout, "usage: l3s [-1lsh]\n" );
2566  fprintf( stdout, "\t performs Armin Biere's live-to-safe transformation\n" );
2567  fprintf( stdout, "\t-1 : no shadow logic, presume all loops are self loops\n");
2568  fprintf( stdout, "\t-l : ignore liveness and fairness outputs\n");
2569  fprintf( stdout, "\t-s : ignore safety assertions and assumptions\n");
2570  fprintf( stdout, "\t-h : print command usage\n");
2571  return 1;
2572 }
#define IGNORE_SAFETY_KEEP_LIVENESS_ONE_LOOP_MODE
Definition: liveness.c:37
VOID_HACK exit()
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Vec_Ptr_t * vecLoNames
Definition: liveness.c:219
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Vec_Ptr_t * populateSafetyAssertionVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1179
static int Saig_ManPoNum(Aig_Man_t *p)
Definition: saig.h:74
Aig_Man_t * LivenessToSafetyTransformationOneStepLoop(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety)
Definition: liveness.c:843
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
ABC_DLL void Abc_FrameSetCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:396
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
Vec_Ptr_t * vecPiNames
Definition: liveness.c:218
Vec_Ptr_t * populateSafetyAssumptionVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1197
void Aig_ManPrintStats(Aig_Man_t *p)
Definition: aigMan.c:379
#define IGNORE_SAFETY_KEEP_LIVENESS_MODE
Definition: liveness.c:36
#define FULL_BIERE_MODE
Definition: liveness.c:34
Vec_Ptr_t * populateFairnessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1161
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
char * retrieveLOName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair)
Definition: liveness.c:137
#define FULL_BIERE_ONE_LOOP_MODE
Definition: liveness.c:38
Aig_Man_t * LivenessToSafetyTransformation(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety)
Definition: liveness.c:244
int strcmp()
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * LivenessToSafetyTransformationWithLTL(int mode, Abc_Ntk_t *pNtk, Aig_Man_t *p, Vec_Ptr_t *vLive, Vec_Ptr_t *vFair, Vec_Ptr_t *vAssertSafety, Vec_Ptr_t *vAssumeSafety, int *numLtlProcessed, Vec_Ptr_t *ltlBuffer)
Definition: liveness.c:1798
void updateNewNetworkNameManager(Abc_Ntk_t *pNtk, Aig_Man_t *pAig, Vec_Ptr_t *vPiNames, Vec_Ptr_t *vLoNames)
Definition: liveness.c:1215
#define Saig_ManForEachLo(p, pObj, i)
Definition: saig.h:96
static int Saig_ManCiNum(Aig_Man_t *p)
Definition: saig.h:75
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
#define IGNORE_LIVENESS_KEEP_SAFETY_MODE
Definition: liveness.c:35
static int Saig_ManPiNum(Aig_Man_t *p)
MACRO DEFINITIONS ///.
Definition: saig.h:73
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Vec_Ptr_t * populateLivenessVector(Abc_Ntk_t *pNtk, Aig_Man_t *pAig)
Definition: liveness.c:1143
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
Definition: mainFrame.c:330
#define assert(ex)
Definition: util_old.h:213
static int Saig_ManCoNum(Aig_Man_t *p)
Definition: saig.h:76
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
Definition: mainFrame.c:314
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
char * pName
Definition: abc.h:158
#define Saig_ManForEachPi(p, pObj, i)
Definition: saig.h:91
char * retrieveTruePiName(Abc_Ntk_t *pNtkOld, Aig_Man_t *pAigOld, Aig_Man_t *pAigNew, Aig_Obj_t *pObjPivot)
Definition: liveness.c:115
int Abc_CommandAbSec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20939 of file abc.c.

20940 {
20941  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
20942  int fDelete1, fDelete2;
20943  char ** pArgvNew;
20944  int nArgcNew;
20945  int fMiter, nFrames, fVerbose, c;
20946 
20947  extern int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVerbose );
20948 
20949  pNtk = Abc_FrameReadNtk(pAbc);
20950  // set defaults
20951  fMiter = 1;
20952  nFrames = 2;
20953  fVerbose = 0;
20955  while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
20956  {
20957  switch ( c )
20958  {
20959  case 'F':
20960  if ( globalUtilOptind >= argc )
20961  {
20962  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
20963  goto usage;
20964  }
20965  nFrames = atoi(argv[globalUtilOptind]);
20966  globalUtilOptind++;
20967  if ( nFrames < 0 )
20968  goto usage;
20969  break;
20970  case 'm':
20971  fMiter ^= 1;
20972  break;
20973  case 'v':
20974  fVerbose ^= 1;
20975  break;
20976  default:
20977  goto usage;
20978  }
20979  }
20980 
20981  if ( fMiter )
20982  {
20983 // pNtk = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
20984  if ( argc == globalUtilOptind + 1 )
20985  {
20986  Abc_Print( -1, "The miter cannot be given on the command line. Use \"read\".\n" );
20987  return 0;
20988  }
20989  if ( !Abc_NtkIsStrash(pNtk) )
20990  {
20991  Abc_Print( -1, "The miter should be structurally hashed. Use \"st\"\n" );
20992  return 0;
20993  }
20994  if ( Abc_NtkDarAbSec( pNtk, NULL, nFrames, fVerbose ) == 1 )
20995  pAbc->Status = 1;
20996  else
20997  pAbc->Status = -1;
20998  }
20999  else
21000  {
21001  pArgvNew = argv + globalUtilOptind;
21002  nArgcNew = argc - globalUtilOptind;
21003  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
21004  return 1;
21005  if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
21006  {
21007  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
21008  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
21009  Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
21010  return 0;
21011  }
21012  // perform verification
21013  if ( Abc_NtkDarAbSec( pNtk1, pNtk2, nFrames, fVerbose ) == 1 )
21014  pAbc->Status = 1;
21015  else
21016  pAbc->Status = -1;
21017  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
21018  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
21019  }
21020  return 0;
21021 
21022 usage:
21023  Abc_Print( -2, "usage: absec [-F num] [-mv] <file1> <file2>\n" );
21024  Abc_Print( -2, "\t performs SEC by applying CEC to several timeframes\n" );
21025  Abc_Print( -2, "\t-F num : the total number of timeframes to use [default = %d]\n", nFrames );
21026  Abc_Print( -2, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
21027  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
21028  Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
21029  Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
21030  Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
21031  Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
21032  return 1;
21033 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_NtkDarAbSec(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nFrames, int fVerbose)
Definition: abcDar.c:3043
int Abc_CommandAddBuffs ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5270 of file abc.c.

5271 {
5272  extern Abc_Ntk_t * Abc_NtkAddBuffs( Abc_Ntk_t * pNtk, int fDirect, int fReverse, int nImprove, int fVerbose );
5273  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
5274  Abc_Ntk_t * pNtkRes;
5275  int fDirect;
5276  int fReverse;
5277  int nImprove;
5278  int c, fVerbose;
5279 
5280  fDirect = 0;
5281  fReverse = 0;
5282  nImprove = 1000;
5283  fVerbose = 0;
5285  while ( ( c = Extra_UtilGetopt( argc, argv, "Idrvh" ) ) != EOF )
5286  {
5287  switch ( c )
5288  {
5289  case 'I':
5290  if ( globalUtilOptind >= argc )
5291  {
5292  Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
5293  goto usage;
5294  }
5295  nImprove = atoi(argv[globalUtilOptind]);
5296  globalUtilOptind++;
5297  if ( nImprove < 0 )
5298  goto usage;
5299  break;
5300  case 'd':
5301  fDirect ^= 1;
5302  break;
5303  case 'r':
5304  fReverse ^= 1;
5305  break;
5306  case 'v':
5307  fVerbose ^= 1;
5308  break;
5309  case 'h':
5310  goto usage;
5311  default:
5312  goto usage;
5313  }
5314  }
5315 
5316  if ( pNtk == NULL )
5317  {
5318  Abc_Print( -1, "Empty network.\n" );
5319  return 1;
5320  }
5321  if ( !Abc_NtkIsLogic(pNtk) )
5322  {
5323  Abc_Print( -1, "This command can only be applied to a logic network.\n" );
5324  return 1;
5325  }
5326 
5327  // modify the current network
5328  pNtkRes = Abc_NtkAddBuffs( pNtk, fDirect, fReverse, nImprove, fVerbose );
5329  if ( pNtkRes == NULL )
5330  {
5331  Abc_Print( -1, "The command has failed.\n" );
5332  return 1;
5333  }
5334  // replace the current network
5335  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
5336  return 0;
5337 
5338 usage:
5339  Abc_Print( -2, "usage: addbuffs [-I num] [-drvh]\n" );
5340  Abc_Print( -2, "\t adds buffers to create balanced CI/CO paths\n" );
5341  Abc_Print( -2, "\t-I <num> : the number of refinement iterations [default = %d]\n", nImprove );
5342  Abc_Print( -2, "\t-d : toggle using only CI-to-CO levelized order [default = %s]\n", fDirect? "yes": "no" );
5343  Abc_Print( -2, "\t-r : toggle using only CO-to-C1 levelized order [default = %s]\n", fReverse? "yes": "no" );
5344  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
5345  Abc_Print( -2, "\t-h : print the command usage\n");
5346  return 1;
5347 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkAddBuffs(Abc_Ntk_t *pNtkInit, int fDirect, int fReverse, int nImprove, int fVerbose)
Definition: abcUtil.c:2416
int Abc_CommandAddPi ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7448 of file abc.c.

7449 {
7450  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes;
7451  int c;
7452 
7453  // set defaults
7455  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
7456  {
7457  switch ( c )
7458  {
7459  case 'h':
7460  default:
7461  goto usage;
7462  }
7463  }
7464 
7465  if ( pNtk == NULL )
7466  {
7467  Abc_Print( -1, "Empty network.\n" );
7468  return 1;
7469  }
7470 
7471  // get the new network
7472  pNtkRes = Abc_NtkDup( pNtk );
7473  if ( Abc_NtkPiNum(pNtkRes) == 0 )
7474  {
7475  Abc_Obj_t * pObj = Abc_NtkCreatePi( pNtkRes );
7476  Abc_ObjAssignName( pObj, "dummy_pi", NULL );
7477  Abc_NtkOrderCisCos( pNtkRes );
7478  }
7479  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7480  return 0;
7481 
7482 usage:
7483  Abc_Print( -2, "usage: addpi [-h]\n" );
7484  Abc_Print( -2, "\t if the network has no PIs, add one dummy PI\n" );
7485  Abc_Print( -2, "\t-h : print the command usage\n");
7486  return 1;
7487 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static Abc_Obj_t * Abc_NtkCreatePi(Abc_Ntk_t *pNtk)
Definition: abc.h:303
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL void Abc_NtkOrderCisCos(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:71
int Abc_CommandAig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7991 of file abc.c.

7992 {
7993  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
7994  int c;
7995 
7996  // set defaults
7998  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
7999  {
8000  switch ( c )
8001  {
8002  case 'h':
8003  goto usage;
8004  default:
8005  goto usage;
8006  }
8007  }
8008  if ( pNtk == NULL )
8009  {
8010  Abc_Print( -1, "Empty network.\n" );
8011  return 1;
8012  }
8013  if ( !Abc_NtkIsLogic(pNtk) )
8014  {
8015  Abc_Print( -1, "Converting to AIG is possible only for logic networks.\n" );
8016  return 1;
8017  }
8018  if ( Abc_NtkIsAigLogic(pNtk) )
8019  {
8020  Abc_Print( -1, "The logic network is already in the AIG form.\n" );
8021  return 0;
8022  }
8023  if ( !Abc_NtkToAig(pNtk) )
8024  {
8025  Abc_Print( -1, "Converting to AIG has failed.\n" );
8026  return 1;
8027  }
8028  return 0;
8029 
8030 usage:
8031  Abc_Print( -2, "usage: aig [-h]\n" );
8032  Abc_Print( -2, "\t converts node functions to AIG\n" );
8033  Abc_Print( -2, "\t-h : print the command usage\n");
8034  return 1;
8035 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static int Abc_NtkIsAigLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:266
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
int Abc_CommandAmap ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14539 of file abc.c.

14540 {
14541  Amap_Par_t Pars, * pPars = &Pars;
14542  Abc_Ntk_t * pNtk, * pNtkRes;
14543  int fSweep;
14544  int c;
14545  extern Abc_Ntk_t * Abc_NtkDarAmap( Abc_Ntk_t * pNtk, Amap_Par_t * pPars );
14546  extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
14547 
14548  pNtk = Abc_FrameReadNtk(pAbc);
14549  // set defaults
14550  fSweep = 0;
14551  Amap_ManSetDefaultParams( pPars );
14553  while ( ( c = Extra_UtilGetopt( argc, argv, "FACEQmxisvh" ) ) != EOF )
14554  {
14555  switch ( c )
14556  {
14557  case 'F':
14558  if ( globalUtilOptind >= argc )
14559  {
14560  Abc_Print( -1, "Command line switch \"-F\" should be followed by a floating point number.\n" );
14561  goto usage;
14562  }
14563  pPars->nIterFlow = atoi(argv[globalUtilOptind]);
14564  globalUtilOptind++;
14565  if ( pPars->nIterFlow < 0 )
14566  goto usage;
14567  break;
14568  case 'A':
14569  if ( globalUtilOptind >= argc )
14570  {
14571  Abc_Print( -1, "Command line switch \"-A\" should be followed by a floating point number.\n" );
14572  goto usage;
14573  }
14574  pPars->nIterArea = atoi(argv[globalUtilOptind]);
14575  globalUtilOptind++;
14576  if ( pPars->nIterArea < 0 )
14577  goto usage;
14578  break;
14579  case 'C':
14580  if ( globalUtilOptind >= argc )
14581  {
14582  Abc_Print( -1, "Command line switch \"-C\" should be followed by a floating point number.\n" );
14583  goto usage;
14584  }
14585  pPars->nCutsMax = atoi(argv[globalUtilOptind]);
14586  globalUtilOptind++;
14587  if ( pPars->nCutsMax < 0 )
14588  goto usage;
14589  break;
14590  case 'E':
14591  if ( globalUtilOptind >= argc )
14592  {
14593  Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
14594  goto usage;
14595  }
14596  pPars->fEpsilon = (float)atof(argv[globalUtilOptind]);
14597  globalUtilOptind++;
14598  if ( pPars->fEpsilon < 0.0 || pPars->fEpsilon > 1.0 )
14599  goto usage;
14600  break;
14601  case 'Q':
14602  if ( globalUtilOptind >= argc )
14603  {
14604  Abc_Print( -1, "Command line switch \"-Q\" should be followed by a floating point number.\n" );
14605  goto usage;
14606  }
14607  pPars->fADratio = (float)atof(argv[globalUtilOptind]);
14608  globalUtilOptind++;
14609  if ( pPars->fADratio < 0.0 )
14610  goto usage;
14611  break;
14612  case 'm':
14613  pPars->fUseMuxes ^= 1;
14614  break;
14615  case 'x':
14616  pPars->fUseXors ^= 1;
14617  break;
14618  case 'i':
14619  pPars->fFreeInvs ^= 1;
14620  break;
14621  case 's':
14622  fSweep ^= 1;
14623  break;
14624  case 'v':
14625  pPars->fVerbose ^= 1;
14626  break;
14627  case 'h':
14628  goto usage;
14629  default:
14630  goto usage;
14631  }
14632  }
14633 
14634  if ( pNtk == NULL )
14635  {
14636  Abc_Print( -1, "Empty network.\n" );
14637  return 1;
14638  }
14639 
14640  if ( !Abc_NtkIsStrash(pNtk) )
14641  {
14642  pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
14643  if ( pNtk == NULL )
14644  {
14645  Abc_Print( -1, "Strashing before mapping has failed.\n" );
14646  return 1;
14647  }
14648  pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
14649  Abc_NtkDelete( pNtkRes );
14650  if ( pNtk == NULL )
14651  {
14652  Abc_Print( -1, "Balancing before mapping has failed.\n" );
14653  return 1;
14654  }
14655  Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
14656  // get the new network
14657  pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
14658  if ( pNtkRes == NULL )
14659  {
14660  Abc_NtkDelete( pNtk );
14661  Abc_Print( -1, "Mapping has failed.\n" );
14662  return 1;
14663  }
14664  Abc_NtkDelete( pNtk );
14665  }
14666  else
14667  {
14668  // get the new network
14669  pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
14670  if ( pNtkRes == NULL )
14671  {
14672  Abc_Print( -1, "Mapping has failed.\n" );
14673  return 1;
14674  }
14675  }
14676 
14677  if ( fSweep )
14678  {
14679  Abc_NtkFraigSweep( pNtkRes, 0, 0, 0, 0 );
14680  if ( Abc_NtkHasMapping(pNtkRes) )
14681  {
14682  pNtkRes = Abc_NtkDupDfs( pNtk = pNtkRes );
14683  Abc_NtkDelete( pNtk );
14684  }
14685  }
14686  // replace the current network
14687  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
14688  return 0;
14689 
14690 usage:
14691  Abc_Print( -2, "usage: amap [-FAC <num>] [-EQ <float>] [-mxisvh]\n" );
14692  Abc_Print( -2, "\t performs standard cell mapping of the current network\n" );
14693  Abc_Print( -2, "\t-F num : the number of iterations of area flow [default = %d]\n", pPars->nIterFlow );
14694  Abc_Print( -2, "\t-A num : the number of iterations of exact area [default = %d]\n", pPars->nIterArea );
14695  Abc_Print( -2, "\t-C num : the maximum number of cuts at a node [default = %d]\n", pPars->nCutsMax );
14696  Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->fEpsilon );
14697  Abc_Print( -2, "\t-Q float : area/delay preference ratio [default = %.2f (area-only)] \n", pPars->fADratio );
14698  Abc_Print( -2, "\t-m : toggles using MUX matching [default = %s]\n", pPars->fUseMuxes? "yes": "no" );
14699  Abc_Print( -2, "\t-x : toggles using XOR matching [default = %s]\n", pPars->fUseXors? "yes": "no" );
14700  Abc_Print( -2, "\t-i : toggles assuming inverters are free [default = %s]\n", pPars->fFreeInvs? "yes": "no" );
14701  Abc_Print( -2, "\t-s : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
14702  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
14703  Abc_Print( -2, "\t-h : print the command usage\n");
14704  return 1;
14705 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Amap_ManSetDefaultParams(Amap_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: amapCore.c:46
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
Definition: abc.h:256
Abc_Ntk_t * Abc_NtkDarAmap(Abc_Ntk_t *pNtk, Amap_Par_t *pPars)
Definition: abcDar.c:4415
int nIterArea
Definition: amap.h:48
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
int fVerbose
Definition: amap.h:55
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Abc_NtkFraigSweep(Abc_Ntk_t *pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcSweep.c:60
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_NtkDupDfs(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:476
double atof()
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int nIterFlow
Definition: amap.h:47
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fUseXors
Definition: amap.h:51
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition: abcBalance.c:53
int nCutsMax
Definition: amap.h:49
int fUseMuxes
Definition: amap.h:50
int fFreeInvs
Definition: amap.h:52
float fEpsilon
Definition: amap.h:53
float fADratio
Definition: amap.h:54
int Abc_CommandAndPos ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7058 of file abc.c.

7059 {
7060  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
7061  int fComb = 0;
7062  int c;
7063 
7064  // set defaults
7066  while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
7067  {
7068  switch ( c )
7069  {
7070  case 'c':
7071  fComb ^= 1;
7072  break;
7073  default:
7074  goto usage;
7075  }
7076  }
7077 
7078  if ( pNtk == NULL )
7079  {
7080  Abc_Print( -1, "Empty network.\n" );
7081  return 1;
7082  }
7083 
7084  if ( !Abc_NtkIsStrash(pNtk) )
7085  {
7086  Abc_Print( -1, "The network is not strashed.\n" );
7087  return 1;
7088  }
7089 
7090  if ( Abc_NtkPoNum(pNtk) == 1 )
7091  {
7092  Abc_Print( -1, "The network already has one PO.\n" );
7093  return 1;
7094  }
7095 
7096  if ( Abc_NtkLatchNum(pNtk) )
7097  {
7098  Abc_Print( -1, "The miter has latches. ORing is not performed.\n" );
7099  return 1;
7100  }
7101 
7102  // get the new network
7103  if ( !Abc_NtkCombinePos( pNtk, 1, 0 ) )
7104  {
7105  Abc_Print( -1, "ANDing the POs has failed.\n" );
7106  return 1;
7107  }
7108  // replace the current network
7109 // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7110  return 0;
7111 
7112 usage:
7113  Abc_Print( -2, "usage: andpos [-h]\n" );
7114  Abc_Print( -2, "\t creates single-output miter by ANDing the POs of the current network\n" );
7115 // Abc_Print( -2, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
7116  Abc_Print( -2, "\t-h : print the command usage\n");
7117  return 1;
7118 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
ABC_DLL int Abc_NtkCombinePos(Abc_Ntk_t *pNtk, int fAnd, int fXor)
Definition: abcMiter.c:1151
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandAppend ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7500 of file abc.c.

7501 {
7502  Abc_Ntk_t * pNtk, * pNtk2;
7503  char * FileName;
7504  int fComb = 0;
7505  int c;
7506  pNtk = Abc_FrameReadNtk(pAbc);
7507 
7508  // set defaults
7510  while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
7511  {
7512  switch ( c )
7513  {
7514  case 'c':
7515  fComb ^= 1;
7516  break;
7517  default:
7518  goto usage;
7519  }
7520  }
7521 
7522  // get the second network
7523  if ( argc != globalUtilOptind + 1 )
7524  {
7525  Abc_Print( -1, "The network to append is not given.\n" );
7526  return 1;
7527  }
7528 
7529  if ( !Abc_NtkIsStrash(pNtk) )
7530  {
7531  Abc_Print( -1, "The base network should be strashed for the appending to work.\n" );
7532  return 1;
7533  }
7534 
7535  // read the second network
7536  FileName = argv[globalUtilOptind];
7537  pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
7538  if ( pNtk2 == NULL )
7539  return 1;
7540 
7541  // check if the second network is combinational
7542  if ( Abc_NtkLatchNum(pNtk2) )
7543  {
7544  Abc_NtkDelete( pNtk2 );
7545  Abc_Print( -1, "The second network has latches. Appending does not work for such networks.\n" );
7546  return 0;
7547  }
7548 
7549  // get the new network
7550  if ( !Abc_NtkAppend( pNtk, pNtk2, 1 ) )
7551  {
7552  Abc_NtkDelete( pNtk2 );
7553  Abc_Print( -1, "Appending the networks failed.\n" );
7554  return 1;
7555  }
7556  Abc_NtkDelete( pNtk2 );
7557  // sweep dangling logic
7558  Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
7559  // replace the current network
7560 // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7561  return 0;
7562 
7563 usage:
7564  Abc_Print( -2, "usage: append [-h] <file>\n" );
7565  Abc_Print( -2, "\t appends a combinational network on top of the current network\n" );
7566 // Abc_Print( -2, "\t-c : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
7567  Abc_Print( -2, "\t-h : print the command usage\n");
7568  Abc_Print( -2, "\t<file> : file name with the second network\n");
7569  return 1;
7570 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
void * pManFunc
Definition: abc.h:191
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition: abcAig.c:194
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int Abc_NtkAppend(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fAddPos)
Definition: abcStrash.c:320
int Abc_CommandAttach ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14773 of file abc.c.

14774 {
14775  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
14776  int c;
14777  // set defaults
14779  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
14780  {
14781  switch ( c )
14782  {
14783  case 'h':
14784  goto usage;
14785  default:
14786  goto usage;
14787  }
14788  }
14789 
14790  if ( pNtk == NULL )
14791  {
14792  Abc_Print( -1, "Empty network.\n" );
14793  return 1;
14794  }
14795 
14796  if ( !Abc_NtkIsSopLogic(pNtk) )
14797  {
14798  Abc_Print( -1, "Can only attach gates if the nodes have SOP representations.\n" );
14799  return 1;
14800  }
14801 
14802  // get the new network
14803  if ( !Abc_NtkAttach( pNtk ) )
14804  {
14805  Abc_Print( -1, "Attaching gates has failed.\n" );
14806  return 1;
14807  }
14808  return 0;
14809 
14810 usage:
14811  Abc_Print( -2, "usage: attach [-h]\n" );
14812  Abc_Print( -2, "\t replaces the SOP functions by the gates from the library\n" );
14813  Abc_Print( -2, "\t-h : print the command usage\n");
14814  return 1;
14815 }
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int Abc_NtkAttach(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcAttach.c:60
int Abc_CommandBackup ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13222 of file abc.c.

13223 {
13224  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
13225  int c;
13226  // set defaults
13228  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
13229  {
13230  switch ( c )
13231  {
13232  case 'h':
13233  goto usage;
13234  default:
13235  goto usage;
13236  }
13237  }
13238 
13239  if ( pNtk == NULL )
13240  {
13241  Abc_Print( -1, "Empty network.\n" );
13242  return 1;
13243  }
13244  if ( pAbc->pNtkBackup )
13245  Abc_NtkDelete( pAbc->pNtkBackup );
13246  pAbc->pNtkBackup = Abc_NtkDup( pNtk );
13247  return 0;
13248 
13249 usage:
13250  Abc_Print( -2, "usage: backup [-h]\n" );
13251  Abc_Print( -2, "\t backs up the current network\n" );
13252  Abc_Print( -2, "\t-h : print the command usage\n");
13253  return 1;
13254 }
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandBalance ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3145 of file abc.c.

3146 {
3147  Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
3148  int c;
3149  int fDuplicate;
3150  int fSelective;
3151  int fUpdateLevel;
3152  int fExor;
3153  int fVerbose;
3154  pNtk = Abc_FrameReadNtk(pAbc);
3155 
3156  // set defaults
3157  fDuplicate = 0;
3158  fSelective = 0;
3159  fUpdateLevel = 1;
3160  fExor = 0;
3161  fVerbose = 0;
3163  while ( ( c = Extra_UtilGetopt( argc, argv, "ldsxvh" ) ) != EOF )
3164  {
3165  switch ( c )
3166  {
3167  case 'l':
3168  fUpdateLevel ^= 1;
3169  break;
3170  case 'd':
3171  fDuplicate ^= 1;
3172  break;
3173  case 's':
3174  fSelective ^= 1;
3175  break;
3176  case 'x':
3177  fExor ^= 1;
3178  break;
3179  case 'v':
3180  fVerbose ^= 1;
3181  break;
3182  case 'h':
3183  goto usage;
3184  default:
3185  goto usage;
3186  }
3187  }
3188 
3189  if ( pNtk == NULL )
3190  {
3191  Abc_Print( -1, "Empty network.\n" );
3192  return 1;
3193  }
3194  // get the new network
3195  if ( Abc_NtkIsStrash(pNtk) )
3196  {
3197  if ( fExor )
3198  pNtkRes = Abc_NtkBalanceExor( pNtk, fUpdateLevel, fVerbose );
3199  else
3200  pNtkRes = Abc_NtkBalance( pNtk, fDuplicate, fSelective, fUpdateLevel );
3201  }
3202  else
3203  {
3204  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
3205  if ( pNtkTemp == NULL )
3206  {
3207  Abc_Print( -1, "Strashing before balancing has failed.\n" );
3208  return 1;
3209  }
3210  if ( fExor )
3211  pNtkRes = Abc_NtkBalanceExor( pNtkTemp, fUpdateLevel, fVerbose );
3212  else
3213  pNtkRes = Abc_NtkBalance( pNtkTemp, fDuplicate, fSelective, fUpdateLevel );
3214  Abc_NtkDelete( pNtkTemp );
3215  }
3216 
3217  // check if balancing worked
3218  if ( pNtkRes == NULL )
3219  {
3220  Abc_Print( -1, "Balancing has failed.\n" );
3221  return 1;
3222  }
3223  // replace the current network
3224  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
3225  return 0;
3226 
3227 usage:
3228  Abc_Print( -2, "usage: balance [-ldsxvh]\n" );
3229  Abc_Print( -2, "\t transforms the current network into a well-balanced AIG\n" );
3230  Abc_Print( -2, "\t-l : toggle minimizing the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
3231  Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
3232  Abc_Print( -2, "\t-s : toggle duplication on the critical paths [default = %s]\n", fSelective? "yes": "no" );
3233  Abc_Print( -2, "\t-x : toggle balancing multi-input EXORs [default = %s]\n", fExor? "yes": "no" );
3234  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
3235  Abc_Print( -2, "\t-h : print the command usage\n");
3236  return 1;
3237 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL Abc_Ntk_t * Abc_NtkBalanceExor(Abc_Ntk_t *pNtk, int fUpdateLevel, int fVerbose)
Definition: abcDar.c:3935
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition: abcBalance.c:53
int Abc_CommandBb2Wb ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10420 of file abc.c.

10421 {
10422  extern void Abc_NtkConvertBb2Wb( char * pFileNameIn, char * pFileNameOut, int fSeq, int fVerbose );
10423  int c;
10424  int fSeq;
10425  int fVerbose;
10426  // set defaults
10427  fSeq = 0;
10428  fVerbose = 0;
10430  while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
10431  {
10432  switch ( c )
10433  {
10434  case 's':
10435  fSeq ^= 1;
10436  break;
10437  case 'v':
10438  fVerbose ^= 1;
10439  break;
10440  default:
10441  goto usage;
10442  }
10443  }
10444  if ( argc != globalUtilOptind + 2 )
10445  {
10446  Abc_Print( -1, "Expecting two files names on the command line.\n" );
10447  goto usage;
10448  }
10449  Abc_NtkConvertBb2Wb( argv[globalUtilOptind], argv[globalUtilOptind+1], fSeq, fVerbose );
10450  return 0;
10451 
10452 usage:
10453  Abc_Print( -2, "usage: bb2wb [-svh] <file_in> <file_out>\n" );
10454  Abc_Print( -2, "\t replaces black boxes by white boxes with AND functions\n" );
10455  Abc_Print( -2, "\t (file names should have standard extensions, e.g. \"blif\")\n" );
10456  Abc_Print( -2, "\t-s : toggle using sequential white boxes [default = %s]\n", fSeq? "yes": "no" );
10457  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
10458  Abc_Print( -2, "\t-h : print the command usage\n");
10459  Abc_Print( -2, "\t<file_in> : input file with design containing black boxes\n");
10460  Abc_Print( -2, "\t<file_out> : output file with design containing white boxes\n");
10461  return 1;
10462 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NtkConvertBb2Wb(char *pFileNameIn, char *pFileNameOut, int fSeq, int fVerbose)
Definition: ioWriteBlif.c:742
int Abc_CommandBdd ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7929 of file abc.c.

7930 {
7931  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
7932  int fReorder = 1;
7933  int c;
7934 
7935  // set defaults
7937  while ( ( c = Extra_UtilGetopt( argc, argv, "rh" ) ) != EOF )
7938  {
7939  switch ( c )
7940  {
7941  case 'r':
7942  fReorder ^= 1;
7943  break;
7944  case 'h':
7945  goto usage;
7946  default:
7947  goto usage;
7948  }
7949  }
7950  if ( pNtk == NULL )
7951  {
7952  Abc_Print( -1, "Empty network.\n" );
7953  return 1;
7954  }
7955  if ( !Abc_NtkIsLogic(pNtk) )
7956  {
7957  Abc_Print( -1, "Converting to BDD is possible only for logic networks.\n" );
7958  return 1;
7959  }
7960  if ( Abc_NtkIsBddLogic(pNtk) )
7961  {
7962  Abc_Print( -1, "The logic network is already in the BDD form.\n" );
7963  return 0;
7964  }
7965  if ( !Abc_NtkToBdd(pNtk) )
7966  {
7967  Abc_Print( -1, "Converting to BDD has failed.\n" );
7968  return 1;
7969  }
7970  return 0;
7971 
7972 usage:
7973  Abc_Print( -2, "usage: bdd [-rh]\n" );
7974  Abc_Print( -2, "\t converts node functions to BDD\n" );
7975  Abc_Print( -2, "\t-r : toggles enabling dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
7976  Abc_Print( -2, "\t-h : print the command usage\n");
7977  return 1;
7978 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkToBdd(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1160
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandBidec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8106 of file abc.c.

8107 {
8108  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
8109  int c;
8110  int fVerbose;
8111  extern void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose );
8112 
8113  // set defaults
8114  fVerbose = 0;
8116  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
8117  {
8118  switch ( c )
8119  {
8120  case 'v':
8121  fVerbose ^= 1;
8122  break;
8123  case 'h':
8124  goto usage;
8125  default:
8126  goto usage;
8127  }
8128  }
8129 
8130  if ( pNtk == NULL )
8131  {
8132  Abc_Print( -1, "Empty network.\n" );
8133  return 1;
8134  }
8135 
8136  // get the new network
8137  if ( !Abc_NtkIsAigLogic(pNtk) )
8138  {
8139  Abc_Print( -1, "Bi-decomposition only works when node functions are AIGs (run \"aig\").\n" );
8140  return 1;
8141  }
8142  Abc_NtkBidecResyn( pNtk, fVerbose );
8143  return 0;
8144 
8145 usage:
8146  Abc_Print( -2, "usage: bidec [-vh]\n" );
8147  Abc_Print( -2, "\t applies bi-decomposition to local functions of the nodes\n" );
8148  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
8149  Abc_Print( -2, "\t-h : print the command usage\n");
8150  return 1;
8151 }
static int Abc_NtkIsAigLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:266
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkBidecResyn(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcBidec.c:110
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandBlockPo ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25121 of file abc.c.

25122 {
25123  Abc_Ntk_t * pNtk, * pNtkNew = NULL;
25124  Aig_Man_t * pAig;
25125  int c;
25126  int nCycles = 0;
25127  int fVerbose = 0;
25129  while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
25130  {
25131  switch ( c )
25132  {
25133  case 'F':
25134  if ( globalUtilOptind >= argc )
25135  {
25136  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
25137  goto usage;
25138  }
25139  nCycles = atoi(argv[globalUtilOptind]);
25140  globalUtilOptind++;
25141  if ( nCycles < 0 )
25142  goto usage;
25143  break;
25144  case 'v':
25145  fVerbose ^= 1;
25146  break;
25147  case 'h':
25148  goto usage;
25149  default:
25150  Abc_Print( -2, "Unknown switch.\n");
25151  goto usage;
25152  }
25153  }
25154 
25155  // check the main AIG
25156  pNtk = Abc_FrameReadNtk(pAbc);
25157  if ( pNtk == NULL )
25158  {
25159  Abc_Print( 1, "Main AIG: There is no current network.\n");
25160  return 0;
25161  }
25162  if ( !Abc_NtkIsStrash(pNtk) )
25163  {
25164  Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
25165  return 0;
25166  }
25167  if ( nCycles == 0 )
25168  {
25169  Abc_Print( 1, "The number of time frame is 0. The circuit is left unchanged.\n" );
25170  return 0;
25171  }
25172 
25173  // transform
25174  pAig = Abc_NtkToDar( pNtk, 0, 1 );
25175  Saig_ManBlockPo( pAig, nCycles );
25176  pNtkNew = Abc_NtkFromAigPhase( pAig );
25177  Aig_ManStop( pAig );
25178  // transfer the name
25179  pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
25180  pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
25181  // replace the current network
25182  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
25183  return 0;
25184 
25185 usage:
25186  Abc_Print( -2, "usage: blockpo [-F num] [-fvh]\n" );
25187  Abc_Print( -2, "\t forces the miter outputs to be \"true\" in the first F frames\n" );
25188  Abc_Print( -2, "\t-F num : the number of time frames [default = %d]\n", nCycles );
25189  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
25190  Abc_Print( -2, "\t-h : print the command usage\n");
25191  return 1;
25192 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Saig_ManBlockPo(Aig_Man_t *pAig, int nCycles)
Definition: saigDual.c:209
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
char * pSpec
Definition: abc.h:159
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
char * pName
Definition: abc.h:158
int Abc_CommandBm ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23837 of file abc.c.

23838 {
23839  FILE * pOut, * pErr;
23840  Abc_Ntk_t *pNtk, *pNtk1, *pNtk2;
23841  int fDelete1, fDelete2;
23842  char ** pArgvNew;
23843  int c, nArgcNew;
23844  int p_equivalence = FALSE;
23845  extern void bmGateWay( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int p_equivalence );
23846 
23847  pNtk = Abc_FrameReadNtk(pAbc);
23848  pOut = Abc_FrameReadOut(pAbc);
23849  pErr = Abc_FrameReadErr(pAbc);
23850 
23852  while ( ( c = Extra_UtilGetopt( argc, argv, "Ph" ) ) != EOF )
23853  {
23854  switch ( c )
23855  {
23856  case 'h':
23857  goto usage;
23858  case 'P':
23859  p_equivalence = 1;
23860  break;
23861  default:
23862  Abc_Print( -2, "Unknown switch.\n");
23863  goto usage;
23864  }
23865  }
23866 
23867  pArgvNew = argv + globalUtilOptind;
23868  nArgcNew = argc - globalUtilOptind;
23869  if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew , &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
23870  return 1;
23871 
23872  if( (unsigned)Abc_NtkPiNum(pNtk1) != (unsigned)Abc_NtkPiNum(pNtk2) || (unsigned)Abc_NtkPoNum(pNtk1) != (unsigned)Abc_NtkPoNum(pNtk2) )
23873  {
23874  Abc_Print( -2, "Mismatch in the number of inputs or outputs\n");
23875  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
23876  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
23877  return 1;
23878  }
23879 
23880  bmGateWay( pNtk1, pNtk2, p_equivalence );
23881 
23882  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
23883  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
23884  return 0;
23885 
23886 usage:
23887  Abc_Print( -2, "usage: bm [-P] <file1> <file2>\n" );
23888  Abc_Print( -2, "\t performs Boolean matching (P-equivalence & PP-equivalence)\n" );
23889  Abc_Print( -2, "\t for equivalent circuits, I/O matches are printed in IOmatch.txt\n" );
23890  Abc_Print( -2, "\t-P : performs P-equivalnce checking\n");
23891  Abc_Print( -2, "\t default is PP-equivalence checking (when -P is not provided)\n" );
23892  Abc_Print( -2, "\t-h : print the command usage\n");
23893  Abc_Print( -2, "\tfile1 : the file with the first network\n");
23894  Abc_Print( -2, "\tfile2 : the file with the second network\n");
23895 
23896  Abc_Print( -2, "\t \n" );
23897  Abc_Print( -2, "\t This command was contributed by Hadi Katebi from U Michigan.\n" );
23898  Abc_Print( -2, "\t The paper describing the method: H. Katebi and I. L. Markov.\n" );
23899  Abc_Print( -2, "\t \"Large-scale Boolean matching\". Proc. DATE 2010. \n" );
23900  Abc_Print( -2, "\t http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
23901 // Abc_Print( -2, "\t \n" );
23902 
23903  return 1;
23904 }
#define FALSE
Definition: cudd.h:91
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
Definition: mainFrame.c:330
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
Definition: mainFrame.c:314
void bmGateWay(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int p_equivalence)
Definition: abcBm.c:1777
int Abc_CommandBm2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23917 of file abc.c.

23918 {
23919  FILE * pOut, * pErr;
23920  Abc_Ntk_t *pNtk, *pNtk1, *pNtk2;
23921  int fDelete1, fDelete2;
23922  Abc_Obj_t * pObj;
23923  char ** pArgvNew;
23924  int c, nArgcNew, i;
23925 
23926  extern void saucyGateWay( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo, FILE * gFile, int fBooleanMatching,
23927  int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree);
23928 
23929  pNtk = Abc_FrameReadNtk(pAbc);
23930  pOut = Abc_FrameReadOut(pAbc);
23931  pErr = Abc_FrameReadErr(pAbc);
23932 
23934  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
23935  {
23936  switch ( c )
23937  {
23938  case 'h':
23939  goto usage;
23940  default:
23941  Abc_Print( -2, "Unknown switch.\n");
23942  goto usage;
23943  }
23944  }
23945 
23946  pArgvNew = argv + globalUtilOptind;
23947  nArgcNew = argc - globalUtilOptind;
23948  if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew , &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
23949  return 1;
23950 
23951  if( (unsigned)Abc_NtkPiNum(pNtk1) != (unsigned)Abc_NtkPiNum(pNtk2) ||
23952  (unsigned)Abc_NtkPoNum(pNtk1) != (unsigned)Abc_NtkPoNum(pNtk2) )
23953  {
23954  Abc_Print( -2, "Mismatch in the number of inputs or outputs\n");
23955  Abc_Print( -2, "*** Networks are NOT equivalent ***\n");
23956  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
23957  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
23958  return 1;
23959  }
23960 
23961  Abc_NtkPermute(pNtk2, 1, 1, 0, NULL );
23962  Abc_NtkShortNames(pNtk2);
23963 
23964  Abc_NtkForEachCi( pNtk1, pObj, i ) {
23965  char * newName = Abc_ObjNamePrefix( pObj, "N1:" );
23966  Nm_ManDeleteIdName( pNtk1->pManName, pObj->Id);
23967  Abc_ObjAssignName( pObj, newName, NULL );
23968  }
23969  Abc_NtkForEachCo( pNtk1, pObj, i ) {
23970  char * newName = Abc_ObjNamePrefix( pObj, "N1:" );
23971  Nm_ManDeleteIdName( pNtk1->pManName, pObj->Id);
23972  Abc_ObjAssignName( pObj, newName, NULL );
23973  }
23974 
23975  Abc_NtkForEachCi( pNtk2, pObj, i ) {
23976  char * newName = Abc_ObjNamePrefix( pObj, "N2:" );
23977  Nm_ManDeleteIdName( pNtk2->pManName, pObj->Id);
23978  Abc_ObjAssignName( pObj, newName, NULL );
23979  }
23980  Abc_NtkForEachCo( pNtk2, pObj, i ) {
23981  char * newName = Abc_ObjNamePrefix( pObj, "N2:" );
23982  Nm_ManDeleteIdName( pNtk2->pManName, pObj->Id);
23983  Abc_ObjAssignName( pObj, newName, NULL );
23984  }
23985 
23986  Abc_NtkAppend( pNtk1, pNtk2, 1 );
23987  saucyGateWay( pNtk1, NULL, NULL, 1, 0, 0, 0, 0, 0);
23988 
23989  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
23990  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
23991  return 0;
23992 
23993 usage:
23994  Abc_Print( -2, "usage: bm2 <file1> <file2>\n" );
23995  Abc_Print( -2, "\t performs Boolean matching (PP-equivalence)\n" );
23996  Abc_Print( -2, "\t for equivalent circuits, permutation that maps one circuit\n" );
23997  Abc_Print( -2, "\t to another is printed to standard output (PIs and POs of the\n" );
23998  Abc_Print( -2, "\t first network have prefix \"N1:\", while PIs and POs of the\n" );
23999  Abc_Print( -2, "\t second network have prefix \"N2:\")\n" );
24000  Abc_Print( -2, "\t-h : print the command usage\n");
24001  Abc_Print( -2, "\tfile1 : the file with the first network\n");
24002  Abc_Print( -2, "\tfile2 : the file with the second network\n");
24003 
24004  Abc_Print( -2, "\t \n" );
24005  Abc_Print( -2, "\t This command was contributed by Hadi Katebi from U Michigan.\n" );
24006  Abc_Print( -2, "\t The paper describing the method: H. Katebi, K. Sakallah and\n");
24007  Abc_Print( -2, "\t I. L. Markov.\n" );
24008  Abc_Print( -2, "\t \"Generalized Boolean Symmetries Through Nested Partition\n");
24009  Abc_Print( -2, "\t Refinement\". Proc. ICCAD 2013. \n" );
24010  //Abc_Print( -2, "\t http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
24011 // Abc_Print( -2, "\t \n" );
24012 
24013  return 1;
24014 }
void Nm_ManDeleteIdName(Nm_Man_t *p, int ObjId)
Definition: nmApi.c:149
Nm_Man_t * pManName
Definition: abc.h:160
void saucyGateWay(Abc_Ntk_t *pNtkOrig, Abc_Obj_t *pNodePo, FILE *gFile, int fBooleanMatching, int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree)
Definition: abcSaucy.c:3246
ABC_DLL void Abc_NtkShortNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:490
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
Definition: abcNames.c:68
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
ABC_DLL char * Abc_ObjNamePrefix(Abc_Obj_t *pObj, char *pPrefix)
Definition: abcNames.c:85
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Id
Definition: abc.h:132
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
Definition: mainFrame.c:330
ABC_DLL void Abc_NtkPermute(Abc_Ntk_t *pNtk, int fInputs, int fOutputs, int fFlops, char *pFlopPermFile)
Definition: abcNtk.c:1906
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
Definition: mainFrame.c:314
ABC_DLL int Abc_NtkAppend(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fAddPos)
Definition: abcStrash.c:320
int Abc_CommandBmc ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21991 of file abc.c.

21992 {
21993  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
21994  int c;
21995  int nFrames;
21996  int nSizeMax;
21997  int nBTLimit;
21998  int nBTLimitAll;
21999  int nNodeDelta;
22000  int fRewrite;
22001  int fNewAlgo;
22002  int nCofFanLit;
22003  int fVerbose;
22004  int iFrames;
22005  char * pLogFileName = NULL;
22006 
22007  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 fOrDecomp, int nCofFanLit, int fVerbose, int * piFrames );
22008  // set defaults
22009  nFrames = 20;
22010  nSizeMax = 100000;
22011  nBTLimit = 0;
22012  nBTLimitAll = 0;
22013  nNodeDelta = 1000;
22014  fRewrite = 0;
22015  fNewAlgo = 1;
22016  nCofFanLit = 0;
22017  fVerbose = 0;
22019  while ( ( c = Extra_UtilGetopt( argc, argv, "FNCGDLrvh" ) ) != EOF )
22020  {
22021  switch ( c )
22022  {
22023  case 'F':
22024  if ( globalUtilOptind >= argc )
22025  {
22026  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
22027  goto usage;
22028  }
22029  nFrames = atoi(argv[globalUtilOptind]);
22030  globalUtilOptind++;
22031  if ( nFrames < 0 )
22032  goto usage;
22033  break;
22034  case 'N':
22035  if ( globalUtilOptind >= argc )
22036  {
22037  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
22038  goto usage;
22039  }
22040  nSizeMax = atoi(argv[globalUtilOptind]);
22041  globalUtilOptind++;
22042  if ( nSizeMax < 0 )
22043  goto usage;
22044  break;
22045  case 'C':
22046  if ( globalUtilOptind >= argc )
22047  {
22048  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
22049  goto usage;
22050  }
22051  nBTLimit = atoi(argv[globalUtilOptind]);
22052  globalUtilOptind++;
22053  if ( nBTLimit < 0 )
22054  goto usage;
22055  break;
22056  case 'G':
22057  if ( globalUtilOptind >= argc )
22058  {
22059  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
22060  goto usage;
22061  }
22062  nBTLimitAll = atoi(argv[globalUtilOptind]);
22063  globalUtilOptind++;
22064  if ( nBTLimitAll < 0 )
22065  goto usage;
22066  break;
22067  case 'D':
22068  if ( globalUtilOptind >= argc )
22069  {
22070  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
22071  goto usage;
22072  }
22073  nNodeDelta = atoi(argv[globalUtilOptind]);
22074  globalUtilOptind++;
22075  if ( nNodeDelta < 0 )
22076  goto usage;
22077  break;
22078 /*
22079  case 'L':
22080  if ( globalUtilOptind >= argc )
22081  {
22082  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
22083  goto usage;
22084  }
22085  nCofFanLit = atoi(argv[globalUtilOptind]);
22086  globalUtilOptind++;
22087  if ( nCofFanLit < 0 )
22088  goto usage;
22089  break;
22090 */
22091  case 'L':
22092  if ( globalUtilOptind >= argc )
22093  {
22094  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
22095  goto usage;
22096  }
22097  pLogFileName = argv[globalUtilOptind];
22098  globalUtilOptind++;
22099  break;
22100  case 'r':
22101  fRewrite ^= 1;
22102  break;
22103  case 'a':
22104  fNewAlgo ^= 1;
22105  break;
22106  case 'v':
22107  fVerbose ^= 1;
22108  break;
22109  case 'h':
22110  goto usage;
22111  default:
22112  goto usage;
22113  }
22114  }
22115  if ( pNtk == NULL )
22116  {
22117  Abc_Print( -1, "Empty network.\n" );
22118  return 1;
22119  }
22120  if ( !Abc_NtkIsStrash(pNtk) )
22121  {
22122  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
22123  return 0;
22124  }
22125  if ( Abc_NtkLatchNum(pNtk) == 0 )
22126  {
22127  Abc_Print( -1, "Does not work for combinational networks.\n" );
22128  return 0;
22129  }
22130  pAbc->Status = Abc_NtkDarBmc( pNtk, 0, nFrames, nSizeMax, nNodeDelta, 0, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, 0, nCofFanLit, fVerbose, &iFrames );
22131  pAbc->nFrames = iFrames;
22132  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
22133  if ( pLogFileName )
22134  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc" );
22135  return 0;
22136 
22137 usage:
22138  Abc_Print( -2, "usage: bmc [-FNC num] [-L file] [-rcvh]\n" );
22139  Abc_Print( -2, "\t performs bounded model checking with static unrolling\n" );
22140  Abc_Print( -2, "\t-F num : the number of time frames [default = %d]\n", nFrames );
22141  Abc_Print( -2, "\t-N num : the max number of nodes in the frames [default = %d]\n", nSizeMax );
22142  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
22143 // Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
22144  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
22145  Abc_Print( -2, "\t-r : toggle the use of rewriting [default = %s]\n", fRewrite? "yes": "no" );
22146 // Abc_Print( -2, "\t-a : toggle SAT sweeping and SAT solving [default = %s]\n", fNewAlgo? "SAT solving": "SAT sweeping" );
22147  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
22148  Abc_Print( -2, "\t-h : print the command usage\n");
22149  return 1;
22150 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
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 fOrDecomp, int nCofFanLit, int fVerbose, int *piFrames)
Definition: abcDar.c:2255
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandBmc2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 22163 of file abc.c.

22164 {
22165  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
22166  int c;
22167  int nStart;
22168  int nFrames;
22169  int nSizeMax;
22170  int nBTLimit;
22171  int nBTLimitAll;
22172  int nNodeDelta;
22173  int nTimeOut;
22174  int fRewrite;
22175  int fNewAlgo;
22176  int fOrDecomp;
22177  int fVerbose;
22178  int iFrames;
22179  char * pLogFileName = NULL;
22180 
22181  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 fOrDecomp, int nCofFanLit, int fVerbose, int * piFrames );
22182 
22183  // set defaults
22184  nStart = 0;
22185  nFrames = 0;
22186  nSizeMax = 200000;
22187  nBTLimit = 0;
22188  nBTLimitAll = 0;
22189  nNodeDelta = 2000;
22190  nTimeOut = 0;
22191  fRewrite = 0;
22192  fNewAlgo = 0;
22193  fOrDecomp = 0;
22194  fVerbose = 0;
22196  while ( ( c = Extra_UtilGetopt( argc, argv, "SFNTCGDLruvh" ) ) != EOF )
22197  {
22198  switch ( c )
22199  {
22200  case 'S':
22201  if ( globalUtilOptind >= argc )
22202  {
22203  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
22204  goto usage;
22205  }
22206  nStart = atoi(argv[globalUtilOptind]);
22207  globalUtilOptind++;
22208  if ( nStart < 0 )
22209  goto usage;
22210  break;
22211  case 'F':
22212  if ( globalUtilOptind >= argc )
22213  {
22214  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
22215  goto usage;
22216  }
22217  nFrames = atoi(argv[globalUtilOptind]);
22218  globalUtilOptind++;
22219  if ( nFrames < 0 )
22220  goto usage;
22221  break;
22222  case 'N':
22223  if ( globalUtilOptind >= argc )
22224  {
22225  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
22226  goto usage;
22227  }
22228  nSizeMax = atoi(argv[globalUtilOptind]);
22229  globalUtilOptind++;
22230  if ( nSizeMax < 0 )
22231  goto usage;
22232  break;
22233  case 'T':
22234  if ( globalUtilOptind >= argc )
22235  {
22236  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
22237  goto usage;
22238  }
22239  nTimeOut = atoi(argv[globalUtilOptind]);
22240  globalUtilOptind++;
22241  if ( nTimeOut < 0 )
22242  goto usage;
22243  break;
22244  case 'C':
22245  if ( globalUtilOptind >= argc )
22246  {
22247  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
22248  goto usage;
22249  }
22250  nBTLimit = atoi(argv[globalUtilOptind]);
22251  globalUtilOptind++;
22252  if ( nBTLimit < 0 )
22253  goto usage;
22254  break;
22255  case 'G':
22256  if ( globalUtilOptind >= argc )
22257  {
22258  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
22259  goto usage;
22260  }
22261  nBTLimitAll = atoi(argv[globalUtilOptind]);
22262  globalUtilOptind++;
22263  if ( nBTLimitAll < 0 )
22264  goto usage;
22265  break;
22266  case 'D':
22267  if ( globalUtilOptind >= argc )
22268  {
22269  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
22270  goto usage;
22271  }
22272  nNodeDelta = atoi(argv[globalUtilOptind]);
22273  globalUtilOptind++;
22274  if ( nNodeDelta < 0 )
22275  goto usage;
22276  break;
22277  case 'L':
22278  if ( globalUtilOptind >= argc )
22279  {
22280  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
22281  goto usage;
22282  }
22283  pLogFileName = argv[globalUtilOptind];
22284  globalUtilOptind++;
22285  break;
22286  case 'r':
22287  fRewrite ^= 1;
22288  break;
22289  case 'a':
22290  fNewAlgo ^= 1;
22291  break;
22292  case 'u':
22293  fOrDecomp ^= 1;
22294  break;
22295  case 'v':
22296  fVerbose ^= 1;
22297  break;
22298  case 'h':
22299  goto usage;
22300  default:
22301  goto usage;
22302  }
22303  }
22304  if ( pNtk == NULL )
22305  {
22306  Abc_Print( -1, "Empty network.\n" );
22307  return 1;
22308  }
22309  if ( !Abc_NtkIsStrash(pNtk) )
22310  {
22311  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
22312  return 0;
22313  }
22314  if ( Abc_NtkLatchNum(pNtk) == 0 )
22315  {
22316  Abc_Print( -1, "Does not work for combinational networks.\n" );
22317  return 0;
22318  }
22319  pAbc->Status = Abc_NtkDarBmc( pNtk, nStart, nFrames, nSizeMax, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, fOrDecomp, 0, fVerbose, &iFrames );
22320  pAbc->nFrames = iFrames;
22321  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
22322  if ( pLogFileName )
22323  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc2" );
22324  return 0;
22325 
22326 usage:
22327  Abc_Print( -2, "usage: bmc2 [-SFTCGD num] [-L file] [-uvh]\n" );
22328  Abc_Print( -2, "\t performs bounded model checking with dynamic unrolling\n" );
22329  Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", nStart );
22330  Abc_Print( -2, "\t-F num : the max number of time frames (0 = unused) [default = %d]\n", nFrames );
22331  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nTimeOut );
22332  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
22333  Abc_Print( -2, "\t-G num : the max number of conflicts globally [default = %d]\n", nBTLimitAll );
22334  Abc_Print( -2, "\t-D num : the delta in the number of nodes [default = %d]\n", nNodeDelta );
22335  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
22336  Abc_Print( -2, "\t-u : toggle performing structural OR-decomposition [default = %s]\n", fOrDecomp? "yes": "no" );
22337  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
22338  Abc_Print( -2, "\t-h : print the command usage\n");
22339  return 1;
22340 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
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 fOrDecomp, int nCofFanLit, int fVerbose, int *piFrames)
Definition: abcDar.c:2255
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandBmc3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 22353 of file abc.c.

22354 {
22355  extern int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp );
22356  Saig_ParBmc_t Pars, * pPars = &Pars;
22357  Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
22358  Vec_Ptr_t * vSeqModelVec = NULL;
22359  Vec_Int_t * vStatuses = NULL;
22360  char * pLogFileName = NULL;
22361  int fOrDecomp = 0;
22362  int c;
22363  Saig_ParBmcSetDefaultParams( pPars );
22365  while ( ( c = Extra_UtilGetopt( argc, argv, "SFTHGCDJIPQRLWaxdruvzh" ) ) != EOF )
22366  {
22367  switch ( c )
22368  {
22369  case 'S':
22370  if ( globalUtilOptind >= argc )
22371  {
22372  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
22373  goto usage;
22374  }
22375  pPars->nStart = atoi(argv[globalUtilOptind]);
22376  globalUtilOptind++;
22377  if ( pPars->nStart < 0 )
22378  goto usage;
22379  break;
22380  case 'F':
22381  if ( globalUtilOptind >= argc )
22382  {
22383  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
22384  goto usage;
22385  }
22386  pPars->nFramesMax = atoi(argv[globalUtilOptind]);
22387  globalUtilOptind++;
22388  if ( pPars->nFramesMax < 0 )
22389  goto usage;
22390  break;
22391  case 'T':
22392  if ( globalUtilOptind >= argc )
22393  {
22394  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
22395  goto usage;
22396  }
22397  pPars->nTimeOut = atoi(argv[globalUtilOptind]);
22398  globalUtilOptind++;
22399  if ( pPars->nTimeOut < 0 )
22400  goto usage;
22401  break;
22402  case 'H':
22403  if ( globalUtilOptind >= argc )
22404  {
22405  Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
22406  goto usage;
22407  }
22408  pPars->nTimeOutOne = atoi(argv[globalUtilOptind]);
22409  globalUtilOptind++;
22410  if ( pPars->nTimeOutOne < 0 )
22411  goto usage;
22412  break;
22413  case 'G':
22414  if ( globalUtilOptind >= argc )
22415  {
22416  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
22417  goto usage;
22418  }
22419  pPars->nTimeOutGap = atoi(argv[globalUtilOptind]);
22420  globalUtilOptind++;
22421  if ( pPars->nTimeOutGap < 0 )
22422  goto usage;
22423  break;
22424  case 'C':
22425  if ( globalUtilOptind >= argc )
22426  {
22427  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
22428  goto usage;
22429  }
22430  pPars->nConfLimit = atoi(argv[globalUtilOptind]);
22431  globalUtilOptind++;
22432  if ( pPars->nConfLimit < 0 )
22433  goto usage;
22434  break;
22435  case 'D':
22436  if ( globalUtilOptind >= argc )
22437  {
22438  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
22439  goto usage;
22440  }
22441  pPars->nConfLimitJump = atoi(argv[globalUtilOptind]);
22442  globalUtilOptind++;
22443  if ( pPars->nConfLimitJump < 0 )
22444  goto usage;
22445  break;
22446  case 'J':
22447  if ( globalUtilOptind >= argc )
22448  {
22449  Abc_Print( -1, "Command line switch \"-J\" should be followed by an integer.\n" );
22450  goto usage;
22451  }
22452  pPars->nFramesJump = atoi(argv[globalUtilOptind]);
22453  globalUtilOptind++;
22454  if ( pPars->nFramesJump < 0 )
22455  goto usage;
22456  break;
22457  case 'I':
22458  if ( globalUtilOptind >= argc )
22459  {
22460  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
22461  goto usage;
22462  }
22463  pPars->nPisAbstract = atoi(argv[globalUtilOptind]);
22464  globalUtilOptind++;
22465  if ( pPars->nPisAbstract < 0 )
22466  goto usage;
22467  break;
22468  case 'P':
22469  if ( globalUtilOptind >= argc )
22470  {
22471  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
22472  goto usage;
22473  }
22474  pPars->nLearnedStart = atoi(argv[globalUtilOptind]);
22475  globalUtilOptind++;
22476  if ( pPars->nLearnedStart < 0 )
22477  goto usage;
22478  break;
22479  case 'Q':
22480  if ( globalUtilOptind >= argc )
22481  {
22482  Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
22483  goto usage;
22484  }
22485  pPars->nLearnedDelta = atoi(argv[globalUtilOptind]);
22486  globalUtilOptind++;
22487  if ( pPars->nLearnedDelta < 0 )
22488  goto usage;
22489  break;
22490  case 'R':
22491  if ( globalUtilOptind >= argc )
22492  {
22493  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
22494  goto usage;
22495  }
22496  pPars->nLearnedPerce = atoi(argv[globalUtilOptind]);
22497  globalUtilOptind++;
22498  if ( pPars->nLearnedPerce < 0 )
22499  goto usage;
22500  break;
22501  case 'L':
22502  if ( globalUtilOptind >= argc )
22503  {
22504  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
22505  goto usage;
22506  }
22507  pLogFileName = argv[globalUtilOptind];
22508  globalUtilOptind++;
22509  break;
22510  case 'W':
22511  if ( globalUtilOptind >= argc )
22512  {
22513  Abc_Print( -1, "Command line switch \"-W\" should be followed by a file name.\n" );
22514  goto usage;
22515  }
22516  pPars->pLogFileName = argv[globalUtilOptind];
22517  globalUtilOptind++;
22518  break;
22519  case 'a':
22520  pPars->fSolveAll ^= 1;
22521  break;
22522  case 'x':
22523  pPars->fStoreCex ^= 1;
22524  break;
22525  case 'd':
22526  pPars->fDropSatOuts ^= 1;
22527  break;
22528  case 'u':
22529  fOrDecomp ^= 1;
22530  break;
22531  case 'v':
22532  pPars->fVerbose ^= 1;
22533  break;
22534  case 'z':
22535  pPars->fNotVerbose ^= 1;
22536  break;
22537  case 'h':
22538  goto usage;
22539  default:
22540  goto usage;
22541  }
22542  }
22543  if ( pNtk == NULL )
22544  {
22545  Abc_Print( -1, "Empty network.\n" );
22546  return 1;
22547  }
22548  if ( !Abc_NtkIsStrash(pNtk) )
22549  {
22550  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
22551  return 0;
22552  }
22553  if ( Abc_NtkLatchNum(pNtk) == 0 )
22554  {
22555  Abc_Print( -1, "Does not work for combinational networks.\n" );
22556  return 0;
22557  }
22558  if ( Abc_NtkConstrNum(pNtk) > 0 )
22559  {
22560  Abc_Print( -1, "Constraints have to be folded (use \"fold\").\n" );
22561  return 0;
22562  }
22563  pPars->fUseBridge = pAbc->fBridgeMode;
22564  pAbc->Status = Abc_NtkDarBmc3( pNtk, pPars, fOrDecomp );
22565  pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
22566  if ( pLogFileName )
22567  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc3" );
22568  vSeqModelVec = pNtk->vSeqModelVec; pNtk->vSeqModelVec = NULL;
22569  if ( pPars->fSolveAll && pPars->fDropSatOuts )
22570  {
22571  if ( vSeqModelVec == NULL )
22572  Abc_Print( 1,"The array of counter-examples is not available.\n" );
22573  else if ( Vec_PtrSize(vSeqModelVec) != Abc_NtkPoNum(pNtk) )
22574  Abc_Print( 1,"The array size does not match the number of outputs.\n" );
22575  else
22576  {
22577  extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
22578  Abc_NtkDropSatOutputs( pNtk, vSeqModelVec, pPars->fVerbose );
22579  pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
22580  if ( pNtkRes == NULL )
22581  {
22582  Abc_Print( -1, "Removing SAT outputs has failed.\n" );
22583  return 1;
22584  }
22585  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
22586  }
22587  }
22588  vStatuses = Abc_FrameDeriveStatusArray( vSeqModelVec );
22589  Abc_FrameReplacePoStatuses( pAbc, &vStatuses );
22590  if ( vSeqModelVec )
22591  Abc_FrameReplaceCexVec( pAbc, &vSeqModelVec );
22592  else
22593  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
22594  return 0;
22595 
22596 usage:
22597  Abc_Print( -2, "usage: bmc3 [-SFTHGCDJIPQR num] [-LW file] [-axduvzh]\n" );
22598  Abc_Print( -2, "\t performs bounded model checking with dynamic unrolling\n" );
22599  Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", pPars->nStart );
22600  Abc_Print( -2, "\t-F num : the max number of time frames (0 = unused) [default = %d]\n", pPars->nFramesMax );
22601  Abc_Print( -2, "\t-T num : runtime limit, in seconds [default = %d]\n", pPars->nTimeOut );
22602  Abc_Print( -2, "\t-H num : runtime limit per output, in miliseconds (with \"-a\") [default = %d]\n", pPars->nTimeOutOne );
22603  Abc_Print( -2, "\t-G num : runtime gap since the last CEX, in seconds [default = %d]\n", pPars->nTimeOutGap );
22604  Abc_Print( -2, "\t-C num : max conflicts at an output [default = %d]\n", pPars->nConfLimit );
22605  Abc_Print( -2, "\t-D num : max conflicts after jumping (0 = infinity) [default = %d]\n", pPars->nConfLimitJump );
22606  Abc_Print( -2, "\t-J num : the number of timeframes to jump (0 = not used) [default = %d]\n", pPars->nFramesJump );
22607  Abc_Print( -2, "\t-I num : the number of PIs to abstract [default = %d]\n", pPars->nPisAbstract );
22608  Abc_Print( -2, "\t-P num : the max number of learned clauses to keep (0=unused) [default = %d]\n", pPars->nLearnedStart );
22609  Abc_Print( -2, "\t-Q num : delta value for learned clause removal [default = %d]\n", pPars->nLearnedDelta );
22610  Abc_Print( -2, "\t-R num : percentage to keep for learned clause removal [default = %d]\n", pPars->nLearnedPerce );
22611  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
22612  Abc_Print( -2, "\t-W file: the log file name with per-output details [default = %s]\n", pPars->pLogFileName ? pPars->pLogFileName : "no logging" );
22613  Abc_Print( -2, "\t-a : solve all outputs (do not stop when one is SAT) [default = %s]\n", pPars->fSolveAll? "yes": "no" );
22614  Abc_Print( -2, "\t-x : toggle storing CEXes when solving all outputs [default = %s]\n", pPars->fStoreCex? "yes": "no" );
22615  Abc_Print( -2, "\t-d : toggle dropping (replacing by 0) SAT outputs [default = %s]\n", pPars->fDropSatOuts? "yes": "no" );
22616  Abc_Print( -2, "\t-u : toggle performing structural OR-decomposition [default = %s]\n", fOrDecomp? "yes": "not" );
22617  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
22618  Abc_Print( -2, "\t-z : toggle suppressing report about solved outputs [default = %s]\n", pPars->fNotVerbose? "yes": "no" );
22619  Abc_Print( -2, "\t-h : print the command usage\n");
22620  return 1;
22621 }
ABC_DLL Abc_Ntk_t * Abc_NtkDarLatchSweep(Abc_Ntk_t *pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
Definition: abcDar.c:3203
void Abc_FrameReplaceCexVec(Abc_Frame_t *pAbc, Vec_Ptr_t **pvCexVec)
Definition: abc.c:515
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
int nConfLimitJump
Definition: bmc.h:51
void Saig_ParBmcSetDefaultParams(Saig_ParBmc_t *p)
Definition: bmcBmc3.c:1284
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int nLearnedPerce
Definition: bmc.h:65
Vec_Ptr_t * vSeqModelVec
Definition: abc.h:200
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int nLearnedStart
Definition: bmc.h:63
int nTimeOutOne
Definition: bmc.h:55
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int fUseBridge
Definition: bmc.h:59
int fVerbose
Definition: bmc.h:66
int nStart
Definition: bmc.h:48
int nTimeOutGap
Definition: bmc.h:54
int iFrame
Definition: bmc.h:70
int nConfLimit
Definition: bmc.h:50
void Abc_NtkDropSatOutputs(Abc_Ntk_t *pNtk, Vec_Ptr_t *vCexes, int fVerbose)
Definition: abcNtk.c:1737
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
int nTimeOut
Definition: bmc.h:53
int nFramesMax
Definition: bmc.h:49
int fDropSatOuts
Definition: bmc.h:60
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int nFramesJump
Definition: bmc.h:52
int fStoreCex
Definition: bmc.h:58
int fNotVerbose
Definition: bmc.h:67
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
int nPisAbstract
Definition: bmc.h:56
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_NtkDarBmc3(Abc_Ntk_t *pNtk, Saig_ParBmc_t *pPars, int fOrDecomp)
Definition: abcDar.c:2337
char * pLogFileName
Definition: bmc.h:68
Vec_Int_t * Abc_FrameDeriveStatusArray(Vec_Ptr_t *vCexes)
Definition: abc.c:575
int nLearnedDelta
Definition: bmc.h:64
int fSolveAll
Definition: bmc.h:57
void Abc_FrameReplacePoStatuses(Abc_Frame_t *pAbc, Vec_Int_t **pvStatuses)
Definition: abc.c:556
int Abc_CommandBmcInter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 22634 of file abc.c.

22635 {
22636  Inter_ManParams_t Pars, * pPars = &Pars;
22637  Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
22638  int c;
22639  char * pLogFileName = NULL;
22640 
22641  extern int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars, Abc_Ntk_t ** ppNtkRes );
22642  // set defaults
22643  Inter_ManSetDefaultParams( pPars );
22645  while ( ( c = Extra_UtilGetopt( argc, argv, "CFTKLIrtpomcgbqkdivh" ) ) != EOF )
22646  {
22647  switch ( c )
22648  {
22649  case 'C':
22650  if ( globalUtilOptind >= argc )
22651  {
22652  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
22653  goto usage;
22654  }
22655  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
22656  globalUtilOptind++;
22657  if ( pPars->nBTLimit < 0 )
22658  goto usage;
22659  break;
22660  case 'F':
22661  if ( globalUtilOptind >= argc )
22662  {
22663  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
22664  goto usage;
22665  }
22666  pPars->nFramesMax = atoi(argv[globalUtilOptind]);
22667  globalUtilOptind++;
22668  if ( pPars->nFramesMax < 0 )
22669  goto usage;
22670  break;
22671  case 'T':
22672  if ( globalUtilOptind >= argc )
22673  {
22674  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
22675  goto usage;
22676  }
22677  pPars->nSecLimit = atoi(argv[globalUtilOptind]);
22678  globalUtilOptind++;
22679  if ( pPars->nSecLimit < 0 )
22680  goto usage;
22681  break;
22682  case 'K':
22683  if ( globalUtilOptind >= argc )
22684  {
22685  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
22686  goto usage;
22687  }
22688  pPars->nFramesK = atoi(argv[globalUtilOptind]);
22689  globalUtilOptind++;
22690  if ( pPars->nFramesK < 0 )
22691  goto usage;
22692  break;
22693  case 'L':
22694  if ( globalUtilOptind >= argc )
22695  {
22696  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
22697  goto usage;
22698  }
22699  pLogFileName = argv[globalUtilOptind];
22700  globalUtilOptind++;
22701  break;
22702  case 'I':
22703  if ( globalUtilOptind >= argc )
22704  {
22705  Abc_Print( -1, "Command line switch \"-I\" should be followed by a file name.\n" );
22706  goto usage;
22707  }
22708  pPars->pFileName = argv[globalUtilOptind];
22709  globalUtilOptind++;
22710  break;
22711  case 'r':
22712  pPars->fRewrite ^= 1;
22713  break;
22714  case 't':
22715  pPars->fTransLoop ^= 1;
22716  break;
22717  case 'p':
22718  pPars->fUsePudlak ^= 1;
22719  break;
22720  case 'o':
22721  pPars->fUseOther ^= 1;
22722  break;
22723  case 'm':
22724  pPars->fUseMiniSat ^= 1;
22725  break;
22726  case 'c':
22727  pPars->fCheckKstep ^= 1;
22728  break;
22729  case 'g':
22730  pPars->fUseBias ^= 1;
22731  break;
22732  case 'b':
22733  pPars->fUseBackward ^= 1;
22734  break;
22735  case 'q':
22736  pPars->fUseTwoFrames ^= 1;
22737  break;
22738  case 'k':
22739  pPars->fUseSeparate ^= 1;
22740  break;
22741  case 'd':
22742  pPars->fDropSatOuts ^= 1;
22743  break;
22744  case 'i':
22745  pPars->fDropInvar ^= 1;
22746  break;
22747  case 'v':
22748  pPars->fVerbose ^= 1;
22749  break;
22750  case 'h':
22751  goto usage;
22752  default:
22753  goto usage;
22754  }
22755  }
22756  if ( pNtk == NULL )
22757  {
22758  Abc_Print( -1, "Empty network.\n" );
22759  return 1;
22760  }
22761  if ( !Abc_NtkIsStrash(pNtk) )
22762  {
22763  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
22764  return 0;
22765  }
22766  if ( Abc_NtkLatchNum(pNtk) == 0 )
22767  {
22768  Abc_Print( -1, "Does not work for combinational networks.\n" );
22769  return 0;
22770  }
22771  if ( Abc_NtkConstrNum(pNtk) > 0 )
22772  {
22773  Abc_Print( -1, "Cannot run interpolation with constraints. Use \"fold\".\n" );
22774  return 0;
22775  }
22776  if ( Abc_NtkPoNum(pNtk)-Abc_NtkConstrNum(pNtk) != 1 )
22777  {
22778  if ( Abc_NtkConstrNum(pNtk) > 0 )
22779  {
22780  Abc_Print( 1,"Cannot solve multiple-output miter with constraints.\n" );
22781  return 0;
22782  }
22783  if ( pPars->fUseSeparate )
22784  {
22785  Abc_Print( 0, "Each of %d outputs will be solved separately.\n", Abc_NtkPoNum(pNtk) );
22786  pAbc->Status = Abc_NtkDarBmcInter( pNtk, pPars, &pNtkRes );
22787  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
22788  if ( pNtkRes == NULL )
22789  {
22790  Abc_Print( -1, "Generating resulting network has failed.\n" );
22791  return 0;
22792  }
22793  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
22794  }
22795  else
22796  {
22797  Abc_Ntk_t * pNtkNew = Abc_NtkDup( pNtk );
22798  Abc_Print( 0, "All %d outputs will be ORed together.\n", Abc_NtkPoNum(pNtk) );
22799  if ( !Abc_NtkCombinePos( pNtkNew, 0, 0 ) )
22800  {
22801  Abc_NtkDelete( pNtkNew );
22802  Abc_Print( -1, "ORing outputs has failed.\n" );
22803  return 0;
22804  }
22805  pAbc->Status = Abc_NtkDarBmcInter( pNtkNew, pPars, NULL );
22806  if ( pAbc->Status == 0 )
22807  {
22808  Aig_Man_t * pMan = Abc_NtkToDar( pNtk, 0, 1 );
22809  pNtkNew->pSeqModel->iPo = Saig_ManFindFailedPoCex( pMan, pNtkNew->pSeqModel );
22810  Aig_ManStop( pMan );
22811  }
22812  Abc_FrameReplaceCex( pAbc, &pNtkNew->pSeqModel );
22813  Abc_NtkDelete( pNtkNew );
22814  }
22815  pAbc->nFrames = -1;
22816  }
22817  else
22818  {
22819  pAbc->Status = Abc_NtkDarBmcInter( pNtk, pPars, NULL );
22820  pAbc->nFrames = pPars->iFrameMax;
22821  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
22822  }
22823  if ( pLogFileName )
22824  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "int" );
22825  return 0;
22826 
22827 usage:
22828  Abc_Print( -2, "usage: int [-CFTK num] [-LI file] [-irtpomcgbqkdvh]\n" );
22829  Abc_Print( -2, "\t uses interpolation to prove the property\n" );
22830  Abc_Print( -2, "\t-C num : the limit on conflicts for one SAT run [default = %d]\n", pPars->nBTLimit );
22831  Abc_Print( -2, "\t-F num : the limit on number of frames to unroll [default = %d]\n", pPars->nFramesMax );
22832  Abc_Print( -2, "\t-T num : the limit on runtime per output in seconds [default = %d]\n", pPars->nSecLimit );
22833  Abc_Print( -2, "\t-K num : the number of steps in inductive checking [default = %d]\n", pPars->nFramesK );
22834  Abc_Print( -2, "\t (K = 1 works in all cases; K > 1 works without -t and -b)\n" );
22835  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
22836  Abc_Print( -2, "\t-I file: the file name for dumping interpolant [default = \"%s\"]\n", pPars->pFileName ? pPars->pFileName : "invar.aig" );
22837  Abc_Print( -2, "\t-i : toggle dumping interpolant/invariant into a file [default = %s]\n", pPars->fDropInvar? "yes": "no" );
22838  Abc_Print( -2, "\t-r : toggle rewriting of the unrolled timeframes [default = %s]\n", pPars->fRewrite? "yes": "no" );
22839  Abc_Print( -2, "\t-t : toggle adding transition into the initial state [default = %s]\n", pPars->fTransLoop? "yes": "no" );
22840  Abc_Print( -2, "\t-p : toggle using original Pudlak's interpolation procedure [default = %s]\n", pPars->fUsePudlak? "yes": "no" );
22841  Abc_Print( -2, "\t-o : toggle using optimized Pudlak's interpolation procedure [default = %s]\n", pPars->fUseOther? "yes": "no" );
22842  Abc_Print( -2, "\t-m : toggle using MiniSat-1.14p (now, Windows-only) [default = %s]\n", pPars->fUseMiniSat? "yes": "no" );
22843  Abc_Print( -2, "\t-c : toggle using inductive containment check [default = %s]\n", pPars->fCheckKstep? "yes": "no" );
22844  Abc_Print( -2, "\t-g : toggle using bias for global variables using SAT [default = %s]\n", pPars->fUseBias? "yes": "no" );
22845  Abc_Print( -2, "\t-b : toggle using backward interpolation (works with -t) [default = %s]\n", pPars->fUseBackward? "yes": "no" );
22846  Abc_Print( -2, "\t-q : toggle using property in two last timeframes [default = %s]\n", pPars->fUseTwoFrames? "yes": "no" );
22847  Abc_Print( -2, "\t-k : toggle solving each output separately [default = %s]\n", pPars->fUseSeparate? "yes": "no" );
22848  Abc_Print( -2, "\t-d : toggle dropping (replacing by 0) SAT outputs (with -k is used) [default = %s]\n", pPars->fDropSatOuts? "yes": "no" );
22849  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
22850  Abc_Print( -2, "\t-h : print the command usage\n");
22851  return 1;
22852 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
void Inter_ManSetDefaultParams(Inter_ManParams_t *p)
MACRO DEFINITIONS ///.
Definition: intCore.c:46
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
int Abc_NtkDarBmcInter(Abc_Ntk_t *pNtk, Inter_ManParams_t *pPars, Abc_Ntk_t **ppNtkRes)
Definition: abcDar.c:2552
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
ABC_DLL int Abc_NtkCombinePos(Abc_Ntk_t *pNtk, int fAnd, int fXor)
Definition: abcMiter.c:1151
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Saig_ManFindFailedPoCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Definition: saigDup.c:434
typedefABC_NAMESPACE_HEADER_START struct Inter_ManParams_t_ Inter_ManParams_t
INCLUDES ///.
Definition: int.h:48
int Abc_CommandCareSet ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9416 of file abc.c.

9417 {
9418  FILE * pFile;
9419  Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
9420  char * FileName;
9421  int c;
9422 
9423  pNtk = Abc_FrameReadNtk(pAbc);
9424  // set defaults
9426  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
9427  {
9428  switch ( c )
9429  {
9430  case 'h':
9431  goto usage;
9432  default:
9433  goto usage;
9434  }
9435  }
9436 
9437  if ( pNtk == NULL )
9438  {
9439  Abc_Print( -1, "Empty network.\n" );
9440  return 1;
9441  }
9442 
9443  if ( argc != globalUtilOptind + 1 )
9444  {
9445  goto usage;
9446  }
9447 
9448  // get the input file name
9449  FileName = argv[globalUtilOptind];
9450  if ( (pFile = fopen( FileName, "r" )) == NULL )
9451  {
9452  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
9453  if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
9454  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
9455  Abc_Print( 1, "\n" );
9456  return 1;
9457  }
9458  fclose( pFile );
9459 
9460  // set the new network
9461  pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
9462  if ( pNtkNew == NULL )
9463  {
9464  Abc_Print( -1, "Reading network from file has failed.\n" );
9465  return 1;
9466  }
9467 
9468  // replace the EXDC
9469  if ( pNtk->pExcare )
9470  {
9471  Abc_NtkDelete( (Abc_Ntk_t *)pNtk->pExcare );
9472  pNtk->pExcare = NULL;
9473  }
9474  pNtkRes = Abc_NtkDup( pNtk );
9475  pNtkRes->pExcare = pNtkNew;
9476 
9477  // replace the current network
9478  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
9479  return 0;
9480 
9481 usage:
9482  Abc_Print( -2, "usage: care_set [-h] <file>\n" );
9483  Abc_Print( -2, "\t sets the network from file as a care for the current network\n" );
9484  Abc_Print( -2, "\t-h : print the command usage\n");
9485  Abc_Print( -2, "\t<file> : file with the new care network\n");
9486  return 1;
9487 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void * pExcare
Definition: abc.h:202
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCascade ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6315 of file abc.c.

6316 {
6317  Abc_Ntk_t * pNtk, * pNtkRes;
6318  int c, nLutSize;
6319  int fCheck;
6320  int fVerbose;
6321  extern Abc_Ntk_t * Abc_NtkCascade( Abc_Ntk_t * pNtk, int nLutSize, int fCheck, int fVerbose );
6322  pNtk = Abc_FrameReadNtk(pAbc);
6323 
6324  // set defaults
6325  nLutSize = 12;
6326  fCheck = 0;
6327  fVerbose = 0;
6329  while ( ( c = Extra_UtilGetopt( argc, argv, "Kcvh" ) ) != EOF )
6330  {
6331  switch ( c )
6332  {
6333  case 'K':
6334  if ( globalUtilOptind >= argc )
6335  {
6336  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
6337  goto usage;
6338  }
6339  nLutSize = atoi(argv[globalUtilOptind]);
6340  globalUtilOptind++;
6341  if ( nLutSize < 0 )
6342  goto usage;
6343  break;
6344  case 'c':
6345  fCheck ^= 1;
6346  break;
6347  case 'v':
6348  fVerbose ^= 1;
6349  break;
6350  case 'h':
6351  goto usage;
6352  default:
6353  goto usage;
6354  }
6355  }
6356 
6357  if ( pNtk == NULL )
6358  {
6359  Abc_Print( -1, "Empty network.\n" );
6360  return 1;
6361  }
6362 
6363  if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
6364  {
6365  Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
6366  return 1;
6367  }
6368 
6369  // get the new network
6370  if ( Abc_NtkIsStrash(pNtk) )
6371  pNtkRes = Abc_NtkCascade( pNtk, nLutSize, fCheck, fVerbose );
6372  else
6373  {
6374  pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
6375  pNtkRes = Abc_NtkCascade( pNtk, nLutSize, fCheck, fVerbose );
6376  Abc_NtkDelete( pNtk );
6377  }
6378  if ( pNtkRes == NULL )
6379  {
6380  Abc_Print( -1, "Cascade synthesis has failed.\n" );
6381  return 1;
6382  }
6383  // replace the current network
6384  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
6385  return 0;
6386 
6387 usage:
6388  Abc_Print( -2, "usage: cascade [-K <num>] [-cvh]\n" );
6389  Abc_Print( -2, "\t performs LUT cascade synthesis for the current network\n" );
6390  Abc_Print( -2, "\t-K <num> : the number of LUT inputs [default = %d]\n", nLutSize );
6391  Abc_Print( -2, "\t-c : check equivalence after synthesis [default = %s]\n", fCheck? "yes": "no" );
6392  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
6393  Abc_Print( -2, "\t-h : print the command usage\n");
6394  Abc_Print( -2, "\t \n");
6395  Abc_Print( -2, " A lookup-table cascade is a programmable architecture developed by\n");
6396  Abc_Print( -2, " Professor Tsutomu Sasao (sasao@cse.kyutech.ac.jp) at Kyushu Institute\n");
6397  Abc_Print( -2, " of Technology. This work received Takeda Techno-Entrepreneurship Award:\n");
6398  Abc_Print( -2, " http://www.lsi-cad.com/sasao/photo/takeda.html\n");
6399  return 1;
6400 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkCascade(Abc_Ntk_t *pNtk, int nLutSize, int fCheck, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcCas.c:55
int Abc_CommandCec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20213 of file abc.c.

20214 {
20215  char Buffer[16];
20216  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
20217  int fDelete1, fDelete2;
20218  char ** pArgvNew;
20219  int nArgcNew;
20220  int c;
20221  int fSat;
20222  int fVerbose;
20223  int nSeconds;
20224  int nPartSize;
20225  int nConfLimit;
20226  int nInsLimit;
20227  int fPartition;
20228  int fIgnoreNames;
20229 
20230  extern void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nInsLimit );
20231  extern void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose );
20232  extern void Abc_NtkCecFraigPart( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nPartSize, int fVerbose );
20233  extern void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose );
20234 
20235  pNtk = Abc_FrameReadNtk(pAbc);
20236  // set defaults
20237  fSat = 0;
20238  fVerbose = 0;
20239  nSeconds = 20;
20240  nPartSize = 0;
20241  nConfLimit = 10000;
20242  nInsLimit = 0;
20243  fPartition = 0;
20244  fIgnoreNames = 0;
20246  while ( ( c = Extra_UtilGetopt( argc, argv, "TCIPpsnvh" ) ) != EOF )
20247  {
20248  switch ( c )
20249  {
20250  case 'T':
20251  if ( globalUtilOptind >= argc )
20252  {
20253  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
20254  goto usage;
20255  }
20256  nSeconds = atoi(argv[globalUtilOptind]);
20257  globalUtilOptind++;
20258  if ( nSeconds < 0 )
20259  goto usage;
20260  break;
20261  case 'C':
20262  if ( globalUtilOptind >= argc )
20263  {
20264  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
20265  goto usage;
20266  }
20267  nConfLimit = atoi(argv[globalUtilOptind]);
20268  globalUtilOptind++;
20269  if ( nConfLimit < 0 )
20270  goto usage;
20271  break;
20272  case 'I':
20273  if ( globalUtilOptind >= argc )
20274  {
20275  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
20276  goto usage;
20277  }
20278  nInsLimit = atoi(argv[globalUtilOptind]);
20279  globalUtilOptind++;
20280  if ( nInsLimit < 0 )
20281  goto usage;
20282  break;
20283  case 'P':
20284  if ( globalUtilOptind >= argc )
20285  {
20286  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
20287  goto usage;
20288  }
20289  nPartSize = atoi(argv[globalUtilOptind]);
20290  globalUtilOptind++;
20291  if ( nPartSize < 0 )
20292  goto usage;
20293  break;
20294  case 'p':
20295  fPartition ^= 1;
20296  break;
20297  case 's':
20298  fSat ^= 1;
20299  break;
20300  case 'n':
20301  fIgnoreNames ^= 1;
20302  break;
20303  case 'v':
20304  fVerbose ^= 1;
20305  break;
20306  default:
20307  goto usage;
20308  }
20309  }
20310 
20311  if ( pNtk && pNtk->vPhases != NULL )
20312  {
20313  Abc_Print( -1, "Cannot compare networks with phases defined.\n" );
20314  return 1;
20315  }
20316 
20317  pArgvNew = argv + globalUtilOptind;
20318  nArgcNew = argc - globalUtilOptind;
20319  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
20320  return 1;
20321 
20322  if ( fIgnoreNames )
20323  {
20324  if ( !fDelete1 )
20325  {
20326  pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
20327  fDelete1 = 1;
20328  }
20329  if ( !fDelete2 )
20330  {
20331  pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
20332  fDelete2 = 1;
20333  }
20334  Abc_NtkShortNames( pNtk1 );
20335  Abc_NtkShortNames( pNtk2 );
20336  }
20337 
20338  // perform equivalence checking
20339  if ( fPartition )
20340  Abc_NtkCecFraigPartAuto( pNtk1, pNtk2, nSeconds, fVerbose );
20341  else if ( nPartSize )
20342  Abc_NtkCecFraigPart( pNtk1, pNtk2, nSeconds, nPartSize, fVerbose );
20343  else if ( fSat )
20344  Abc_NtkCecSat( pNtk1, pNtk2, nConfLimit, nInsLimit );
20345  else
20346  Abc_NtkCecFraig( pNtk1, pNtk2, nSeconds, fVerbose );
20347 
20348  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
20349  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
20350  return 0;
20351 
20352 usage:
20353  if ( nPartSize == 0 )
20354  strcpy( Buffer, "unused" );
20355  else
20356  sprintf(Buffer, "%d", nPartSize );
20357  Abc_Print( -2, "usage: cec [-T num] [-C num] [-I num] [-P num] [-psnvh] <file1> <file2>\n" );
20358  Abc_Print( -2, "\t performs combinational equivalence checking\n" );
20359  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
20360  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
20361  Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
20362  Abc_Print( -2, "\t-P num : partition size for multi-output networks [default = %s]\n", Buffer );
20363  Abc_Print( -2, "\t-p : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
20364  Abc_Print( -2, "\t-s : toggle \"SAT only\" and \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
20365  Abc_Print( -2, "\t-n : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
20366  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
20367  Abc_Print( -2, "\t-h : print the command usage\n");
20368  Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
20369  Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
20370  Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
20371  Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
20372  return 1;
20373 }
void Abc_NtkCecFraigPartAuto(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int fVerbose)
Definition: abcVerify.c:363
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkShortNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:490
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
Vec_Int_t * vPhases
Definition: abc.h:208
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
char * strcpy()
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkCecFraig(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int fVerbose)
Definition: abcVerify.c:123
void Abc_NtkCecSat(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nConfLimit, int nInsLimit)
FUNCTION DEFINITIONS ///.
Definition: abcVerify.c:56
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NtkCecFraigPart(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nSeconds, int nPartSize, int fVerbose)
Definition: abcVerify.c:251
int Abc_CommandCexCut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24676 of file abc.c.

24677 {
24678  Abc_Ntk_t * pNtkNew;
24679  int c, iFrStart = 0;
24680  int iFrStop = ABC_INFINITY;
24681  int fCombOnly = 0;
24682  int fUseOne = 0;
24683  int fAllFrames = 0;
24684  int fVerbose = 0;
24686  while ( ( c = Extra_UtilGetopt( argc, argv, "FGcnmvh" ) ) != EOF )
24687  {
24688  switch ( c )
24689  {
24690  case 'F':
24691  if ( globalUtilOptind >= argc )
24692  {
24693  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
24694  goto usage;
24695  }
24696  iFrStart = atoi(argv[globalUtilOptind]);
24697  globalUtilOptind++;
24698  if ( iFrStart < 0 )
24699  goto usage;
24700  break;
24701  case 'G':
24702  if ( globalUtilOptind >= argc )
24703  {
24704  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
24705  goto usage;
24706  }
24707  iFrStop = atoi(argv[globalUtilOptind]);
24708  globalUtilOptind++;
24709  if ( iFrStop < 0 )
24710  goto usage;
24711  break;
24712  case 'c':
24713  fCombOnly ^= 1;
24714  break;
24715  case 'n':
24716  fUseOne ^= 1;
24717  break;
24718  case 'm':
24719  fAllFrames ^= 1;
24720  break;
24721  case 'v':
24722  fVerbose ^= 1;
24723  break;
24724  case 'h':
24725  goto usage;
24726  default:
24727  Abc_Print( -2, "Unknown switch.\n");
24728  goto usage;
24729  }
24730  }
24731 
24732  if ( pAbc->pCex == NULL )
24733  {
24734  Abc_Print( 1, "There is no current cex.\n");
24735  return 0;
24736  }
24737  if ( pAbc->pNtkCur == NULL )
24738  {
24739  Abc_Print( 1, "There is no AIG in the &-space.\n");
24740  return 0;
24741  }
24742  if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
24743  {
24744  Abc_Print( 1, "Current network is not an AIG.\n");
24745  return 0;
24746  }
24747  if ( iFrStop == ABC_INFINITY )
24748  iFrStop = pAbc->pCex->iFrame;
24749 
24750  {
24751  Aig_Man_t * pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
24752  Aig_Man_t * pAigNew = Bmc_AigTargetStates( pAig, pAbc->pCex, iFrStart, iFrStop, fCombOnly, fUseOne, fAllFrames, fVerbose );
24753  Aig_ManStop( pAig );
24754  if ( pAigNew == NULL )
24755  {
24756  Abc_Print( 1, "Command has failed.\n");
24757  return 0;
24758  }
24759  pNtkNew = Abc_NtkFromAigPhase( pAigNew );
24760  pNtkNew->pName = Extra_UtilStrsav( pAbc->pNtkCur->pName );
24761  Aig_ManStop( pAigNew );
24762  // update the network
24763  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
24764  }
24765 /*
24766  pGiaNew = Bmc_GiaTargetStates( pAbc->pGia, pAbc->pCex, iFrStart, iFrStop, fCombOnly, fUseOne, fVerbose );
24767  if ( pGiaNew == NULL )
24768  {
24769  Abc_Print( 1, "Command has failed.\n");
24770  return 0;
24771  }
24772  Abc_FrameUpdateGia( pAbc, pGiaNew );
24773 */
24774  return 0;
24775 
24776 usage:
24777  Abc_Print( -2, "usage: cexcut [-FG num] [-cnmvh]\n" );
24778  Abc_Print( -2, "\t creates logic for bad states using the current CEX\n" );
24779  Abc_Print( -2, "\t-F num : 0-based number of the starting frame [default = %d]\n", iFrStart );
24780  Abc_Print( -2, "\t-G num : 0-based number of the ending frame [default = %d]\n", iFrStop );
24781  Abc_Print( -2, "\t-c : toggle outputting unate combinational circuit [default = %s]\n", fCombOnly? "yes": "no" );
24782  Abc_Print( -2, "\t-n : toggle generating only one bad state [default = %s]\n", fUseOne? "yes": "no" );
24783  Abc_Print( -2, "\t-m : toggle generating bad states for all frames after G [default = %s]\n", fAllFrames? "yes": "no" );
24784  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
24785  Abc_Print( -2, "\t-h : print the command usage\n");
24786  return 1;
24787 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Aig_Man_t * Bmc_AigTargetStates(Aig_Man_t *p, Abc_Cex_t *pCex, int iFrBeg, int iFrEnd, int fCombOnly, int fGenAll, int fAllFrames, int fVerbose)
Definition: bmcCexCut.c:513
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
char * pName
Definition: abc.h:158
int Abc_CommandCexLoad ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24631 of file abc.c.

24632 {
24633  int c;
24635  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
24636  {
24637  switch ( c )
24638  {
24639  case 'h':
24640  goto usage;
24641  default:
24642  goto usage;
24643  }
24644  }
24645  if ( pAbc->pCex2 == NULL )
24646  {
24647  Abc_Print( -1, "Saved CEX is not available.\n" );
24648  return 1;
24649  }
24650  ABC_FREE( pAbc->pCex );
24651  pAbc->pCex = Abc_CexDup( pAbc->pCex2, -1 );
24652  // update status
24653  pAbc->nFrames = pAbc->pCex2->iFrame;
24654  pAbc->Status = 0;
24655  return 0;
24656 
24657 usage:
24658  Abc_Print( -2, "usage: cexload [-h]\n" );
24659  Abc_Print( -2, "\t loads the current CEX from the internal storage\n" );
24660  Abc_Print( -2, "\t-h : print the command usage\n");
24661  return 1;
24662 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
#define ABC_FREE(obj)
Definition: abc_global.h:232
Abc_Cex_t * Abc_CexDup(Abc_Cex_t *p, int nRegsNew)
Definition: utilCex.c:145
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCexMerge ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24800 of file abc.c.

24801 {
24802  Abc_Cex_t * pCexNew;
24803  int c;
24804  int iFrStart = 0;
24805  int iFrStop = ABC_INFINITY;
24806  int fVerbose = 0;
24808  while ( ( c = Extra_UtilGetopt( argc, argv, "FGvh" ) ) != EOF )
24809  {
24810  switch ( c )
24811  {
24812  case 'F':
24813  if ( globalUtilOptind >= argc )
24814  {
24815  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
24816  goto usage;
24817  }
24818  iFrStart = atoi(argv[globalUtilOptind]);
24819  globalUtilOptind++;
24820  if ( iFrStart < 0 )
24821  goto usage;
24822  break;
24823  case 'G':
24824  if ( globalUtilOptind >= argc )
24825  {
24826  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
24827  goto usage;
24828  }
24829  iFrStop = atoi(argv[globalUtilOptind]);
24830  globalUtilOptind++;
24831  if ( iFrStop < 0 )
24832  goto usage;
24833  break;
24834  case 'v':
24835  fVerbose ^= 1;
24836  break;
24837  case 'h':
24838  goto usage;
24839  default:
24840  Abc_Print( -2, "Unknown switch.\n");
24841  goto usage;
24842  }
24843  }
24844 
24845  if ( pAbc->pCex == NULL )
24846  {
24847  Abc_Print( 1, "There is no current cex.\n");
24848  return 0;
24849  }
24850  if ( pAbc->pCex2 == NULL )
24851  {
24852  Abc_Print( 1, "There is no saved cex.\n");
24853  return 0;
24854  }
24855  if ( iFrStop - iFrStart + pAbc->pCex->iPo < pAbc->pCex->iFrame )
24856  {
24857  Abc_Print( 1, "Current CEX does not allow to shorten the saved CEX.\n");
24858  return 0;
24859  }
24860  pCexNew = Abc_CexMerge( pAbc->pCex2, pAbc->pCex, iFrStart, iFrStop );
24861  if ( pCexNew == NULL )
24862  {
24863  Abc_Print( 1, "Merging CEXes has failed.\n");
24864  return 0;
24865  }
24866  // replace the saved CEX
24867  ABC_FREE( pAbc->pCex2 );
24868  pAbc->pCex2 = pCexNew;
24869  return 0;
24870 
24871 usage:
24872  Abc_Print( -2, "usage: cexmerge [-FG num] [-vh]\n" );
24873  Abc_Print( -2, "\t merges the current CEX into the saved one\n" );
24874  Abc_Print( -2, "\t and sets the resulting CEX as the saved one\n" );
24875  Abc_Print( -2, "\t-F num : 0-based number of the starting frame [default = %d]\n", iFrStart );
24876  Abc_Print( -2, "\t-G num : 0-based number of the ending frame [default = %d]\n", iFrStop );
24877  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
24878  Abc_Print( -2, "\t-h : print the command usage\n");
24879  return 1;
24880 }
Abc_Cex_t * Abc_CexMerge(Abc_Cex_t *pCex, Abc_Cex_t *pPart, int iFrBeg, int iFrEnd)
Definition: utilCex.c:197
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
int Abc_CommandCexMin ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24893 of file abc.c.

24894 {
24895  Abc_Ntk_t * pNtk;
24896  Abc_Cex_t * vCexNew = NULL;
24897  int c;
24898  int nConfLimit = 1000;
24899  int nRounds = 1;
24900  int fVerbose = 0;
24902  while ( ( c = Extra_UtilGetopt( argc, argv, "CRvh" ) ) != EOF )
24903  {
24904  switch ( c )
24905  {
24906  case 'C':
24907  if ( globalUtilOptind >= argc )
24908  {
24909  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
24910  goto usage;
24911  }
24912  nConfLimit = atoi(argv[globalUtilOptind]);
24913  globalUtilOptind++;
24914  if ( nConfLimit < 0 )
24915  goto usage;
24916  break;
24917  case 'R':
24918  if ( globalUtilOptind >= argc )
24919  {
24920  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
24921  goto usage;
24922  }
24923  nRounds = atoi(argv[globalUtilOptind]);
24924  globalUtilOptind++;
24925  if ( nRounds < 0 )
24926  goto usage;
24927  break;
24928  case 'v':
24929  fVerbose ^= 1;
24930  break;
24931  case 'h':
24932  goto usage;
24933  default:
24934  Abc_Print( -2, "Unknown switch.\n");
24935  goto usage;
24936  }
24937  }
24938 
24939  if ( pAbc->pCex == NULL )
24940  {
24941  Abc_Print( 1, "There is no current cex.\n");
24942  return 0;
24943  }
24944 
24945  // check the main AIG
24946  pNtk = Abc_FrameReadNtk(pAbc);
24947  if ( pNtk == NULL )
24948  Abc_Print( 1, "Main AIG: There is no current network.\n");
24949  else if ( !Abc_NtkIsStrash(pNtk) )
24950  Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
24951  else if ( Abc_NtkPiNum(pNtk) != pAbc->pCex->nPis )
24952  Abc_Print( 1, "Main AIG: The number of PIs (%d) is different from cex (%d).\n", Abc_NtkPiNum(pNtk), pAbc->pCex->nPis );
24953 // else if ( Abc_NtkLatchNum(pNtk) != pAbc->pCex->nRegs )
24954 // Abc_Print( 1, "Main AIG: The number of registers (%d) is different from cex (%d).\n", Abc_NtkLatchNum(pNtk), pAbc->pCex->nRegs );
24955 // else if ( Abc_NtkPoNum(pNtk) <= pAbc->pCex->iPo )
24956 // Abc_Print( 1, "Main AIG: The number of POs (%d) is less than the PO index in cex (%d).\n", Abc_NtkPoNum(pNtk), pAbc->pCex->iPo );
24957  else
24958  {
24959  Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
24960  Gia_Man_t * pGia = Gia_ManFromAigSimple( pAig );
24961 // if ( !Gia_ManVerifyCex( pGia, pAbc->pCex, 0 ) )
24962  int iPoOld = pAbc->pCex->iPo;
24963  pAbc->pCex->iPo = Gia_ManFindFailedPoCex( pGia, pAbc->pCex, 0 );
24964  Gia_ManStop( pGia );
24965  if ( pAbc->pCex->iPo == -1 )
24966  {
24967  pAbc->pCex->iPo = iPoOld;
24968  Abc_Print( -1, "Main AIG: The cex does not fail any outputs.\n" );
24969  return 0;
24970  }
24971  else if ( iPoOld != pAbc->pCex->iPo )
24972  Abc_Print( 0, "Main AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
24973  // perform minimization
24974  vCexNew = Saig_ManCexMinPerform( pAig, pAbc->pCex );
24975  Aig_ManStop( pAig );
24976  Abc_CexFree( vCexNew );
24977 // Abc_FrameReplaceCex( pAbc, &vCexNew );
24978 
24979 // Abc_Print( 1,"Implementation of this command is not finished.\n" );
24980  }
24981  return 0;
24982 
24983 usage:
24984  Abc_Print( -2, "usage: cexmin [-CR num] [-vh]\n" );
24985  Abc_Print( -2, "\t reduces the length of the counter-example\n" );
24986  Abc_Print( -2, "\t-C num : the maximum number of conflicts [default = %d]\n", nConfLimit );
24987  Abc_Print( -2, "\t-R num : the number of minimization rounds [default = %d]\n", nRounds );
24988  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
24989  Abc_Print( -2, "\t-h : print the command usage\n");
24990  return 1;
24991 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Definition: giaAig.c:171
int Gia_ManFindFailedPoCex(Gia_Man_t *pAig, Abc_Cex_t *p, int nOutputs)
Definition: giaCex.c:87
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Definition: gia.h:95
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
void Abc_CexFree(Abc_Cex_t *p)
Definition: utilCex.c:371
Abc_Cex_t * Saig_ManCexMinPerform(Aig_Man_t *pAig, Abc_Cex_t *pCex)
Definition: bmcCexMin1.c:547
int Abc_CommandCexSave ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24590 of file abc.c.

24591 {
24592  int c;
24594  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
24595  {
24596  switch ( c )
24597  {
24598  case 'h':
24599  goto usage;
24600  default:
24601  goto usage;
24602  }
24603  }
24604  if ( pAbc->pCex == NULL )
24605  {
24606  Abc_Print( -1, "Current CEX is not available..\n" );
24607  return 1;
24608  }
24609  ABC_FREE( pAbc->pCex2 );
24610  pAbc->pCex2 = Abc_CexDup( pAbc->pCex, -1 );
24611  return 0;
24612 
24613 usage:
24614  Abc_Print( -2, "usage: cexsave [-h]\n" );
24615  Abc_Print( -2, "\t saves the current CEX into the internal storage\n" );
24616  Abc_Print( -2, "\t-h : print the command usage\n");
24617  return 1;
24618 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
#define ABC_FREE(obj)
Definition: abc_global.h:232
Abc_Cex_t * Abc_CexDup(Abc_Cex_t *p, int nRegsNew)
Definition: utilCex.c:145
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCleanup ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3601 of file abc.c.

3602 {
3603  Abc_Ntk_t * pNtk, * pNtkRes;
3604  int c;
3605  int fCleanupPis;
3606  int fCleanupPos;
3607  int fVerbose;
3608 
3609  extern Abc_Ntk_t * Abc_NtkDarCleanupAig( Abc_Ntk_t * pNtk, int fCleanupPis, int fCleanupPos, int fVerbose );
3610 
3611  pNtk = Abc_FrameReadNtk(pAbc);
3612 
3613  // set defaults
3614  fCleanupPis = 1;
3615  fCleanupPos = 1;
3616  fVerbose = 1;
3618  while ( ( c = Extra_UtilGetopt( argc, argv, "iovh" ) ) != EOF )
3619  {
3620  switch ( c )
3621  {
3622  case 'i':
3623  fCleanupPis ^= 1;
3624  break;
3625  case 'o':
3626  fCleanupPos ^= 1;
3627  break;
3628  case 'v':
3629  fVerbose ^= 1;
3630  break;
3631  case 'h':
3632  goto usage;
3633  default:
3634  goto usage;
3635  }
3636  }
3637 
3638  if ( pNtk == NULL )
3639  {
3640  Abc_Print( -1, "Empty network.\n" );
3641  return 1;
3642  }
3643  if ( Abc_NtkIsStrash(pNtk) )
3644  {
3645  if ( !fCleanupPos && !fCleanupPos )
3646  {
3647  Abc_Print( -1, "Cleanup for PIs and POs is not enabled.\n" );
3648  pNtkRes = Abc_NtkDup( pNtk );
3649  }
3650  else
3651  pNtkRes = Abc_NtkDarCleanupAig( pNtk, fCleanupPis, fCleanupPos, fVerbose );
3652  }
3653  else
3654  {
3655  Abc_NtkCleanup( pNtk, fVerbose );
3656  pNtkRes = Abc_NtkDup( pNtk );
3657  }
3658  if ( pNtkRes == NULL )
3659  {
3660  Abc_Print( -1, "Cleanup has failed.\n" );
3661  return 1;
3662  }
3663  // replace the current network
3664  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
3665  return 0;
3666 
3667 usage:
3668  Abc_Print( -2, "usage: cleanup [-iovh]\n" );
3669  Abc_Print( -2, "\t for logic networks, removes dangling combinatinal logic\n" );
3670  Abc_Print( -2, "\t for AIGs, removes PIs w/o fanout and POs driven by const-0\n" );
3671  Abc_Print( -2, "\t-i : toggles removing PIs without fanout [default = %s]\n", fCleanupPis? "yes": "no" );
3672  Abc_Print( -2, "\t-o : toggles removing POs with const-0 drivers [default = %s]\n", fCleanupPos? "yes": "no" );
3673  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
3674  Abc_Print( -2, "\t-h : print the command usage\n");
3675  return 1;
3676 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL int Abc_NtkCleanup(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcSweep.c:476
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDarCleanupAig(Abc_Ntk_t *pNtk, int fCleanupPis, int fCleanupPos, int fVerbose)
Definition: abcDar.c:4284
int Abc_CommandClockGate ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 19649 of file abc.c.

19650 {
19651  Cgt_Par_t Pars, * pPars = &Pars;
19652  Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
19653  int c;
19654 
19655  extern Abc_Ntk_t * Abc_NtkDarClockGate( Abc_Ntk_t * pNtk, Abc_Ntk_t * pCare, Cgt_Par_t * pPars );
19656 
19657  pNtk = Abc_FrameReadNtk(pAbc);
19658  // set defaults
19659  Cgt_SetDefaultParams( pPars );
19661  while ( ( c = Extra_UtilGetopt( argc, argv, "LNDCVKavwh" ) ) != EOF )
19662  {
19663  switch ( c )
19664  {
19665  case 'L':
19666  if ( globalUtilOptind >= argc )
19667  {
19668  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
19669  goto usage;
19670  }
19671  pPars->nLevelMax = atoi(argv[globalUtilOptind]);
19672  globalUtilOptind++;
19673  if ( pPars->nLevelMax <= 0 )
19674  goto usage;
19675  break;
19676  case 'N':
19677  if ( globalUtilOptind >= argc )
19678  {
19679  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
19680  goto usage;
19681  }
19682  pPars->nCandMax = atoi(argv[globalUtilOptind]);
19683  globalUtilOptind++;
19684  if ( pPars->nCandMax <= 0 )
19685  goto usage;
19686  break;
19687  case 'D':
19688  if ( globalUtilOptind >= argc )
19689  {
19690  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
19691  goto usage;
19692  }
19693  pPars->nOdcMax = atoi(argv[globalUtilOptind]);
19694  globalUtilOptind++;
19695  if ( pPars->nOdcMax <= 0 )
19696  goto usage;
19697  break;
19698  case 'C':
19699  if ( globalUtilOptind >= argc )
19700  {
19701  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
19702  goto usage;
19703  }
19704  pPars->nConfMax = atoi(argv[globalUtilOptind]);
19705  globalUtilOptind++;
19706  if ( pPars->nConfMax <= 0 )
19707  goto usage;
19708  break;
19709  case 'V':
19710  if ( globalUtilOptind >= argc )
19711  {
19712  Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
19713  goto usage;
19714  }
19715  pPars->nVarsMin = atoi(argv[globalUtilOptind]);
19716  globalUtilOptind++;
19717  if ( pPars->nVarsMin <= 0 )
19718  goto usage;
19719  break;
19720  case 'K':
19721  if ( globalUtilOptind >= argc )
19722  {
19723  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
19724  goto usage;
19725  }
19726  pPars->nFlopsMin = atoi(argv[globalUtilOptind]);
19727  globalUtilOptind++;
19728  if ( pPars->nFlopsMin <= 0 )
19729  goto usage;
19730  break;
19731  case 'a':
19732  pPars->fAreaOnly ^= 1;
19733  break;
19734  case 'v':
19735  pPars->fVerbose ^= 1;
19736  break;
19737  case 'w':
19738  pPars->fVeryVerbose ^= 1;
19739  break;
19740  case 'h':
19741  goto usage;
19742  default:
19743  goto usage;
19744  }
19745  }
19746  if ( pNtk == NULL )
19747  {
19748  Abc_Print( -1, "Empty network.\n" );
19749  return 1;
19750  }
19751 
19752  if ( argc == globalUtilOptind + 1 )
19753  {
19754  pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
19755  if ( pNtkCare == NULL )
19756  {
19757  Abc_Print( -1, "Reading care network has failed.\n" );
19758  return 1;
19759  }
19760  // modify the current network
19761  pNtkRes = Abc_NtkDarClockGate( pNtk, pNtkCare, pPars );
19762  Abc_NtkDelete( pNtkCare );
19763  }
19764  else if ( argc == globalUtilOptind )
19765  {
19766  pNtkRes = Abc_NtkDarClockGate( pNtk, NULL, pPars );
19767  }
19768  else
19769  {
19770  Abc_Print( -1, "Wrong number of arguments.\n" );
19771  return 0;
19772  }
19773  if ( pNtkRes == NULL )
19774  {
19775  Abc_Print( -1, "Clock gating has failed.\n" );
19776  return 0;
19777  }
19778  // replace the current network
19779  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
19780  return 0;
19781 
19782 usage:
19783  Abc_Print( -2, "usage: clockgate [-LNDCVK <num>] [-avwh] <file>\n" );
19784  Abc_Print( -2, "\t sequential clock gating with observability don't-cares\n" );
19785  Abc_Print( -2, "\t-L num : max level number of a clock gate [default = %d]\n", pPars->nLevelMax );
19786  Abc_Print( -2, "\t-N num : max number of candidates for a flop [default = %d]\n", pPars->nCandMax );
19787  Abc_Print( -2, "\t-D num : max number of ODC levels to consider [default = %d]\n", pPars->nOdcMax );
19788  Abc_Print( -2, "\t-C num : max number of conflicts at a node [default = %d]\n", pPars->nConfMax );
19789  Abc_Print( -2, "\t-V num : min number of vars to recycle SAT solver [default = %d]\n", pPars->nVarsMin );
19790  Abc_Print( -2, "\t-K num : min number of flops to recycle SAT solver [default = %d]\n", pPars->nFlopsMin );
19791  Abc_Print( -2, "\t-a : toggle minimizing area-only [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
19792  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
19793  Abc_Print( -2, "\t-w : toggle even more detailed output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
19794  Abc_Print( -2, "\t-h : print the command usage\n");
19795  Abc_Print( -2, "\tfile : (optional) constraints for primary inputs and register outputs\n");
19796  return 1;
19797 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
void Cgt_SetDefaultParams(Cgt_Par_t *p)
MACRO DEFINITIONS ///.
Definition: cgtCore.c:46
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
typedefABC_NAMESPACE_HEADER_START struct Cgt_Par_t_ Cgt_Par_t
INCLUDES ///.
Definition: cgt.h:48
Abc_Ntk_t * Abc_NtkDarClockGate(Abc_Ntk_t *pNtk, Abc_Ntk_t *pCare, Cgt_Par_t *pPars)
Definition: abcDar.c:4094
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCollapse ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2964 of file abc.c.

2965 {
2966  Abc_Ntk_t * pNtk, * pNtkRes;
2967  int fVerbose;
2968  int fBddSizeMax;
2969  int fDualRail;
2970  int fReorder;
2971  int c;
2972  pNtk = Abc_FrameReadNtk(pAbc);
2973 
2974  // set defaults
2975  fVerbose = 0;
2976  fReorder = 1;
2977  fDualRail = 0;
2978  fBddSizeMax = ABC_INFINITY;
2980  while ( ( c = Extra_UtilGetopt( argc, argv, "Brdvh" ) ) != EOF )
2981  {
2982  switch ( c )
2983  {
2984  case 'B':
2985  if ( globalUtilOptind >= argc )
2986  {
2987  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
2988  goto usage;
2989  }
2990  fBddSizeMax = atoi(argv[globalUtilOptind]);
2991  globalUtilOptind++;
2992  if ( fBddSizeMax < 0 )
2993  goto usage;
2994  break;
2995  case 'd':
2996  fDualRail ^= 1;
2997  break;
2998  case 'v':
2999  fVerbose ^= 1;
3000  break;
3001  case 'r':
3002  fReorder ^= 1;
3003  break;
3004  case 'h':
3005  goto usage;
3006  default:
3007  goto usage;
3008  }
3009  }
3010 
3011  if ( pNtk == NULL )
3012  {
3013  Abc_Print( -1, "Empty network.\n" );
3014  return 1;
3015  }
3016 
3017  if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
3018  {
3019  Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
3020  return 1;
3021  }
3022 
3023  // get the new network
3024  if ( Abc_NtkIsStrash(pNtk) )
3025  pNtkRes = Abc_NtkCollapse( pNtk, fBddSizeMax, fDualRail, fReorder, fVerbose );
3026  else
3027  {
3028  pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
3029  pNtkRes = Abc_NtkCollapse( pNtk, fBddSizeMax, fDualRail, fReorder, fVerbose );
3030  Abc_NtkDelete( pNtk );
3031  }
3032  if ( pNtkRes == NULL )
3033  {
3034  Abc_Print( -1, "Collapsing has failed.\n" );
3035  return 1;
3036  }
3037  // replace the current network
3038  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
3039  return 0;
3040 
3041 usage:
3042  Abc_Print( -2, "usage: collapse [-B <num>] [-rdvh]\n" );
3043  Abc_Print( -2, "\t collapses the network by constructing global BDDs\n" );
3044  Abc_Print( -2, "\t-B <num>: limit on live BDD nodes during collapsing [default = %d]\n", fBddSizeMax );
3045  Abc_Print( -2, "\t-r : toggles dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
3046  Abc_Print( -2, "\t-d : toggles dual-rail collapsing mode [default = %s]\n", fDualRail? "yes": "no" );
3047  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
3048  Abc_Print( -2, "\t-h : print the command usage\n");
3049  return 1;
3050 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL Abc_Ntk_t * Abc_NtkCollapse(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcCollapse.c:49
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
int Abc_CommandComb ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6639 of file abc.c.

6640 {
6641  Abc_Ntk_t * pNtk, * pNtkRes;
6642  int c;
6643  int fRemoveLatches;
6644  int nLatchesToAdd;
6645  extern void Abc_NtkMakeSeq( Abc_Ntk_t * pNtk, int nLatchesToAdd );
6646 
6647  pNtk = Abc_FrameReadNtk(pAbc);
6648  // set defaults
6649  fRemoveLatches = 0;
6650  nLatchesToAdd = 0;
6652  while ( ( c = Extra_UtilGetopt( argc, argv, "Llh" ) ) != EOF )
6653  {
6654  switch ( c )
6655  {
6656  case 'L':
6657  if ( globalUtilOptind >= argc )
6658  {
6659  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
6660  goto usage;
6661  }
6662  nLatchesToAdd = atoi(argv[globalUtilOptind]);
6663  globalUtilOptind++;
6664  if ( nLatchesToAdd < 0 )
6665  goto usage;
6666  break;
6667  case 'l':
6668  fRemoveLatches ^= 1;
6669  break;
6670  case 'h':
6671  goto usage;
6672  default:
6673  goto usage;
6674  }
6675  }
6676 
6677  if ( pNtk == NULL )
6678  {
6679  Abc_Print( -1, "Empty network.\n" );
6680  return 1;
6681  }
6682  if ( Abc_NtkIsComb(pNtk) && nLatchesToAdd == 0 )
6683  {
6684  Abc_Print( -1, "The network is already combinational.\n" );
6685  return 0;
6686  }
6687  if ( !Abc_NtkIsComb(pNtk) && nLatchesToAdd != 0 )
6688  {
6689  Abc_Print( -1, "The network is already combinational.\n" );
6690  return 0;
6691  }
6692 
6693  // get the new network
6694  pNtkRes = Abc_NtkDup( pNtk );
6695  if ( nLatchesToAdd )
6696  Abc_NtkMakeSeq( pNtkRes, nLatchesToAdd );
6697  else
6698  Abc_NtkMakeComb( pNtkRes, fRemoveLatches );
6699  // replace the current network
6700  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
6701  return 0;
6702 
6703 usage:
6704  Abc_Print( -2, "usage: comb [-L <num>] [-lh]\n" );
6705  Abc_Print( -2, "\t converts comb network into seq, and vice versa\n" );
6706  Abc_Print( -2, "\t-L <num> : number of latches to add to comb network (0 = do not add) [default = %d]\n", nLatchesToAdd );
6707  Abc_Print( -2, "\t-l : toggle converting latches to PIs/POs or removing them [default = %s]\n", fRemoveLatches? "remove": "convert" );
6708  Abc_Print( -2, "\t-h : print the command usage\n");
6709  return 1;
6710 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL void Abc_NtkMakeComb(Abc_Ntk_t *pNtk, int fRemoveLatches)
Definition: abcNtk.c:1422
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Abc_NtkMakeSeq(Abc_Ntk_t *pNtk, int nLatchesToAdd)
Definition: abcNtk.c:1514
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCone ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8641 of file abc.c.

8642 {
8643  Abc_Ntk_t * pNtk, * pNtkRes;
8644  Abc_Obj_t * pNode, * pNodeCo;
8645  int c;
8646  int fUseAllCis;
8647  int fUseMffc;
8648  int fSeq;
8649  int Output;
8650  int nRange;
8651 
8652  extern Abc_Ntk_t * Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, int Output, int nRange );
8653 
8654  pNtk = Abc_FrameReadNtk(pAbc);
8655  // set defaults
8656  fUseAllCis = 0;
8657  fUseMffc = 0;
8658  fSeq = 0;
8659  Output = -1;
8660  nRange = -1;
8662  while ( ( c = Extra_UtilGetopt( argc, argv, "ORmash" ) ) != EOF )
8663  {
8664  switch ( c )
8665  {
8666  case 'O':
8667  if ( globalUtilOptind >= argc )
8668  {
8669  Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
8670  goto usage;
8671  }
8672  Output = atoi(argv[globalUtilOptind]);
8673  globalUtilOptind++;
8674  if ( Output < 0 )
8675  goto usage;
8676  break;
8677  case 'R':
8678  if ( globalUtilOptind >= argc )
8679  {
8680  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
8681  goto usage;
8682  }
8683  nRange = atoi(argv[globalUtilOptind]);
8684  globalUtilOptind++;
8685  if ( nRange < 0 )
8686  goto usage;
8687  break;
8688  case 'm':
8689  fUseMffc ^= 1;
8690  break;
8691  case 'a':
8692  fUseAllCis ^= 1;
8693  break;
8694  case 's':
8695  fSeq ^= 1;
8696  break;
8697  case 'h':
8698  goto usage;
8699  default:
8700  goto usage;
8701  }
8702  }
8703 
8704  if ( pNtk == NULL )
8705  {
8706  Abc_Print( -1, "Empty network.\n" );
8707  return 1;
8708  }
8709 
8710  if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
8711  {
8712  Abc_Print( -1, "Currently can only be applied to the logic network or an AIG.\n" );
8713  return 1;
8714  }
8715 
8716  if ( argc > globalUtilOptind + 1 )
8717  {
8718  Abc_Print( -1, "Wrong number of auguments.\n" );
8719  goto usage;
8720  }
8721 
8722  pNodeCo = NULL;
8723  if ( argc == globalUtilOptind + 1 )
8724  {
8725  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
8726  if ( pNode == NULL )
8727  {
8728  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
8729  return 1;
8730  }
8731  if ( fUseMffc )
8732  pNtkRes = Abc_NtkCreateMffc( pNtk, pNode, argv[globalUtilOptind] );
8733  else
8734  pNtkRes = Abc_NtkCreateCone( pNtk, pNode, argv[globalUtilOptind], fUseAllCis );
8735  }
8736  else
8737  {
8738  if ( Output == -1 )
8739  {
8740  Abc_Print( -1, "The node is not specified.\n" );
8741  return 1;
8742  }
8743  if ( Output >= Abc_NtkCoNum(pNtk) )
8744  {
8745  Abc_Print( -1, "The 0-based output number (%d) is larger than the number of outputs (%d).\n", Output, Abc_NtkCoNum(pNtk) );
8746  return 1;
8747  }
8748  pNodeCo = Abc_NtkCo( pNtk, Output );
8749  if ( fSeq )
8750  pNtkRes = Abc_NtkMakeOnePo( pNtk, Output, nRange );
8751  else if ( fUseMffc )
8752  pNtkRes = Abc_NtkCreateMffc( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo) );
8753  else
8754  pNtkRes = Abc_NtkCreateCone( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo), fUseAllCis );
8755  }
8756  if ( pNodeCo && Abc_ObjFaninC0(pNodeCo) && !fSeq )
8757  {
8758  Abc_NtkPo(pNtkRes, 0)->fCompl0 ^= 1;
8759 // Abc_Print( -1, "The extracted cone represents the complement function of the CO.\n" );
8760  }
8761  if ( pNtkRes == NULL )
8762  {
8763  Abc_Print( -1, "Writing the logic cone of one node has failed.\n" );
8764  return 1;
8765  }
8766  // replace the current network
8767  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
8768  return 0;
8769 
8770 usage:
8771  Abc_Print( -2, "usage: cone [-OR num] [-amsh] <name>\n" );
8772  Abc_Print( -2, "\t replaces the current network by one logic cone\n" );
8773  Abc_Print( -2, "\t-a : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
8774  Abc_Print( -2, "\t-m : toggle keeping only MFFC or complete TFI cone [default = %s]\n", fUseMffc? "MFFC": "TFI cone" );
8775  Abc_Print( -2, "\t-s : toggle comb or sequential cone (works with \"-O num\") [default = %s]\n", fSeq? "seq": "comb" );
8776  Abc_Print( -2, "\t-h : print the command usage\n");
8777  Abc_Print( -2, "\t-O num : (optional) the 0-based number of the CO to extract\n");
8778  Abc_Print( -2, "\t-R num : (optional) the number of outputs to extract\n");
8779  Abc_Print( -2, "\tname : (optional) the name of the node to extract\n");
8780  return 1;
8781 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
unsigned fCompl0
Definition: abc.h:140
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:318
ABC_DLL Abc_Ntk_t * Abc_NtkCreateMffc(Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, char *pNodeName)
Definition: abcNtk.c:1022
Abc_Ntk_t * Abc_NtkMakeOnePo(Abc_Ntk_t *pNtkInit, int Output, int nRange)
Definition: abcNtk.c:1590
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL Abc_Ntk_t * Abc_NtkCreateCone(Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, char *pNodeName, int fUseAllCis)
Definition: abcNtk.c:819
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandConstr ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23421 of file abc.c.

23422 {
23423  Abc_Ntk_t * pNtk;
23424  int c;
23425  int nFrames;
23426  int nConfs;
23427  int nProps;
23428  int fRemove;
23429  int fStruct;
23430  int fInvert;
23431  int fOldAlgo;
23432  int fVerbose;
23433  int nConstrs;
23434  extern void Abc_NtkDarConstr( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
23435 
23436  pNtk = Abc_FrameReadNtk(pAbc);
23437  // set defaults
23438  nFrames = 1;
23439  nConfs = 1000;
23440  nProps = 1000;
23441  fRemove = 0;
23442  fStruct = 0;
23443  fInvert = 0;
23444  fOldAlgo = 0;
23445  fVerbose = 0;
23446  nConstrs = -1;
23448  while ( ( c = Extra_UtilGetopt( argc, argv, "FCPNrsiavh" ) ) != EOF )
23449  {
23450  switch ( c )
23451  {
23452  case 'F':
23453  if ( globalUtilOptind >= argc )
23454  {
23455  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
23456  goto usage;
23457  }
23458  nFrames = atoi(argv[globalUtilOptind]);
23459  globalUtilOptind++;
23460  if ( nFrames < 0 )
23461  goto usage;
23462  break;
23463  case 'C':
23464  if ( globalUtilOptind >= argc )
23465  {
23466  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
23467  goto usage;
23468  }
23469  nConfs = atoi(argv[globalUtilOptind]);
23470  globalUtilOptind++;
23471  if ( nConfs < 0 )
23472  goto usage;
23473  break;
23474  case 'P':
23475  if ( globalUtilOptind >= argc )
23476  {
23477  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
23478  goto usage;
23479  }
23480  nProps = atoi(argv[globalUtilOptind]);
23481  globalUtilOptind++;
23482  if ( nProps < 0 )
23483  goto usage;
23484  break;
23485  case 'N':
23486  if ( globalUtilOptind >= argc )
23487  {
23488  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
23489  goto usage;
23490  }
23491  nConstrs = atoi(argv[globalUtilOptind]);
23492  globalUtilOptind++;
23493  if ( nConstrs < 0 )
23494  goto usage;
23495  break;
23496  case 'r':
23497  fRemove ^= 1;
23498  break;
23499  case 's':
23500  fStruct ^= 1;
23501  break;
23502  case 'i':
23503  fInvert ^= 1;
23504  break;
23505  case 'a':
23506  fOldAlgo ^= 1;
23507  break;
23508  case 'v':
23509  fVerbose ^= 1;
23510  break;
23511  case 'h':
23512  goto usage;
23513  default:
23514  goto usage;
23515  }
23516  }
23517  if ( pNtk == NULL )
23518  {
23519  Abc_Print( -1, "Empty network.\n" );
23520  return 1;
23521  }
23522  if ( !Abc_NtkIsStrash(pNtk) )
23523  {
23524  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
23525  return 0;
23526  }
23527  if ( fRemove )
23528  {
23529  if ( Abc_NtkConstrNum(pNtk) == 0 )
23530  {
23531  Abc_Print( -1, "Constraints are not defined.\n" );
23532  return 0;
23533  }
23534  Abc_Print( 1, "Constraints are converted to be primary outputs.\n" );
23535  pNtk->nConstrs = 0;
23536  return 0;
23537  }
23538  // consider the case of manual constraint definition
23539  if ( nConstrs >= 0 )
23540  {
23541  if ( Abc_NtkIsComb(pNtk) )
23542  Abc_Print( 0, "The network is combinational.\n" );
23543  if ( Abc_NtkConstrNum(pNtk) > 0 )
23544  Abc_Print( 0, "The network currently has %d constraints.\n", Abc_NtkConstrNum(pNtk) );
23545  if ( nConstrs >= Abc_NtkPoNum(pNtk) )
23546  {
23547  Abc_Print( -1, "The number of constraints specified (%d) should be less than POs (%d).\n", nConstrs, Abc_NtkPoNum(pNtk) );
23548  return 0;
23549  }
23550  Abc_Print( 1, "Setting the last %d POs as constraint outputs.\n", nConstrs );
23551  pNtk->nConstrs = nConstrs;
23552  return 0;
23553  }
23554  // consider the case of already defined constraints
23555  if ( Abc_NtkConstrNum(pNtk) > 0 )
23556  {
23557  extern void Abc_NtkDarConstrProfile( Abc_Ntk_t * pNtk, int fVerbose );
23558  if ( fInvert )
23559  {
23560  Abc_NtkInvertConstraints( pNtk );
23561  if ( Abc_NtkConstrNum(pNtk) == 1 )
23562  Abc_Print( 1, "The output of %d constraint is complemented.\n", Abc_NtkConstrNum(pNtk) );
23563  else
23564  Abc_Print( 1, "The outputs of %d constraints are complemented.\n", Abc_NtkConstrNum(pNtk) );
23565  }
23566  if ( fVerbose )
23567  Abc_NtkDarConstrProfile( pNtk, fVerbose );
23568  return 0;
23569  }
23570  if ( Abc_NtkIsComb(pNtk) )
23571  {
23572  Abc_Print( -1, "The network is combinational.\n" );
23573  return 0;
23574  }
23575  // detect constraints using functional/structural methods
23576  Abc_NtkDarConstr( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
23577  return 0;
23578 usage:
23579  Abc_Print( -2, "usage: constr [-FCPN num] [-risavh]\n" );
23580  Abc_Print( -2, "\t a toolkit for constraint manipulation\n" );
23581  Abc_Print( -2, "\t if constraints are absent, detect them functionally\n" );
23582  Abc_Print( -2, "\t if constraints are present, profiles them using random simulation\n" );
23583  Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
23584  Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
23585  Abc_Print( -2, "\t-P num : the max number of propagations in SAT solving [default = %d]\n", nProps );
23586  Abc_Print( -2, "\t-N num : manually set the last <num> POs to be constraints [default = %d]\n", nConstrs );
23587  Abc_Print( -2, "\t-r : manually remove the constraints [default = %s]\n", fRemove? "yes": "no" );
23588  Abc_Print( -2, "\t-i : toggle inverting already defined constraints [default = %s]\n", fInvert? "yes": "no" );
23589  Abc_Print( -2, "\t-s : toggle using structural detection methods [default = %s]\n", fStruct? "yes": "no" );
23590  Abc_Print( -2, "\t-a : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
23591  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
23592  Abc_Print( -2, "\t-h : print the command usage\n");
23593  return 1;
23594 }
ABC_DLL void Abc_NtkInvertConstraints(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:2204
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
void Abc_NtkDarConstrProfile(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcDar.c:4576
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkDarConstr(Abc_Ntk_t *pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose)
Definition: abcDar.c:4460
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int nConstrs
Definition: abc.h:173
int Abc_CommandCover ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10148 of file abc.c.

10149 {
10150  Abc_Ntk_t * pNtk, * pNtkRes;
10151  int c;
10152  int fVerbose;
10153  int fUseSop;
10154  int fUseEsop;
10155  int fUseInvs;
10156  int nFaninMax;
10157  pNtk = Abc_FrameReadNtk(pAbc);
10158 
10159  // set defaults
10160  fUseSop = 1;
10161  fUseEsop = 0;
10162  fVerbose = 0;
10163  fUseInvs = 1;
10164  nFaninMax = 8;
10166  while ( ( c = Extra_UtilGetopt( argc, argv, "Nsxivh" ) ) != EOF )
10167  {
10168  switch ( c )
10169  {
10170  case 'N':
10171  if ( globalUtilOptind >= argc )
10172  {
10173  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
10174  goto usage;
10175  }
10176  nFaninMax = atoi(argv[globalUtilOptind]);
10177  globalUtilOptind++;
10178  if ( nFaninMax < 0 )
10179  goto usage;
10180  break;
10181  case 's':
10182  fUseSop ^= 1;
10183  break;
10184  case 'x':
10185  fUseEsop ^= 1;
10186  break;
10187  case 'i':
10188  fUseInvs ^= 1;
10189  break;
10190  case 'v':
10191  fVerbose ^= 1;
10192  break;
10193  case 'h':
10194  goto usage;
10195  default:
10196  goto usage;
10197  }
10198  }
10199  if ( pNtk == NULL )
10200  {
10201  Abc_Print( -1, "Empty network.\n" );
10202  return 1;
10203  }
10204 
10205  if ( !Abc_NtkIsStrash(pNtk) )
10206  {
10207  Abc_Print( -1, "Only works for strashed networks.\n" );
10208  return 1;
10209  }
10210 
10211  // run the command
10212  pNtkRes = Abc_NtkSopEsopCover( pNtk, nFaninMax, fUseEsop, fUseSop, fUseInvs, fVerbose );
10213  if ( pNtkRes == NULL )
10214  {
10215  Abc_Print( -1, "Command has failed.\n" );
10216  return 0;
10217  }
10218  // replace the current network
10219  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10220  return 0;
10221 
10222 usage:
10223  Abc_Print( -2, "usage: cover [-N num] [-sxvh]\n" );
10224  Abc_Print( -2, "\t decomposition into a network of SOP/ESOP PLAs\n" );
10225  Abc_Print( -2, "\t-N num : maximum number of inputs [default = %d]\n", nFaninMax );
10226  Abc_Print( -2, "\t-s : toggle the use of SOPs [default = %s]\n", fUseSop? "yes": "no" );
10227  Abc_Print( -2, "\t-x : toggle the use of ESOPs [default = %s]\n", fUseEsop? "yes": "no" );
10228 // Abc_Print( -2, "\t-i : toggle the use of interters [default = %s]\n", fUseInvs? "yes": "no" );
10229  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
10230  Abc_Print( -2, "\t-h : print the command usage\n");
10231  return 1;
10232 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkSopEsopCover(Abc_Ntk_t *pNtk, int nFaninMax, int fUseEsop, int fUseSop, int fUseInvs, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: covCore.c:60
int Abc_CommandCRetime ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17558 of file abc.c.

17559 {
17560  Abc_Ntk_t * pNtk, * pNtkRes;
17561  int c;
17562  int fVerbose;
17563  extern Abc_Ntk_t * Abc_NtkCRetime( Abc_Ntk_t * pNtk, int fVerbose );
17564 
17565  pNtk = Abc_FrameReadNtk(pAbc);
17566  // set defaults
17567  fVerbose = 0;
17569  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
17570  {
17571  switch ( c )
17572  {
17573  case 'v':
17574  fVerbose ^= 1;
17575  break;
17576  case 'h':
17577  goto usage;
17578  default:
17579  goto usage;
17580  }
17581  }
17582  if ( pNtk == NULL )
17583  {
17584  Abc_Print( -1, "Empty network.\n" );
17585  return 1;
17586  }
17587  if ( Abc_NtkIsStrash(pNtk) )
17588  {
17589  Abc_Print( -1, "Only works for logic networks.\n" );
17590  return 1;
17591  }
17592  if ( !Abc_NtkLatchNum(pNtk) )
17593  {
17594  Abc_Print( -1, "The network is combinational.\n" );
17595  return 0;
17596  }
17597  // modify the current network
17598  pNtkRes = Abc_NtkCRetime( pNtk, fVerbose );
17599  if ( pNtkRes == NULL )
17600  {
17601  Abc_Print( -1, "Sequential cleanup has failed.\n" );
17602  return 1;
17603  }
17604  // replace the current network
17605  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17606  return 0;
17607 
17608 usage:
17609  Abc_Print( -2, "usage: cretime [-vh]\n" );
17610  Abc_Print( -2, "\t performs most-forward retiming with equiv classes\n" );
17611  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
17612  Abc_Print( -2, "\t-h : print the command usage\n");
17613  return 1;
17614 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Abc_Ntk_t * Abc_NtkCRetime(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcLatch.c:641
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCS_kLiveness ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Definition at line 525 of file kliveness.c.

526 {
527  Abc_Ntk_t * pNtk, * pNtkTemp;
528  Aig_Man_t * pAig, *pAigCS, *pAigCSNew;
529  int absorberCount;
530  int absorberLimit = 500;
531  int RetValue;
532  int liveIndex_0 = -1, liveIndex_k = -1;
533  int fVerbose = 1;
534  int directive = -1;
535  int c;
536  int safetyInvariantPO = -1;
537  abctime beginTime, endTime;
538  double time_spent;
539  Vec_Ptr_t *vMasterBarrierDisjuncts = NULL;
540  Aig_Man_t *pWorkingAig;
541  //FILE *fp;
542 
543  pNtk = Abc_FrameReadNtk(pAbc);
544 
545  //fp = fopen("propFile.txt", "r");
546  //if( fp )
547  // getVecOfVecFairness(fp);
548  //exit(0);
549 
550  /*************************************************
551  Extraction of Command Line Argument
552  *************************************************/
553  if( argc == 1 )
554  {
555  assert( directive == -1 );
556  directive = SIMPLE_kCS;
557  }
558  else
559  {
561  while ( ( c = Extra_UtilGetopt( argc, argv, "cmCgh" ) ) != EOF )
562  {
563  switch( c )
564  {
565  case 'c':
566  directive = kCS_WITH_SAFETY_INVARIANTS;
567  break;
568  case 'm':
570  break;
571  case 'C':
573  break;
574  case 'g':
576  break;
577  case 'h':
578  goto usage;
579  break;
580  default:
581  goto usage;
582  }
583  }
584  }
585  /*************************************************
586  Extraction of Command Line Argument Ends
587  *************************************************/
588 
589  if( !Abc_NtkIsStrash( pNtk ) )
590  {
591  printf("The input network was not strashed, strashing....\n");
592  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
593  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
594  }
595  else
596  {
597  pAig = Abc_NtkToDar( pNtk, 0, 1 );
598  pNtkTemp = pNtk;
599  }
600 
601  if( directive == kCS_WITH_SAFETY_INVARIANTS )
602  {
603  safetyInvariantPO = collectSafetyInvariantPOIndex(pNtkTemp);
604  assert( safetyInvariantPO != -1 );
605  }
606 
607  if(directive == kCS_WITH_DISCOVER_MONOTONE_SIGNALS)
608  {
609  beginTime = Abc_Clock();
610  vMasterBarrierDisjuncts = findDisjunctiveMonotoneSignals( pNtk );
611  endTime = Abc_Clock();
612  time_spent = (double)(endTime - beginTime)/CLOCKS_PER_SEC;
613  printf("pre-processing time = %f\n",time_spent);
614  return 0;
615  }
616 
617  if(directive == kCS_WITH_SAFETY_AND_DCS_INVARIANTS)
618  {
619  safetyInvariantPO = collectSafetyInvariantPOIndex(pNtkTemp);
620  assert( safetyInvariantPO != -1 );
621 
622  beginTime = Abc_Clock();
623  vMasterBarrierDisjuncts = findDisjunctiveMonotoneSignals( pNtk );
624  endTime = Abc_Clock();
625  time_spent = (double)(endTime - beginTime)/CLOCKS_PER_SEC;
626  printf("pre-processing time = %f\n",time_spent);
627 
628  assert( vMasterBarrierDisjuncts != NULL );
629  assert( Vec_PtrSize(vMasterBarrierDisjuncts) > 0 );
630  }
631 
633  {
634  safetyInvariantPO = collectSafetyInvariantPOIndex(pNtkTemp);
635  assert( safetyInvariantPO != -1 );
636 
637  beginTime = Abc_Clock();
638  vMasterBarrierDisjuncts = collectUserGivenDisjunctiveMonotoneSignals( pNtk );
639  endTime = Abc_Clock();
640  time_spent = (double)(endTime - beginTime)/CLOCKS_PER_SEC;
641  printf("pre-processing time = %f\n",time_spent);
642 
643  assert( vMasterBarrierDisjuncts != NULL );
644  assert( Vec_PtrSize(vMasterBarrierDisjuncts) > 0 );
645  }
646 
648  {
649  assert( vMasterBarrierDisjuncts != NULL );
650  pWorkingAig = generateWorkingAigWithDSC( pAig, pNtk, &liveIndex_0, vMasterBarrierDisjuncts );
651  pAigCS = introduceAbsorberLogic(pWorkingAig, &liveIndex_0, &liveIndex_k, 0);
652  }
653  else
654  {
655  pWorkingAig = generateWorkingAig( pAig, pNtk, &liveIndex_0 );
656  pAigCS = introduceAbsorberLogic(pWorkingAig, &liveIndex_0, &liveIndex_k, 0);
657  }
658 
659  Aig_ManStop(pWorkingAig);
660 
661  for( absorberCount=1; absorberCount<absorberLimit; absorberCount++ )
662  {
663  //printf( "\nindex of the liveness output = %d\n", liveIndex_k );
664  RetValue = flipConePdr( pAigCS, directive, liveIndex_k, safetyInvariantPO, absorberCount );
665 
666  if ( RetValue == 1 )
667  {
668  Abc_Print( 1, "k = %d, Property proved\n", absorberCount );
669  break;
670  }
671  else if ( RetValue == 0 )
672  {
673  if( fVerbose )
674  {
675  Abc_Print( 1, "k = %d, Property DISPROVED\n", absorberCount );
676  }
677  }
678  else if ( RetValue == -1 )
679  {
680  Abc_Print( 1, "Property UNDECIDED with k = %d.\n", absorberCount );
681  }
682  else
683  assert( 0 );
684 
685  pAigCSNew = introduceAbsorberLogic(pAigCS, &liveIndex_0, &liveIndex_k, absorberCount);
686  Aig_ManStop(pAigCS);
687  pAigCS = pAigCSNew;
688  }
689 
690  Aig_ManStop(pAigCS);
691  Aig_ManStop(pAig);
692 
694  {
695  deallocateMasterBarrierDisjunctInt(vMasterBarrierDisjuncts);
696  }
697  else
698  {
699  //if(vMasterBarrierDisjuncts)
700  // Vec_PtrFree(vMasterBarrierDisjuncts);
701  //deallocateMasterBarrierDisjunctVecPtrVecInt(vMasterBarrierDisjuncts);
702  deallocateMasterBarrierDisjunctInt(vMasterBarrierDisjuncts);
703  }
704  return 0;
705 
706  usage:
707  fprintf( stdout, "usage: kcs [-cmgCh]\n" );
708  fprintf( stdout, "\timplements Claessen-Sorensson's k-Liveness algorithm\n" );
709  fprintf( stdout, "\t-c : verification with constraints, looks for POs prefixed with csSafetyInvar_\n");
710  fprintf( stdout, "\t-m : discovers monotone signals\n");
711  fprintf( stdout, "\t-g : verification with user-supplied barriers, looks for POs prefixed with csLevel1Stabil_\n");
712  fprintf( stdout, "\t-C : verification with discovered monotone signals\n");
713  fprintf( stdout, "\t-h : print usage\n");
714  return 1;
715 
716 }
ABC_NAMESPACE_IMPL_START Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
#define kCS_WITH_SAFETY_AND_USER_GIVEN_DCS_INVARIANTS
Definition: kliveness.c:61
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
static abctime Abc_Clock()
Definition: abc_global.h:279
#define kCS_WITH_SAFETY_AND_DCS_INVARIANTS
Definition: kliveness.c:60
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
#define kCS_WITH_DISCOVER_MONOTONE_SIGNALS
Definition: kliveness.c:59
Vec_Ptr_t * collectUserGivenDisjunctiveMonotoneSignals(Abc_Ntk_t *pNtk)
Definition: kliveness.c:439
Aig_Man_t * generateWorkingAig(Aig_Man_t *pAig, Abc_Ntk_t *pNtk, int *pIndex0Live)
int flipConePdr(Aig_Man_t *pAig, int directive, int targetCSPropertyIndex, int safetyInvariantPOIndex, int absorberCount)
Definition: kliveness.c:341
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
#define kCS_WITH_SAFETY_INVARIANTS
Definition: kliveness.c:58
#define SIMPLE_kCS
Definition: kliveness.c:57
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Aig_Man_t * generateWorkingAigWithDSC(Aig_Man_t *pAig, Abc_Ntk_t *pNtk, int *pIndex0Live, Vec_Ptr_t *vMasterBarriers)
Aig_Man_t * introduceAbsorberLogic(Aig_Man_t *pAig, int *pLiveIndex_0, int *pLiveIndex_k, int nonFirstIteration)
Definition: kliveness.c:175
#define assert(ex)
Definition: util_old.h:213
int collectSafetyInvariantPOIndex(Abc_Ntk_t *pNtk)
Definition: kliveness.c:425
ABC_INT64_T abctime
Definition: abc_global.h:278
Vec_Ptr_t * findDisjunctiveMonotoneSignals(Abc_Ntk_t *pNtk)
void deallocateMasterBarrierDisjunctInt(Vec_Ptr_t *vMasterBarrierDisjunctsArg)
Definition: kliveness.c:463
int Abc_CommandCSweep ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12498 of file abc.c.

12499 {
12500  Abc_Ntk_t * pNtk, * pNtkRes;
12501  int c, nCutsMax, nLeafMax, fVerbose;
12502 
12503  extern Abc_Ntk_t * Abc_NtkCSweep( Abc_Ntk_t * pNtk, int nCutsMax, int nLeafMax, int fVerbose );
12504 
12505  pNtk = Abc_FrameReadNtk(pAbc);
12506  // set defaults
12507  nCutsMax = 8;
12508  nLeafMax = 6;
12509  fVerbose = 0;
12511  while ( ( c = Extra_UtilGetopt( argc, argv, "CKvh" ) ) != EOF )
12512  {
12513  switch ( c )
12514  {
12515  case 'C':
12516  if ( globalUtilOptind >= argc )
12517  {
12518  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
12519  goto usage;
12520  }
12521  nCutsMax = atoi(argv[globalUtilOptind]);
12522  globalUtilOptind++;
12523  if ( nCutsMax < 0 )
12524  goto usage;
12525  break;
12526  case 'K':
12527  if ( globalUtilOptind >= argc )
12528  {
12529  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
12530  goto usage;
12531  }
12532  nLeafMax = atoi(argv[globalUtilOptind]);
12533  globalUtilOptind++;
12534  if ( nLeafMax < 0 )
12535  goto usage;
12536  break;
12537  case 'v':
12538  fVerbose ^= 1;
12539  break;
12540  case 'h':
12541  goto usage;
12542  default:
12543  goto usage;
12544  }
12545  }
12546  if ( pNtk == NULL )
12547  {
12548  Abc_Print( -1, "Empty network.\n" );
12549  return 1;
12550  }
12551 
12552  if ( nCutsMax < 2 )
12553  {
12554  Abc_Print( -1, "The number of cuts cannot be less than 2.\n" );
12555  return 1;
12556  }
12557 
12558  if ( nLeafMax < 3 || nLeafMax > 16 )
12559  {
12560  Abc_Print( -1, "The number of leaves is infeasible.\n" );
12561  return 1;
12562  }
12563  if ( !Abc_NtkIsStrash(pNtk) )
12564  {
12565  Abc_Print( -1, "This command works only for strashed networks.\n" );
12566  return 1;
12567  }
12568 
12569  pNtkRes = Abc_NtkCSweep( pNtk, nCutsMax, nLeafMax, fVerbose );
12570  if ( pNtkRes == NULL )
12571  {
12572  Abc_Print( -1, "Command has failed.\n" );
12573  return 0;
12574  }
12575  // replace the current network
12576  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
12577  return 0;
12578 
12579 usage:
12580  Abc_Print( -2, "usage: csweep [-C num] [-K num] [-vh]\n" );
12581  Abc_Print( -2, "\t performs cut sweeping using a new method\n" );
12582  Abc_Print( -2, "\t-C num : limit on the number of cuts (C >= 2) [default = %d]\n", nCutsMax );
12583  Abc_Print( -2, "\t-K num : limit on the cut size (3 <= K <= 16) [default = %d]\n", nLeafMax );
12584  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
12585  Abc_Print( -2, "\t-h : print the command usage\n");
12586  return 1;
12587 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Abc_Ntk_t * Abc_NtkCSweep(Abc_Ntk_t *pNtk, int nCutsMax, int nLeafMax, int fVerbose)
Definition: abcDar.c:1418
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCubeEnum ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20161 of file abc.c.

20162 {
20163  extern void Abc_EnumerateCubeStates();
20164  extern void Abc_EnumerateCubeStatesZdd();
20165  int c, fZddAlgo = 0, fVerbose = 0;
20167  while ( ( c = Extra_UtilGetopt( argc, argv, "zvh" ) ) != EOF )
20168  {
20169  switch ( c )
20170  {
20171  case 'z':
20172  fZddAlgo ^= 1;
20173  break;
20174  case 'v':
20175  fVerbose ^= 1;
20176  break;
20177  case 'h':
20178  goto usage;
20179  default:
20180  Abc_Print( -2, "Unknown switch.\n");
20181  goto usage;
20182  }
20183  }
20184  if ( fZddAlgo )
20186  else
20188  return 0;
20189 
20190 usage:
20191  Abc_Print( -2, "usage: cubeenum [-vh]\n" );
20192  Abc_Print( -2, "\t enumerates reachable states of 2x2x2 cube\n" );
20193  Abc_Print( -2, "\t (http://en.wikipedia.org/wiki/Pocket_Cube)\n" );
20194  Abc_Print( -2, "\t-z : toggle using ZDD-based algorithm [default = %s]\n", fZddAlgo? "yes": "no" );
20195  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
20196  Abc_Print( -2, "\t-h : print the command usage\n");
20197  return 1;
20198 }
void Abc_EnumerateCubeStates()
void Abc_EnumerateCubeStatesZdd()
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCubes ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8308 of file abc.c.

8309 {
8310  extern Abc_Ntk_t * Abc_NtkSopToCubes( Abc_Ntk_t * pNtk );
8311  Abc_Ntk_t * pNtk, * pNtkRes;
8312  int c;
8313 
8314  pNtk = Abc_FrameReadNtk(pAbc);
8315  // set defaults
8317  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
8318  {
8319  switch ( c )
8320  {
8321  case 'h':
8322  goto usage;
8323  default:
8324  goto usage;
8325  }
8326  }
8327 
8328  if ( pNtk == NULL )
8329  {
8330  Abc_Print( -1, "Empty network.\n" );
8331  return 1;
8332  }
8333 
8334  if ( !Abc_NtkIsSopLogic(pNtk) )
8335  {
8336  Abc_Print( -1, "Only a SOP logic network can be transformed into cubes.\n" );
8337  return 1;
8338  }
8339 
8340  // get the new network
8341  pNtkRes = Abc_NtkSopToCubes( pNtk );
8342  if ( pNtkRes == NULL )
8343  {
8344  Abc_Print( -1, "Converting to cubes has failed.\n" );
8345  return 1;
8346  }
8347  // replace the current network
8348  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
8349  return 0;
8350 
8351 usage:
8352  Abc_Print( -2, "usage: cubes [-h]\n" );
8353  Abc_Print( -2, "\t converts the current network into a network derived by creating\n" );
8354  Abc_Print( -2, "\t a separate node for each product and sum in the local SOPs\n" );
8355  Abc_Print( -2, "\t-h : print the command usage\n");
8356  return 1;
8357 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Abc_Ntk_t * Abc_NtkSopToCubes(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:2539
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandCut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9500 of file abc.c.

9501 {
9502  Cut_Params_t Params, * pParams = &Params;
9503  Cut_Man_t * pCutMan;
9504  Cut_Oracle_t * pCutOracle = NULL;
9505  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
9506  int c;
9507  int fOracle;
9508  extern Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
9509  extern void Abc_NtkCutsOracle( Abc_Ntk_t * pNtk, Cut_Oracle_t * pCutOracle );
9510 
9511  // set defaults
9512  fOracle = 0;
9513  memset( pParams, 0, sizeof(Cut_Params_t) );
9514  pParams->nVarsMax = 5; // the max cut size ("k" of the k-feasible cuts)
9515  pParams->nKeepMax = 1000; // the max number of cuts kept at a node
9516  pParams->fTruth = 1; // compute truth tables
9517  pParams->fFilter = 1; // filter dominated cuts
9518  pParams->fDrop = 0; // drop cuts on the fly
9519  pParams->fDag = 1; // compute DAG cuts
9520  pParams->fTree = 0; // compute tree cuts
9521  pParams->fGlobal = 0; // compute global cuts
9522  pParams->fLocal = 0; // compute local cuts
9523  pParams->fFancy = 0; // compute something fancy
9524  pParams->fRecordAig = 1; // compute something fancy
9525  pParams->fMap = 0; // compute mapping delay
9526  pParams->fAdjust = 0; // removes useless fanouts
9527  pParams->fNpnSave = 0; // enables dumping truth tables
9528  pParams->fVerbose = 0; // the verbosiness flag
9530  while ( ( c = Extra_UtilGetopt( argc, argv, "KMtfdxyglzamjvosh" ) ) != EOF )
9531  {
9532  switch ( c )
9533  {
9534  case 'K':
9535  if ( globalUtilOptind >= argc )
9536  {
9537  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
9538  goto usage;
9539  }
9540  pParams->nVarsMax = atoi(argv[globalUtilOptind]);
9541  globalUtilOptind++;
9542  if ( pParams->nVarsMax < 0 )
9543  goto usage;
9544  break;
9545  case 'M':
9546  if ( globalUtilOptind >= argc )
9547  {
9548  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
9549  goto usage;
9550  }
9551  pParams->nKeepMax = atoi(argv[globalUtilOptind]);
9552  globalUtilOptind++;
9553  if ( pParams->nKeepMax < 0 )
9554  goto usage;
9555  break;
9556  case 't':
9557  pParams->fTruth ^= 1;
9558  break;
9559  case 'f':
9560  pParams->fFilter ^= 1;
9561  break;
9562  case 'd':
9563  pParams->fDrop ^= 1;
9564  break;
9565  case 'x':
9566  pParams->fDag ^= 1;
9567  break;
9568  case 'y':
9569  pParams->fTree ^= 1;
9570  break;
9571  case 'g':
9572  pParams->fGlobal ^= 1;
9573  break;
9574  case 'l':
9575  pParams->fLocal ^= 1;
9576  break;
9577  case 'z':
9578  pParams->fFancy ^= 1;
9579  break;
9580  case 'a':
9581  pParams->fRecordAig ^= 1;
9582  break;
9583  case 'm':
9584  pParams->fMap ^= 1;
9585  break;
9586  case 'j':
9587  pParams->fAdjust ^= 1;
9588  break;
9589  case 'v':
9590  pParams->fVerbose ^= 1;
9591  break;
9592  case 'o':
9593  fOracle ^= 1;
9594  break;
9595  case 's':
9596  pParams->fNpnSave ^= 1;
9597  break;
9598  case 'h':
9599  goto usage;
9600  default:
9601  goto usage;
9602  }
9603  }
9604 
9605  if ( pNtk == NULL )
9606  {
9607  Abc_Print( -1, "Empty network.\n" );
9608  return 1;
9609  }
9610  if ( !Abc_NtkIsStrash(pNtk) )
9611  {
9612  Abc_Print( -1, "Cut computation is available only for AIGs (run \"strash\").\n" );
9613  return 1;
9614  }
9615  if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
9616  {
9617  Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
9618  return 1;
9619  }
9620  if ( pParams->fDag && pParams->fTree )
9621  {
9622  Abc_Print( -1, "Cannot compute both DAG cuts and tree cuts at the same time.\n" );
9623  return 1;
9624  }
9625 
9626  if ( pParams->fNpnSave )
9627  {
9628  pParams->nVarsMax = 6;
9629  pParams->fTruth = 1;
9630  }
9631 
9632  if ( fOracle )
9633  pParams->fRecord = 1;
9634  pCutMan = Abc_NtkCuts( pNtk, pParams );
9635  if ( fOracle )
9636  pCutOracle = Cut_OracleStart( pCutMan );
9637  Cut_ManStop( pCutMan );
9638  if ( fOracle )
9639  {
9640  assert(pCutOracle);
9641  Abc_NtkCutsOracle( pNtk, pCutOracle );
9642  Cut_OracleStop( pCutOracle );
9643  }
9644  return 0;
9645 
9646 usage:
9647  Abc_Print( -2, "usage: cut [-K num] [-M num] [-tfdcovamjsvh]\n" );
9648  Abc_Print( -2, "\t computes k-feasible cuts for the AIG\n" );
9649  Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
9650  Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n", pParams->nKeepMax );
9651  Abc_Print( -2, "\t-t : toggle truth table computation [default = %s]\n", pParams->fTruth? "yes": "no" );
9652  Abc_Print( -2, "\t-f : toggle filtering of duplicated/dominated [default = %s]\n", pParams->fFilter? "yes": "no" );
9653  Abc_Print( -2, "\t-d : toggle dropping when fanouts are done [default = %s]\n", pParams->fDrop? "yes": "no" );
9654  Abc_Print( -2, "\t-x : toggle computing only DAG cuts [default = %s]\n", pParams->fDag? "yes": "no" );
9655  Abc_Print( -2, "\t-y : toggle computing only tree cuts [default = %s]\n", pParams->fTree? "yes": "no" );
9656  Abc_Print( -2, "\t-g : toggle computing only global cuts [default = %s]\n", pParams->fGlobal? "yes": "no" );
9657  Abc_Print( -2, "\t-l : toggle computing only local cuts [default = %s]\n", pParams->fLocal? "yes": "no" );
9658  Abc_Print( -2, "\t-z : toggle fancy computations [default = %s]\n", pParams->fFancy? "yes": "no" );
9659  Abc_Print( -2, "\t-a : toggle recording cut functions [default = %s]\n", pParams->fRecordAig?"yes": "no" );
9660  Abc_Print( -2, "\t-m : toggle delay-oriented FPGA mapping [default = %s]\n", pParams->fMap? "yes": "no" );
9661  Abc_Print( -2, "\t-j : toggle removing fanouts due to XOR/MUX [default = %s]\n", pParams->fAdjust? "yes": "no" );
9662  Abc_Print( -2, "\t-s : toggle creating library of 6-var functions [default = %s]\n", pParams->fNpnSave? "yes": "no" );
9663  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
9664  Abc_Print( -2, "\t-h : print the command usage\n");
9665  return 1;
9666 }
char * memset()
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Cut_Oracle_t * Cut_OracleStart(Cut_Man_t *pMan)
FUNCTION DEFINITIONS ///.
Definition: cutOracle.c:73
void Cut_OracleStop(Cut_Oracle_t *p)
Definition: cutOracle.c:127
#define CUT_SIZE_MAX
Definition: cut.h:39
int fRecordAig
Definition: cut.h:69
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
#define CUT_SIZE_MIN
INCLUDES ///.
Definition: cut.h:38
void Cut_ManStop(Cut_Man_t *p)
Definition: cutMan.c:124
Cut_Man_t * Abc_NtkCuts(Abc_Ntk_t *pNtk, Cut_Params_t *pParams)
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Abc_NtkCutsOracle(Abc_Ntk_t *pNtk, Cut_Oracle_t *p)
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define assert(ex)
Definition: util_old.h:213
DECLARATIONS ///.
Definition: cutOracle.c:30
int Abc_CommandCycle ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 18861 of file abc.c.

18862 {
18863  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
18864  int c;
18865  int nFrames;
18866  int fUseXval;
18867  int fVerbose;
18868  extern void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVerbose );
18869  extern void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
18870  // set defaults
18871  nFrames = 100;
18872  fUseXval = 0;
18873  fVerbose = 0;
18875  while ( ( c = Extra_UtilGetopt( argc, argv, "Fxvh" ) ) != EOF )
18876  {
18877  switch ( c )
18878  {
18879  case 'F':
18880  if ( globalUtilOptind >= argc )
18881  {
18882  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
18883  goto usage;
18884  }
18885  nFrames = atoi(argv[globalUtilOptind]);
18886  globalUtilOptind++;
18887  if ( nFrames < 0 )
18888  goto usage;
18889  break;
18890  case 'x':
18891  fUseXval ^= 1;
18892  break;
18893  case 'v':
18894  fVerbose ^= 1;
18895  break;
18896  case 'h':
18897  goto usage;
18898  default:
18899  goto usage;
18900  }
18901  }
18902  if ( pNtk == NULL )
18903  {
18904  Abc_Print( -1, "Empty network.\n" );
18905  return 1;
18906  }
18907 
18908  if ( !Abc_NtkIsStrash(pNtk) && !Abc_NtkIsSopLogic(pNtk) )
18909  {
18910  Abc_Print( -1, "Only works for strashed networks or logic SOP networks.\n" );
18911  return 1;
18912  }
18913  if ( !Abc_NtkLatchNum(pNtk) )
18914  {
18915  Abc_Print( -1, "The network is combinational.\n" );
18916  return 0;
18917  }
18918  if ( fUseXval && !Abc_NtkIsStrash(pNtk) )
18919  {
18920  Abc_Print( -1, "X-valued simulation only works for AIGs. Run \"strash\".\n" );
18921  return 0;
18922  }
18923  if ( fUseXval )
18924  Abc_NtkCycleInitState( pNtk, nFrames, 1, fVerbose );
18925  else if ( Abc_NtkIsStrash(pNtk) )
18926  Abc_NtkCycleInitState( pNtk, nFrames, 0, fVerbose );
18927  else
18928  Abc_NtkCycleInitStateSop( pNtk, nFrames, fVerbose );
18929  return 0;
18930 
18931 usage:
18932  Abc_Print( -2, "usage: cycle [-F num] [-xvh]\n" );
18933  Abc_Print( -2, "\t cycles sequential circuit for the given number of timeframes\n" );
18934  Abc_Print( -2, "\t to derive a new initial state (which may be on the envelope)\n" );
18935  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
18936  Abc_Print( -2, "\t-x : use x-valued primary inputs [default = %s]\n", fUseXval? "yes": "no" );
18937  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
18938  Abc_Print( -2, "\t-h : print the command usage\n");
18939  return 1;
18940 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Abc_NtkCycleInitStateSop(Abc_Ntk_t *pNtk, int nFrames, int fVerbose)
Definition: retInit.c:314
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Abc_NtkCycleInitState(Abc_Ntk_t *pNtk, int nFrames, int fUseXval, int fVerbose)
Definition: abcXsim.c:192
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDarPhase ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 19388 of file abc.c.

19389 {
19390  Abc_Ntk_t * pNtk, * pNtkRes;
19391  int nFrames, nPref;
19392  int fIgnore;
19393  int fPrint;
19394  int fUpdateCex;
19395  int c, fVerbose;
19396  extern Abc_Ntk_t * Abc_NtkPhaseAbstract( Abc_Ntk_t * pNtk, int nFrames, int nPref, int fIgnore, int fPrint, int fVerbose );
19397 
19398  pNtk = Abc_FrameReadNtk(pAbc);
19399  // set defaults
19400  nFrames = 0;
19401  nPref = 0;
19402  fIgnore = 0;
19403  fPrint = 0;
19404  fUpdateCex = 0;
19405  fVerbose = 0;
19407  while ( ( c = Extra_UtilGetopt( argc, argv, "FPipcvh" ) ) != EOF )
19408  {
19409  switch ( c )
19410  {
19411  case 'F':
19412  if ( globalUtilOptind >= argc )
19413  {
19414  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
19415  goto usage;
19416  }
19417  nFrames = atoi(argv[globalUtilOptind]);
19418  globalUtilOptind++;
19419  if ( nFrames < 0 )
19420  goto usage;
19421  break;
19422  case 'P':
19423  if ( globalUtilOptind >= argc )
19424  {
19425  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
19426  goto usage;
19427  }
19428  nPref = atoi(argv[globalUtilOptind]);
19429  globalUtilOptind++;
19430  if ( nPref < 0 )
19431  goto usage;
19432  break;
19433  case 'i':
19434  fIgnore ^= 1;
19435  break;
19436  case 'p':
19437  fPrint ^= 1;
19438  break;
19439  case 'c':
19440  fUpdateCex ^= 1;
19441  break;
19442  case 'v':
19443  fVerbose ^= 1;
19444  break;
19445  case 'h':
19446  goto usage;
19447  default:
19448  goto usage;
19449  }
19450  }
19451  if ( pNtk == NULL )
19452  {
19453  Abc_Print( -1, "Empty network.\n" );
19454  return 1;
19455  }
19456  if ( !Abc_NtkIsStrash(pNtk) )
19457  {
19458  Abc_Print( -1, "Only works for structrally hashed networks.\n" );
19459  return 1;
19460  }
19461  if ( fUpdateCex )
19462  {
19463  Abc_Cex_t * pCexNew;
19464  if ( pAbc->pCex == NULL )
19465  {
19466  Abc_Print( -1, "Counter-example is not available.\n" );
19467  return 1;
19468  }
19469  if ( pAbc->pCex->nPis % Abc_NtkPiNum(pNtk) != 0 )
19470  {
19471  Abc_Print( -1, "PI count of the CEX is not a multiple of PI count of the current AIG.\n" );
19472  return 1;
19473  }
19474  pCexNew = Abc_CexTransformPhase( pAbc->pCex, Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkLatchNum(pNtk) );
19475  {
19476  Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
19477  Gia_Man_t * pGia = Gia_ManFromAig( pAig );
19478  int iPo = Gia_ManSetFailedPoCex( pGia, pCexNew );
19479  Gia_ManStop( pGia );
19480  Aig_ManStop( pAig );
19481  if ( iPo == -1 )
19482  {
19483  Abc_Print( -1, "The counter-example does not fail any of the outputs of the original AIG.\n" );
19484  return 1;
19485  }
19486  }
19487  Abc_FrameReplaceCex( pAbc, &pCexNew );
19488  return 0;
19489  }
19490  if ( !Abc_NtkLatchNum(pNtk) )
19491  {
19492  Abc_Print( -1, "The network is combinational.\n" );
19493  return 0;
19494  }
19495  if ( fPrint )
19496  {
19497  Abc_NtkPhaseAbstract( pNtk, 0, nPref, fIgnore, 1, fVerbose );
19498  return 0;
19499  }
19500  // modify the current network
19501  pNtkRes = Abc_NtkPhaseAbstract( pNtk, nFrames, nPref, fIgnore, 0, fVerbose );
19502  if ( pNtkRes == NULL )
19503  {
19504 // Abc_Print( -1, "Phase abstraction has failed.\n" );
19505  return 0;
19506  }
19507  // replace the current network
19508  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
19509  return 0;
19510 
19511 usage:
19512  Abc_Print( -2, "usage: phase [-FP <num>] [-ipcvh]\n" );
19513  Abc_Print( -2, "\t performs sequential cleanup of the current network\n" );
19514  Abc_Print( -2, "\t by removing nodes and latches that do not feed into POs\n" );
19515  Abc_Print( -2, "\t-F num : the number of frames to abstract [default = %d]\n", nFrames );
19516  Abc_Print( -2, "\t-P num : the number of prefix frames to skip [default = %d]\n", nPref );
19517  Abc_Print( -2, "\t-i : toggle ignoring the initial state [default = %s]\n", fIgnore? "yes": "no" );
19518  Abc_Print( -2, "\t-p : toggle printing statistics about generators [default = %s]\n", fPrint? "yes": "no" );
19519  Abc_Print( -2, "\t-c : update the current CEX derived for a new AIG after \"phase\"\n" );
19520  Abc_Print( -2, "\t to match the current AIG (the one before \"phase\") [default = %s]\n", fUpdateCex? "yes": "no" );
19521  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
19522  Abc_Print( -2, "\t-h : print the command usage\n");
19523  return 1;
19524 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int Gia_ManSetFailedPoCex(Gia_Man_t *pAig, Abc_Cex_t *p)
Definition: giaCex.c:135
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition: giaAig.c:73
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
Definition: gia.h:95
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
Abc_Cex_t * Abc_CexTransformPhase(Abc_Cex_t *p, int nPisOld, int nPosOld, int nRegsOld)
Definition: utilCex.c:390
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
Abc_Ntk_t * Abc_NtkPhaseAbstract(Abc_Ntk_t *pNtk, int nFrames, int nPref, int fIgnore, int fPrint, int fVerbose)
Definition: abcDar.c:3969
int Abc_CommandDc2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11673 of file abc.c.

11674 {
11675  Abc_Ntk_t * pNtk, * pNtkRes;
11676  int fBalance, fVerbose, fUpdateLevel, fFanout, fPower, c;
11677 
11678  extern Abc_Ntk_t * Abc_NtkDC2( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose );
11679 
11680  pNtk = Abc_FrameReadNtk(pAbc);
11681  // set defaults
11682  fBalance = 0;
11683  fVerbose = 0;
11684  fUpdateLevel = 0;
11685  fFanout = 1;
11686  fPower = 0;
11688  while ( ( c = Extra_UtilGetopt( argc, argv, "blfpvh" ) ) != EOF )
11689  {
11690  switch ( c )
11691  {
11692  case 'b':
11693  fBalance ^= 1;
11694  break;
11695  case 'l':
11696  fUpdateLevel ^= 1;
11697  break;
11698  case 'f':
11699  fFanout ^= 1;
11700  break;
11701  case 'p':
11702  fPower ^= 1;
11703  break;
11704  case 'v':
11705  fVerbose ^= 1;
11706  break;
11707  case 'h':
11708  goto usage;
11709  default:
11710  goto usage;
11711  }
11712  }
11713  if ( pNtk == NULL )
11714  {
11715  Abc_Print( -1, "Empty network.\n" );
11716  return 1;
11717  }
11718  if ( !Abc_NtkIsStrash(pNtk) )
11719  {
11720  Abc_Print( -1, "This command works only for strashed networks.\n" );
11721  return 1;
11722  }
11723  pNtkRes = Abc_NtkDC2( pNtk, fBalance, fUpdateLevel, fFanout, fPower, fVerbose );
11724  if ( pNtkRes == NULL )
11725  {
11726  Abc_Print( -1, "Command has failed.\n" );
11727  return 0;
11728  }
11729  // replace the current network
11730  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11731  return 0;
11732 
11733 usage:
11734  Abc_Print( -2, "usage: dc2 [-blfpvh]\n" );
11735  Abc_Print( -2, "\t performs combinational AIG optimization\n" );
11736  Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
11737  Abc_Print( -2, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
11738  Abc_Print( -2, "\t-f : toggle representing fanouts [default = %s]\n", fFanout? "yes": "no" );
11739  Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", fPower? "yes": "no" );
11740  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
11741  Abc_Print( -2, "\t-h : print the command usage\n");
11742  return 1;
11743 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDC2(Abc_Ntk_t *pNtk, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose)
Definition: abcDar.c:1525
int Abc_CommandDCec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20387 of file abc.c.

20388 {
20389  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
20390  int fDelete1, fDelete2;
20391  char ** pArgvNew;
20392  int nArgcNew;
20393  int c;
20394  int fSat;
20395  int fVerbose;
20396  int nSeconds;
20397  int nConfLimit;
20398  int nInsLimit;
20399  int fPartition;
20400  int fMiter;
20401 
20402  extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose );
20403  extern int Abc_NtkDarCec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int fPartition, int fVerbose );
20404 
20405  pNtk = Abc_FrameReadNtk(pAbc);
20406  // set defaults
20407  fSat = 0;
20408  fVerbose = 0;
20409  nSeconds = 20;
20410  nConfLimit = 10000;
20411  nInsLimit = 0;
20412  fPartition = 0;
20413  fMiter = 0;
20415  while ( ( c = Extra_UtilGetopt( argc, argv, "TCIpmsvh" ) ) != EOF )
20416  {
20417  switch ( c )
20418  {
20419  case 'T':
20420  if ( globalUtilOptind >= argc )
20421  {
20422  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
20423  goto usage;
20424  }
20425  nSeconds = atoi(argv[globalUtilOptind]);
20426  globalUtilOptind++;
20427  if ( nSeconds < 0 )
20428  goto usage;
20429  break;
20430  case 'C':
20431  if ( globalUtilOptind >= argc )
20432  {
20433  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
20434  goto usage;
20435  }
20436  nConfLimit = atoi(argv[globalUtilOptind]);
20437  globalUtilOptind++;
20438  if ( nConfLimit < 0 )
20439  goto usage;
20440  break;
20441  case 'I':
20442  if ( globalUtilOptind >= argc )
20443  {
20444  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
20445  goto usage;
20446  }
20447  nInsLimit = atoi(argv[globalUtilOptind]);
20448  globalUtilOptind++;
20449  if ( nInsLimit < 0 )
20450  goto usage;
20451  break;
20452  case 'p':
20453  fPartition ^= 1;
20454  break;
20455  case 'm':
20456  fMiter ^= 1;
20457  break;
20458  case 's':
20459  fSat ^= 1;
20460  break;
20461  case 'v':
20462  fVerbose ^= 1;
20463  break;
20464  default:
20465  goto usage;
20466  }
20467  }
20468 
20469  pArgvNew = argv + globalUtilOptind;
20470  nArgcNew = argc - globalUtilOptind;
20471  if ( fMiter )
20472  {
20473  if ( pNtk == NULL )
20474  {
20475  Abc_Print( -1, "Empty network.\n" );
20476  return 1;
20477  }
20478  if ( Abc_NtkIsStrash(pNtk) )
20479  {
20480  pNtk1 = pNtk;
20481  fDelete1 = 0;
20482  }
20483  else
20484  {
20485  pNtk1 = Abc_NtkStrash( pNtk, 0, 1, 0 );
20486  fDelete1 = 1;
20487  }
20488  pNtk2 = NULL;
20489  fDelete2 = 0;
20490  }
20491  else
20492  {
20493  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
20494  return 1;
20495  }
20496 
20497  if ( (pNtk1 && Abc_NtkLatchNum(pNtk1)) || (pNtk2 && Abc_NtkLatchNum(pNtk2)) )
20498  {
20499  if ( pNtk1 && fDelete1 ) Abc_NtkDelete( pNtk1 );
20500  if ( pNtk2 && fDelete2 ) Abc_NtkDelete( pNtk2 );
20501  Abc_Print( -1, "Currently this command only works for networks without latches. Run \"comb\".\n" );
20502  return 1;
20503  }
20504 
20505  // perform equivalence checking
20506  if ( fSat && fMiter )
20507  Abc_NtkDSat( pNtk1, nConfLimit, nInsLimit, 0, 0, 0, 0, 0, 0, fVerbose );
20508  else
20509  Abc_NtkDarCec( pNtk1, pNtk2, nConfLimit, fPartition, fVerbose );
20510 
20511  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
20512  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
20513  return 0;
20514 
20515 usage:
20516  Abc_Print( -2, "usage: dcec [-T num] [-C num] [-I num] [-mpsvh] <file1> <file2>\n" );
20517  Abc_Print( -2, "\t performs combinational equivalence checking\n" );
20518  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
20519  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
20520  Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
20521  Abc_Print( -2, "\t-m : toggle working on two networks or a miter [default = %s]\n", fMiter? "miter": "two networks" );
20522  Abc_Print( -2, "\t-p : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
20523  Abc_Print( -2, "\t-s : toggle \"SAT only\" (miter) or \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
20524  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
20525  Abc_Print( -2, "\t-h : print the command usage\n");
20526  Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
20527  Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
20528  Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
20529  Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
20530  return 1;
20531 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Abc_NtkDSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose)
Definition: abcDar.c:1804
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_NtkDarCec(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nConfLimit, int fPartition, int fVerbose)
Definition: abcDar.c:1854
int Abc_CommandDch ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11862 of file abc.c.

11863 {
11864  Dch_Pars_t Pars, * pPars = &Pars;
11865  Abc_Ntk_t * pNtk, * pNtkRes;
11866  int c;
11867  extern Abc_Ntk_t * Abc_NtkDch( Abc_Ntk_t * pNtk, Dch_Pars_t * pPars );
11868 
11869  pNtk = Abc_FrameReadNtk(pAbc);
11870  // set defaults
11871  Dch_ManSetDefaultParams( pPars );
11873  while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptgcfrvh" ) ) != EOF )
11874  {
11875  switch ( c )
11876  {
11877  case 'W':
11878  if ( globalUtilOptind >= argc )
11879  {
11880  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
11881  goto usage;
11882  }
11883  pPars->nWords = atoi(argv[globalUtilOptind]);
11884  globalUtilOptind++;
11885  if ( pPars->nWords < 0 )
11886  goto usage;
11887  break;
11888  case 'C':
11889  if ( globalUtilOptind >= argc )
11890  {
11891  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
11892  goto usage;
11893  }
11894  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
11895  globalUtilOptind++;
11896  if ( pPars->nBTLimit < 0 )
11897  goto usage;
11898  break;
11899  case 'S':
11900  if ( globalUtilOptind >= argc )
11901  {
11902  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
11903  goto usage;
11904  }
11905  pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
11906  globalUtilOptind++;
11907  if ( pPars->nSatVarMax < 0 )
11908  goto usage;
11909  break;
11910  case 's':
11911  pPars->fSynthesis ^= 1;
11912  break;
11913  case 'p':
11914  pPars->fPower ^= 1;
11915  break;
11916  case 't':
11917  pPars->fSimulateTfo ^= 1;
11918  break;
11919  case 'g':
11920  pPars->fUseGia ^= 1;
11921  break;
11922  case 'c':
11923  pPars->fUseCSat ^= 1;
11924  break;
11925  case 'f':
11926  pPars->fLightSynth ^= 1;
11927  break;
11928  case 'r':
11929  pPars->fSkipRedSupp ^= 1;
11930  break;
11931  case 'v':
11932  pPars->fVerbose ^= 1;
11933  break;
11934  case 'h':
11935  goto usage;
11936  default:
11937  goto usage;
11938  }
11939  }
11940  if ( pNtk == NULL )
11941  {
11942  Abc_Print( -1, "Empty network.\n" );
11943  return 1;
11944  }
11945  if ( !Abc_NtkIsStrash(pNtk) )
11946  {
11947  Abc_Print( -1, "This command works only for strashed networks.\n" );
11948  return 1;
11949  }
11950  pNtkRes = Abc_NtkDch( pNtk, pPars );
11951  if ( pNtkRes == NULL )
11952  {
11953  Abc_Print( -1, "Command has failed.\n" );
11954  return 0;
11955  }
11956  // replace the current network
11957  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11958  return 0;
11959 
11960 usage:
11961  Abc_Print( -2, "usage: dch [-WCS num] [-sptgcfrvh]\n" );
11962  Abc_Print( -2, "\t computes structural choices using a new approach\n" );
11963  Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
11964  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
11965  Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
11966  Abc_Print( -2, "\t-s : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
11967  Abc_Print( -2, "\t-p : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
11968  Abc_Print( -2, "\t-t : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
11969  Abc_Print( -2, "\t-g : toggle using GIA to prove equivalences [default = %s]\n", pPars->fUseGia? "yes": "no" );
11970  Abc_Print( -2, "\t-c : toggle using circuit-based SAT vs. MiniSat [default = %s]\n", pPars->fUseCSat? "yes": "no" );
11971  Abc_Print( -2, "\t-f : toggle using faster logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
11972  Abc_Print( -2, "\t-r : toggle skipping choices with redundant support [default = %s]\n", pPars->fSkipRedSupp? "yes": "no" );
11973  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
11974  Abc_Print( -2, "\t-h : print the command usage\n");
11975  return 1;
11976 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Dch_ManSetDefaultParams(Dch_Pars_t *p)
DECLARATIONS ///.
Definition: dchCore.c:45
Abc_Ntk_t * Abc_NtkDch(Abc_Ntk_t *pNtk, Dch_Pars_t *pPars)
Definition: abcDar.c:1584
typedefABC_NAMESPACE_HEADER_START struct Dch_Pars_t_ Dch_Pars_t
INCLUDES ///.
Definition: dch.h:43
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDChoice ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11757 of file abc.c.

11758 {
11759  Abc_Ntk_t * pNtk, * pNtkRes;
11760  int fBalance, fVerbose, fUpdateLevel, fConstruct, c;
11761  int nConfMax, nLevelMax;
11762 
11763  extern Abc_Ntk_t * Abc_NtkDChoice( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fConstruct, int nConfMax, int nLevelMax, int fVerbose );
11764 
11765  pNtk = Abc_FrameReadNtk(pAbc);
11766  // set defaults
11767  fBalance = 1;
11768  fUpdateLevel = 1;
11769  fConstruct = 0;
11770  nConfMax = 1000;
11771  nLevelMax = 0;
11772  fVerbose = 0;
11774  while ( ( c = Extra_UtilGetopt( argc, argv, "CLblcvh" ) ) != EOF )
11775  {
11776  switch ( c )
11777  {
11778  case 'C':
11779  if ( globalUtilOptind >= argc )
11780  {
11781  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
11782  goto usage;
11783  }
11784  nConfMax = atoi(argv[globalUtilOptind]);
11785  globalUtilOptind++;
11786  if ( nConfMax < 0 )
11787  goto usage;
11788  break;
11789  case 'L':
11790  if ( globalUtilOptind >= argc )
11791  {
11792  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
11793  goto usage;
11794  }
11795  nLevelMax = atoi(argv[globalUtilOptind]);
11796  globalUtilOptind++;
11797  if ( nLevelMax < 0 )
11798  goto usage;
11799  break;
11800  case 'b':
11801  fBalance ^= 1;
11802  break;
11803  case 'l':
11804  fUpdateLevel ^= 1;
11805  break;
11806  case 'c':
11807  fConstruct ^= 1;
11808  break;
11809  case 'v':
11810  fVerbose ^= 1;
11811  break;
11812  case 'h':
11813  goto usage;
11814  default:
11815  goto usage;
11816  }
11817  }
11818  if ( pNtk == NULL )
11819  {
11820  Abc_Print( -1, "Empty network.\n" );
11821  return 1;
11822  }
11823  if ( !Abc_NtkIsStrash(pNtk) )
11824  {
11825  Abc_Print( -1, "This command works only for strashed networks.\n" );
11826  return 1;
11827  }
11828  pNtkRes = Abc_NtkDChoice( pNtk, fBalance, fUpdateLevel, fConstruct, nConfMax, nLevelMax, fVerbose );
11829  if ( pNtkRes == NULL )
11830  {
11831  Abc_Print( -1, "Command has failed.\n" );
11832  return 0;
11833  }
11834  // replace the current network
11835  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11836  return 0;
11837 
11838 usage:
11839  Abc_Print( -2, "usage: dchoice [-C num] [-L num] [-blcvh]\n" );
11840  Abc_Print( -2, "\t performs partitioned choicing using new AIG package\n" );
11841  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
11842  Abc_Print( -2, "\t-L num : the max level of nodes to consider (0 = not used) [default = %d]\n", nLevelMax );
11843  Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
11844  Abc_Print( -2, "\t-l : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
11845  Abc_Print( -2, "\t-c : toggle constructive computation of choices [default = %s]\n", fConstruct? "yes": "no" );
11846  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
11847  Abc_Print( -2, "\t-h : print the command usage\n");
11848  return 1;
11849 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDChoice(Abc_Ntk_t *pNtk, int fBalance, int fUpdateLevel, int fConstruct, int nConfMax, int nLevelMax, int fVerbose)
Definition: abcDar.c:1558
int Abc_CommandDebug ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21940 of file abc.c.

21941 {
21942  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
21943  int c;
21944  extern void Abc_NtkAutoDebug( Abc_Ntk_t * pNtk, int (*pFuncError) (Abc_Ntk_t *) );
21945  extern int Abc_NtkRetimeDebug( Abc_Ntk_t * pNtk );
21946  // set defaults
21948  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
21949  {
21950  switch ( c )
21951  {
21952  case 'h':
21953  goto usage;
21954  default:
21955  goto usage;
21956  }
21957  }
21958 
21959  if ( pNtk == NULL )
21960  {
21961  Abc_Print( -1, "Empty network.\n" );
21962  return 1;
21963  }
21964  if ( !Abc_NtkIsLogic(pNtk) )
21965  {
21966  Abc_Print( -1, "This command is applicable to logic networks.\n" );
21967  return 1;
21968  }
21969 
21971  return 0;
21972 
21973 usage:
21974  Abc_Print( -2, "usage: debug [-h]\n" );
21975  Abc_Print( -2, "\t performs automated debugging of the given procedure\n" );
21976  Abc_Print( -2, "\t-h : print the command usage\n");
21977  return 1;
21978 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
int Abc_NtkRetimeDebug(Abc_Ntk_t *pNtk)
Definition: retCore.c:118
void Abc_NtkAutoDebug(Abc_Ntk_t *pNtk, int(*pFuncError)(Abc_Ntk_t *))
FUNCTION DEFINITIONS ///.
Definition: abcDebug.c:50
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDemiter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6866 of file abc.c.

6867 {
6868  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
6869  int c, fDual, fVerbose;
6870  extern int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk );
6871  extern int Abc_NtkDarDemiterDual( Abc_Ntk_t * pNtk, int fVerbose );
6872  // set defaults
6873  fDual = 0;
6874  fVerbose = 1;
6876  while ( ( c = Extra_UtilGetopt( argc, argv, "dvh" ) ) != EOF )
6877  {
6878  switch ( c )
6879  {
6880  case 'd':
6881  fDual ^= 1;
6882  break;
6883  case 'v':
6884  fVerbose ^= 1;
6885  break;
6886  default:
6887  goto usage;
6888  }
6889  }
6890 
6891  if ( pNtk == NULL )
6892  {
6893  Abc_Print( -1, "Empty network.\n" );
6894  return 1;
6895  }
6896 
6897  if ( !Abc_NtkIsStrash(pNtk) )
6898  {
6899  Abc_Print( -1, "The network is not strashed.\n" );
6900  return 1;
6901  }
6902 
6903  if ( fDual )
6904  {
6905  if ( (Abc_NtkPoNum(pNtk) & 1) )
6906  {
6907  Abc_Print( -1, "The number of POs should be even.\n" );
6908  return 0;
6909  }
6910  if ( !Abc_NtkDarDemiterDual( pNtk, fVerbose ) )
6911  {
6912  Abc_Print( -1, "Demitering has failed.\n" );
6913  return 1;
6914  }
6915  return 0;
6916  }
6917 /*
6918  if ( Abc_NtkPoNum(pNtk) != 1 )
6919  {
6920  Abc_Print( -1, "The network is not a single-output miter.\n" );
6921  return 1;
6922  }
6923  if ( !Abc_NodeIsExorType(Abc_ObjFanin0(Abc_NtkPo(pNtk,0))) )
6924  {
6925  Abc_Print( -1, "The miter's PO is not an EXOR.\n" );
6926  return 1;
6927  }
6928  if ( !Abc_NtkDemiter( pNtk ) )
6929  {
6930  Abc_Print( -1, "Demitering has failed.\n" );
6931  return 1;
6932  }
6933 */
6934  // get the new network
6935  if ( !Abc_NtkDarDemiter( pNtk ) )
6936  {
6937  Abc_Print( -1, "Demitering has failed.\n" );
6938  return 1;
6939  }
6940  // replace the current network
6941 // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
6942  return 0;
6943 
6944 usage:
6945  Abc_Print( -2, "usage: demiter [-dvh]\n" );
6946  Abc_Print( -2, "\t splits sequential miter into two circuits\n" );
6947  Abc_Print( -2, "\t-d : expects a dual-output miter (without XORs) [default = %s]\n", fDual? "yes": "no" );
6948  Abc_Print( -2, "\t-v : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
6949  Abc_Print( -2, "\t-h : print the command usage\n");
6950  return 1;
6951 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int Abc_NtkDarDemiter(Abc_Ntk_t *pNtk)
Definition: abcDar.c:2593
int Abc_NtkDarDemiterDual(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcDar.c:2697
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDFraig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12401 of file abc.c.

12402 {
12403  Abc_Ntk_t * pNtk, * pNtkRes;
12404  int c, nConfLimit, fDoSparse, fProve, fSpeculate, fChoicing, fVerbose;
12405 
12406  extern Abc_Ntk_t * Abc_NtkDarFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fSpeculate, int fChoicing, int fVerbose );
12407 
12408  pNtk = Abc_FrameReadNtk(pAbc);
12409  // set defaults
12410  nConfLimit = 100;
12411  fDoSparse = 1;
12412  fProve = 0;
12413  fSpeculate = 0;
12414  fChoicing = 0;
12415  fVerbose = 0;
12417  while ( ( c = Extra_UtilGetopt( argc, argv, "Csprcvh" ) ) != EOF )
12418  {
12419  switch ( c )
12420  {
12421  case 'C':
12422  if ( globalUtilOptind >= argc )
12423  {
12424  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
12425  goto usage;
12426  }
12427  nConfLimit = atoi(argv[globalUtilOptind]);
12428  globalUtilOptind++;
12429  if ( nConfLimit < 0 )
12430  goto usage;
12431  break;
12432  case 's':
12433  fDoSparse ^= 1;
12434  break;
12435  case 'p':
12436  fProve ^= 1;
12437  break;
12438  case 'r':
12439  fSpeculate ^= 1;
12440  break;
12441  case 'c':
12442  fChoicing ^= 1;
12443  break;
12444  case 'v':
12445  fVerbose ^= 1;
12446  break;
12447  case 'h':
12448  goto usage;
12449  default:
12450  goto usage;
12451  }
12452  }
12453  if ( pNtk == NULL )
12454  {
12455  Abc_Print( -1, "Empty network.\n" );
12456  return 1;
12457  }
12458  if ( !Abc_NtkIsStrash(pNtk) )
12459  {
12460  Abc_Print( -1, "This command works only for strashed networks.\n" );
12461  return 1;
12462  }
12463 
12464  pNtkRes = Abc_NtkDarFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fSpeculate, fChoicing, fVerbose );
12465  if ( pNtkRes == NULL )
12466  {
12467  Abc_Print( -1, "Command has failed.\n" );
12468  return 0;
12469  }
12470  // replace the current network
12471  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
12472  return 0;
12473 
12474 usage:
12475  Abc_Print( -2, "usage: dfraig [-C num] [-sprcvh]\n" );
12476  Abc_Print( -2, "\t performs fraiging using a new method\n" );
12477  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
12478  Abc_Print( -2, "\t-s : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
12479  Abc_Print( -2, "\t-p : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
12480  Abc_Print( -2, "\t-r : toggle speculative reduction [default = %s]\n", fSpeculate? "yes": "no" );
12481  Abc_Print( -2, "\t-c : toggle accumulation of choices [default = %s]\n", fChoicing? "yes": "no" );
12482  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
12483  Abc_Print( -2, "\t-h : print the command usage\n");
12484  return 1;
12485 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkDarFraig(Abc_Ntk_t *pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fSpeculate, int fChoicing, int fVerbose)
Definition: abcDar.c:1357
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDFrames ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7761 of file abc.c.

7762 {
7763  Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
7764  int nPrefix;
7765  int nFrames;
7766  int fInitial;
7767  int fVerbose;
7768  int c;
7769 
7770  extern Abc_Ntk_t * Abc_NtkDarFrames( Abc_Ntk_t * pNtk, int nPrefix, int nFrames, int fInitial, int fVerbose );
7771  pNtk = Abc_FrameReadNtk(pAbc);
7772 
7773  // set defaults
7774  nPrefix = 5;
7775  nFrames = 5;
7776  fInitial = 0;
7777  fVerbose = 0;
7779  while ( ( c = Extra_UtilGetopt( argc, argv, "NFivh" ) ) != EOF )
7780  {
7781  switch ( c )
7782  {
7783  case 'N':
7784  if ( globalUtilOptind >= argc )
7785  {
7786  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
7787  goto usage;
7788  }
7789  nPrefix = atoi(argv[globalUtilOptind]);
7790  globalUtilOptind++;
7791  if ( nPrefix <= 0 )
7792  goto usage;
7793  break;
7794  case 'F':
7795  if ( globalUtilOptind >= argc )
7796  {
7797  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
7798  goto usage;
7799  }
7800  nFrames = atoi(argv[globalUtilOptind]);
7801  globalUtilOptind++;
7802  if ( nFrames <= 0 )
7803  goto usage;
7804  break;
7805  case 'i':
7806  fInitial ^= 1;
7807  break;
7808  case 'v':
7809  fVerbose ^= 1;
7810  break;
7811  case 'h':
7812  goto usage;
7813  default:
7814  goto usage;
7815  }
7816  }
7817 
7818  if ( pNtk == NULL )
7819  {
7820  Abc_Print( -1, "Empty network.\n" );
7821  return 1;
7822  }
7823  if ( nPrefix > nFrames )
7824  {
7825  Abc_Print( -1, "Prefix (%d) cannot be more than the number of frames (%d).\n", nPrefix, nFrames );
7826  return 1;
7827  }
7828 
7829  // get the new network
7830  if ( !Abc_NtkIsStrash(pNtk) )
7831  {
7832  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
7833  pNtkRes = Abc_NtkDarFrames( pNtkTemp, nPrefix, nFrames, fInitial, fVerbose );
7834  Abc_NtkDelete( pNtkTemp );
7835  }
7836  else
7837  pNtkRes = Abc_NtkDarFrames( pNtk, nPrefix, nFrames, fInitial, fVerbose );
7838  if ( pNtkRes == NULL )
7839  {
7840  Abc_Print( -1, "Unrolling the network has failed.\n" );
7841  return 1;
7842  }
7843  // replace the current network
7844  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7845  return 0;
7846 
7847 usage:
7848  Abc_Print( -2, "usage: dframes [-NF <num>] [-ivh]\n" );
7849  Abc_Print( -2, "\t unrolls the network with simplification\n" );
7850  Abc_Print( -2, "\t-N num : the number of frames to use as prefix [default = %d]\n", nPrefix );
7851  Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", nFrames );
7852  Abc_Print( -2, "\t-i : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
7853  Abc_Print( -2, "\t-v : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
7854  Abc_Print( -2, "\t-h : print the command usage\n");
7855  return 1;
7856 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkDarFrames(Abc_Ntk_t *pNtk, int nPrefix, int nFrames, int fInit, int fVerbose)
Definition: abcDar.c:4255
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDisjoint ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4041 of file abc.c.

4042 {
4043  Abc_Ntk_t * pNtk, * pNtkRes, * pNtkNew;
4044  int fGlobal, fRecursive, fVerbose, fPrint, fShort, c;
4045 
4046  extern Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int fShort );
4047  extern int Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, int fVerbose, int fRecursive );
4048 
4049  pNtk = Abc_FrameReadNtk(pAbc);
4050  // set defaults
4051  fGlobal = 1;
4052  fRecursive = 0;
4053  fVerbose = 0;
4054  fPrint = 0;
4055  fShort = 0;
4057  while ( ( c = Extra_UtilGetopt( argc, argv, "grvpsh" ) ) != EOF )
4058  {
4059  switch ( c )
4060  {
4061  case 'g':
4062  fGlobal ^= 1;
4063  break;
4064  case 'r':
4065  fRecursive ^= 1;
4066  break;
4067  case 'v':
4068  fVerbose ^= 1;
4069  break;
4070  case 'p':
4071  fPrint ^= 1;
4072  break;
4073  case 's':
4074  fShort ^= 1;
4075  break;
4076  case 'h':
4077  goto usage;
4078  break;
4079  default:
4080  goto usage;
4081  }
4082  }
4083 
4084  if ( pNtk == NULL )
4085  {
4086  Abc_Print( -1, "Empty network.\n" );
4087  return 1;
4088  }
4089 
4090  if ( fGlobal )
4091  {
4092 // Abc_Print( 0, "Performing DSD of global functions of the network.\n" );
4093  // get the new network
4094  if ( !Abc_NtkIsStrash(pNtk) )
4095  {
4096  pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
4097  pNtkRes = Abc_NtkDsdGlobal( pNtkNew, fVerbose, fPrint, fShort );
4098  Abc_NtkDelete( pNtkNew );
4099  }
4100  else
4101  {
4102  pNtkRes = Abc_NtkDsdGlobal( pNtk, fVerbose, fPrint, fShort );
4103  }
4104  if ( pNtkRes == NULL )
4105  {
4106  Abc_Print( -1, "Global DSD has failed.\n" );
4107  return 1;
4108  }
4109  // replace the current network
4110  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
4111  }
4112  else if ( fRecursive )
4113  {
4114  if ( !Abc_NtkIsBddLogic( pNtk ) )
4115  {
4116  Abc_Print( -1, "This command is only applicable to logic BDD networks.\n" );
4117  return 1;
4118  }
4119  if ( fVerbose )
4120  Abc_Print( 1, "Performing recursive DSD and MUX decomposition of local functions.\n" );
4121  if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
4122  Abc_Print( -1, "Recursive DSD has failed.\n" );
4123  }
4124  else
4125  {
4126  if ( !Abc_NtkIsBddLogic( pNtk ) )
4127  {
4128  Abc_Print( -1, "This command is only applicable to logic BDD networks (run \"bdd\").\n" );
4129  return 1;
4130  }
4131  if ( fVerbose )
4132  Abc_Print( 1, "Performing simple non-recursive DSD of local functions.\n" );
4133  if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
4134  Abc_Print( -1, "Simple DSD of local functions has failed.\n" );
4135  }
4136  return 0;
4137 
4138 usage:
4139  Abc_Print( -2, "usage: dsd [-grvpsh]\n" );
4140  Abc_Print( -2, "\t decomposes the network using disjoint-support decomposition\n" );
4141  Abc_Print( -2, "\t-g : toggle DSD of global and local functions [default = %s]\n", fGlobal? "global": "local" );
4142  Abc_Print( -2, "\t-r : toggle recursive DSD/MUX and simple DSD [default = %s]\n", fRecursive? "recursive DSD/MUX": "simple DSD" );
4143  Abc_Print( -2, "\t-v : prints DSD statistics and runtime [default = %s]\n", fVerbose? "yes": "no" );
4144  Abc_Print( -2, "\t-p : prints DSD structure to the standard output [default = %s]\n", fPrint? "yes": "no" );
4145  Abc_Print( -2, "\t-s : use short PI names when printing DSD structure [default = %s]\n", fShort? "yes": "no" );
4146  Abc_Print( -2, "\t-h : print the command usage\n");
4147  return 1;
4148 }
Abc_Ntk_t * Abc_NtkDsdGlobal(Abc_Ntk_t *pNtk, int fVerbose, int fPrint, int fShort)
FUNCTION DEFINITIONS ///.
Definition: abcDsd.c:60
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int Abc_NtkDsdLocal(Abc_Ntk_t *pNtk, int fVerbose, int fRecursive)
Definition: abcDsd.c:316
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDouble ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10342 of file abc.c.

10343 {
10344  Abc_Ntk_t * pNtk, * pNtkRes;
10345  int c;
10346  int nFrames;
10347  int fVerbose;
10348  extern Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk );
10349 
10350  pNtk = Abc_FrameReadNtk(pAbc);
10351  // set defaults
10352  nFrames = 50;
10353  fVerbose = 0;
10355  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
10356  {
10357  switch ( c )
10358  {
10359  case 'F':
10360  if ( globalUtilOptind >= argc )
10361  {
10362  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
10363  goto usage;
10364  }
10365  nFrames = atoi(argv[globalUtilOptind]);
10366  globalUtilOptind++;
10367  if ( nFrames < 0 )
10368  goto usage;
10369  break;
10370  case 'v':
10371  fVerbose ^= 1;
10372  break;
10373  case 'h':
10374  goto usage;
10375  default:
10376  goto usage;
10377  }
10378  }
10379  if ( pNtk == NULL )
10380  {
10381  Abc_Print( -1, "Empty network.\n" );
10382  return 1;
10383  }
10384 
10385  if ( !Abc_NtkIsSopLogic(pNtk) )
10386  {
10387  Abc_Print( -1, "Only works for logic SOP networks.\n" );
10388  return 1;
10389  }
10390 
10391  pNtkRes = Abc_NtkDouble( pNtk );
10392  if ( pNtkRes == NULL )
10393  {
10394  Abc_Print( -1, "Command has failed.\n" );
10395  return 0;
10396  }
10397  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10398  return 0;
10399 
10400 usage:
10401  Abc_Print( -2, "usage: double [-vh]\n" );
10402  Abc_Print( -2, "\t puts together two parallel copies of the current network\n" );
10403 // Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
10404  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
10405  Abc_Print( -2, "\t-h : print the command usage\n");
10406  return 1;
10407 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Abc_Ntk_t * Abc_NtkDouble(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:619
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDProve ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20680 of file abc.c.

20681 {
20682  Fra_Sec_t SecPar, * pSecPar = &SecPar;
20683  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
20684  int c;
20685  char * pLogFileName = NULL;
20686  int nBmcFramesMax = 20;
20687  int nBmcConfMax = 2000;
20688 
20689  extern void Fra_SecSetDefaultParams( Fra_Sec_t * p );
20690  extern int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar, int nBmcFramesMax, int nBmcConfMax );
20691  // set defaults
20692  Fra_SecSetDefaultParams( pSecPar );
20693 // pSecPar->TimeLimit = 300;
20695  while ( ( c = Extra_UtilGetopt( argc, argv, "cbAEFCGDVBRTLarmfijkoupwvh" ) ) != EOF )
20696  {
20697  switch ( c )
20698  {
20699  case 'c':
20700  pSecPar->fTryComb ^= 1;
20701  break;
20702  case 'b':
20703  pSecPar->fTryBmc ^= 1;
20704  break;
20705  case 'A':
20706  if ( globalUtilOptind >= argc )
20707  {
20708  Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
20709  goto usage;
20710  }
20711  nBmcFramesMax = atoi(argv[globalUtilOptind]);
20712  globalUtilOptind++;
20713  if ( nBmcFramesMax < 0 )
20714  goto usage;
20715  break;
20716  case 'E':
20717  if ( globalUtilOptind >= argc )
20718  {
20719  Abc_Print( -1, "Command line switch \"-E\" should be followed by an integer.\n" );
20720  goto usage;
20721  }
20722  nBmcConfMax = atoi(argv[globalUtilOptind]);
20723  globalUtilOptind++;
20724  if ( nBmcConfMax < 0 )
20725  goto usage;
20726  break;
20727  case 'F':
20728  if ( globalUtilOptind >= argc )
20729  {
20730  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
20731  goto usage;
20732  }
20733  pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
20734  globalUtilOptind++;
20735  if ( pSecPar->nFramesMax < 0 )
20736  goto usage;
20737  break;
20738  case 'C':
20739  if ( globalUtilOptind >= argc )
20740  {
20741  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
20742  goto usage;
20743  }
20744  pSecPar->nBTLimit = atoi(argv[globalUtilOptind]);
20745  globalUtilOptind++;
20746  if ( pSecPar->nBTLimit < 0 )
20747  goto usage;
20748  break;
20749  case 'G':
20750  if ( globalUtilOptind >= argc )
20751  {
20752  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
20753  goto usage;
20754  }
20755  pSecPar->nBTLimitGlobal = atoi(argv[globalUtilOptind]);
20756  globalUtilOptind++;
20757  if ( pSecPar->nBTLimitGlobal < 0 )
20758  goto usage;
20759  break;
20760  case 'D':
20761  if ( globalUtilOptind >= argc )
20762  {
20763  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
20764  goto usage;
20765  }
20766  pSecPar->nBTLimitInter = atoi(argv[globalUtilOptind]);
20767  globalUtilOptind++;
20768  if ( pSecPar->nBTLimitInter < 0 )
20769  goto usage;
20770  break;
20771  case 'V':
20772  if ( globalUtilOptind >= argc )
20773  {
20774  Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
20775  goto usage;
20776  }
20777  pSecPar->nBddVarsMax = atoi(argv[globalUtilOptind]);
20778  globalUtilOptind++;
20779  if ( pSecPar->nBddVarsMax < 0 )
20780  goto usage;
20781  break;
20782  case 'B':
20783  if ( globalUtilOptind >= argc )
20784  {
20785  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
20786  goto usage;
20787  }
20788  pSecPar->nBddMax = atoi(argv[globalUtilOptind]);
20789  globalUtilOptind++;
20790  if ( pSecPar->nBddMax < 0 )
20791  goto usage;
20792  break;
20793  case 'R':
20794  if ( globalUtilOptind >= argc )
20795  {
20796  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
20797  goto usage;
20798  }
20799  pSecPar->nBddIterMax = atoi(argv[globalUtilOptind]);
20800  globalUtilOptind++;
20801  if ( pSecPar->nBddIterMax < 0 )
20802  goto usage;
20803  break;
20804  case 'T':
20805  if ( globalUtilOptind >= argc )
20806  {
20807  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
20808  goto usage;
20809  }
20810  pSecPar->nPdrTimeout = atoi(argv[globalUtilOptind]);
20811  globalUtilOptind++;
20812  if ( pSecPar->nPdrTimeout < 0 )
20813  goto usage;
20814  break;
20815  case 'L':
20816  if ( globalUtilOptind >= argc )
20817  {
20818  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
20819  goto usage;
20820  }
20821  pLogFileName = argv[globalUtilOptind];
20822  globalUtilOptind++;
20823  break;
20824  case 'a':
20825  pSecPar->fPhaseAbstract ^= 1;
20826  break;
20827  case 'r':
20828  pSecPar->fRetimeFirst ^= 1;
20829  break;
20830  case 'm':
20831  pSecPar->fRetimeRegs ^= 1;
20832  break;
20833  case 'f':
20834  pSecPar->fFraiging ^= 1;
20835  break;
20836  case 'i':
20837  pSecPar->fInduction ^= 1;
20838  break;
20839  case 'j':
20840  pSecPar->fInterpolation ^= 1;
20841  break;
20842  case 'k':
20843  pSecPar->fInterSeparate ^= 1;
20844  break;
20845  case 'o':
20846  pSecPar->fReorderImage ^= 1;
20847  break;
20848  case 'u':
20849  pSecPar->fReadUnsolved ^= 1;
20850  break;
20851  case 'p':
20852  pSecPar->fUsePdr ^= 1;
20853  break;
20854  case 'w':
20855  pSecPar->fVeryVerbose ^= 1;
20856  break;
20857  case 'v':
20858  pSecPar->fVerbose ^= 1;
20859  break;
20860  default:
20861  goto usage;
20862  }
20863  }
20864  if ( pNtk == NULL )
20865  {
20866  Abc_Print( -1, "Empty network.\n" );
20867  return 1;
20868  }
20869 
20870  if ( !Abc_NtkIsStrash(pNtk) )
20871  {
20872  Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
20873  return 0;
20874  }
20875 
20876  // perform verification
20877  pAbc->Status = Abc_NtkDarProve( pNtk, pSecPar, nBmcFramesMax, nBmcConfMax );
20878  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
20879  if ( pLogFileName )
20880  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "dprove" );
20881 
20882  // read back the resulting unsolved reduced sequential miter
20883  if ( pSecPar->fReadUnsolved && pSecPar->nSMnumber >= 0 )
20884  {
20885  char FileName[100];
20886  sprintf(FileName, "sm%02d.aig", pSecPar->nSMnumber );
20887  pNtk = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
20888  if ( pNtk == NULL )
20889  Abc_Print( -1, "Cannot read back unsolved reduced sequential miter \"%s\",\n", FileName );
20890  else
20891  Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
20892  }
20893  return 0;
20894 
20895 usage:
20896  Abc_Print( -2, "usage: dprove [-AEFCGDVBRT num] [-L file] [-cbarmfijoupvwh]\n" );
20897  Abc_Print( -2, "\t performs SEC on the sequential miter\n" );
20898  Abc_Print( -2, "\t-A num : the limit on the depth of BMC [default = %d]\n", nBmcFramesMax );
20899  Abc_Print( -2, "\t-E num : the conflict limit during BMC [default = %d]\n", nBmcConfMax );
20900  Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
20901  Abc_Print( -2, "\t-C num : the conflict limit at a node during induction [default = %d]\n", pSecPar->nBTLimit );
20902  Abc_Print( -2, "\t-G num : the global conflict limit during induction [default = %d]\n", pSecPar->nBTLimitGlobal );
20903  Abc_Print( -2, "\t-D num : the conflict limit during interpolation [default = %d]\n", pSecPar->nBTLimitInter );
20904  Abc_Print( -2, "\t-V num : the flop count limit for BDD-based reachablity [default = %d]\n", pSecPar->nBddVarsMax );
20905  Abc_Print( -2, "\t-B num : the BDD size limit in BDD-based reachablity [default = %d]\n", pSecPar->nBddMax );
20906  Abc_Print( -2, "\t-R num : the max number of reachability iterations [default = %d]\n", pSecPar->nBddIterMax );
20907  Abc_Print( -2, "\t-T num : the timeout for property directed reachability [default = %d]\n", pSecPar->nPdrTimeout );
20908  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
20909  Abc_Print( -2, "\t-c : toggles using CEC before attempting SEC [default = %s]\n", pSecPar->fTryComb? "yes": "no" );
20910  Abc_Print( -2, "\t-b : toggles using BMC before attempting SEC [default = %s]\n", pSecPar->fTryBmc? "yes": "no" );
20911  Abc_Print( -2, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
20912  Abc_Print( -2, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
20913  Abc_Print( -2, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
20914  Abc_Print( -2, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
20915  Abc_Print( -2, "\t-i : toggles the use of induction [default = %s]\n", pSecPar->fInduction? "yes": "no" );
20916  Abc_Print( -2, "\t-j : toggles the use of interpolation [default = %s]\n", pSecPar->fInterpolation? "yes": "no" );
20917  Abc_Print( -2, "\t-k : toggles applying interpolation to each output [default = %s]\n", pSecPar->fInterSeparate? "yes": "no" );
20918  Abc_Print( -2, "\t-o : toggles using BDD variable reordering during image computation [default = %s]\n", pSecPar->fReorderImage? "yes": "no" );
20919  Abc_Print( -2, "\t-u : toggles reading back unsolved reduced sequential miter [default = %s]\n", pSecPar->fReadUnsolved? "yes": "no" );
20920  Abc_Print( -2, "\t-p : toggles trying property directed reachability in the end [default = %s]\n", pSecPar->fUsePdr? "yes": "no" );
20921  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
20922  Abc_Print( -2, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
20923  Abc_Print( -2, "\t-h : print the command usage\n");
20924  Abc_Print( -2, "\tCommand \"dprove\" can also be used for sequential synthesis (dprove -brjopu)\n");
20925  return 1;
20926 }
int fFraiging
Definition: fra.h:129
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int fInterSeparate
Definition: fra.h:132
int fInduction
Definition: fra.h:130
int nBddMax
Definition: fra.h:123
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Abc_NtkDarProve(Abc_Ntk_t *pNtk, Fra_Sec_t *pSecPar, int nBmcFramesMax, int nBmcConfMax)
Definition: abcDar.c:2767
int nBddIterMax
Definition: fra.h:124
int nFramesMax
Definition: fra.h:118
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
void Fra_SecSetDefaultParams(Fra_Sec_t *p)
DECLARATIONS ///.
Definition: fraSec.c:51
int fReadUnsolved
Definition: fra.h:142
int fReorderImage
Definition: fra.h:134
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
int fVerbose
Definition: fra.h:139
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
int fRetimeRegs
Definition: fra.h:128
int fVeryVerbose
Definition: fra.h:140
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fUsePdr
Definition: fra.h:137
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
int nBTLimitGlobal
Definition: fra.h:120
Abc_Cex_t * pSeqModel
Definition: abc.h:199
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fPhaseAbstract
Definition: fra.h:126
int nSMnumber
Definition: fra.h:143
int fTryBmc
Definition: fra.h:117
int nBddVarsMax
Definition: fra.h:122
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int nBTLimit
Definition: fra.h:119
int fTryComb
Definition: fra.h:116
int fInterpolation
Definition: fra.h:131
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int nBTLimitInter
Definition: fra.h:121
int nPdrTimeout
Definition: fra.h:125
int fRetimeFirst
Definition: fra.h:127
int Abc_CommandDRefactor ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11552 of file abc.c.

11553 {
11554  Abc_Ntk_t * pNtk, * pNtkRes;
11555  Dar_RefPar_t Pars, * pPars = &Pars;
11556  int c;
11557 
11558  extern Abc_Ntk_t * Abc_NtkDRefactor( Abc_Ntk_t * pNtk, Dar_RefPar_t * pPars );
11559 
11560  pNtk = Abc_FrameReadNtk(pAbc);
11561  // set defaults
11562  Dar_ManDefaultRefParams( pPars );
11564  while ( ( c = Extra_UtilGetopt( argc, argv, "MKCelzvwh" ) ) != EOF )
11565  {
11566  switch ( c )
11567  {
11568  case 'M':
11569  if ( globalUtilOptind >= argc )
11570  {
11571  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
11572  goto usage;
11573  }
11574  pPars->nMffcMin = atoi(argv[globalUtilOptind]);
11575  globalUtilOptind++;
11576  if ( pPars->nMffcMin < 0 )
11577  goto usage;
11578  break;
11579  case 'K':
11580  if ( globalUtilOptind >= argc )
11581  {
11582  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
11583  goto usage;
11584  }
11585  pPars->nLeafMax = atoi(argv[globalUtilOptind]);
11586  globalUtilOptind++;
11587  if ( pPars->nLeafMax < 0 )
11588  goto usage;
11589  break;
11590  case 'C':
11591  if ( globalUtilOptind >= argc )
11592  {
11593  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
11594  goto usage;
11595  }
11596  pPars->nCutsMax = atoi(argv[globalUtilOptind]);
11597  globalUtilOptind++;
11598  if ( pPars->nCutsMax < 0 )
11599  goto usage;
11600  break;
11601  case 'e':
11602  pPars->fExtend ^= 1;
11603  break;
11604  case 'l':
11605  pPars->fUpdateLevel ^= 1;
11606  break;
11607  case 'z':
11608  pPars->fUseZeros ^= 1;
11609  break;
11610  case 'v':
11611  pPars->fVerbose ^= 1;
11612  break;
11613  case 'w':
11614  pPars->fVeryVerbose ^= 1;
11615  break;
11616  case 'h':
11617  goto usage;
11618  default:
11619  goto usage;
11620  }
11621  }
11622  if ( pNtk == NULL )
11623  {
11624  Abc_Print( -1, "Empty network.\n" );
11625  return 1;
11626  }
11627  if ( !Abc_NtkIsStrash(pNtk) )
11628  {
11629  Abc_Print( -1, "This command works only for strashed networks.\n" );
11630  return 1;
11631  }
11632  if ( pPars->nLeafMax < 4 || pPars->nLeafMax > 15 )
11633  {
11634  Abc_Print( -1, "This command only works for cut sizes 4 <= K <= 15.\n" );
11635  return 1;
11636  }
11637  pNtkRes = Abc_NtkDRefactor( pNtk, pPars );
11638  if ( pNtkRes == NULL )
11639  {
11640  Abc_Print( -1, "Command has failed.\n" );
11641  return 0;
11642  }
11643  // replace the current network
11644  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11645  return 0;
11646 
11647 usage:
11648  Abc_Print( -2, "usage: drf [-M num] [-K num] [-C num] [-elzvwh]\n" );
11649  Abc_Print( -2, "\t performs combinational AIG refactoring\n" );
11650  Abc_Print( -2, "\t-M num : the min MFFC size to attempt refactoring [default = %d]\n", pPars->nMffcMin );
11651  Abc_Print( -2, "\t-K num : the max number of cuts leaves [default = %d]\n", pPars->nLeafMax );
11652  Abc_Print( -2, "\t-C num : the max number of cuts to try at a node [default = %d]\n", pPars->nCutsMax );
11653  Abc_Print( -2, "\t-e : toggle extending tbe cut below MFFC [default = %s]\n", pPars->fExtend? "yes": "no" );
11654  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
11655  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
11656  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
11657  Abc_Print( -2, "\t-w : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
11658  Abc_Print( -2, "\t-h : print the command usage\n");
11659  return 1;
11660 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int fUpdateLevel
Definition: dar.h:64
int fVeryVerbose
Definition: dar.h:67
int nCutsMax
Definition: dar.h:62
int nLeafMax
Definition: dar.h:61
int fVerbose
Definition: dar.h:66
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Dar_ManDefaultRefParams(Dar_RefPar_t *pPars)
FUNCTION DEFINITIONS ///.
Definition: darRefact.c:85
int nMffcMin
Definition: dar.h:60
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fUseZeros
Definition: dar.h:65
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fExtend
Definition: dar.h:63
Abc_Ntk_t * Abc_NtkDRefactor(Abc_Ntk_t *pNtk, Dar_RefPar_t *pPars)
Definition: abcDar.c:1488
int Abc_CommandDRetime ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17261 of file abc.c.

17262 {
17263  Abc_Ntk_t * pNtk, * pNtkRes;
17264  int fMinArea;
17265  int fForwardOnly;
17266  int fBackwardOnly;
17267  int fInitial;
17268  int nStepsMax;
17269  int fFastAlgo;
17270  int fVerbose;
17271  int c, nMaxIters;
17272  extern Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
17273  extern Abc_Ntk_t * Abc_NtkDarRetimeF( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
17274  extern Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
17275  extern Abc_Ntk_t * Abc_NtkDarRetimeMostFwd( Abc_Ntk_t * pNtk, int nMaxIters, int fVerbose );
17276 
17277  pNtk = Abc_FrameReadNtk(pAbc);
17278  // set defaults
17279  fMinArea = 1;
17280  fForwardOnly = 0;
17281  fBackwardOnly = 0;
17282  fInitial = 1;
17283  nStepsMax = 100000;
17284  fFastAlgo = 0;
17285  nMaxIters = 20;
17286  fVerbose = 0;
17288  while ( ( c = Extra_UtilGetopt( argc, argv, "NSmfbiavh" ) ) != EOF )
17289  {
17290  switch ( c )
17291  {
17292  case 'N':
17293  if ( globalUtilOptind >= argc )
17294  {
17295  Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
17296  goto usage;
17297  }
17298  nMaxIters = atoi(argv[globalUtilOptind]);
17299  globalUtilOptind++;
17300  if ( nMaxIters < 0 )
17301  goto usage;
17302  break;
17303  case 'S':
17304  if ( globalUtilOptind >= argc )
17305  {
17306  Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
17307  goto usage;
17308  }
17309  nStepsMax = atoi(argv[globalUtilOptind]);
17310  globalUtilOptind++;
17311  if ( nStepsMax < 0 )
17312  goto usage;
17313  break;
17314  case 'm':
17315  fMinArea ^= 1;
17316  break;
17317  case 'f':
17318  fForwardOnly ^= 1;
17319  break;
17320  case 'b':
17321  fBackwardOnly ^= 1;
17322  break;
17323  case 'i':
17324  fInitial ^= 1;
17325  break;
17326  case 'a':
17327  fFastAlgo ^= 1;
17328  break;
17329  case 'v':
17330  fVerbose ^= 1;
17331  break;
17332  case 'h':
17333  goto usage;
17334  default:
17335  goto usage;
17336  }
17337  }
17338 
17339  if ( pNtk == NULL )
17340  {
17341  Abc_Print( -1, "Empty network.\n" );
17342  return 1;
17343  }
17344 
17345  if ( !Abc_NtkLatchNum(pNtk) )
17346  {
17347 // Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
17348  return 0;
17349  }
17350 
17351  if ( !Abc_NtkIsStrash(pNtk) )
17352  {
17353  Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
17354  return 0;
17355  }
17356 
17357  // perform the retiming
17358  if ( fMinArea )
17359  pNtkRes = Abc_NtkDarRetimeMinArea( pNtk, nMaxIters, fForwardOnly, fBackwardOnly, fInitial, fVerbose );
17360  else if ( fFastAlgo )
17361  pNtkRes = Abc_NtkDarRetime( pNtk, nStepsMax, fVerbose );
17362  else
17363 // pNtkRes = Abc_NtkDarRetimeF( pNtk, nStepsMax, fVerbose );
17364  pNtkRes = Abc_NtkDarRetimeMostFwd( pNtk, nMaxIters, fVerbose );
17365  if ( pNtkRes == NULL )
17366  {
17367  Abc_Print( -1, "Retiming has failed.\n" );
17368  return 1;
17369  }
17370  // replace the current network
17371  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17372  return 0;
17373 
17374 usage:
17375  Abc_Print( -2, "usage: dretime [-NS num] [-mfbiavh]\n" );
17376  Abc_Print( -2, "\t new implementation of min-area (or most-forward) retiming\n" );
17377  Abc_Print( -2, "\t-m : toggle min-area retiming and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" );
17378  Abc_Print( -2, "\t-f : enables forward-only retiming [default = %s]\n", fForwardOnly? "yes": "no" );
17379  Abc_Print( -2, "\t-b : enables backward-only retiming [default = %s]\n", fBackwardOnly? "yes": "no" );
17380  Abc_Print( -2, "\t-i : enables init state computation [default = %s]\n", fInitial? "yes": "no" );
17381  Abc_Print( -2, "\t-N num : the max number of one-frame iterations to perform [default = %d]\n", nMaxIters );
17382  Abc_Print( -2, "\t-S num : the max number of forward retiming steps to perform [default = %d]\n", nStepsMax );
17383  Abc_Print( -2, "\t-a : enables a fast most-forward algorithm [default = %s]\n", fFastAlgo? "yes": "no" );
17384  Abc_Print( -2, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
17385  Abc_Print( -2, "\t-h : print the command usage\n");
17386  return 1;
17387 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
Abc_Ntk_t * Abc_NtkDarRetime(Abc_Ntk_t *pNtk, int nStepsMax, int fVerbose)
Definition: abcDar.c:3245
Abc_Ntk_t * Abc_NtkDarRetimeMinArea(Abc_Ntk_t *pNtk, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose)
Definition: abcDar.c:3349
Abc_Ntk_t * Abc_NtkDarRetimeF(Abc_Ntk_t *pNtk, int nStepsMax, int fVerbose)
Definition: abcDar.c:3279
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Abc_Ntk_t * Abc_NtkDarRetimeMostFwd(Abc_Ntk_t *pNtk, int nMaxIters, int fVerbose)
Definition: abcDar.c:3313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDRewrite ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11444 of file abc.c.

11445 {
11446  Abc_Ntk_t * pNtk, * pNtkRes;
11447  Dar_RwrPar_t Pars, * pPars = &Pars;
11448  int c;
11449 
11450  extern Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars );
11451 
11452  pNtk = Abc_FrameReadNtk(pAbc);
11453  // set defaults
11454  Dar_ManDefaultRwrParams( pPars );
11456  while ( ( c = Extra_UtilGetopt( argc, argv, "CNflzrvwh" ) ) != EOF )
11457  {
11458  switch ( c )
11459  {
11460  case 'C':
11461  if ( globalUtilOptind >= argc )
11462  {
11463  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
11464  goto usage;
11465  }
11466  pPars->nCutsMax = atoi(argv[globalUtilOptind]);
11467  globalUtilOptind++;
11468  if ( pPars->nCutsMax < 0 )
11469  goto usage;
11470  break;
11471  case 'N':
11472  if ( globalUtilOptind >= argc )
11473  {
11474  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
11475  goto usage;
11476  }
11477  pPars->nSubgMax = atoi(argv[globalUtilOptind]);
11478  globalUtilOptind++;
11479  if ( pPars->nSubgMax < 0 )
11480  goto usage;
11481  break;
11482  case 'f':
11483  pPars->fFanout ^= 1;
11484  break;
11485  case 'l':
11486  pPars->fUpdateLevel ^= 1;
11487  break;
11488  case 'z':
11489  pPars->fUseZeros ^= 1;
11490  break;
11491  case 'r':
11492  pPars->fRecycle ^= 1;
11493  break;
11494  case 'v':
11495  pPars->fVerbose ^= 1;
11496  break;
11497  case 'w':
11498  pPars->fVeryVerbose ^= 1;
11499  break;
11500  case 'h':
11501  goto usage;
11502  default:
11503  goto usage;
11504  }
11505  }
11506  if ( pNtk == NULL )
11507  {
11508  Abc_Print( -1, "Empty network.\n" );
11509  return 1;
11510  }
11511  if ( !Abc_NtkIsStrash(pNtk) )
11512  {
11513  Abc_Print( -1, "This command works only for strashed networks.\n" );
11514  return 1;
11515  }
11516  pNtkRes = Abc_NtkDRewrite( pNtk, pPars );
11517  if ( pNtkRes == NULL )
11518  {
11519  Abc_Print( -1, "Command has failed.\n" );
11520  return 0;
11521  }
11522  // replace the current network
11523  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11524  return 0;
11525 
11526 usage:
11527  Abc_Print( -2, "usage: drw [-C num] [-N num] [-lfzrvwh]\n" );
11528  Abc_Print( -2, "\t performs combinational AIG rewriting\n" );
11529  Abc_Print( -2, "\t-C num : the max number of cuts at a node [default = %d]\n", pPars->nCutsMax );
11530  Abc_Print( -2, "\t-N num : the max number of subgraphs tried [default = %d]\n", pPars->nSubgMax );
11531  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
11532  Abc_Print( -2, "\t-f : toggle representing fanouts [default = %s]\n", pPars->fFanout? "yes": "no" );
11533  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
11534  Abc_Print( -2, "\t-r : toggle using cut recycling [default = %s]\n", pPars->fRecycle? "yes": "no" );
11535  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
11536  Abc_Print( -2, "\t-w : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
11537  Abc_Print( -2, "\t-h : print the command usage\n");
11538  return 1;
11539 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Dar_RwrPar_t_ Dar_RwrPar_t
INCLUDES ///.
Definition: dar.h:42
Abc_Ntk_t * Abc_NtkDRewrite(Abc_Ntk_t *pNtk, Dar_RwrPar_t *pPars)
Definition: abcDar.c:1444
void Dar_ManDefaultRwrParams(Dar_RwrPar_t *pPars)
FUNCTION DEFINITIONS ///.
Definition: darCore.c:51
int Abc_CommandDropSat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7373 of file abc.c.

7374 {
7375  extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
7376  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes = NULL;
7377  int fNoSweep = 0;
7378  int c, fVerbose = 0;
7380  while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
7381  {
7382  switch ( c )
7383  {
7384  case 's':
7385  fNoSweep ^= 1;
7386  break;
7387  case 'v':
7388  fVerbose ^= 1;
7389  break;
7390  case 'h':
7391  default:
7392  goto usage;
7393  }
7394  }
7395  if ( pNtk == NULL )
7396  {
7397  Abc_Print( -1, "Empty network.\n" );
7398  return 1;
7399  }
7400  if ( !Abc_NtkIsStrash(pNtk) )
7401  {
7402  Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
7403  return 1;
7404  }
7405  if ( pAbc->vCexVec == NULL )
7406  {
7407  Abc_Print( -1, "CEX array is not defined. Run \"bmc3 -az\", \"sim3 -az\", or \"pdr -az\".\n" );
7408  return 1;
7409  }
7410  if ( Vec_PtrSize(pAbc->vCexVec) != Abc_NtkPoNum(pNtk) )
7411  {
7412  Abc_Print( -1, "CEX array size (%d) does not match the number of outputs (%d).\n", Vec_PtrSize(pAbc->vCexVec), Abc_NtkPoNum(pNtk) );
7413  return 1;
7414  }
7415  Abc_NtkDropSatOutputs( pNtk, pAbc->vCexVec, fVerbose );
7416  if ( !fNoSweep )
7417  {
7418  pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
7419  if ( pNtkRes == NULL )
7420  {
7421  Abc_Print( -1, "Removing SAT outputs has failed.\n" );
7422  return 1;
7423  }
7424  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7425  }
7426  return 0;
7427 
7428 usage:
7429  Abc_Print( -2, "usage: dropsat [-sh]\n" );
7430  Abc_Print( -2, "\t replaces satisfiable POs by constant 0 and cleans up the AIG\n" );
7431  Abc_Print( -2, "\t-s : toggles skipping sequential sweep [default = %s]\n", fNoSweep? "yes": "no" );
7432  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
7433  Abc_Print( -2, "\t-h : print the command usage\n");
7434  return 1;
7435 }
ABC_DLL Abc_Ntk_t * Abc_NtkDarLatchSweep(Abc_Ntk_t *pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
Definition: abcDar.c:3203
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Abc_NtkDropSatOutputs(Abc_Ntk_t *pNtk, Vec_Ptr_t *vCexes, int fVerbose)
Definition: abcNtk.c:1737
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDrwsat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11989 of file abc.c.

11990 {
11991  Abc_Ntk_t * pNtk, * pNtkRes;
11992  int fBalance, fVerbose, c;
11993 
11994  extern Abc_Ntk_t * Abc_NtkDrwsat( Abc_Ntk_t * pNtk, int fBalance, int fVerbose );
11995 
11996  pNtk = Abc_FrameReadNtk(pAbc);
11997  // set defaults
11998  fBalance = 0;
11999  fVerbose = 0;
12001  while ( ( c = Extra_UtilGetopt( argc, argv, "bvh" ) ) != EOF )
12002  {
12003  switch ( c )
12004  {
12005  case 'b':
12006  fBalance ^= 1;
12007  break;
12008  case 'v':
12009  fVerbose ^= 1;
12010  break;
12011  case 'h':
12012  goto usage;
12013  default:
12014  goto usage;
12015  }
12016  }
12017  if ( pNtk == NULL )
12018  {
12019  Abc_Print( -1, "Empty network.\n" );
12020  return 1;
12021  }
12022  if ( !Abc_NtkIsStrash(pNtk) )
12023  {
12024  Abc_Print( -1, "This command works only for strashed networks.\n" );
12025  return 1;
12026  }
12027  pNtkRes = Abc_NtkDrwsat( pNtk, fBalance, fVerbose );
12028  if ( pNtkRes == NULL )
12029  {
12030  Abc_Print( -1, "Command has failed.\n" );
12031  return 0;
12032  }
12033  // replace the current network
12034  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
12035  return 0;
12036 
12037 usage:
12038  Abc_Print( -2, "usage: drwsat [-bvh]\n" );
12039  Abc_Print( -2, "\t performs combinational AIG optimization for SAT\n" );
12040  Abc_Print( -2, "\t-b : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
12041  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
12042  Abc_Print( -2, "\t-h : print the command usage\n");
12043  return 1;
12044 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Abc_Ntk_t * Abc_NtkDrwsat(Abc_Ntk_t *pNtk, int fBalance, int fVerbose)
Definition: abcDar.c:1631
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDSat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21411 of file abc.c.

21412 {
21413  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
21414  int c;
21415  int RetValue;
21416  int fAlignPol;
21417  int fAndOuts;
21418  int fNewSolver;
21419  int fVerbose;
21420  int nConfLimit;
21421  int nLearnedStart;
21422  int nLearnedDelta;
21423  int nLearnedPerce;
21424  int nInsLimit;
21425  abctime clk;
21426 
21427  extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose );
21428  // set defaults
21429  fAlignPol = 0;
21430  fAndOuts = 0;
21431  fNewSolver = 0;
21432  fVerbose = 0;
21433  nConfLimit = 0;
21434  nInsLimit = 0;
21435  nLearnedStart = 0;
21436  nLearnedDelta = 0;
21437  nLearnedPerce = 0;
21439  while ( ( c = Extra_UtilGetopt( argc, argv, "CILDEpanvh" ) ) != EOF )
21440  {
21441  switch ( c )
21442  {
21443  case 'C':
21444  if ( globalUtilOptind >= argc )
21445  {
21446  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
21447  goto usage;
21448  }
21449  nConfLimit = atoi(argv[globalUtilOptind]);
21450  globalUtilOptind++;
21451  if ( nConfLimit < 0 )
21452  goto usage;
21453  break;
21454  case 'I':
21455  if ( globalUtilOptind >= argc )
21456  {
21457  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
21458  goto usage;
21459  }
21460  nInsLimit = atoi(argv[globalUtilOptind]);
21461  globalUtilOptind++;
21462  if ( nInsLimit < 0 )
21463  goto usage;
21464  break;
21465  case 'L':
21466  if ( globalUtilOptind >= argc )
21467  {
21468  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
21469  goto usage;
21470  }
21471  nLearnedStart = atoi(argv[globalUtilOptind]);
21472  globalUtilOptind++;
21473  if ( nLearnedStart < 0 )
21474  goto usage;
21475  break;
21476  case 'D':
21477  if ( globalUtilOptind >= argc )
21478  {
21479  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
21480  goto usage;
21481  }
21482  nLearnedDelta = atoi(argv[globalUtilOptind]);
21483  globalUtilOptind++;
21484  if ( nLearnedDelta < 0 )
21485  goto usage;
21486  break;
21487  case 'E':
21488  if ( globalUtilOptind >= argc )
21489  {
21490  Abc_Print( -1, "Command line switch \"-E\" should be followed by an integer.\n" );
21491  goto usage;
21492  }
21493  nLearnedPerce = atoi(argv[globalUtilOptind]);
21494  globalUtilOptind++;
21495  if ( nLearnedPerce < 0 )
21496  goto usage;
21497  break;
21498  case 'p':
21499  fAlignPol ^= 1;
21500  break;
21501  case 'a':
21502  fAndOuts ^= 1;
21503  break;
21504  case 'n':
21505  fNewSolver ^= 1;
21506  break;
21507  case 'v':
21508  fVerbose ^= 1;
21509  break;
21510  case 'h':
21511  goto usage;
21512  default:
21513  goto usage;
21514  }
21515  }
21516 
21517  if ( argc == globalUtilOptind + 1 )
21518  {
21519  extern int Cnf_DataSolveFromFile( char * pFileName, int nConfLimit, int fVerbose );
21520  // get the input file name
21521  char * pFileName = argv[globalUtilOptind];
21522  FILE * pFile = fopen( pFileName, "rb" );
21523  if ( pFile == NULL )
21524  {
21525  printf( "Cannot open file \"%s\" for writing.\n", pFileName );
21526  return 0;
21527  }
21528  fclose( pFile );
21529  Cnf_DataSolveFromFile( pFileName, nConfLimit, fVerbose );
21530  return 0;
21531  }
21532 
21533  if ( pNtk == NULL )
21534  {
21535  Abc_Print( -1, "Empty network.\n" );
21536  return 1;
21537  }
21538  if ( Abc_NtkLatchNum(pNtk) > 0 )
21539  {
21540  Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
21541  return 0;
21542  }
21543 
21544  if ( Abc_NtkPoNum(pNtk) != 1 )
21545  {
21546  Abc_Print( -1, "Currently expects a single-output miter.\n" );
21547  return 0;
21548  }
21549 
21550  if ( !Abc_NtkIsStrash(pNtk) )
21551  {
21552  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
21553  return 0;
21554  }
21555  clk = Abc_Clock();
21556  RetValue = Abc_NtkDSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, nLearnedStart, nLearnedDelta, nLearnedPerce, fAlignPol, fAndOuts, fNewSolver, fVerbose );
21557  // verify that the pattern is correct
21558  if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
21559  {
21560  int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
21561  if ( pSimInfo[0] != 1 )
21562  Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
21563  ABC_FREE( pSimInfo );
21564  pAbc->pCex = Abc_CexCreate( 0, Abc_NtkPiNum(pNtk), pNtk->pModel, 0, 0, 0 );
21565  }
21566  pAbc->Status = RetValue;
21567  if ( RetValue == -1 )
21568  Abc_Print( 1, "UNDECIDED " );
21569  else if ( RetValue == 0 )
21570  Abc_Print( 1, "SATISFIABLE " );
21571  else
21572  Abc_Print( 1, "UNSATISFIABLE " );
21573  //Abc_Print( -1, "\n" );
21574  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
21575  return 0;
21576 
21577 usage:
21578  Abc_Print( -2, "usage: dsat [-CILDE num] [-panvh]\n" );
21579  Abc_Print( -2, "\t solves the combinational miter using SAT solver MiniSat-1.14\n" );
21580  Abc_Print( -2, "\t derives CNF from the current network and leaves it unchanged\n" );
21581  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
21582  Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
21583  Abc_Print( -2, "\t-L num : starting value for learned clause removal [default = %d]\n", nLearnedStart );
21584  Abc_Print( -2, "\t-D num : delta value for learned clause removal [default = %d]\n", nLearnedDelta );
21585  Abc_Print( -2, "\t-E num : ratio percentage for learned clause removal [default = %d]\n", nLearnedPerce );
21586  Abc_Print( -2, "\t-p : align polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
21587  Abc_Print( -2, "\t-a : toggle ANDing/ORing of miter outputs [default = %s]\n", fAndOuts? "ANDing": "ORing" );
21588  Abc_Print( -2, "\t-n : toggle using new solver [default = %s]\n", fNewSolver? "yes": "no" );
21589  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
21590  Abc_Print( -2, "\t-h : print the command usage\n");
21591  return 1;
21592 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static abctime Abc_Clock()
Definition: abc_global.h:279
int Cnf_DataSolveFromFile(char *pFileName, int nConfLimit, int fVerbose)
Definition: cnfUtil.c:402
int * pModel
Definition: abc.h:198
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Abc_NtkDSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose)
Definition: abcDar.c:1804
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define ABC_FREE(obj)
Definition: abc_global.h:232
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
Definition: abcVerify.c:686
ABC_INT64_T abctime
Definition: abc_global.h:278
Abc_Cex_t * Abc_CexCreate(int nRegs, int nPis, int *pArray, int iFrame, int iPo, int fSkipRegs)
Definition: utilCex.c:110
int Abc_CommandDsdFilter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16416 of file abc.c.

16417 {
16418  extern void Id_DsdManTuneThresh( If_DsdMan_t * p, int fUnate, int fThresh, int fVerbose );
16420  int c, nLimit = 0, nLutSize = -1, fCleanOccur = 0, fCleanMarks = 0, fInvMarks = 0, fUnate = 0, fThresh = 0, fVerbose = 0;
16422  while ( ( c = Extra_UtilGetopt( argc, argv, "LKomiutvh" ) ) != EOF )
16423  {
16424  switch ( c )
16425  {
16426  case 'L':
16427  if ( globalUtilOptind >= argc )
16428  {
16429  Abc_Print( -1, "Command line switch \"-L\" should be followed by a floating point number.\n" );
16430  goto usage;
16431  }
16432  nLimit = atoi(argv[globalUtilOptind]);
16433  globalUtilOptind++;
16434  break;
16435  case 'K':
16436  if ( globalUtilOptind >= argc )
16437  {
16438  Abc_Print( -1, "Command line switch \"-K\" should be followed by a floating point number.\n" );
16439  goto usage;
16440  }
16441  nLutSize = atoi(argv[globalUtilOptind]);
16442  globalUtilOptind++;
16443  break;
16444  case 'o':
16445  fCleanOccur ^= 1;
16446  break;
16447  case 'm':
16448  fCleanMarks ^= 1;
16449  break;
16450  case 'i':
16451  fInvMarks ^= 1;
16452  break;
16453  case 'u':
16454  fUnate ^= 1;
16455  break;
16456  case 't':
16457  fThresh ^= 1;
16458  break;
16459  case 'v':
16460  fVerbose ^= 1;
16461  break;
16462  case 'h':
16463  goto usage;
16464  default:
16465  goto usage;
16466  }
16467  }
16468  if ( pDsd == NULL )
16469  {
16470  Abc_Print( -1, "The DSD manager is not started.\n" );
16471  return 0;
16472  }
16473  if ( nLimit > 0 )
16474  Abc_FrameSetManDsd( If_DsdManFilter(pDsd, nLimit) );
16475  if ( nLutSize >= 0 )
16476  If_DsdManSetLutSize( pDsd, nLutSize );
16477  if ( fCleanOccur )
16478  If_DsdManCleanOccur( pDsd, fVerbose );
16479  if ( fCleanMarks )
16480  If_DsdManCleanMarks( pDsd, fVerbose );
16481  if ( fInvMarks )
16482  If_DsdManInvertMarks( pDsd, fVerbose );
16483  if ( fUnate )
16484  Id_DsdManTuneThresh( pDsd, 1, 0, fVerbose );
16485  if ( fThresh )
16486  Id_DsdManTuneThresh( pDsd, 0, 1, fVerbose );
16487  return 0;
16488 
16489 usage:
16490  Abc_Print( -2, "usage: dsd_filter [-LK num] [-omiutvh]\n" );
16491  Abc_Print( -2, "\t filtering structured and modifying parameters of DSD manager\n" );
16492  Abc_Print( -2, "\t-L num : remove structures with fewer occurrences that this [default = %d]\n", nLimit );
16493  Abc_Print( -2, "\t-K num : new LUT size to set for the DSD manager [default = %d]\n", nLutSize );
16494  Abc_Print( -2, "\t-o : toggles cleaning occurrence counters [default = %s]\n", fCleanOccur? "yes": "no" );
16495  Abc_Print( -2, "\t-m : toggles cleaning matching marks [default = %s]\n", fCleanMarks? "yes": "no" );
16496  Abc_Print( -2, "\t-i : toggles inverting matching marks [default = %s]\n", fInvMarks? "yes": "no" );
16497  Abc_Print( -2, "\t-u : toggles marking unate functions [default = %s]\n", fUnate? "yes": "no" );
16498  Abc_Print( -2, "\t-t : toggles marking threshold functions [default = %s]\n", fThresh? "yes": "no" );
16499  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
16500  Abc_Print( -2, "\t-h : print the command usage\n");
16501  return 1;
16502 }
void If_DsdManSetLutSize(If_DsdMan_t *p, int nLutSize)
Definition: ifDsd.c:177
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void If_DsdManInvertMarks(If_DsdMan_t *p, int fVerbose)
Definition: ifDsd.c:1233
void If_DsdManCleanMarks(If_DsdMan_t *p, int fVerbose)
Definition: ifDsd.c:1224
void Id_DsdManTuneThresh(If_DsdMan_t *p, int fUnate, int fThresh, int fVerbose)
Definition: ifDsd.c:2721
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL void Abc_FrameSetManDsd(void *pMan)
Definition: mainFrame.c:89
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
If_DsdMan_t * If_DsdManFilter(If_DsdMan_t *p, int Limit)
Definition: ifDsd.c:1263
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void If_DsdManCleanOccur(If_DsdMan_t *p, int fVerbose)
Definition: ifDsd.c:1217
int Abc_CommandDsdFree ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16086 of file abc.c.

16087 {
16088  int c, fSecond = 0;
16090  while ( ( c = Extra_UtilGetopt( argc, argv, "bh" ) ) != EOF )
16091  {
16092  switch ( c )
16093  {
16094  case 'b':
16095  fSecond ^= 1;
16096  break;
16097  case 'h':
16098  goto usage;
16099  default:
16100  goto usage;
16101  }
16102  }
16103  if ( fSecond )
16104  {
16105  if ( !Abc_FrameReadManDsd2() )
16106  {
16107  Abc_Print( -1, "The DSD manager is not started.\n" );
16108  return 0;
16109  }
16110  Abc_FrameSetManDsd2( NULL );
16111  }
16112  else
16113  {
16114  if ( !Abc_FrameReadManDsd() )
16115  {
16116  Abc_Print( -1, "The DSD manager is not started.\n" );
16117  return 0;
16118  }
16119  Abc_FrameSetManDsd( NULL );
16120  }
16121  return 0;
16122 
16123 usage:
16124  Abc_Print( -2, "usage: dsd_free [-bh]\n" );
16125  Abc_Print( -2, "\t deletes DSD manager\n" );
16126  Abc_Print( -2, "\t-b : toggles processing second manager [default = %s]\n", fSecond? "yes": "no" );
16127  Abc_Print( -2, "\t-h : print the command usage\n");
16128  return 1;
16129 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL void Abc_FrameSetManDsd(void *pMan)
Definition: mainFrame.c:89
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL void Abc_FrameSetManDsd2(void *pMan)
Definition: mainFrame.c:90
ABC_DLL void * Abc_FrameReadManDsd2()
Definition: mainFrame.c:63
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDsdLoad ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16005 of file abc.c.

16006 {
16007  char * FileName, * pTemp;
16008  char ** pArgvNew;
16009  int c, nArgcNew, fSecond = 0;
16010  FILE * pFile;
16011  If_DsdMan_t * pDsdMan;
16013  while ( ( c = Extra_UtilGetopt( argc, argv, "bh" ) ) != EOF )
16014  {
16015  switch ( c )
16016  {
16017  case 'b':
16018  fSecond ^= 1;
16019  break;
16020  case 'h':
16021  goto usage;
16022  default:
16023  goto usage;
16024  }
16025  }
16026  pArgvNew = argv + globalUtilOptind;
16027  nArgcNew = argc - globalUtilOptind;
16028  if ( nArgcNew != 1 )
16029  {
16030  Abc_Print( -1, "File name is not given on the command line.\n" );
16031  return 1;
16032  }
16033  // get the input file name
16034  FileName = pArgvNew[0];
16035  // fix the wrong symbol
16036  for ( pTemp = FileName; *pTemp; pTemp++ )
16037  if ( *pTemp == '>' )
16038  *pTemp = '\\';
16039  if ( (pFile = fopen( FileName, "r" )) == NULL )
16040  {
16041  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
16042  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
16043  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
16044  Abc_Print( 1, "\n" );
16045  return 1;
16046  }
16047  fclose( pFile );
16048  if ( fSecond )
16049  {
16050  Abc_FrameSetManDsd2( NULL );
16051  pDsdMan = If_DsdManLoad(FileName);
16052  if ( pDsdMan == NULL )
16053  return 1;
16054  Abc_FrameSetManDsd2( pDsdMan );
16055  }
16056  else
16057  {
16058  Abc_FrameSetManDsd( NULL );
16059  pDsdMan = If_DsdManLoad(FileName);
16060  if ( pDsdMan == NULL )
16061  return 1;
16062  Abc_FrameSetManDsd( pDsdMan );
16063  }
16064  return 0;
16065 
16066 usage:
16067  Abc_Print( -2, "usage: dsd_load [-bh] <file>\n" );
16068  Abc_Print( -2, "\t loads DSD manager from file\n");
16069  Abc_Print( -2, "\t-b : toggles processing second manager [default = %s]\n", fSecond? "yes": "no" );
16070  Abc_Print( -2, "\t-h : print the command usage\n");
16071  Abc_Print( -2, "\t<file> : file name to read\n");
16072  return 1;
16073 }
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL void Abc_FrameSetManDsd(void *pMan)
Definition: mainFrame.c:89
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL void Abc_FrameSetManDsd2(void *pMan)
Definition: mainFrame.c:90
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
If_DsdMan_t * If_DsdManLoad(char *pFileName)
Definition: ifDsd.c:1086
int Abc_CommandDsdMatch ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16234 of file abc.c.

16235 {
16236  char * pStruct = NULL;
16237  int c, fVerbose = 0, fFast = 0, fAdd = 0, fSpec = 0, LutSize = 0, nConfls = 10000, nProcs = 1;
16238  If_DsdMan_t * pDsdMan = (If_DsdMan_t *)Abc_FrameReadManDsd();
16240  while ( ( c = Extra_UtilGetopt( argc, argv, "KCPSfasvh" ) ) != EOF )
16241  {
16242  switch ( c )
16243  {
16244  case 'K':
16245  if ( globalUtilOptind >= argc )
16246  {
16247  Abc_Print( -1, "Command line switch \"-K\" should be followed by a floating point number.\n" );
16248  goto usage;
16249  }
16250  LutSize = atoi(argv[globalUtilOptind]);
16251  globalUtilOptind++;
16252  if ( LutSize < 4 || LutSize > 6 )
16253  goto usage;
16254  break;
16255  case 'C':
16256  if ( globalUtilOptind >= argc )
16257  {
16258  Abc_Print( -1, "Command line switch \"-C\" should be followed by a floating point number.\n" );
16259  goto usage;
16260  }
16261  nConfls = atoi(argv[globalUtilOptind]);
16262  globalUtilOptind++;
16263  break;
16264  case 'P':
16265  if ( globalUtilOptind >= argc )
16266  {
16267  Abc_Print( -1, "Command line switch \"-P\" should be followed by a floating point number.\n" );
16268  goto usage;
16269  }
16270  nProcs = atoi(argv[globalUtilOptind]);
16271  globalUtilOptind++;
16272  break;
16273  case 'S':
16274  if ( globalUtilOptind >= argc )
16275  {
16276  Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
16277  goto usage;
16278  }
16279  pStruct = argv[globalUtilOptind];
16280  globalUtilOptind++;
16281  break;
16282  case 'f':
16283  fFast ^= 1;
16284  break;
16285  case 'a':
16286  fAdd ^= 1;
16287  break;
16288  case 's':
16289  fSpec ^= 1;
16290  break;
16291  case 'v':
16292  fVerbose ^= 1;
16293  break;
16294  case 'h':
16295  goto usage;
16296  default:
16297  goto usage;
16298  }
16299  }
16300  if ( !Abc_FrameReadManDsd() )
16301  {
16302  Abc_Print( -1, "The DSD manager is not started.\n" );
16303  return 0;
16304  }
16305  if ( pStruct )
16306  {
16307  char * pStructCur = If_DsdManGetCellStr( pDsdMan );
16308  if ( pStructCur && strcmp(pStructCur, pStruct) )
16309  {
16310  Abc_Print( -1, "DSD manager matched with cell %s should be cleaned by \"dsd_filter -m\" before matching with cell %s.\n", pStructCur, pStruct );
16311  return 0;
16312  }
16313  Id_DsdManTuneStr( pDsdMan, pStruct, nConfls, nProcs, fVerbose );
16314  }
16315  else
16316  If_DsdManTune( pDsdMan, LutSize, fFast, fAdd, fSpec, fVerbose );
16317  return 0;
16318 
16319 usage:
16320  Abc_Print( -2, "usage: dsd_match [-KCP num] [-fasvh] [-S str]\n" );
16321  Abc_Print( -2, "\t matches DSD structures with the given cell\n" );
16322  Abc_Print( -2, "\t-K num : LUT size used for tuning [default = %d]\n", LutSize );
16323  Abc_Print( -2, "\t-C num : the maximum number of conflicts [default = %d]\n", nConfls );
16324  Abc_Print( -2, "\t-P num : the maximum number of processes [default = %d]\n", nProcs );
16325  Abc_Print( -2, "\t-f : toggles using fast check [default = %s]\n", fFast? "yes": "no" );
16326  Abc_Print( -2, "\t-a : toggles adding tuning to the current one [default = %s]\n", fAdd? "yes": "no" );
16327  Abc_Print( -2, "\t-s : toggles using specialized check [default = %s]\n", fSpec? "yes": "no" );
16328  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
16329  Abc_Print( -2, "\t-S str : string representing programmable cell [default = %s]\n", pStruct ? pStruct : "not used" );
16330  Abc_Print( -2, "\t-h : print the command usage\n");
16331  return 1;
16332 }
int strcmp()
void Id_DsdManTuneStr(If_DsdMan_t *p, char *pStruct, int nConfls, int nProcs, int fVerbose)
Definition: ifDsd.c:2519
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void If_DsdManTune(If_DsdMan_t *p, int LutSize, int fFast, int fAdd, int fSpec, int fVerbose)
Definition: ifDsd.c:2377
char * If_DsdManGetCellStr(If_DsdMan_t *p)
Definition: ifDsd.c:203
int Abc_CommandDsdMerge ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16345 of file abc.c.

16346 {
16347  char * FileName, * pTemp;
16348  char ** pArgvNew;
16349  int c, nArgcNew;
16350  FILE * pFile;
16351  If_DsdMan_t * pDsdMan;
16353  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
16354  {
16355  switch ( c )
16356  {
16357  case 'h':
16358  goto usage;
16359  default:
16360  goto usage;
16361  }
16362  }
16363  if ( !Abc_FrameReadManDsd() )
16364  {
16365  Abc_Print( -1, "The DSD manager is not started.\n" );
16366  return 0;
16367  }
16368  pArgvNew = argv + globalUtilOptind;
16369  nArgcNew = argc - globalUtilOptind;
16370  if ( nArgcNew != 1 )
16371  {
16372  Abc_Print( -1, "File name is not given on the command line.\n" );
16373  return 1;
16374  }
16375  // get the input file name
16376  FileName = pArgvNew[0];
16377  // fix the wrong symbol
16378  for ( pTemp = FileName; *pTemp; pTemp++ )
16379  if ( *pTemp == '>' )
16380  *pTemp = '\\';
16381  if ( (pFile = fopen( FileName, "r" )) == NULL )
16382  {
16383  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
16384  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
16385  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
16386  Abc_Print( 1, "\n" );
16387  return 1;
16388  }
16389  fclose( pFile );
16390  pDsdMan = If_DsdManLoad(FileName);
16391  if ( pDsdMan == NULL )
16392  return 1;
16394  If_DsdManFree( pDsdMan, 0 );
16395  return 0;
16396 
16397 usage:
16398  Abc_Print( -2, "usage: dsd_merge [-h] <file>\n" );
16399  Abc_Print( -2, "\t merges DSD manager from file with the current one\n");
16400  Abc_Print( -2, "\t-h : print the command usage\n");
16401  Abc_Print( -2, "\t<file> : file name to read\n");
16402  return 1;
16403 }
void If_DsdManFree(If_DsdMan_t *p, int fVerbose)
Definition: ifDsd.c:316
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
void If_DsdManMerge(If_DsdMan_t *p, If_DsdMan_t *pNew)
Definition: ifDsd.c:1177
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
If_DsdMan_t * If_DsdManLoad(char *pFileName)
Definition: ifDsd.c:1086
int Abc_CommandDsdPs ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16142 of file abc.c.

16143 {
16144  int c, Number = 0, Support = 0, fOccurs = 0, fTtDump = 0, fSecond = 0, fVerbose = 0;
16146  while ( ( c = Extra_UtilGetopt( argc, argv, "NSotbvh" ) ) != EOF )
16147  {
16148  switch ( c )
16149  {
16150  case 'N':
16151  if ( globalUtilOptind >= argc )
16152  {
16153  Abc_Print( -1, "Command line switch \"-N\" should be followed by a floating point number.\n" );
16154  goto usage;
16155  }
16156  Number = atoi(argv[globalUtilOptind]);
16157  globalUtilOptind++;
16158  if ( Number < 0 )
16159  goto usage;
16160  break;
16161  case 'S':
16162  if ( globalUtilOptind >= argc )
16163  {
16164  Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
16165  goto usage;
16166  }
16167  Support = atoi(argv[globalUtilOptind]);
16168  globalUtilOptind++;
16169  if ( Support < 0 )
16170  goto usage;
16171  break;
16172  case 'o':
16173  fOccurs ^= 1;
16174  break;
16175  case 't':
16176  fTtDump ^= 1;
16177  break;
16178  case 'b':
16179  fSecond ^= 1;
16180  break;
16181  case 'v':
16182  fVerbose ^= 1;
16183  break;
16184  case 'h':
16185  goto usage;
16186  default:
16187  goto usage;
16188  }
16189  }
16190  if ( fSecond )
16191  {
16192  if ( !Abc_FrameReadManDsd2() )
16193  {
16194  Abc_Print( -1, "The DSD manager is not started.\n" );
16195  return 0;
16196  }
16197  If_DsdManPrint( (If_DsdMan_t *)Abc_FrameReadManDsd2(), NULL, Number, Support, fOccurs, fTtDump, fVerbose );
16198  }
16199  else
16200  {
16201  if ( !Abc_FrameReadManDsd() )
16202  {
16203  Abc_Print( -1, "The DSD manager is not started.\n" );
16204  return 0;
16205  }
16206  If_DsdManPrint( (If_DsdMan_t *)Abc_FrameReadManDsd(), NULL, Number, Support, fOccurs, fTtDump, fVerbose );
16207  }
16208  return 0;
16209 
16210 usage:
16211  Abc_Print( -2, "usage: dsd_ps [-NS num] [-obvh]\n" );
16212  Abc_Print( -2, "\t prints statistics of the DSD manager\n" );
16213  Abc_Print( -2, "\t-N num : show structures whose ID divides by N [default = %d]\n", Number );
16214  Abc_Print( -2, "\t-S num : show structures whose support size is S [default = %d]\n", Support );
16215  Abc_Print( -2, "\t-o : toggles printing occurence distribution [default = %s]\n", fOccurs? "yes": "no" );
16216  Abc_Print( -2, "\t-t : toggles dumping truth tables [default = %s]\n", fTtDump? "yes": "no" );
16217  Abc_Print( -2, "\t-b : toggles processing second manager [default = %s]\n", fSecond? "yes": "no" );
16218  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
16219  Abc_Print( -2, "\t-h : print the command usage\n");
16220  return 1;
16221 }
void If_DsdManPrint(If_DsdMan_t *p, char *pFileName, int Number, int Support, int fOccurs, int fTtDump, int fVerbose)
Definition: ifDsd.c:684
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL void * Abc_FrameReadManDsd2()
Definition: mainFrame.c:63
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDsdSave ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 15936 of file abc.c.

15937 {
15938  char * FileName;
15939  char ** pArgvNew;
15940  int nArgcNew;
15941  int c, fSecond = 0;
15943  while ( ( c = Extra_UtilGetopt( argc, argv, "bh" ) ) != EOF )
15944  {
15945  switch ( c )
15946  {
15947  case 'b':
15948  fSecond ^= 1;
15949  break;
15950  case 'h':
15951  goto usage;
15952  default:
15953  goto usage;
15954  }
15955  }
15956  pArgvNew = argv + globalUtilOptind;
15957  nArgcNew = argc - globalUtilOptind;
15958  if ( nArgcNew != 1 )
15959  {
15960  Abc_Print( -1, "File name is not given on the command line.\n" );
15961  return 1;
15962  }
15963  // get the input file name
15964  FileName = (nArgcNew == 1) ? pArgvNew[0] : NULL;
15965  if ( fSecond )
15966  {
15967  if ( !Abc_FrameReadManDsd2() )
15968  {
15969  Abc_Print( -1, "The DSD manager is not started.\n" );
15970  return 1;
15971  }
15973  }
15974  else
15975  {
15976  if ( !Abc_FrameReadManDsd() )
15977  {
15978  Abc_Print( -1, "The DSD manager is not started.\n" );
15979  return 1;
15980  }
15981  If_DsdManSave( (If_DsdMan_t *)Abc_FrameReadManDsd(), FileName );
15982  }
15983  return 0;
15984 
15985 usage:
15986  Abc_Print( -2, "usage: dsd_save [-bh] <file>\n" );
15987  Abc_Print( -2, "\t saves DSD manager into a file\n");
15988  Abc_Print( -2, "\t-b : toggles processing second manager [default = %s]\n", fSecond? "yes": "no" );
15989  Abc_Print( -2, "\t-h : print the command usage\n");
15990  Abc_Print( -2, "\t<file> : (optional) file name to write\n");
15991  return 1;
15992 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void If_DsdManSave(If_DsdMan_t *p, char *pFileName)
Definition: ifDsd.c:1032
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL void * Abc_FrameReadManDsd2()
Definition: mainFrame.c:63
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandDSec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20544 of file abc.c.

20545 {
20546  Fra_Sec_t SecPar, * pSecPar = &SecPar;
20547  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
20548  int fDelete1, fDelete2;
20549  char ** pArgvNew;
20550  int nArgcNew;
20551  int c;
20552  int fIgnoreNames;
20553 
20554  extern int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Fra_Sec_t * p );
20555 
20556  pNtk = Abc_FrameReadNtk(pAbc);
20557  // set defaults
20558  Fra_SecSetDefaultParams( pSecPar );
20559  pSecPar->TimeLimit = 0;
20560  fIgnoreNames = 0;
20562  while ( ( c = Extra_UtilGetopt( argc, argv, "FTarmfnwvh" ) ) != EOF )
20563  {
20564  switch ( c )
20565  {
20566  case 'F':
20567  if ( globalUtilOptind >= argc )
20568  {
20569  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
20570  goto usage;
20571  }
20572  pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
20573  globalUtilOptind++;
20574  if ( pSecPar->nFramesMax < 0 )
20575  goto usage;
20576  break;
20577  case 'T':
20578  if ( globalUtilOptind >= argc )
20579  {
20580  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
20581  goto usage;
20582  }
20583  pSecPar->TimeLimit = atoi(argv[globalUtilOptind]);
20584  globalUtilOptind++;
20585  if ( pSecPar->TimeLimit < 0 )
20586  goto usage;
20587  break;
20588  case 'a':
20589  pSecPar->fPhaseAbstract ^= 1;
20590  break;
20591  case 'r':
20592  pSecPar->fRetimeFirst ^= 1;
20593  break;
20594  case 'm':
20595  pSecPar->fRetimeRegs ^= 1;
20596  break;
20597  case 'f':
20598  pSecPar->fFraiging ^= 1;
20599  break;
20600  case 'n':
20601  fIgnoreNames ^= 1;
20602  break;
20603  case 'w':
20604  pSecPar->fVeryVerbose ^= 1;
20605  break;
20606  case 'v':
20607  pSecPar->fVerbose ^= 1;
20608  break;
20609  default:
20610  goto usage;
20611  }
20612  }
20613 
20614  pArgvNew = argv + globalUtilOptind;
20615  nArgcNew = argc - globalUtilOptind;
20616  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
20617  return 1;
20618  if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
20619  {
20620  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
20621  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
20622  Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
20623  return 0;
20624  }
20625 
20626  if ( fIgnoreNames )
20627  {
20628  if ( !fDelete1 )
20629  {
20630  pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
20631  fDelete1 = 1;
20632  }
20633  if ( !fDelete2 )
20634  {
20635  pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
20636  fDelete2 = 1;
20637  }
20638  Abc_NtkShortNames( pNtk1 );
20639  Abc_NtkShortNames( pNtk2 );
20640  }
20641 
20642  // perform verification
20643  Abc_NtkDarSec( pNtk1, pNtk2, pSecPar );
20644 
20645  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
20646  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
20647  return 0;
20648 
20649 usage:
20650  Abc_Print( -2, "usage: dsec [-F num] [-T num] [-armfnwvh] <file1> <file2>\n" );
20651  Abc_Print( -2, "\t performs inductive sequential equivalence checking\n" );
20652  Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
20653  Abc_Print( -2, "\t-T num : the approximate runtime limit (in seconds) [default = %d]\n", pSecPar->TimeLimit );
20654  Abc_Print( -2, "\t-a : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
20655  Abc_Print( -2, "\t-r : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
20656  Abc_Print( -2, "\t-m : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
20657  Abc_Print( -2, "\t-f : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
20658  Abc_Print( -2, "\t-n : toggle ignoring names when matching PIs/POs [default = %s]\n", fIgnoreNames? "yes": "no" );
20659  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
20660  Abc_Print( -2, "\t-w : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
20661  Abc_Print( -2, "\t-h : print the command usage\n");
20662  Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
20663  Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
20664  Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
20665  Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
20666  return 1;
20667 }
int fFraiging
Definition: fra.h:129
int TimeLimit
Definition: fra.h:141
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Abc_NtkDarSec(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, Fra_Sec_t *pSecPar)
Definition: abcDar.c:2877
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
int nFramesMax
Definition: fra.h:118
ABC_DLL void Abc_NtkShortNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
void Fra_SecSetDefaultParams(Fra_Sec_t *p)
DECLARATIONS ///.
Definition: fraSec.c:51
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
int fVerbose
Definition: fra.h:139
int fRetimeRegs
Definition: fra.h:128
int fVeryVerbose
Definition: fra.h:140
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int fPhaseAbstract
Definition: fra.h:126
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fRetimeFirst
Definition: fra.h:127
int Abc_CommandDualRail ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25004 of file abc.c.

25005 {
25006  extern Vec_Int_t * Abc_NtkFindDcLatches( Abc_Ntk_t * pNtk );
25007  Abc_Ntk_t * pNtk, * pNtkNew = NULL;
25008  Aig_Man_t * pAig, * pAigNew;
25009  Vec_Int_t * vDcFlops = NULL;
25010  int c;
25011  int nDualPis = 0;
25012  int fDualFfs = 0;
25013  int fDualDcFfs = 0;
25014  int fMiterFfs = 0;
25015  int fComplPo = 0;
25016  int fCheckZero = 0;
25017  int fCheckOne = 0;
25018  int fVerbose = 0;
25020  while ( ( c = Extra_UtilGetopt( argc, argv, "Itxfczovh" ) ) != EOF )
25021  {
25022  switch ( c )
25023  {
25024  case 'I':
25025  if ( globalUtilOptind >= argc )
25026  {
25027  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
25028  goto usage;
25029  }
25030  nDualPis = atoi(argv[globalUtilOptind]);
25031  globalUtilOptind++;
25032  if ( nDualPis < 0 )
25033  goto usage;
25034  break;
25035  case 't':
25036  fDualFfs ^= 1;
25037  break;
25038  case 'x':
25039  fDualDcFfs ^= 1;
25040  break;
25041  case 'f':
25042  fMiterFfs ^= 1;
25043  break;
25044  case 'c':
25045  fComplPo ^= 1;
25046  break;
25047  case 'z':
25048  fCheckZero ^= 1;
25049  break;
25050  case 'o':
25051  fCheckOne ^= 1;
25052  break;
25053  case 'v':
25054  fVerbose ^= 1;
25055  break;
25056  case 'h':
25057  goto usage;
25058  default:
25059  Abc_Print( -2, "Unknown switch.\n");
25060  goto usage;
25061  }
25062  }
25063 
25064  // check the main AIG
25065  pNtk = Abc_FrameReadNtk(pAbc);
25066  if ( pNtk == NULL )
25067  {
25068  Abc_Print( 1, "Main AIG: There is no current network.\n");
25069  return 0;
25070  }
25071  if ( !Abc_NtkIsStrash(pNtk) )
25072  {
25073  Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
25074  return 0;
25075  }
25076 
25077  if ( fDualDcFfs )
25078  vDcFlops = Abc_NtkFindDcLatches( pNtk );
25079 
25080  // transform
25081  pAig = Abc_NtkToDar( pNtk, 0, 1 );
25082  pAigNew = Saig_ManDupDual( pAig, vDcFlops, nDualPis, fDualFfs, fMiterFfs, fComplPo, fCheckZero, fCheckOne );
25083  Aig_ManStop( pAig );
25084  pNtkNew = Abc_NtkFromAigPhase( pAigNew );
25085  pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
25086  Aig_ManStop( pAigNew );
25087  Vec_IntFreeP( &vDcFlops );
25088 
25089  // replace the current network
25090  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
25091  return 0;
25092 
25093 usage:
25094  Abc_Print( -2, "usage: dualrail [-I num] [-txfczovh]\n" );
25095  Abc_Print( -2, "\t transforms the current AIG into a dual-rail miter\n" );
25096  Abc_Print( -2, "\t expressing the property \"at least one PO has ternary value\"\n" );
25097  Abc_Print( -2, "\t (to compute an initialization sequence, use switches \"-tfc\")\n" );
25098  Abc_Print( -2, "\t-I num : the number of first PIs interpreted as ternary [default = %d]\n", nDualPis );
25099  Abc_Print( -2, "\t-t : toggle ternary flop init values for all flops [default = %s]\n", fDualFfs? "yes": "const0 init values" );
25100  Abc_Print( -2, "\t-x : toggle ternary flop init values for DC-valued flops [default = %s]\n", fDualDcFfs? "yes": "const0 init values" );
25101  Abc_Print( -2, "\t-f : toggle mitering flops instead of POs [default = %s]\n", fMiterFfs? "flops": "POs" );
25102  Abc_Print( -2, "\t-c : toggle complementing the miter output [default = %s]\n", fComplPo? "yes": "no" );
25103  Abc_Print( -2, "\t-z : toggle checking PO==0 instead of PO==X [default = %s]\n", fCheckZero? "yes": "no" );
25104  Abc_Print( -2, "\t-o : toggle checking PO==1 instead of PO==X [default = %s]\n", fCheckOne? "yes": "no" );
25105  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
25106  Abc_Print( -2, "\t-h : print the command usage\n");
25107  return 1;
25108 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Vec_Int_t * Abc_NtkFindDcLatches(Abc_Ntk_t *pNtk)
Definition: abcDar.c:207
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Aig_Man_t * Saig_ManDupDual(Aig_Man_t *pAig, Vec_Int_t *vDcFlops, int nDualPis, int fDualFfs, int fMiterFfs, int fComplPo, int fCheckZero, int fCheckOne)
FUNCTION DEFINITIONS ///.
Definition: saigDual.c:81
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
char * pName
Definition: abc.h:158
int Abc_CommandEliminate ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3908 of file abc.c.

3909 {
3910  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
3911  int ElimValue;
3912  int nMaxSize;
3913  int nIterMax;
3914  int fGreedy;
3915  int fReverse;
3916  int fSpecial;
3917  int fVerbose;
3918  int c;
3919  extern int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose );
3920  extern int Abc_NtkEliminate1( Abc_Ntk_t * pNtk, int ElimValue, int nMaxSize, int nIterMax, int fReverse, int fVerbose );
3921  extern int Abc_NtkEliminateSpecial( Abc_Ntk_t * pNtk, int nMaxSize, int fVerbose );
3922 
3923  // set the defaults
3924  ElimValue = -1;
3925  nMaxSize = 12;
3926  nIterMax = 1;
3927  fGreedy = 0;
3928  fReverse = 0;
3929  fSpecial = 0;
3930  fVerbose = 0;
3932  while ( (c = Extra_UtilGetopt(argc, argv, "VNIgrsvh")) != EOF )
3933  {
3934  switch (c)
3935  {
3936  case 'V':
3937  if ( globalUtilOptind >= argc )
3938  {
3939  Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer that is -1 or larger.\n" );
3940  goto usage;
3941  }
3942  ElimValue = atoi(argv[globalUtilOptind]);
3943  globalUtilOptind++;
3944  if ( ElimValue < -1 )
3945  goto usage;
3946  break;
3947  case 'N':
3948  if ( globalUtilOptind >= argc )
3949  {
3950  Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
3951  goto usage;
3952  }
3953  nMaxSize = atoi(argv[globalUtilOptind]);
3954  globalUtilOptind++;
3955  if ( nMaxSize <= 0 )
3956  goto usage;
3957  break;
3958  case 'I':
3959  if ( globalUtilOptind >= argc )
3960  {
3961  Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
3962  goto usage;
3963  }
3964  nIterMax = atoi(argv[globalUtilOptind]);
3965  globalUtilOptind++;
3966  if ( nIterMax <= 0 )
3967  goto usage;
3968  break;
3969  case 'g':
3970  fGreedy ^= 1;
3971  break;
3972  case 'r':
3973  fReverse ^= 1;
3974  break;
3975  case 's':
3976  fSpecial ^= 1;
3977  break;
3978  case 'v':
3979  fVerbose ^= 1;
3980  break;
3981  case 'h':
3982  goto usage;
3983  break;
3984  default:
3985  goto usage;
3986  }
3987  }
3988 
3989  if ( pNtk == NULL )
3990  {
3991  Abc_Print( -1, "Empty network.\n" );
3992  return 1;
3993  }
3994 
3995  if ( Abc_NtkNodeNum(pNtk) == 0 )
3996  {
3997  Abc_Print( -1, "The network does not have internal nodes.\n" );
3998  return 1;
3999  }
4000 
4001  if ( !Abc_NtkIsLogic(pNtk) )
4002  {
4003  Abc_Print( -1, "This command can only be applied to a logic network (run \"renode\" or \"if\").\n" );
4004  return 1;
4005  }
4006 
4007  if ( fSpecial )
4008  Abc_NtkEliminateSpecial( pNtk, 1000, fVerbose );
4009  else if ( fGreedy )
4010  Abc_NtkEliminate( pNtk, nMaxSize, fReverse, fVerbose );
4011  else
4012  Abc_NtkEliminate1( pNtk, ElimValue, nMaxSize, nIterMax, fReverse, fVerbose );
4013  return 0;
4014 
4015 usage:
4016  Abc_Print( -2, "usage: eliminate [-VNI <num>] [-grsvh]\n");
4017  Abc_Print( -2, "\t traditional \"eliminate -1\", which collapses the node into its fanout\n");
4018  Abc_Print( -2, "\t if the node's variable appears in the fanout's factored form only once\n");
4019  Abc_Print( -2, "\t-V <num> : the \"value\" parameter used by \"eliminate\" in SIS [default = %d]\n", ElimValue );
4020  Abc_Print( -2, "\t-N <num> : the maximum node support after collapsing [default = %d]\n", nMaxSize );
4021  Abc_Print( -2, "\t-I <num> : the maximum number of iterations [default = %d]\n", nIterMax );
4022  Abc_Print( -2, "\t-g : toggle using greedy eliminate (without \"value\") [default = %s]\n", fGreedy? "yes": "no" );
4023  Abc_Print( -2, "\t-r : use the reverse topological order [default = %s]\n", fReverse? "yes": "no" );
4024  Abc_Print( -2, "\t-s : toggle eliminating similar nodes [default = %s]\n", fSpecial? "yes": "no" );
4025  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
4026  Abc_Print( -2, "\t-h : print the command usage\n");
4027  return 1;
4028 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
int Abc_NtkEliminate1(Abc_Ntk_t *pNtk, int ElimValue, int nMaxSize, int nIterMax, int fReverse, int fVerbose)
Definition: abcMinBase.c:663
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Abc_NtkEliminateSpecial(Abc_Ntk_t *pNtk, int nMaxSize, int fVerbose)
Definition: abcMinBase.c:719
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_NtkEliminate(Abc_Ntk_t *pNtk, int nMaxSize, int fReverse, int fVerbose)
Definition: abcMinBase.c:429
int Abc_CommandEnlarge ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23056 of file abc.c.

23057 {
23058  Abc_Ntk_t * pNtk, * pNtkRes;
23059  int nFrames;
23060  int fVerbose;
23061  int c;
23062  extern Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
23063 
23064  pNtk = Abc_FrameReadNtk(pAbc);
23065  // set defaults
23066  nFrames = 5;
23067  fVerbose = 0;
23069  while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
23070  {
23071  switch ( c )
23072  {
23073  case 'F':
23074  if ( globalUtilOptind >= argc )
23075  {
23076  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
23077  goto usage;
23078  }
23079  nFrames = atoi(argv[globalUtilOptind]);
23080  globalUtilOptind++;
23081  if ( nFrames < 1 )
23082  goto usage;
23083  break;
23084  case 'v':
23085  fVerbose ^= 1;
23086  break;
23087  case 'h':
23088  goto usage;
23089  default:
23090  goto usage;
23091  }
23092  }
23093  if ( pNtk == NULL )
23094  {
23095  Abc_Print( -1, "Empty network.\n" );
23096  return 1;
23097  }
23098  if ( Abc_NtkIsComb(pNtk) )
23099  {
23100  Abc_Print( -1, "The network is combinational.\n" );
23101  return 0;
23102  }
23103  if ( !Abc_NtkIsStrash(pNtk) )
23104  {
23105  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
23106  return 0;
23107  }
23108 
23109  // modify the current network
23110  pNtkRes = Abc_NtkDarEnlarge( pNtk, nFrames, fVerbose );
23111  if ( pNtkRes == NULL )
23112  {
23113  Abc_Print( -1, "Target enlargement has failed.\n" );
23114  return 1;
23115  }
23116  // replace the current network
23117  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
23118  return 0;
23119 usage:
23120  Abc_Print( -2, "usage: enlarge [-F <num>] [-vh]\n" );
23121  Abc_Print( -2, "\t performs structural K-step target enlargement\n" );
23122  Abc_Print( -2, "\t-F <num> : the number of timeframes to unroll (<num> > 0) [default = %d]\n", nFrames );
23123  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
23124  Abc_Print( -2, "\t-h : print the command usage\n");
23125  return 1;
23126 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
Abc_Ntk_t * Abc_NtkDarEnlarge(Abc_Ntk_t *pNtk, int nFrames, int fVerbose)
Definition: abcDar.c:3628
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandEspresso ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9779 of file abc.c.

9780 {
9781  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
9782  int c;
9783  int fVerbose;
9784  extern void Abc_NtkEspresso( Abc_Ntk_t * pNtk, int fVerbose );
9785 
9786  if ( argc == 2 && !strcmp(argv[1], "-h") )
9787  {
9788  Abc_Print( -2, "The espresso command is currently disabled.\n" );
9789  return 1;
9790  }
9791 
9792  Abc_Print( -1, "This command is currently disabled.\n" );
9793  return 0;
9794 
9795  // set defaults
9796  fVerbose = 0;
9798  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
9799  {
9800  switch ( c )
9801  {
9802  case 'v':
9803  fVerbose ^= 1;
9804  break;
9805  case 'h':
9806  goto usage;
9807  default:
9808  goto usage;
9809  }
9810  }
9811  if ( pNtk == NULL )
9812  {
9813  Abc_Print( -1, "Empty network.\n" );
9814  return 1;
9815  }
9816  if ( !Abc_NtkIsLogic(pNtk) )
9817  {
9818  Abc_Print( -1, "SOP minimization is possible for logic networks (run \"renode\").\n" );
9819  return 1;
9820  }
9821 // Abc_NtkEspresso( pNtk, fVerbose );
9822  return 0;
9823 
9824 usage:
9825  Abc_Print( -2, "usage: espresso [-vh]\n" );
9826  Abc_Print( -2, "\t minimizes SOPs of the local functions using Espresso\n" );
9827  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
9828  Abc_Print( -2, "\t-h : print the command usage\n");
9829  return 1;
9830 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
void Abc_NtkEspresso(Abc_Ntk_t *pNtk, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcEspresso.c:51
int strcmp()
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandExdcFree ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9223 of file abc.c.

9224 {
9225  Abc_Ntk_t * pNtk, * pNtkRes;
9226  int c;
9227 
9228  pNtk = Abc_FrameReadNtk(pAbc);
9229  // set defaults
9231  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
9232  {
9233  switch ( c )
9234  {
9235  case 'h':
9236  goto usage;
9237  default:
9238  goto usage;
9239  }
9240  }
9241 
9242  if ( pNtk == NULL )
9243  {
9244  Abc_Print( -1, "Empty network.\n" );
9245  return 1;
9246  }
9247  if ( pNtk->pExdc == NULL )
9248  {
9249  Abc_Print( -1, "The network has no EXDC.\n" );
9250  return 1;
9251  }
9252 
9253  Abc_NtkDelete( pNtk->pExdc );
9254  pNtk->pExdc = NULL;
9255 
9256  // replace the current network
9257  pNtkRes = Abc_NtkDup( pNtk );
9258  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
9259  return 0;
9260 
9261 usage:
9262  Abc_Print( -2, "usage: exdc_free [-h]\n" );
9263  Abc_Print( -2, "\t frees the EXDC network of the current network\n" );
9264  Abc_Print( -2, "\t-h : print the command usage\n");
9265  return 1;
9266 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
Abc_Ntk_t * pExdc
Definition: abc.h:201
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandExdcGet ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9279 of file abc.c.

9280 {
9281  Abc_Ntk_t * pNtk, * pNtkRes;
9282  int c;
9283 
9284  pNtk = Abc_FrameReadNtk(pAbc);
9285  // set defaults
9287  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
9288  {
9289  switch ( c )
9290  {
9291  case 'h':
9292  goto usage;
9293  default:
9294  goto usage;
9295  }
9296  }
9297 
9298  if ( pNtk == NULL )
9299  {
9300  Abc_Print( -1, "Empty network.\n" );
9301  return 1;
9302  }
9303  if ( pNtk->pExdc == NULL )
9304  {
9305  Abc_Print( -1, "The network has no EXDC.\n" );
9306  return 1;
9307  }
9308 
9309  // replace the current network
9310  pNtkRes = Abc_NtkDup( pNtk->pExdc );
9311  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
9312  return 0;
9313 
9314 usage:
9315  Abc_Print( -2, "usage: exdc_get [-h]\n" );
9316  Abc_Print( -2, "\t replaces the current network by the EXDC of the current network\n" );
9317  Abc_Print( -2, "\t-h : print the command usage\n");
9318  return 1;
9319 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
Abc_Ntk_t * pExdc
Definition: abc.h:201
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandExdcSet ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9332 of file abc.c.

9333 {
9334  FILE * pFile;
9335  Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
9336  char * FileName;
9337  int c;
9338 
9339  pNtk = Abc_FrameReadNtk(pAbc);
9340  // set defaults
9342  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
9343  {
9344  switch ( c )
9345  {
9346  case 'h':
9347  goto usage;
9348  default:
9349  goto usage;
9350  }
9351  }
9352 
9353  if ( pNtk == NULL )
9354  {
9355  Abc_Print( -1, "Empty network.\n" );
9356  return 1;
9357  }
9358 
9359  if ( argc != globalUtilOptind + 1 )
9360  {
9361  goto usage;
9362  }
9363 
9364  // get the input file name
9365  FileName = argv[globalUtilOptind];
9366  if ( (pFile = fopen( FileName, "r" )) == NULL )
9367  {
9368  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
9369  if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
9370  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
9371  Abc_Print( 1, "\n" );
9372  return 1;
9373  }
9374  fclose( pFile );
9375 
9376  // set the new network
9377  pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
9378  if ( pNtkNew == NULL )
9379  {
9380  Abc_Print( -1, "Reading network from file has failed.\n" );
9381  return 1;
9382  }
9383 
9384  // replace the EXDC
9385  if ( pNtk->pExdc )
9386  {
9387  Abc_NtkDelete( pNtk->pExdc );
9388  pNtk->pExdc = NULL;
9389  }
9390  pNtkRes = Abc_NtkDup( pNtk );
9391  pNtkRes->pExdc = pNtkNew;
9392 
9393  // replace the current network
9394  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
9395  return 0;
9396 
9397 usage:
9398  Abc_Print( -2, "usage: exdc_set [-h] <file>\n" );
9399  Abc_Print( -2, "\t sets the network from file as EXDC for the current network\n" );
9400  Abc_Print( -2, "\t-h : print the command usage\n");
9401  Abc_Print( -2, "\t<file> : file with the new EXDC network\n");
9402  return 1;
9403 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
Abc_Ntk_t * pExdc
Definition: abc.h:201
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandExtract ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6413 of file abc.c.

6414 {
6415  extern Abc_Ntk_t * Abc_NtkShareXor( Abc_Ntk_t * pNtk, int nMultiSize, int fAnd, int fVerbose );
6416  Abc_Ntk_t * pNtk, * pNtkRes;
6417  int c, nMultiSize, fAnd, fVerbose;
6418  pNtk = Abc_FrameReadNtk(pAbc);
6419 
6420  // set defaults
6421  nMultiSize = 3;
6422  fAnd = 0;
6423  fVerbose = 0;
6425  while ( ( c = Extra_UtilGetopt( argc, argv, "Kavh" ) ) != EOF )
6426  {
6427  switch ( c )
6428  {
6429  case 'K':
6430  if ( globalUtilOptind >= argc )
6431  {
6432  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
6433  goto usage;
6434  }
6435  nMultiSize = atoi(argv[globalUtilOptind]);
6436  globalUtilOptind++;
6437  if ( nMultiSize < 0 )
6438  goto usage;
6439  break;
6440  case 'a':
6441  fAnd ^= 1;
6442  break;
6443  case 'v':
6444  fVerbose ^= 1;
6445  break;
6446  case 'h':
6447  goto usage;
6448  default:
6449  goto usage;
6450  }
6451  }
6452  if ( pNtk == NULL )
6453  {
6454  Abc_Print( -1, "Empty network.\n" );
6455  return 1;
6456  }
6457  if ( !Abc_NtkIsStrash(pNtk) )
6458  {
6459  Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
6460  return 1;
6461  }
6462  // get the new network
6463  pNtkRes = Abc_NtkShareXor( pNtk, nMultiSize, fAnd, fVerbose );
6464  if ( pNtkRes == NULL )
6465  {
6466  Abc_Print( -1, "Cascade synthesis has failed.\n" );
6467  return 1;
6468  }
6469  // replace the current network
6470  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
6471  return 0;
6472 
6473 usage:
6474  Abc_Print( -2, "usage: extract [-K <num>] [-avh]\n" );
6475  Abc_Print( -2, "\t extracts shared logic from multi-input gates\n" );
6476  Abc_Print( -2, "\t-K <num> : the minimum gate size to consider for extraction [default = %d]\n", nMultiSize );
6477  Abc_Print( -2, "\t-a : toggle multi-input XOR vs multi-input AND [default = %s]\n", fAnd? "AND": "XOR" );
6478  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
6479  Abc_Print( -2, "\t-h : print the command usage\n");
6480  return 1;
6481 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkShareXor(Abc_Ntk_t *pNtk, int nMultiSize, int fAnd, int fVerbose)
Definition: abcExtract.c:720
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandExtSeqDcs ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8447 of file abc.c.

8448 {
8449  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
8450  int c;
8451  int fVerbose;
8452  extern int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNet, int fVerbose );
8453 
8454  pNtk = Abc_FrameReadNtk(pAbc);
8455  // set defaults
8456  fVerbose = 0;
8458  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
8459  {
8460  switch ( c )
8461  {
8462  case 'v':
8463  fVerbose ^= 1;
8464  break;
8465  case 'h':
8466  goto usage;
8467  default:
8468  goto usage;
8469  }
8470  }
8471 
8472  if ( pNtk == NULL )
8473  {
8474  Abc_Print( -1, "Empty network.\n" );
8475  return 1;
8476  }
8477  if ( Abc_NtkLatchNum(pNtk) == 0 )
8478  {
8479  Abc_Print( -1, "The current network has no latches.\n" );
8480  return 0;
8481  }
8482  if ( !Abc_NtkIsStrash(pNtk) )
8483  {
8484  Abc_Print( -1, "Extracting sequential don't-cares works only for AIGs (run \"strash\").\n" );
8485  return 0;
8486  }
8487  if ( !Abc_NtkExtractSequentialDcs( pNtk, fVerbose ) )
8488  {
8489  Abc_Print( -1, "Extracting sequential don't-cares has failed.\n" );
8490  return 1;
8491  }
8492  return 0;
8493 
8494 usage:
8495  Abc_Print( -2, "usage: ext_seq_dcs [-vh]\n" );
8496  Abc_Print( -2, "\t create EXDC network using unreachable states\n" );
8497  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
8498  Abc_Print( -2, "\t-h : print the command usage\n");
8499  return 1;
8500 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int Abc_NtkExtractSequentialDcs(Abc_Ntk_t *pNtk, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcUnreach.c:51
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandExtWin ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 19810 of file abc.c.

19811 {
19812  Abc_Ntk_t * pNtkRes, * pNtk;
19813  int c;
19814  int nObjId;
19815  int nDist;
19816  int fVerbose;
19817 
19818  extern Abc_Ntk_t * Abc_NtkDarExtWin( Abc_Ntk_t * pNtk, int nObjId, int nDist, int fVerbose );
19819 
19820  pNtk = Abc_FrameReadNtk(pAbc);
19821  // set defaults
19822  nObjId = -1;
19823  nDist = 5;
19824  fVerbose = 0;
19826  while ( ( c = Extra_UtilGetopt( argc, argv, "NDvh" ) ) != EOF )
19827  {
19828  switch ( c )
19829  {
19830  case 'N':
19831  if ( globalUtilOptind >= argc )
19832  {
19833  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
19834  goto usage;
19835  }
19836  nObjId = atoi(argv[globalUtilOptind]);
19837  globalUtilOptind++;
19838  if ( nObjId <= 0 )
19839  goto usage;
19840  break;
19841  case 'D':
19842  if ( globalUtilOptind >= argc )
19843  {
19844  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
19845  goto usage;
19846  }
19847  nDist = atoi(argv[globalUtilOptind]);
19848  globalUtilOptind++;
19849  if ( nDist <= 0 )
19850  goto usage;
19851  break;
19852  case 'v':
19853  fVerbose ^= 1;
19854  break;
19855  case 'h':
19856  goto usage;
19857  default:
19858  goto usage;
19859  }
19860  }
19861  if ( pNtk == NULL )
19862  {
19863  Abc_Print( -1, "Empty network.\n" );
19864  return 1;
19865  }
19866  if ( !Abc_NtkIsStrash(pNtk) )
19867  {
19868  Abc_Print( -1, "Only works for structrally hashed networks.\n" );
19869  return 1;
19870  }
19871 
19872  if ( argc != globalUtilOptind )
19873  {
19874  Abc_Print( -1, "Not enough command-line arguments.\n" );
19875  return 1;
19876  }
19877  // modify the current network
19878  pNtkRes = Abc_NtkDarExtWin( pNtk, nObjId, nDist, fVerbose );
19879  if ( pNtkRes == NULL )
19880  {
19881  Abc_Print( -1, "Extracting sequential window has failed.\n" );
19882  return 0;
19883  }
19884  // replace the current network
19885  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
19886  return 0;
19887 
19888 usage:
19889  Abc_Print( -2, "usage: extwin [-ND <num>] [-vh]\n" );
19890  Abc_Print( -2, "\t extracts sequential window from the AIG\n" );
19891  Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
19892  Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
19893  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
19894  Abc_Print( -2, "\t-h : print the command usage\n");
19895  return 1;
19896 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkDarExtWin(Abc_Ntk_t *pNtk, int nObjId, int nDist, int fVerbose)
Definition: abcDar.c:4132
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandFastExtract ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3753 of file abc.c.

3754 {
3755  extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int nLitCountMax, int fVerbose, int fVeryVerbose );
3756  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
3757  Fxu_Data_t Params, * p = &Params;
3758  int c, fNewAlgo = 1;
3759  // set the defaults
3762  while ( (c = Extra_UtilGetopt(argc, argv, "SDNWMsdzcnvwh")) != EOF )
3763  {
3764  switch (c)
3765  {
3766  case 'S':
3767  if ( globalUtilOptind >= argc )
3768  {
3769  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
3770  goto usage;
3771  }
3772  p->nSingleMax = atoi(argv[globalUtilOptind]);
3773  globalUtilOptind++;
3774  if ( p->nSingleMax < 0 )
3775  goto usage;
3776  break;
3777  case 'D':
3778  if ( globalUtilOptind >= argc )
3779  {
3780  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
3781  goto usage;
3782  }
3783  p->nPairsMax = atoi(argv[globalUtilOptind]);
3784  globalUtilOptind++;
3785  if ( p->nPairsMax < 0 )
3786  goto usage;
3787  break;
3788  case 'N':
3789  if ( globalUtilOptind >= argc )
3790  {
3791  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
3792  goto usage;
3793  }
3794  p->nNodesExt = atoi(argv[globalUtilOptind]);
3795  globalUtilOptind++;
3796  if ( p->nNodesExt < 0 )
3797  goto usage;
3798  break;
3799  case 'W':
3800  if ( globalUtilOptind >= argc )
3801  {
3802  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
3803  goto usage;
3804  }
3805  p->WeightMin = atoi(argv[globalUtilOptind]);
3806  globalUtilOptind++;
3807  if ( p->WeightMin < 0 )
3808  goto usage;
3809  break;
3810  case 'M':
3811  if ( globalUtilOptind >= argc )
3812  {
3813  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
3814  goto usage;
3815  }
3816  p->LitCountMax = atoi(argv[globalUtilOptind]);
3817  globalUtilOptind++;
3818  if ( p->LitCountMax < 0 )
3819  goto usage;
3820  break;
3821  case 's':
3822  p->fOnlyS ^= 1;
3823  break;
3824  case 'd':
3825  p->fOnlyD ^= 1;
3826  break;
3827  case 'z':
3828  p->fUse0 ^= 1;
3829  break;
3830  case 'c':
3831  p->fUseCompl ^= 1;
3832  break;
3833  case 'n':
3834  fNewAlgo ^= 1;
3835  break;
3836  case 'v':
3837  p->fVerbose ^= 1;
3838  break;
3839  case 'w':
3840  p->fVeryVerbose ^= 1;
3841  break;
3842  case 'h':
3843  goto usage;
3844  break;
3845  default:
3846  goto usage;
3847  }
3848  }
3849  if ( pNtk == NULL )
3850  {
3851  Abc_Print( -1, "Empty network.\n" );
3852  return 1;
3853  }
3854  if ( Abc_NtkNodeNum(pNtk) == 0 )
3855  {
3856  Abc_Print( -1, "The network does not have internal nodes.\n" );
3857  return 1;
3858  }
3859  if ( !Abc_NtkIsLogic(pNtk) )
3860  {
3861  Abc_Print( -1, "Fast extract can only be applied to a logic network (run \"renode\" or \"if\").\n" );
3862  return 1;
3863  }
3864  if ( !Abc_NtkIsSopLogic(pNtk) )
3865  {
3866  Abc_Print( -1, "Fast extract can only be applied to a logic network with SOP local functions (run \"bdd; sop\").\n" );
3867  return 1;
3868  }
3869 
3870  // the nodes to be merged are linked into the special linked list
3871  if ( fNewAlgo )
3872  Abc_NtkFxPerform( pNtk, p->nNodesExt, p->LitCountMax, p->fVerbose, p->fVeryVerbose );
3873  else
3874  Abc_NtkFastExtract( pNtk, p );
3875  Abc_NtkFxuFreeInfo( p );
3876  return 0;
3877 
3878 usage:
3879  Abc_Print( -2, "usage: fx [-SDNWM <num>] [-sdzcnvwh]\n");
3880  Abc_Print( -2, "\t performs unate fast extract on the current network\n");
3881  Abc_Print( -2, "\t-S <num> : max number of single-cube divisors to consider [default = %d]\n", p->nSingleMax );
3882  Abc_Print( -2, "\t-D <num> : max number of double-cube divisors to consider [default = %d]\n", p->nPairsMax );
3883  Abc_Print( -2, "\t-N <num> : max number of divisors to extract during this run [default = %d]\n", p->nNodesExt );
3884  Abc_Print( -2, "\t-W <num> : lower bound on the weight of divisors to extract [default = %d]\n", p->WeightMin );
3885  Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", p->LitCountMax );
3886  Abc_Print( -2, "\t-s : use only single-cube divisors [default = %s]\n", p->fOnlyS? "yes": "no" );
3887  Abc_Print( -2, "\t-d : use only double-cube divisors [default = %s]\n", p->fOnlyD? "yes": "no" );
3888  Abc_Print( -2, "\t-z : use zero-weight divisors [default = %s]\n", p->fUse0? "yes": "no" );
3889  Abc_Print( -2, "\t-c : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" );
3890  Abc_Print( -2, "\t-n : use new implementation of fast extract [default = %s]\n", fNewAlgo? "yes": "no" );
3891  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" );
3892  Abc_Print( -2, "\t-w : print additional information [default = %s]\n", p->fVeryVerbose? "yes": "no" );
3893  Abc_Print( -2, "\t-h : print the command usage\n");
3894  return 1;
3895 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Abc_NtkFxuFreeInfo(Fxu_Data_t *p)
Definition: abcFxu.c:207
typedefABC_NAMESPACE_HEADER_START struct FxuDataStruct Fxu_Data_t
INCLUDES ///.
Definition: fxu.h:42
int Abc_NtkFastExtract(Abc_Ntk_t *pNtk, Fxu_Data_t *p)
Definition: abcFxu.c:83
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
int Abc_NtkFxPerform(Abc_Ntk_t *pNtk, int nNewNodesMax, int LitCountMax, int fVerbose, int fVeryVerbose)
Definition: abcFx.c:303
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Abc_NtkSetDefaultFxParams(Fxu_Data_t *p)
FUNCTION DEFINITIONS ///.
Definition: abcFxu.c:52
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandFlowRetime ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17400 of file abc.c.

17401 {
17402  Abc_Ntk_t * pNtk, * pNtkRes;
17403  int c, nMaxIters;
17404  int fForward;
17405  int fBackward;
17406  int fVerbose;
17407  int fComputeInit, fGuaranteeInit, fBlockConst;
17408  int fFastButConservative;
17409  int maxDelay;
17410 
17411  if ( argc == 2 && !strcmp(argv[1], "-h") )
17412  {
17413  Abc_Print( -2, "The fretime command is temporarily disabled.\n" );
17414  return 1;
17415  }
17416 
17417  Abc_Print( -1, "This command is temporarily disabled.\n" );
17418  return 0;
17419 // extern Abc_Ntk_t* Abc_FlowRetime_MinReg( Abc_Ntk_t * pNtk, int fVerbose,
17420 // int fComputeInit, int fGuaranteeInit, int fBlockConst,
17421 // int fForward, int fBackward, int nMaxIters,
17422 // int maxDelay, int fFastButConservative);
17423 
17424  pNtk = Abc_FrameReadNtk(pAbc);
17425  // set defaults
17426  fForward = 0;
17427  fFastButConservative = 0;
17428  fBackward = 0;
17429  fComputeInit = 1;
17430  fGuaranteeInit = 0;
17431  fVerbose = 0;
17432  fBlockConst = 0;
17433  nMaxIters = 999;
17434  maxDelay = 0;
17436  while ( ( c = Extra_UtilGetopt( argc, argv, "MDfcgbkivh" ) ) != EOF )
17437  {
17438  switch ( c )
17439  {
17440  case 'M':
17441  if ( globalUtilOptind >= argc )
17442  {
17443  Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
17444  goto usage;
17445  }
17446  nMaxIters = atoi(argv[globalUtilOptind]);
17447  globalUtilOptind++;
17448  if ( nMaxIters < 0 )
17449  goto usage;
17450  break;
17451  case 'D':
17452  if ( globalUtilOptind >= argc )
17453  {
17454  Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
17455  goto usage;
17456  }
17457  maxDelay = atoi(argv[globalUtilOptind]);
17458  globalUtilOptind++;
17459  if ( maxDelay < 0 )
17460  goto usage;
17461  break;
17462  case 'f':
17463  fForward ^= 1;
17464  break;
17465  case 'c':
17466  fFastButConservative ^= 1;
17467  break;
17468  case 'i':
17469  fComputeInit ^= 1;
17470  break;
17471  case 'b':
17472  fBackward ^= 1;
17473  break;
17474  case 'g':
17475  fGuaranteeInit ^= 1;
17476  break;
17477  case 'k':
17478  fBlockConst ^= 1;
17479  break;
17480  case 'v':
17481  fVerbose ^= 1;
17482  break;
17483  case 'h':
17484  goto usage;
17485  default:
17486  goto usage;
17487  }
17488  }
17489 
17490  if ( pNtk == NULL )
17491  {
17492  Abc_Print( -1, "Empty network.\n" );
17493  return 1;
17494  }
17495 
17496  if ( fForward && fBackward )
17497  {
17498  Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
17499  return 1;
17500  }
17501 
17502  if ( fGuaranteeInit && !fComputeInit )
17503  {
17504  Abc_Print( -1, "Initial state guarantee (-g) requires initial state computation (-i).\n" );
17505  return 1;
17506  }
17507 
17508  if ( !Abc_NtkLatchNum(pNtk) )
17509  {
17510 // Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
17511  return 0;
17512  }
17513 
17514  if ( Abc_NtkGetChoiceNum(pNtk) )
17515  {
17516  Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
17517  return 0;
17518  }
17519 
17520  // perform the retiming
17521 // pNtkRes = Abc_FlowRetime_MinReg( pNtk, fVerbose, fComputeInit,
17522 // fGuaranteeInit, fBlockConst,
17523 // fForward, fBackward,
17524 // nMaxIters, maxDelay, fFastButConservative );
17525 
17526  if (pNtkRes != pNtk)
17527  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17528 
17529  return 0;
17530 
17531 usage:
17532  Abc_Print( -2, "usage: fretime [-M num] [-D num] [-fbvih]\n" );
17533  Abc_Print( -2, "\t retimes the current network using flow-based algorithm\n" );
17534  Abc_Print( -2, "\t-M num : the maximum number of iterations [default = %d]\n", nMaxIters );
17535  Abc_Print( -2, "\t-D num : the maximum delay [default = none]\n" );
17536  Abc_Print( -2, "\t-i : enables init state computation [default = %s]\n", fComputeInit? "yes": "no" );
17537  Abc_Print( -2, "\t-k : blocks retiming over const nodes [default = %s]\n", fBlockConst? "yes": "no" );
17538  Abc_Print( -2, "\t-g : guarantees init state computation [default = %s]\n", fGuaranteeInit? "yes": "no" );
17539  Abc_Print( -2, "\t-c : very fast (but conserv.) delay constraints [default = %s]\n", fFastButConservative? "yes": "no" );
17540  Abc_Print( -2, "\t-f : enables forward-only retiming [default = %s]\n", fForward? "yes": "no" );
17541  Abc_Print( -2, "\t-b : enables backward-only retiming [default = %s]\n", fBackward? "yes": "no" );
17542  Abc_Print( -2, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
17543  Abc_Print( -2, "\t-h : print the command usage\n");
17544  return 1;
17545 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
int strcmp()
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandFold ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23762 of file abc.c.

23763 {
23764  Abc_Ntk_t * pNtk, * pNtkRes;
23765  int fCompl;
23766  int fVerbose;
23767  int c;
23768  extern Abc_Ntk_t * Abc_NtkDarFold( Abc_Ntk_t * pNtk, int fCompl, int fVerbose );
23769  pNtk = Abc_FrameReadNtk(pAbc);
23770  // set defaults
23771  fCompl = 0;
23772  fVerbose = 0;
23774  while ( ( c = Extra_UtilGetopt( argc, argv, "cvh" ) ) != EOF )
23775  {
23776  switch ( c )
23777  {
23778  case 'c':
23779  fCompl ^= 1;
23780  break;
23781  case 'v':
23782  fVerbose ^= 1;
23783  break;
23784  case 'h':
23785  goto usage;
23786  default:
23787  goto usage;
23788  }
23789  }
23790  if ( pNtk == NULL )
23791  {
23792  Abc_Print( -1, "Empty network.\n" );
23793  return 1;
23794  }
23795  if ( !Abc_NtkIsStrash(pNtk) )
23796  {
23797  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
23798  return 0;
23799  }
23800  if ( Abc_NtkConstrNum(pNtk) == 0 )
23801  {
23802  Abc_Print( 0, "The network has no constraints.\n" );
23803  return 0;
23804  }
23805  if ( Abc_NtkIsComb(pNtk) )
23806  Abc_Print( 0, "The network is combinational.\n" );
23807  // modify the current network
23808  pNtkRes = Abc_NtkDarFold( pNtk, fCompl, fVerbose );
23809  if ( pNtkRes == NULL )
23810  {
23811  Abc_Print( 1,"Transformation has failed.\n" );
23812  return 0;
23813  }
23814  // replace the current network
23815  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
23816  return 0;
23817 usage:
23818  Abc_Print( -2, "usage: fold [-cvh]\n" );
23819  Abc_Print( -2, "\t folds constraints represented as separate outputs\n" );
23820  Abc_Print( -2, "\t-c : toggle complementing constraints while folding [default = %s]\n", fCompl? "yes": "no" );
23821  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
23822  Abc_Print( -2, "\t-h : print the command usage\n");
23823  return 1;
23824 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkDarFold(Abc_Ntk_t *pNtk, int fCompl, int fVerbose)
Definition: abcDar.c:4548
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Abc_CommandFold2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Definition at line 124 of file abciUnfold2.c.

125 {
126  Abc_Ntk_t * pNtk, * pNtkRes;
127  int fCompl;
128  int fVerbose;
129  int c;
130  extern Abc_Ntk_t * Abc_NtkDarFold2( Abc_Ntk_t * pNtk, int fCompl, int fVerbose , int);
131  pNtk = Abc_FrameReadNtk(pAbc);
132  // set defaults
133  fCompl = 0;
134  fVerbose = 0;
136  while ( ( c = Extra_UtilGetopt( argc, argv, "cvh" ) ) != EOF )
137  {
138  switch ( c )
139  {
140  /* case 'c': */
141  /* fCompl ^= 1; */
142  /* break; */
143  case 'v':
144  fVerbose ^= 1;
145  break;
146  case 'h':
147  goto usage;
148  default:
149  goto usage;
150  }
151  }
152  if ( pNtk == NULL )
153  {
154  Abc_Print( -1, "Empty network.\n" );
155  return 1;
156  }
157  if ( !Abc_NtkIsStrash(pNtk) )
158  {
159  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
160  return 0;
161  }
162  if ( Abc_NtkConstrNum(pNtk) == 0 )
163  {
164  Abc_Print( 0, "The network has no constraints.\n" );
165  return 0;
166  }
167  if ( Abc_NtkIsComb(pNtk) )
168  Abc_Print( 0, "The network is combinational.\n" );
169  // modify the current network
170  pNtkRes = Abc_NtkDarFold2( pNtk, fCompl, fVerbose ,0);
171  if ( pNtkRes == NULL )
172  {
173  Abc_Print( 1,"Transformation has failed.\n" );
174  return 0;
175  }
176  // replace the current network
177  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
178  return 0;
179 usage:
180  Abc_Print( -2, "usage: fold [-cvh]\n" );
181  Abc_Print( -2, "\t folds constraints represented as separate outputs\n" );
182  // Abc_Print( -2, "\t-c : toggle complementing constraints while folding [default = %s]\n", fCompl? "yes": "no" );
183  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
184  Abc_Print( -2, "\t-h : print the command usage\n");
185  return 1;
186 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDarFold2(Abc_Ntk_t *pNtk, int fCompl, int fVerbose, int)
Definition: abcDarUnfold2.c:51
int Abc_CommandFraig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13332 of file abc.c.

13333 {
13334  char Buffer[100];
13335  Fraig_Params_t Params, * pParams = &Params;
13336  Abc_Ntk_t * pNtk, * pNtkRes;
13337  int fAllNodes;
13338  int fExdc;
13339  int c;
13340  int fPartition = 0;
13341  extern void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams );
13342 
13343  pNtk = Abc_FrameReadNtk(pAbc);
13344  // set defaults
13345  fExdc = 0;
13346  fAllNodes = 0;
13347  memset( pParams, 0, sizeof(Fraig_Params_t) );
13348  pParams->nPatsRand = 2048; // the number of words of random simulation info
13349  pParams->nPatsDyna = 2048; // the number of words of dynamic simulation info
13350  pParams->nBTLimit = 100; // the max number of backtracks to perform
13351  pParams->fFuncRed = 1; // performs only one level hashing
13352  pParams->fFeedBack = 1; // enables solver feedback
13353  pParams->fDist1Pats = 1; // enables distance-1 patterns
13354  pParams->fDoSparse = 1; // performs equiv tests for sparse functions
13355  pParams->fChoicing = 0; // enables recording structural choices
13356  pParams->fTryProve = 0; // tries to solve the final miter
13357  pParams->fVerbose = 0; // the verbosiness flag
13358  pParams->fVerboseP = 0; // the verbosiness flag
13360  while ( ( c = Extra_UtilGetopt( argc, argv, "RDCrscptvaeh" ) ) != EOF )
13361  {
13362  switch ( c )
13363  {
13364  case 'R':
13365  if ( globalUtilOptind >= argc )
13366  {
13367  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
13368  goto usage;
13369  }
13370  pParams->nPatsRand = atoi(argv[globalUtilOptind]);
13371  globalUtilOptind++;
13372  if ( pParams->nPatsRand < 0 )
13373  goto usage;
13374  break;
13375  case 'D':
13376  if ( globalUtilOptind >= argc )
13377  {
13378  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
13379  goto usage;
13380  }
13381  pParams->nPatsDyna = atoi(argv[globalUtilOptind]);
13382  globalUtilOptind++;
13383  if ( pParams->nPatsDyna < 0 )
13384  goto usage;
13385  break;
13386  case 'C':
13387  if ( globalUtilOptind >= argc )
13388  {
13389  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
13390  goto usage;
13391  }
13392  pParams->nBTLimit = atoi(argv[globalUtilOptind]);
13393  globalUtilOptind++;
13394  if ( pParams->nBTLimit < 0 )
13395  goto usage;
13396  break;
13397 
13398  case 'r':
13399  pParams->fFuncRed ^= 1;
13400  break;
13401  case 's':
13402  pParams->fDoSparse ^= 1;
13403  break;
13404  case 'c':
13405  pParams->fChoicing ^= 1;
13406  break;
13407  case 'p':
13408  pParams->fTryProve ^= 1;
13409  break;
13410  case 'v':
13411  pParams->fVerbose ^= 1;
13412  break;
13413  case 't':
13414  fPartition ^= 1;
13415  break;
13416  case 'a':
13417  fAllNodes ^= 1;
13418  break;
13419  case 'e':
13420  fExdc ^= 1;
13421  break;
13422  case 'h':
13423  goto usage;
13424  default:
13425  goto usage;
13426  }
13427  }
13428 
13429  if ( pNtk == NULL )
13430  {
13431  Abc_Print( -1, "Empty network.\n" );
13432  return 1;
13433  }
13434  if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
13435  {
13436  Abc_Print( -1, "Can only fraig a logic network or an AIG.\n" );
13437  return 1;
13438  }
13439 
13440  // report the proof
13441  pParams->fVerboseP = pParams->fTryProve;
13442 
13443  // get the new network
13444  if ( fPartition )
13445  {
13446  pNtkRes = Abc_NtkDup( pNtk );
13447  if ( Abc_NtkIsStrash(pNtk) )
13448  Abc_NtkFraigPartitionedTime( pNtk, &Params );
13449  else
13450  {
13451  pNtk = Abc_NtkStrash( pNtk, fAllNodes, !fAllNodes, 0 );
13452  Abc_NtkFraigPartitionedTime( pNtk, &Params );
13453  Abc_NtkDelete( pNtk );
13454  }
13455  }
13456  else
13457  {
13458  if ( Abc_NtkIsStrash(pNtk) )
13459  pNtkRes = Abc_NtkFraig( pNtk, &Params, fAllNodes, fExdc );
13460  else
13461  {
13462  pNtk = Abc_NtkStrash( pNtk, fAllNodes, !fAllNodes, 0 );
13463  pNtkRes = Abc_NtkFraig( pNtk, &Params, fAllNodes, fExdc );
13464  Abc_NtkDelete( pNtk );
13465  }
13466  }
13467  if ( pNtkRes == NULL )
13468  {
13469  Abc_Print( -1, "Fraiging has failed.\n" );
13470  return 1;
13471  }
13472 
13473  if ( pParams->fTryProve ) // report the result
13474  Abc_NtkMiterReport( pNtkRes );
13475 
13476  // replace the current network
13477  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
13478  return 0;
13479 
13480 usage:
13481  sprintf(Buffer, "%d", pParams->nBTLimit );
13482  Abc_Print( -2, "usage: fraig [-R num] [-D num] [-C num] [-rscpvtah]\n" );
13483  Abc_Print( -2, "\t transforms a logic network into a functionally reduced AIG\n" );
13484  Abc_Print( -2, "\t (known bugs: takes an UNSAT miter and returns a SAT one)\n");
13485  Abc_Print( -2, "\t (there are newer fraiging commands, \"ifraig\" and \"dfraig\")\n" );
13486  Abc_Print( -2, "\t-R num : number of random patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsRand );
13487  Abc_Print( -2, "\t-D num : number of systematic patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsDyna );
13488  Abc_Print( -2, "\t-C num : number of backtracks for one SAT problem [default = %s]\n", pParams->nBTLimit==-1? "infinity" : Buffer );
13489  Abc_Print( -2, "\t-r : toggle functional reduction [default = %s]\n", pParams->fFuncRed? "yes": "no" );
13490  Abc_Print( -2, "\t-s : toggle considering sparse functions [default = %s]\n", pParams->fDoSparse? "yes": "no" );
13491  Abc_Print( -2, "\t-c : toggle accumulation of choices [default = %s]\n", pParams->fChoicing? "yes": "no" );
13492  Abc_Print( -2, "\t-p : toggle proving the miter outputs [default = %s]\n", pParams->fTryProve? "yes": "no" );
13493  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pParams->fVerbose? "yes": "no" );
13494  Abc_Print( -2, "\t-e : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
13495  Abc_Print( -2, "\t-a : toggle between all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "dfs" );
13496  Abc_Print( -2, "\t-t : toggle using partitioned representation [default = %s]\n", fPartition? "yes": "no" );
13497  Abc_Print( -2, "\t-h : print the command usage\n");
13498  return 1;
13499 }
char * memset()
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkMiterReport(Abc_Ntk_t *pMiter)
Definition: abcMiter.c:724
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL Abc_Ntk_t * Abc_NtkFraig(Abc_Ntk_t *pNtk, void *pParams, int fAllNodes, int fExdc)
FUNCTION DEFINITIONS ///.
Definition: abcFraig.c:58
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkFraigPartitionedTime(Abc_Ntk_t *pNtk, void *pParams)
Definition: abcPart.c:1160
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandFraigClean ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13688 of file abc.c.

13689 {
13690 // Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
13691  int c;
13692  int fDuplicate;
13693  // set defaults
13694  fDuplicate = 0;
13696  while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
13697  {
13698  switch ( c )
13699  {
13700  case 'd':
13701  fDuplicate ^= 1;
13702  break;
13703  case 'h':
13704  goto usage;
13705  default:
13706  goto usage;
13707  }
13708  }
13710  return 0;
13711 
13712 usage:
13713  Abc_Print( -2, "usage: fraig_clean [-h]\n" );
13714  Abc_Print( -2, "\t cleans the internal FRAIG storage\n" );
13715 // Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
13716  Abc_Print( -2, "\t-h : print the command usage\n");
13717  return 1;
13718 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL void Abc_NtkFraigStoreClean()
Definition: abcFraig.c:762
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandFraigDress ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13813 of file abc.c.

13814 {
13815  extern void Abc_NtkDress( Abc_Ntk_t * pNtk, char * pFileName, int fVerbose );
13816  extern void Abc_NtkDress2( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConflictLimit, int fVerbose );
13817  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtk2;
13818  char * pFileName;
13819  int c;
13820  int nConfs;
13821  int fVerbose;
13822  // set defaults
13823  nConfs = 1000;
13824  fVerbose = 0;
13826  while ( ( c = Extra_UtilGetopt( argc, argv, "Cvh" ) ) != EOF )
13827  {
13828  switch ( c )
13829  {
13830  case 'C':
13831  if ( globalUtilOptind >= argc )
13832  {
13833  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
13834  goto usage;
13835  }
13836  nConfs = atoi(argv[globalUtilOptind]);
13837  globalUtilOptind++;
13838  if ( nConfs < 0 )
13839  goto usage;
13840  break;
13841  case 'v':
13842  fVerbose ^= 1;
13843  break;
13844  case 'h':
13845  goto usage;
13846  default:
13847  goto usage;
13848  }
13849  }
13850  if ( pNtk == NULL )
13851  {
13852  Abc_Print( -1, "Empty network.\n" );
13853  return 1;
13854  }
13855  if ( Abc_NtkIsStrash(pNtk) )
13856  {
13857  Abc_Print( -1, "This command works only for logic networks.\n" );
13858  return 1;
13859  }
13860  if ( argc != globalUtilOptind && argc != globalUtilOptind + 1 )
13861  goto usage;
13862  if ( argc == globalUtilOptind && Abc_NtkSpec(pNtk) == NULL )
13863  {
13864  Abc_Print( -1, "The current network has no spec.\n" );
13865  return 1;
13866  }
13867  // get the input file name
13868  pFileName = (argc == globalUtilOptind + 1) ? argv[globalUtilOptind] : Abc_NtkSpec(pNtk);
13869  // modify the current network
13870 // Abc_NtkDress( pNtk, pFileName, fVerbose );
13871  pNtk2 = Io_Read( pFileName, Io_ReadFileType(pFileName), 1, 0 );
13872  Abc_NtkDress2( pNtk, pNtk2, nConfs, fVerbose );
13873  Abc_NtkDelete( pNtk2 );
13874  return 0;
13875 
13876 usage:
13877  Abc_Print( -2, "usage: dress [-C num] [-vh] <file>\n" );
13878  Abc_Print( -2, "\t transfers internal node names from file to the current network\n" );
13879  Abc_Print( -2, "\t<file> : network with names (if not given, the current network spec is used)\n" );
13880  Abc_Print( -2, "\t-C num : the maximum number of conflicts at each node [default = %d]\n", nConfs );
13881  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
13882  Abc_Print( -2, "\t-h : print the command usage\n");
13883  return 1;
13884 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Abc_NtkDress(Abc_Ntk_t *pNtkLogic, char *pFileName, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcDress.c:51
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkDress2(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nConflictLimit, int fVerbose)
Definition: abcDress2.c:419
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static char * Abc_NtkSpec(Abc_Ntk_t *pNtk)
Definition: abc.h:271
int Abc_CommandFraigRestore ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13628 of file abc.c.

13629 {
13630  Abc_Ntk_t * pNtk, * pNtkRes;
13631  int c;
13632  int fDuplicate;
13633 
13634  pNtk = Abc_FrameReadNtk(pAbc);
13635  // set defaults
13636  fDuplicate = 0;
13638  while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
13639  {
13640  switch ( c )
13641  {
13642  case 'd':
13643  fDuplicate ^= 1;
13644  break;
13645  case 'h':
13646  goto usage;
13647  default:
13648  goto usage;
13649  }
13650  }
13651 
13652  if ( pNtk == NULL )
13653  {
13654  Abc_Print( -1, "Empty network.\n" );
13655  return 1;
13656  }
13657 
13658  // get the new network
13659  pNtkRes = Abc_NtkFraigRestore();
13660  if ( pNtkRes == NULL )
13661  {
13662  Abc_Print( -1, "Fraig restoring has failed.\n" );
13663  return 1;
13664  }
13665  // replace the current network
13666  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
13667  return 0;
13668 
13669 usage:
13670  Abc_Print( -2, "usage: fraig_restore [-h]\n" );
13671  Abc_Print( -2, "\t makes the current network by fraiging the AIG database\n" );
13672 // Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
13673  Abc_Print( -2, "\t-h : print the command usage\n");
13674  return 1;
13675 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL Abc_Ntk_t * Abc_NtkFraigRestore()
Definition: abcFraig.c:694
int Abc_CommandFraigStore ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13572 of file abc.c.

13573 {
13574  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
13575  int c;
13576  int fDuplicate;
13577 
13578  // set defaults
13579  fDuplicate = 0;
13581  while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
13582  {
13583  switch ( c )
13584  {
13585  case 'd':
13586  fDuplicate ^= 1;
13587  break;
13588  case 'h':
13589  goto usage;
13590  default:
13591  goto usage;
13592  }
13593  }
13594 
13595  if ( pNtk == NULL )
13596  {
13597  Abc_Print( -1, "Empty network.\n" );
13598  return 1;
13599  }
13600 
13601  // get the new network
13602  if ( !Abc_NtkFraigStore( pNtk ) )
13603  {
13604  Abc_Print( -1, "Fraig storing has failed.\n" );
13605  return 1;
13606  }
13607  return 0;
13608 
13609 usage:
13610  Abc_Print( -2, "usage: fraig_store [-h]\n" );
13611  Abc_Print( -2, "\t saves the current network in the AIG database\n" );
13612 // Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
13613  Abc_Print( -2, "\t-h : print the command usage\n");
13614  return 1;
13615 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int Abc_NtkFraigStore(Abc_Ntk_t *pNtk)
Definition: abcFraig.c:654
int Abc_CommandFraigSweep ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13731 of file abc.c.

13732 {
13733  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
13734  int c;
13735  int fUseInv;
13736  int fExdc;
13737  int fVerbose;
13738  int fVeryVerbose;
13739  extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
13740  // set defaults
13741  fUseInv = 1;
13742  fExdc = 0;
13743  fVerbose = 0;
13744  fVeryVerbose = 0;
13746  while ( ( c = Extra_UtilGetopt( argc, argv, "ievwh" ) ) != EOF )
13747  {
13748  switch ( c )
13749  {
13750  case 'i':
13751  fUseInv ^= 1;
13752  break;
13753  case 'e':
13754  fExdc ^= 1;
13755  break;
13756  case 'v':
13757  fVerbose ^= 1;
13758  break;
13759  case 'w':
13760  fVeryVerbose ^= 1;
13761  break;
13762  case 'h':
13763  goto usage;
13764  default:
13765  goto usage;
13766  }
13767  }
13768 
13769  if ( pNtk == NULL )
13770  {
13771  Abc_Print( -1, "Empty network.\n" );
13772  return 1;
13773  }
13774  if ( Abc_NtkIsStrash(pNtk) )
13775  {
13776  Abc_Print( -1, "Cannot sweep AIGs (use \"fraig\").\n" );
13777  return 1;
13778  }
13779  if ( !Abc_NtkIsLogic(pNtk) )
13780  {
13781  Abc_Print( -1, "Transform the current network into a logic network.\n" );
13782  return 1;
13783  }
13784  // modify the current network
13785  if ( !Abc_NtkFraigSweep( pNtk, fUseInv, fExdc, fVerbose, fVeryVerbose ) )
13786  {
13787  Abc_Print( -1, "Sweeping has failed.\n" );
13788  return 1;
13789  }
13790  return 0;
13791 
13792 usage:
13793  Abc_Print( -2, "usage: fraig_sweep [-evwh]\n" );
13794  Abc_Print( -2, "\t performs technology-dependent sweep\n" );
13795  Abc_Print( -2, "\t-e : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
13796  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
13797  Abc_Print( -2, "\t-w : prints equivalence class information [default = %s]\n", fVeryVerbose? "yes": "no" );
13798  Abc_Print( -2, "\t-h : print the command usage\n");
13799  return 1;
13800 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Abc_NtkFraigSweep(Abc_Ntk_t *pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcSweep.c:60
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandFraigTrust ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13512 of file abc.c.

13513 {
13514  Abc_Ntk_t * pNtk, * pNtkRes;
13515  int c;
13516  int fDuplicate;
13517 
13518  pNtk = Abc_FrameReadNtk(pAbc);
13519  // set defaults
13520  fDuplicate = 0;
13522  while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
13523  {
13524  switch ( c )
13525  {
13526  case 'd':
13527  fDuplicate ^= 1;
13528  break;
13529  case 'h':
13530  goto usage;
13531  default:
13532  goto usage;
13533  }
13534  }
13535 
13536  if ( pNtk == NULL )
13537  {
13538  Abc_Print( -1, "Empty network.\n" );
13539  return 1;
13540  }
13541 
13542  // get the new network
13543  pNtkRes = Abc_NtkFraigTrust( pNtk );
13544  if ( pNtkRes == NULL )
13545  {
13546  Abc_Print( -1, "Fraiging in the trust mode has failed.\n" );
13547  return 1;
13548  }
13549  // replace the current network
13550  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
13551  return 0;
13552 
13553 usage:
13554  Abc_Print( -2, "usage: fraig_trust [-h]\n" );
13555  Abc_Print( -2, "\t transforms the current network into an AIG assuming it is FRAIG with choices\n" );
13556 // Abc_Print( -2, "\t-d : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
13557  Abc_Print( -2, "\t-h : print the command usage\n");
13558  return 1;
13559 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Ntk_t * Abc_NtkFraigTrust(Abc_Ntk_t *pNtk)
Definition: abcFraig.c:485
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandFrames ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7674 of file abc.c.

7675 {
7676  Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
7677  int nFrames;
7678  int fInitial;
7679  int fVerbose;
7680  int c;
7681  pNtk = Abc_FrameReadNtk(pAbc);
7682 
7683  // set defaults
7684  nFrames = 5;
7685  fInitial = 0;
7686  fVerbose = 0;
7688  while ( ( c = Extra_UtilGetopt( argc, argv, "Fivh" ) ) != EOF )
7689  {
7690  switch ( c )
7691  {
7692  case 'F':
7693  if ( globalUtilOptind >= argc )
7694  {
7695  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
7696  goto usage;
7697  }
7698  nFrames = atoi(argv[globalUtilOptind]);
7699  globalUtilOptind++;
7700  if ( nFrames <= 0 )
7701  goto usage;
7702  break;
7703  case 'i':
7704  fInitial ^= 1;
7705  break;
7706  case 'v':
7707  fVerbose ^= 1;
7708  break;
7709  case 'h':
7710  goto usage;
7711  default:
7712  goto usage;
7713  }
7714  }
7715 
7716  if ( pNtk == NULL )
7717  {
7718  Abc_Print( -1, "Empty network.\n" );
7719  return 1;
7720  }
7721 
7722  // get the new network
7723  if ( !Abc_NtkIsStrash(pNtk) )
7724  {
7725  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
7726  pNtkRes = Abc_NtkFrames( pNtkTemp, nFrames, fInitial, fVerbose );
7727  Abc_NtkDelete( pNtkTemp );
7728  }
7729  else
7730  pNtkRes = Abc_NtkFrames( pNtk, nFrames, fInitial, fVerbose );
7731  if ( pNtkRes == NULL )
7732  {
7733  Abc_Print( -1, "Unrolling the network has failed.\n" );
7734  return 1;
7735  }
7736  // replace the current network
7737  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7738  return 0;
7739 
7740 usage:
7741  Abc_Print( -2, "usage: frames [-F <num>] [-ivh]\n" );
7742  Abc_Print( -2, "\t unrolls the network for a number of time frames\n" );
7743  Abc_Print( -2, "\t-F <num> : the number of frames to unroll [default = %d]\n", nFrames );
7744  Abc_Print( -2, "\t-i : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
7745  Abc_Print( -2, "\t-v : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
7746  Abc_Print( -2, "\t-h : print the command usage\n");
7747  return 1;
7748 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkFrames(Abc_Ntk_t *pNtk, int nFrames, int fInitial, int fVerbose)
Definition: abcMiter.c:772
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandGen ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9843 of file abc.c.

9844 {
9845 // Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
9846  int c;
9847  int nVars; // the number of variables
9848  int nLutSize = -1; // the size of LUTs
9849  int nLuts = -1; // the number of LUTs
9850  int fAdder;
9851  int fSorter;
9852  int fMesh;
9853  int fMulti;
9854  int fFpga;
9855  int fOneHot;
9856  int fRandom;
9857  int fVerbose;
9858  char * FileName;
9859  char Command[1000];
9860  extern void Abc_GenAdder( char * pFileName, int nVars );
9861  extern void Abc_GenSorter( char * pFileName, int nVars );
9862  extern void Abc_GenMesh( char * pFileName, int nVars );
9863  extern void Abc_GenMulti( char * pFileName, int nVars );
9864  extern void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars );
9865  extern void Abc_GenOneHot( char * pFileName, int nVars );
9866  extern void Abc_GenRandom( char * pFileName, int nPis );
9867 
9868  // set defaults
9869  nVars = 8;
9870  fAdder = 0;
9871  fSorter = 0;
9872  fMesh = 0;
9873  fMulti = 0;
9874  fFpga = 0;
9875  fOneHot = 0;
9876  fRandom = 0;
9877  fVerbose = 0;
9879  while ( ( c = Extra_UtilGetopt( argc, argv, "NKLasemftrvh" ) ) != EOF )
9880  {
9881  switch ( c )
9882  {
9883  case 'N':
9884  if ( globalUtilOptind >= argc )
9885  {
9886  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
9887  goto usage;
9888  }
9889  nVars = atoi(argv[globalUtilOptind]);
9890  globalUtilOptind++;
9891  if ( nVars < 0 )
9892  goto usage;
9893  break;
9894  case 'K':
9895  if ( globalUtilOptind >= argc )
9896  {
9897  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
9898  goto usage;
9899  }
9900  nLutSize = atoi(argv[globalUtilOptind]);
9901  globalUtilOptind++;
9902  if ( nLutSize < 0 )
9903  goto usage;
9904  break;
9905  case 'L':
9906  if ( globalUtilOptind >= argc )
9907  {
9908  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
9909  goto usage;
9910  }
9911  nLuts = atoi(argv[globalUtilOptind]);
9912  globalUtilOptind++;
9913  if ( nLuts < 0 )
9914  goto usage;
9915  break;
9916  case 'a':
9917  fAdder ^= 1;
9918  break;
9919  case 's':
9920  fSorter ^= 1;
9921  break;
9922  case 'e':
9923  fMesh ^= 1;
9924  break;
9925  case 'm':
9926  fMulti ^= 1;
9927  break;
9928  case 'f':
9929  fFpga ^= 1;
9930  break;
9931  case 't':
9932  fOneHot ^= 1;
9933  break;
9934  case 'r':
9935  fRandom ^= 1;
9936  break;
9937  case 'v':
9938  fVerbose ^= 1;
9939  break;
9940  case 'h':
9941  goto usage;
9942  default:
9943  goto usage;
9944  }
9945  }
9946 
9947  if ( argc != globalUtilOptind + 1 )
9948  {
9949  goto usage;
9950  }
9951  if ( nVars < 1 )
9952  {
9953  Abc_Print( -1, "The number of variables should be a positive integer.\n" );
9954  return 0;
9955  }
9956  // get the input file name
9957  FileName = argv[globalUtilOptind];
9958  if ( fAdder )
9959  Abc_GenAdder( FileName, nVars );
9960  else if ( fSorter )
9961  Abc_GenSorter( FileName, nVars );
9962  else if ( fMesh )
9963  Abc_GenMesh( FileName, nVars );
9964  else if ( fMulti )
9965  Abc_GenMulti( FileName, nVars );
9966  else if ( fFpga )
9967  Abc_GenFpga( FileName, nLutSize, nLuts, nVars );
9968 // Abc_GenFpga( FileName, 2, 2, 3 );
9969 // Abc_GenFpga( FileName, 3, 2, 5 );
9970  else if ( fOneHot )
9971  Abc_GenOneHot( FileName, nVars );
9972  else if ( fRandom )
9973  Abc_GenRandom( FileName, nVars );
9974  else
9975  {
9976  Abc_Print( -1, "Type of circuit is not specified.\n" );
9977  return 0;
9978  }
9979  // read the file just produced
9980  sprintf(Command, "read %s", FileName );
9981  Cmd_CommandExecute( pAbc, Command );
9982  return 0;
9983 
9984 usage:
9985  Abc_Print( -2, "usage: gen [-NKL num] [-asemftrvh] <file>\n" );
9986  Abc_Print( -2, "\t generates simple circuits\n" );
9987  Abc_Print( -2, "\t-N num : the number of variables [default = %d]\n", nVars );
9988  Abc_Print( -2, "\t-K num : the LUT size (to be used with switch -f) [default = %d]\n", nLutSize );
9989  Abc_Print( -2, "\t-L num : the LUT count (to be used with switch -f) [default = %d]\n", nLuts );
9990  Abc_Print( -2, "\t-a : generate ripple-carry adder [default = %s]\n", fAdder? "yes": "no" );
9991  Abc_Print( -2, "\t-s : generate a sorter [default = %s]\n", fSorter? "yes": "no" );
9992  Abc_Print( -2, "\t-e : generate a mesh [default = %s]\n", fMesh? "yes": "no" );
9993  Abc_Print( -2, "\t-m : generate a multiplier [default = %s]\n", fMulti? "yes": "no" );
9994  Abc_Print( -2, "\t-f : generate a LUT FPGA structure [default = %s]\n", fFpga? "yes": "no" );
9995  Abc_Print( -2, "\t-t : generate one-hotness conditions [default = %s]\n", fOneHot? "yes": "no" );
9996  Abc_Print( -2, "\t-r : generate random single-output function [default = %s]\n", fRandom? "yes": "no" );
9997  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
9998  Abc_Print( -2, "\t-h : print the command usage\n");
9999  Abc_Print( -2, "\t<file> : output file name\n");
10000  return 1;
10001 }
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
void Abc_GenAdder(char *pFileName, int nVars)
Definition: abcGen.c:95
void Abc_GenSorter(char *pFileName, int nVars)
Definition: abcGen.c:235
void Abc_GenFpga(char *pFileName, int nLutSize, int nLuts, int nVars)
Definition: abcGen.c:459
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Abc_GenMulti(char *pFileName, int nVars)
Definition: abcGen.c:159
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Abc_GenMesh(char *pFileName, int nVars)
Definition: abcGen.c:340
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_NAMESPACE_IMPL_END ABC_NAMESPACE_IMPL_START void Abc_GenRandom(char *pFileName, int nPis)
Definition: abcGen.c:679
void Abc_GenOneHot(char *pFileName, int nVars)
Definition: abcGen.c:577
int Abc_CommandGenFsm ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10014 of file abc.c.

10015 {
10016  extern void Abc_GenFsm( char * pFileName, int nIns, int nOuts, int nStates, int nLines, int ProbI, int ProbO );
10017  int c, nIns, nOuts, nStates, nLines, ProbI, ProbO, fVerbose;
10018  char * FileName;
10019  // set defaults
10020  nIns = 30;
10021  nOuts = 1;
10022  nStates = 20;
10023  nLines = 100;
10024  ProbI = 10;
10025  ProbO = 100;
10026  fVerbose = 0;
10028  while ( ( c = Extra_UtilGetopt( argc, argv, "IOSLPQvh" ) ) != EOF )
10029  {
10030  switch ( c )
10031  {
10032  case 'I':
10033  if ( globalUtilOptind >= argc )
10034  {
10035  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
10036  goto usage;
10037  }
10038  nIns = atoi(argv[globalUtilOptind]);
10039  globalUtilOptind++;
10040  if ( nIns < 0 )
10041  goto usage;
10042  break;
10043  case 'O':
10044  if ( globalUtilOptind >= argc )
10045  {
10046  Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
10047  goto usage;
10048  }
10049  nOuts = atoi(argv[globalUtilOptind]);
10050  globalUtilOptind++;
10051  if ( nOuts < 0 )
10052  goto usage;
10053  break;
10054  case 'S':
10055  if ( globalUtilOptind >= argc )
10056  {
10057  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
10058  goto usage;
10059  }
10060  nStates = atoi(argv[globalUtilOptind]);
10061  globalUtilOptind++;
10062  if ( nStates < 0 )
10063  goto usage;
10064  break;
10065  case 'L':
10066  if ( globalUtilOptind >= argc )
10067  {
10068  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
10069  goto usage;
10070  }
10071  nLines = atoi(argv[globalUtilOptind]);
10072  globalUtilOptind++;
10073  if ( nLines < 0 )
10074  goto usage;
10075  break;
10076  case 'P':
10077  if ( globalUtilOptind >= argc )
10078  {
10079  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
10080  goto usage;
10081  }
10082  ProbI = atoi(argv[globalUtilOptind]);
10083  globalUtilOptind++;
10084  if ( ProbI < 0 )
10085  goto usage;
10086  break;
10087  case 'Q':
10088  if ( globalUtilOptind >= argc )
10089  {
10090  Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
10091  goto usage;
10092  }
10093  ProbO = atoi(argv[globalUtilOptind]);
10094  globalUtilOptind++;
10095  if ( ProbO < 0 )
10096  goto usage;
10097  break;
10098  case 'v':
10099  fVerbose ^= 1;
10100  break;
10101  case 'h':
10102  goto usage;
10103  default:
10104  goto usage;
10105  }
10106  }
10107 
10108  if ( argc != globalUtilOptind + 1 )
10109  {
10110  goto usage;
10111  }
10112  if ( nIns < 1 || nStates < 1 || nLines < 1 || ProbI < 1 || ProbO < 1 )
10113  {
10114  Abc_Print( -1, "The number of inputs. states, lines, and probablity should be positive integers.\n" );
10115  goto usage;
10116  }
10117  // get the input file name
10118  FileName = argv[globalUtilOptind];
10119  Abc_GenFsm( FileName, nIns, nOuts, nStates, nLines, ProbI, ProbO );
10120  return 0;
10121 
10122 usage:
10123  Abc_Print( -2, "usage: genfsm [-IOSLPQ num] [-vh] <file>\n" );
10124  Abc_Print( -2, "\t generates random FSM in KISS format\n" );
10125  Abc_Print( -2, "\t-I num : the number of input variables [default = %d]\n", nIns );
10126  Abc_Print( -2, "\t-O num : the number of output variables [default = %d]\n", nOuts );
10127  Abc_Print( -2, "\t-S num : the number of state variables [default = %d]\n", nStates );
10128  Abc_Print( -2, "\t-L num : the number of lines (product terms) [default = %d]\n", nLines );
10129  Abc_Print( -2, "\t-P num : percentage propability of a variable present in the input cube [default = %d]\n", ProbI );
10130  Abc_Print( -2, "\t-Q num : percentage propability of a variable present in the output cube [default = %d]\n", ProbO );
10131  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
10132  Abc_Print( -2, "\t-h : print the command usage\n");
10133  Abc_Print( -2, "\t<file> : output file name\n");
10134  return 1;
10135 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Abc_GenFsm(char *pFileName, int nPis, int nPos, int nStates, int nLines, int ProbI, int ProbO)
Definition: abcGen.c:744
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandICut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11308 of file abc.c.

11309 {
11310  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
11311  int c, nInputs;
11312  extern void Abc_NtkIvyCuts( Abc_Ntk_t * pNtk, int nInputs );
11313 
11314  // set defaults
11315  nInputs = 5;
11317  while ( ( c = Extra_UtilGetopt( argc, argv, "Kh" ) ) != EOF )
11318  {
11319  switch ( c )
11320  {
11321  case 'K':
11322  if ( globalUtilOptind >= argc )
11323  {
11324  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
11325  goto usage;
11326  }
11327  nInputs = atoi(argv[globalUtilOptind]);
11328  globalUtilOptind++;
11329  if ( nInputs < 0 )
11330  goto usage;
11331  break;
11332  case 'h':
11333  goto usage;
11334  default:
11335  goto usage;
11336  }
11337  }
11338  if ( pNtk == NULL )
11339  {
11340  Abc_Print( -1, "Empty network.\n" );
11341  return 1;
11342  }
11343  if ( !Abc_NtkIsStrash(pNtk) )
11344  {
11345  Abc_Print( -1, "This command works only for strashed networks.\n" );
11346  return 1;
11347  }
11348 
11349  Abc_NtkIvyCuts( pNtk, nInputs );
11350  return 0;
11351 
11352 usage:
11353  Abc_Print( -2, "usage: icut [-K num] [-h]\n" );
11354  Abc_Print( -2, "\t computes sequential cuts of the given size\n" );
11355  Abc_Print( -2, "\t-K num : the number of cut inputs (2 <= num <= 6) [default = %d]\n", nInputs );
11356  Abc_Print( -2, "\t-h : print the command usage\n");
11357  return 1;
11358 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_NtkIvyCuts(Abc_Ntk_t *pNtk, int nInputs)
Definition: abcIvy.c:264
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandIf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso [] Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 15283 of file abc.c.

15284 {
15285  extern Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
15286  char Buffer[100], LutSize[100];
15287  Abc_Ntk_t * pNtk, * pNtkRes;
15288  If_Par_t Pars, * pPars = &Pars;
15289  int c;
15290  pNtk = Abc_FrameReadNtk(pAbc);
15291  If_ManSetDefaultPars( pPars );
15292  pPars->pLutLib = (If_LibLut_t *)Abc_FrameReadLibLut();
15294  while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRNTDEWSqaflepmrsdbgxyojiktncvh" ) ) != EOF )
15295  {
15296  switch ( c )
15297  {
15298  case 'K':
15299  if ( globalUtilOptind >= argc )
15300  {
15301  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
15302  goto usage;
15303  }
15304  pPars->nLutSize = atoi(argv[globalUtilOptind]);
15305  globalUtilOptind++;
15306  if ( pPars->nLutSize < 0 )
15307  goto usage;
15308  // if the LUT size is specified, disable library
15309  pPars->pLutLib = NULL;
15310  break;
15311  case 'C':
15312  if ( globalUtilOptind >= argc )
15313  {
15314  Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
15315  goto usage;
15316  }
15317  pPars->nCutsMax = atoi(argv[globalUtilOptind]);
15318  globalUtilOptind++;
15319  if ( pPars->nCutsMax < 0 )
15320  goto usage;
15321  break;
15322  case 'F':
15323  if ( globalUtilOptind >= argc )
15324  {
15325  Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
15326  goto usage;
15327  }
15328  pPars->nFlowIters = atoi(argv[globalUtilOptind]);
15329  globalUtilOptind++;
15330  if ( pPars->nFlowIters < 0 )
15331  goto usage;
15332  break;
15333  case 'A':
15334  if ( globalUtilOptind >= argc )
15335  {
15336  Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
15337  goto usage;
15338  }
15339  pPars->nAreaIters = atoi(argv[globalUtilOptind]);
15340  globalUtilOptind++;
15341  if ( pPars->nAreaIters < 0 )
15342  goto usage;
15343  break;
15344  case 'G':
15345  if ( globalUtilOptind >= argc )
15346  {
15347  Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer no less than 3.\n" );
15348  goto usage;
15349  }
15350  pPars->nGateSize = atoi(argv[globalUtilOptind]);
15351  globalUtilOptind++;
15352  if ( pPars->nGateSize < 2 )
15353  goto usage;
15354  break;
15355  case 'R':
15356  if ( globalUtilOptind >= argc )
15357  {
15358  Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
15359  return 0;
15360  }
15361  pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
15362  globalUtilOptind++;
15363  if ( pPars->nRelaxRatio < 0 )
15364  goto usage;
15365  break;
15366  case 'N':
15367  if ( globalUtilOptind >= argc )
15368  {
15369  Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer no less than 3.\n" );
15370  goto usage;
15371  }
15372  pPars->nNonDecLimit = atoi(argv[globalUtilOptind]);
15373  globalUtilOptind++;
15374  if ( pPars->nNonDecLimit < 2 )
15375  goto usage;
15376  break;
15377  case 'T':
15378  if ( globalUtilOptind >= argc )
15379  {
15380  Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer 0,1,or 2.\n" );
15381  goto usage;
15382  }
15383  pPars->nStructType = atoi(argv[globalUtilOptind]);
15384  globalUtilOptind++;
15385  if ( pPars->nStructType < 0 || pPars->nStructType > 2 )
15386  goto usage;
15387  break;
15388  case 'D':
15389  if ( globalUtilOptind >= argc )
15390  {
15391  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
15392  goto usage;
15393  }
15394  pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
15395  globalUtilOptind++;
15396  if ( pPars->DelayTarget <= 0.0 )
15397  goto usage;
15398  break;
15399  case 'E':
15400  if ( globalUtilOptind >= argc )
15401  {
15402  Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
15403  goto usage;
15404  }
15405  pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
15406  globalUtilOptind++;
15407  if ( pPars->Epsilon < 0.0 || pPars->Epsilon > 1.0 )
15408  goto usage;
15409  break;
15410  case 'W':
15411  if ( globalUtilOptind >= argc )
15412  {
15413  Abc_Print( -1, "Command line switch \"-W\" should be followed by a floating point number.\n" );
15414  goto usage;
15415  }
15416  pPars->WireDelay = (float)atof(argv[globalUtilOptind]);
15417  globalUtilOptind++;
15418  if ( pPars->WireDelay < 0.0 )
15419  goto usage;
15420  break;
15421  case 'S':
15422  if ( globalUtilOptind >= argc )
15423  {
15424  Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
15425  goto usage;
15426  }
15427  pPars->pLutStruct = argv[globalUtilOptind];
15428  globalUtilOptind++;
15429  if ( strlen(pPars->pLutStruct) != 2 && strlen(pPars->pLutStruct) != 3 )
15430  {
15431  Abc_Print( -1, "Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
15432  goto usage;
15433  }
15434  break;
15435  case 'q':
15436  pPars->fPreprocess ^= 1;
15437  break;
15438  case 'a':
15439  pPars->fArea ^= 1;
15440  break;
15441  case 'r':
15442  pPars->fExpRed ^= 1;
15443  break;
15444  case 'f':
15445  pPars->fFancy ^= 1;
15446  break;
15447  case 'l':
15448  pPars->fLatchPaths ^= 1;
15449  break;
15450  case 'e':
15451  pPars->fEdge ^= 1;
15452  break;
15453  case 'p':
15454  pPars->fPower ^= 1;
15455  break;
15456  case 'm':
15457  pPars->fCutMin ^= 1;
15458  break;
15459  case 's':
15460  pPars->fDelayOptLut ^= 1;
15461  break;
15462  case 'd':
15463  pPars->fBidec ^= 1;
15464  break;
15465  case 'b':
15466  pPars->fUseBat ^= 1;
15467  break;
15468  case 'g':
15469  pPars->fDelayOpt ^= 1;
15470  break;
15471  case 'x':
15472  pPars->fDsdBalance ^= 1;
15473  break;
15474  case 'y':
15475  pPars->fUserRecLib ^= 1;
15476  break;
15477  case 'o':
15478  pPars->fUseBuffs ^= 1;
15479  break;
15480  case 'j':
15481  pPars->fEnableCheck07 ^= 1;
15482  break;
15483  case 'i':
15484  pPars->fUseCofVars ^= 1;
15485  break;
15486  case 'k':
15487  pPars->fUseDsdTune ^= 1;
15488  break;
15489  case 't':
15490  pPars->fDoAverage ^= 1;
15491  break;
15492  case 'n':
15493  pPars->fUseDsd ^= 1;
15494  break;
15495  case 'c':
15496  pPars->fUseTtPerm ^= 1;
15497  break;
15498  case 'v':
15499  pPars->fVerbose ^= 1;
15500  break;
15501  case 'h':
15502  default:
15503  goto usage;
15504  }
15505  }
15506  if ( pNtk == NULL )
15507  {
15508  Abc_Print( -1, "Empty network.\n" );
15509  return 1;
15510  }
15511  if ( pPars->nLutSize == -1 )
15512  {
15513  if ( pPars->pLutLib == NULL )
15514  {
15515  Abc_Print( -1, "The LUT library is not given.\n" );
15516  return 1;
15517  }
15518  pPars->nLutSize = pPars->pLutLib->LutMax;
15519  }
15520 
15521  if ( pPars->nLutSize < 2 || pPars->nLutSize > IF_MAX_LUTSIZE )
15522  {
15523  Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
15524  return 1;
15525  }
15526 
15527  if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
15528  {
15529  Abc_Print( -1, "Incorrect number of cuts.\n" );
15530  return 1;
15531  }
15532 
15533  // enable truth table computation if choices are selected
15534  if ( (c = Abc_NtkGetChoiceNum( pNtk )) )
15535  {
15536 // if ( !Abc_FrameReadFlag("silentmode") )
15537 // Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c );
15538  pPars->fExpRed = 0;
15539  }
15540 
15541  if ( pPars->fUseBat )
15542  {
15543  if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
15544  {
15545  Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
15546  return 1;
15547  }
15548  pPars->fCutMin = 1;
15549  }
15550 
15551  if ( pPars->fEnableCheck07 + pPars->fUseCofVars + pPars->fUseDsdTune + (pPars->pLutStruct != NULL) > 1 )
15552  {
15553  Abc_Print( -1, "Only one additional check can be performed at the same time.\n" );
15554  return 1;
15555  }
15556  if ( pPars->fEnableCheck07 )
15557  {
15558  if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
15559  {
15560  Abc_Print( -1, "This feature only works for {6,7}-LUTs.\n" );
15561  return 1;
15562  }
15564  pPars->fCutMin = 1;
15565  }
15566  if ( pPars->fUseCofVars )
15567  {
15568  if ( !(pPars->nLutSize & 1) )
15569  {
15570  Abc_Print( -1, "This feature only works for odd-sized LUTs.\n" );
15571  return 1;
15572  }
15573  pPars->fCutMin = 1;
15574  }
15575  if ( pPars->fUseDsdTune )
15576  {
15577  If_DsdMan_t * pDsdMan = (If_DsdMan_t *)Abc_FrameReadManDsd();
15578  if ( pDsdMan == NULL )
15579  {
15580  Abc_Print( -1, "DSD manager is not available.\n" );
15581  return 1;
15582  }
15583  if ( pPars->nLutSize > If_DsdManVarNum(pDsdMan) )
15584  {
15585  Abc_Print( -1, "LUT size (%d) is more than the number of variables in the DSD manager (%d).\n", pPars->nLutSize, If_DsdManVarNum(pDsdMan) );
15586  return 1;
15587  }
15588  if ( pPars->fDeriveLuts && If_DsdManGetCellStr(pDsdMan) == NULL )
15589  {
15590  Abc_Print( -1, "DSD manager is not matched with any particular cell.\n" );
15591  return 1;
15592  }
15593  pPars->fCutMin = 1;
15594  pPars->fUseDsd = 1;
15595  If_DsdManSetNewAsUseless( pDsdMan );
15596  }
15597  if ( pPars->pLutStruct )
15598  {
15599  if ( pPars->fDsdBalance )
15600  {
15601  Abc_Print( -1, "Incompatible options (-S and -x).\n" );
15602  return 1;
15603  }
15604  if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
15605  {
15606  Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
15607  return 1;
15608  }
15609  pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
15610  pPars->fCutMin = 1;
15611  }
15612 
15613  // enable truth table computation if cut minimization is selected
15614  if ( pPars->fCutMin )
15615  {
15616  pPars->fTruth = 1;
15617  pPars->fExpRed = 0;
15618  }
15619  // modify the subgraph recording
15620  if ( pPars->fUserRecLib )
15621  {
15622  pPars->fTruth = 1;
15623  pPars->fCutMin = 1;
15624  pPars->fExpRed = 0;
15625  pPars->fUsePerm = 1;
15626  pPars->pLutLib = NULL;
15627  }
15628  // modify for delay optimization
15629  if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
15630  {
15631  pPars->fTruth = 1;
15632  pPars->fCutMin = 1;
15633  pPars->fExpRed = 0;
15634  pPars->fUseDsd = pPars->fDsdBalance || pPars->fDelayOptLut;
15635  pPars->pLutLib = NULL;
15636  }
15637  // modify for delay optimization
15638  if ( pPars->nGateSize > 0 )
15639  {
15640  pPars->fTruth = 1;
15641  pPars->fCutMin = 1;
15642  pPars->fExpRed = 0;
15643  pPars->fUsePerm = 1;
15644  pPars->pLutLib = NULL;
15645  pPars->nLutSize = pPars->nGateSize;
15646  }
15647 
15648  if ( pPars->fUseDsd || pPars->fUseTtPerm )
15649  {
15650  pPars->fTruth = 1;
15651  pPars->fCutMin = 1;
15652  pPars->fExpRed = 0;
15653  }
15654 
15655  if ( pPars->fUseDsd )
15656  {
15657  int LutSize = (pPars->pLutStruct && pPars->pLutStruct[2] == 0)? pPars->pLutStruct[0] - '0' : 0;
15659  if ( pPars->pLutStruct && pPars->pLutStruct[2] != 0 )
15660  {
15661  printf( "DSD only works for LUT structures XY.\n" );
15662  return 0;
15663  }
15664  if ( p && pPars->nLutSize > If_DsdManVarNum(p) )
15665  {
15666  printf( "DSD manager has incompatible number of variables.\n" );
15667  return 0;
15668  }
15669  if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
15670  {
15671  printf( "DSD manager has different LUT size.\n" );
15672  return 0;
15673  }
15674  if ( p == NULL )
15675  {
15676  if ( LutSize > DAU_MAX_VAR || pPars->nLutSize > DAU_MAX_VAR )
15677  {
15678  printf( "Size of required DSD manager (%d) exceeds the precompiled limit (%d) (change parameter DAU_MAX_VAR).\n", LutSize, DAU_MAX_VAR );
15679  return 0;
15680  }
15681  Abc_FrameSetManDsd( If_DsdManAlloc(pPars->nLutSize, LutSize) );
15682  }
15683  }
15684 
15685  if ( pPars->fUserRecLib )
15686  {
15687  if ( !Abc_NtkRecIsRunning3() )
15688  {
15689  printf( "LMS manager is not running (use \"rec_start3\").\n" );
15690  return 0;
15691  }
15692  if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
15693  {
15694  printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
15695  return 0;
15696  }
15697  }
15698 
15699  // complain if truth tables are requested but the cut size is too large
15700  if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
15701  {
15702  Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
15703  return 1;
15704  }
15705 
15706  // disable cut-expansion if edge-based heuristics are selected
15707 // if ( pPars->fEdge )
15708 // pPars->fExpRed = 0;
15709 
15710  if ( !Abc_NtkIsStrash(pNtk) )
15711  {
15712  // strash and balance the network
15713  pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
15714  if ( pNtk == NULL )
15715  {
15716  Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
15717  return 1;
15718  }
15719  pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
15720  Abc_NtkDelete( pNtkRes );
15721  if ( pNtk == NULL )
15722  {
15723  Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
15724  return 1;
15725  }
15726  if ( !Abc_FrameReadFlag("silentmode") )
15727  Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
15728  // get the new network
15729  pNtkRes = Abc_NtkIf( pNtk, pPars );
15730  if ( pNtkRes == NULL )
15731  {
15732  Abc_NtkDelete( pNtk );
15733  Abc_Print( -1, "FPGA mapping has failed.\n" );
15734  return 0;
15735  }
15736  Abc_NtkDelete( pNtk );
15737  }
15738  else
15739  {
15740  // get the new network
15741  pNtkRes = Abc_NtkIf( pNtk, pPars );
15742  if ( pNtkRes == NULL )
15743  {
15744  Abc_Print( -1, "FPGA mapping has failed.\n" );
15745  return 0;
15746  }
15747  }
15748  // replace the current network
15749  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
15750  return 0;
15751 
15752 usage:
15753  if ( pPars->DelayTarget == -1 )
15754  sprintf(Buffer, "best possible" );
15755  else
15756  sprintf(Buffer, "%.2f", pPars->DelayTarget );
15757  if ( pPars->nLutSize == -1 )
15758  sprintf(LutSize, "library" );
15759  else
15760  sprintf(LutSize, "%d", pPars->nLutSize );
15761  Abc_Print( -2, "usage: if [-KCFAGRNT num] [-DEW float] [-S str] [-qarlepmsdbgxyojiktncvh]\n" );
15762  Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
15763  Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
15764  Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
15765  Abc_Print( -2, "\t-F num : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
15766  Abc_Print( -2, "\t-A num : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
15767  Abc_Print( -2, "\t-G num : the max AND/OR gate size for mapping (0 = unused) [default = %d]\n", pPars->nGateSize );
15768  Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
15769  Abc_Print( -2, "\t-N num : the max size of non-decomposable nodes [default = unused]\n", pPars->nNonDecLimit );
15770  Abc_Print( -2, "\t-T num : the type of LUT structures [default = any]\n", pPars->nStructType );
15771  Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
15772  Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
15773  Abc_Print( -2, "\t-W float : sets wire delay between adjects LUTs [default = %f]\n", pPars->WireDelay );
15774  Abc_Print( -2, "\t-S str : string representing the LUT structure [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
15775  Abc_Print( -2, "\t-q : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
15776  Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
15777  Abc_Print( -2, "\t-r : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
15778  Abc_Print( -2, "\t-l : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
15779  Abc_Print( -2, "\t-e : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
15780  Abc_Print( -2, "\t-p : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
15781  Abc_Print( -2, "\t-m : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
15782  Abc_Print( -2, "\t-s : toggles delay-oriented mapping used with -S <NN> [default = %s]\n", pPars->fDelayOptLut? "yes": "no" );
15783  Abc_Print( -2, "\t-d : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
15784  Abc_Print( -2, "\t-b : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
15785  Abc_Print( -2, "\t-g : toggles delay optimization by SOP balancing [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
15786  Abc_Print( -2, "\t-x : toggles delay optimization by DSD balancing [default = %s]\n", pPars->fDsdBalance? "yes": "no" );
15787  Abc_Print( -2, "\t-y : toggles delay optimization with recorded library [default = %s]\n", pPars->fUserRecLib? "yes": "no" );
15788  Abc_Print( -2, "\t-o : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
15789  Abc_Print( -2, "\t-j : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
15790  Abc_Print( -2, "\t-i : toggles using cofactoring variables [default = %s]\n", pPars->fUseCofVars? "yes": "no" );
15791  Abc_Print( -2, "\t-k : toggles matching based on precomputed DSD manager [default = %s]\n", pPars->fUseDsdTune? "yes": "no" );
15792  Abc_Print( -2, "\t-t : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
15793  Abc_Print( -2, "\t-n : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
15794  Abc_Print( -2, "\t-c : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
15795  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
15796  Abc_Print( -2, "\t-h : prints the command usage\n");
15797  return 1;
15798 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int nLutSize
Definition: if.h:103
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Definition: if.h:100
void If_ManSetDefaultPars(If_Par_t *pPars)
FUNCTION DECLARATIONS ///.
Definition: ifCore.c:47
int fDeriveLuts
Definition: if.h:138
int fDelayOptLut
Definition: if.h:122
ABC_DLL int Abc_NtkRecInputNum3()
Definition: abcRec3.c:1391
int fVerbose
Definition: if.h:140
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
int LutMax
Definition: if.h:173
char * pLutStruct
Definition: if.h:141
Abc_Ntk_t * Abc_NtkIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
Definition: abcIf.c:106
int fDoAverage
Definition: if.h:139
int If_CutPerformCheck07(If_Man_t *p, unsigned *pTruth, int nVars, int nLeaves, char *pStr)
Definition: ifDec07.c:1071
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
float WireDelay
Definition: if.h:142
int fUseCofVars
Definition: if.h:135
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
int fExpRed
Definition: if.h:116
int nFlowIters
Definition: if.h:105
int nGateSize
Definition: if.h:107
int fEdge
Definition: if.h:118
int fUsePerm
Definition: if.h:147
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fPreprocess
Definition: if.h:113
int fDsdBalance
Definition: if.h:123
ABC_DLL void Abc_FrameSetManDsd(void *pMan)
Definition: mainFrame.c:89
#define DAU_MAX_VAR
INCLUDES ///.
Definition: dau.h:42
int fTruth
Definition: if.h:146
int fLatchPaths
Definition: if.h:117
#define IF_MAX_LUTSIZE
INCLUDES ///.
Definition: if.h:52
int nNonDecLimit
Definition: if.h:108
int fEnableCheck07
Definition: if.h:128
int globalUtilOptind
Definition: extraUtilUtil.c:45
#define IF_MAX_FUNC_LUTSIZE
Definition: if.h:54
int If_DsdManVarNum(If_DsdMan_t *p)
Definition: ifDsd.c:165
char * sprintf()
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
int fBidec
Definition: if.h:125
float Epsilon
Definition: if.h:110
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
double atof()
int fFancy
Definition: if.h:115
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int fUseDsd
Definition: if.h:133
int nRelaxRatio
Definition: if.h:111
float DelayTarget
Definition: if.h:109
If_DsdMan_t * If_DsdManAlloc(int nVars, int nLutSize)
Definition: ifDsd.c:248
int(* pFuncCell)(If_Man_t *, unsigned *, int, int, char *)
Definition: if.h:165
int fUseDsdTune
Definition: if.h:134
int nAreaIters
Definition: if.h:106
int If_DsdManLutSize(If_DsdMan_t *p)
Definition: ifDsd.c:173
int fUserRecLib
Definition: if.h:124
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fPower
Definition: if.h:119
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition: abcBalance.c:53
int fDelayOpt
Definition: if.h:121
int fUseBuffs
Definition: if.h:127
int fUseBat
Definition: if.h:126
int fCutMin
Definition: if.h:120
char * If_DsdManGetCellStr(If_DsdMan_t *p)
Definition: ifDsd.c:203
int fUseTtPerm
Definition: if.h:137
int nCutsMax
Definition: if.h:104
int strlen()
ABC_DLL char * Abc_FrameReadFlag(char *pFlag)
Definition: mainFrame.c:64
void If_DsdManSetNewAsUseless(If_DsdMan_t *p)
Definition: ifDsd.c:193
int fArea
Definition: if.h:114
int nStructType
Definition: if.h:112
ABC_DLL void * Abc_FrameReadLibLut()
Definition: mainFrame.c:54
int If_CutPerformCheck16(If_Man_t *p, unsigned *pTruth, int nVars, int nLeaves, char *pStr)
Definition: ifDec16.c:2216
If_LibLut_t * pLutLib
Definition: if.h:160
int Abc_CommandIfif ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 15811 of file abc.c.

15812 {
15813  extern void Abc_NtkPerformIfif( Abc_Ntk_t * pNtk, Ifif_Par_t * pPars );
15814  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
15815  Ifif_Par_t Pars, * pPars = &Pars;
15816  int c, fError;
15817 
15818  pPars->nLutSize = -1; // the LUT size
15819  pPars->pLutLib = (If_LibLut_t *)Abc_FrameReadLibLut(); // the LUT library
15820  pPars->DelayWire = (float)0.5; // wire delay
15821  pPars->nDegree = 0; // structure degree
15822  pPars->fCascade = 0; // cascade
15823  pPars->fVerbose = 0; // verbose
15824  pPars->fVeryVerbose = 0; // verbose
15825 
15827  while ( ( c = Extra_UtilGetopt( argc, argv, "DNcvwh" ) ) != EOF )
15828  {
15829  switch ( c )
15830  {
15831  case 'D':
15832  if ( globalUtilOptind >= argc )
15833  {
15834  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
15835  goto usage;
15836  }
15837  pPars->DelayWire = atof(argv[globalUtilOptind]);
15838  globalUtilOptind++;
15839  if ( pPars->DelayWire < 0.0 )
15840  goto usage;
15841  break;
15842  case 'N':
15843  if ( globalUtilOptind >= argc )
15844  {
15845  Abc_Print( -1, "Command line switch \"-N\" should be followed by a floating point number.\n" );
15846  goto usage;
15847  }
15848  pPars->nDegree = atoi(argv[globalUtilOptind]);
15849  globalUtilOptind++;
15850  if ( pPars->nDegree < 0 )
15851  goto usage;
15852  break;
15853  case 'c':
15854  pPars->fCascade ^= 1;
15855  break;
15856  case 'v':
15857  pPars->fVerbose ^= 1;
15858  break;
15859  case 'w':
15860  pPars->fVeryVerbose ^= 1;
15861  break;
15862  case 'h':
15863  goto usage;
15864  default:
15865  goto usage;
15866  }
15867  }
15868 
15869  if ( pNtk == NULL )
15870  {
15871  Abc_Print( -1, "Empty network.\n" );
15872  return 1;
15873  }
15874  if ( !Abc_NtkIsLogic(pNtk) )
15875  {
15876  Abc_Print( -1, "Need mapped network.\n" );
15877  return 1;
15878  }
15879  if ( pPars->pLutLib == NULL )
15880  {
15881  Abc_Print( -1, "LUT library is not given.\n" );
15882  return 1;
15883  }
15884 
15885  pPars->nLutSize = Abc_NtkGetFaninMax( pNtk );
15886  if ( pPars->nLutSize > pPars->pLutLib->LutMax )
15887  {
15888  Abc_Print( -1, "The max node size (%d) exceeds the LUT size (%d).\n", pPars->nLutSize, pPars->pLutLib->LutMax );
15889  return 1;
15890  }
15891  if ( pPars->nLutSize < pPars->pLutLib->LutMax )
15892  Abc_Print( 0, "Node size (%d) is less than LUT size (%d).\n", pPars->nLutSize, pPars->pLutLib->LutMax );
15893  // check delay information
15894  fError = 0;
15895  for ( c = 0; c < pPars->pLutLib->LutMax; c++ )
15896  {
15897  pPars->pLutDelays[c] = ( pPars->pLutLib->fVarPinDelays ? pPars->pLutLib->pLutDelays[pPars->pLutLib->LutMax][c] : pPars->pLutLib->pLutDelays[pPars->pLutLib->LutMax][0] );
15898  if ( pPars->DelayWire >= pPars->pLutDelays[c] )
15899  {
15900  fError = 1;
15901  printf(" Wire delay (%.2f) exceeds pin+wire delay (%.2f) for pin %d in the LUT library.\n", pPars->DelayWire, pPars->pLutDelays[c], c );
15902  }
15903  }
15904  if ( fError )
15905  return 1;
15906 
15907  // call the mapper
15908  Abc_NtkPerformIfif( pNtk, pPars );
15909  return 0;
15910 
15911 usage:
15912  Abc_Print( -2, "usage: ifif [-DNcvwh]\n" );
15913  Abc_Print( -2, "\t technology mapper into N-node K-LUT structures\n" );
15914  Abc_Print( -2, "\t (takes a LUT network and maps it into a delay-optimal network\n" );
15915  Abc_Print( -2, "\t of N-node K-LUT structures using the current LUT library)\n" );
15916  Abc_Print( -2, "\t-D float : wire delay (should be less than the LUT delay) [default = %.2f]\n", pPars->DelayWire );
15917  Abc_Print( -2, "\t-N num : degree of the LUT structure [default = %d]\n", pPars->nDegree );
15918  Abc_Print( -2, "\t-c : toggles using LUT cascade vs LUT cluster [default = %s]\n", pPars->fCascade? "cascade": "cluster" );
15919  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
15920  Abc_Print( -2, "\t-w : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
15921  Abc_Print( -2, "\t-h : print the command usage\n");
15922  return 1;
15923 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
int nLutSize
Definition: if.h:89
int fVerbose
Definition: if.h:95
If_LibLut_t * pLutLib
Definition: if.h:90
int LutMax
Definition: if.h:173
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:453
float pLutDelays[IF_MAX_LUTSIZE+1][IF_MAX_LUTSIZE+1]
Definition: if.h:176
int fVeryVerbose
Definition: if.h:96
Definition: if.h:87
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fVarPinDelays
Definition: if.h:174
float DelayWire
Definition: if.h:92
int globalUtilOptind
Definition: extraUtilUtil.c:45
int fCascade
Definition: if.h:94
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nDegree
Definition: if.h:93
double atof()
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkPerformIfif(Abc_Ntk_t *pNtk, Ifif_Par_t *pPars)
Definition: abcIfif.c:255
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
float pLutDelays[IF_MAX_LUTSIZE]
Definition: if.h:91
ABC_DLL void * Abc_FrameReadLibLut()
Definition: mainFrame.c:54
int Abc_CommandIFraig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12281 of file abc.c.

12282 {
12283  Abc_Ntk_t * pNtk, * pNtkRes;
12284  int c, fProve, fVerbose, fDoSparse;
12285  int nConfLimit;
12286  int nPartSize;
12287  int nLevelMax;
12288 
12289  extern Abc_Ntk_t * Abc_NtkIvyFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose );
12290  extern Abc_Ntk_t * Abc_NtkDarFraigPart( Abc_Ntk_t * pNtk, int nPartSize, int nConfLimit, int nLevelMax, int fVerbose );
12291 
12292  pNtk = Abc_FrameReadNtk(pAbc);
12293  // set defaults
12294  nPartSize = 0;
12295  nLevelMax = 0;
12296  nConfLimit = 100;
12297  fDoSparse = 0;
12298  fProve = 0;
12299  fVerbose = 0;
12301  while ( ( c = Extra_UtilGetopt( argc, argv, "PCLspvh" ) ) != EOF )
12302  {
12303  switch ( c )
12304  {
12305  case 'P':
12306  if ( globalUtilOptind >= argc )
12307  {
12308  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
12309  goto usage;
12310  }
12311  nPartSize = atoi(argv[globalUtilOptind]);
12312  globalUtilOptind++;
12313  if ( nPartSize < 0 )
12314  goto usage;
12315  break;
12316  case 'C':
12317  if ( globalUtilOptind >= argc )
12318  {
12319  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
12320  goto usage;
12321  }
12322  nConfLimit = atoi(argv[globalUtilOptind]);
12323  globalUtilOptind++;
12324  if ( nConfLimit < 0 )
12325  goto usage;
12326  break;
12327  case 'L':
12328  if ( globalUtilOptind >= argc )
12329  {
12330  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
12331  goto usage;
12332  }
12333  nLevelMax = atoi(argv[globalUtilOptind]);
12334  globalUtilOptind++;
12335  if ( nLevelMax < 0 )
12336  goto usage;
12337  break;
12338  case 's':
12339  fDoSparse ^= 1;
12340  break;
12341  case 'p':
12342  fProve ^= 1;
12343  break;
12344  case 'v':
12345  fVerbose ^= 1;
12346  break;
12347  case 'h':
12348  goto usage;
12349  default:
12350  goto usage;
12351  }
12352  }
12353  if ( pNtk == NULL )
12354  {
12355  Abc_Print( -1, "Empty network.\n" );
12356  return 1;
12357  }
12358  if ( !Abc_NtkIsStrash(pNtk) )
12359  {
12360  Abc_Print( -1, "This command works only for strashed networks.\n" );
12361  return 1;
12362  }
12363 
12364  if ( nPartSize > 0 )
12365  pNtkRes = Abc_NtkDarFraigPart( pNtk, nPartSize, nConfLimit, nLevelMax, fVerbose );
12366  else
12367  pNtkRes = Abc_NtkIvyFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fVerbose );
12368  if ( pNtkRes == NULL )
12369  {
12370  Abc_Print( -1, "Command has failed.\n" );
12371  return 0;
12372  }
12373  // replace the current network
12374  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
12375  return 0;
12376 
12377 usage:
12378  Abc_Print( -2, "usage: ifraig [-P num] [-C num] [-L num] [-spvh]\n" );
12379  Abc_Print( -2, "\t performs fraiging using a new method\n" );
12380  Abc_Print( -2, "\t-P num : partition size (0 = partitioning is not used) [default = %d]\n", nPartSize );
12381  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
12382  Abc_Print( -2, "\t-L num : limit on node level to fraig (0 = fraig all nodes) [default = %d]\n", nLevelMax );
12383  Abc_Print( -2, "\t-s : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
12384  Abc_Print( -2, "\t-p : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
12385  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
12386  Abc_Print( -2, "\t-h : print the command usage\n");
12387  return 1;
12388 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkDarFraigPart(Abc_Ntk_t *pNtk, int nPartSize, int nConfLimit, int nLevelMax, int fVerbose)
Definition: abcDar.c:1393
Abc_Ntk_t * Abc_NtkIvyFraig(Abc_Ntk_t *pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose)
Definition: abcIvy.c:456
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandIndcut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 22865 of file abc.c.

22866 {
22867  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
22868  int nFrames;
22869  int nPref;
22870  int nClauses;
22871  int nLutSize;
22872  int nLevels;
22873  int nCutsMax;
22874  int nBatches;
22875  int fStepUp;
22876  int fBmc;
22877  int fRegs;
22878  int fTarget;
22879  int fVerbose;
22880  int fVeryVerbose;
22881  int c;
22882  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 );
22883  // set defaults
22884  nFrames = 1;
22885  nPref = 0;
22886  nClauses = 5000;
22887  nLutSize = 4;
22888  nLevels = 8;
22889  nCutsMax = 16;
22890  nBatches = 1;
22891  fStepUp = 0;
22892  fBmc = 1;
22893  fRegs = 1;
22894  fTarget = 1;
22895  fVerbose = 0;
22896  fVeryVerbose = 0;
22898  while ( ( c = Extra_UtilGetopt( argc, argv, "FPCMLNBsbrtvwh" ) ) != EOF )
22899  {
22900  switch ( c )
22901  {
22902  case 'F':
22903  if ( globalUtilOptind >= argc )
22904  {
22905  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
22906  goto usage;
22907  }
22908  nFrames = atoi(argv[globalUtilOptind]);
22909  globalUtilOptind++;
22910  if ( nFrames < 0 )
22911  goto usage;
22912  break;
22913  case 'P':
22914  if ( globalUtilOptind >= argc )
22915  {
22916  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
22917  goto usage;
22918  }
22919  nPref = atoi(argv[globalUtilOptind]);
22920  globalUtilOptind++;
22921  if ( nPref < 0 )
22922  goto usage;
22923  break;
22924  case 'C':
22925  if ( globalUtilOptind >= argc )
22926  {
22927  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
22928  goto usage;
22929  }
22930  nClauses = atoi(argv[globalUtilOptind]);
22931  globalUtilOptind++;
22932  if ( nClauses < 0 )
22933  goto usage;
22934  break;
22935  case 'M':
22936  if ( globalUtilOptind >= argc )
22937  {
22938  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
22939  goto usage;
22940  }
22941  nLutSize = atoi(argv[globalUtilOptind]);
22942  globalUtilOptind++;
22943  if ( nLutSize < 0 )
22944  goto usage;
22945  break;
22946  case 'L':
22947  if ( globalUtilOptind >= argc )
22948  {
22949  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
22950  goto usage;
22951  }
22952  nLevels = atoi(argv[globalUtilOptind]);
22953  globalUtilOptind++;
22954  if ( nLevels < 0 )
22955  goto usage;
22956  break;
22957  case 'N':
22958  if ( globalUtilOptind >= argc )
22959  {
22960  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
22961  goto usage;
22962  }
22963  nCutsMax = atoi(argv[globalUtilOptind]);
22964  globalUtilOptind++;
22965  if ( nCutsMax < 0 )
22966  goto usage;
22967  break;
22968  case 'B':
22969  if ( globalUtilOptind >= argc )
22970  {
22971  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
22972  goto usage;
22973  }
22974  nBatches = atoi(argv[globalUtilOptind]);
22975  globalUtilOptind++;
22976  if ( nBatches < 0 )
22977  goto usage;
22978  break;
22979  case 's':
22980  fStepUp ^= 1;
22981  break;
22982  case 'b':
22983  fBmc ^= 1;
22984  break;
22985  case 'r':
22986  fRegs ^= 1;
22987  break;
22988  case 't':
22989  fTarget ^= 1;
22990  break;
22991  case 'v':
22992  fVerbose ^= 1;
22993  break;
22994  case 'w':
22995  fVeryVerbose ^= 1;
22996  break;
22997  case 'h':
22998  goto usage;
22999  default:
23000  goto usage;
23001  }
23002  }
23003  if ( pNtk == NULL )
23004  {
23005  Abc_Print( -1, "Empty network.\n" );
23006  return 1;
23007  }
23008  if ( Abc_NtkIsComb(pNtk) )
23009  {
23010  Abc_Print( -1, "The network is combinational.\n" );
23011  return 0;
23012  }
23013  if ( !Abc_NtkIsStrash(pNtk) )
23014  {
23015  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
23016  return 0;
23017  }
23018  if ( nLutSize > 12 )
23019  {
23020  Abc_Print( -1, "The cut size should be not exceed 12.\n" );
23021  return 0;
23022  }
23023  Abc_NtkDarClau( pNtk, nFrames, nPref, nClauses, nLutSize, nLevels, nCutsMax, nBatches, fStepUp, fBmc, fRegs, fTarget, fVerbose, fVeryVerbose );
23024  return 0;
23025 usage:
23026  Abc_Print( -2, "usage: indcut [-FPCMLNB num] [-sbrtvh]\n" );
23027  Abc_Print( -2, "\t K-step induction strengthened with cut properties\n" );
23028  Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", nFrames );
23029  Abc_Print( -2, "\t-P num : number of time frames in the prefix (0=no prefix) [default = %d]\n", nPref );
23030  Abc_Print( -2, "\t-C num : the max number of clauses to use for strengthening [default = %d]\n", nClauses );
23031  Abc_Print( -2, "\t-M num : the cut size (2 <= M <= 12) [default = %d]\n", nLutSize );
23032  Abc_Print( -2, "\t-L num : the max number of levels for cut computation [default = %d]\n", nLevels );
23033  Abc_Print( -2, "\t-N num : the max number of cuts to compute at a node [default = %d]\n", nCutsMax );
23034  Abc_Print( -2, "\t-B num : the max number of invariant batches to try [default = %d]\n", nBatches );
23035  Abc_Print( -2, "\t-s : toggle increment cut size in each batch [default = %s]\n", fStepUp? "yes": "no" );
23036  Abc_Print( -2, "\t-b : toggle enabling BMC check [default = %s]\n", fBmc? "yes": "no" );
23037  Abc_Print( -2, "\t-r : toggle enabling register clauses [default = %s]\n", fRegs? "yes": "no" );
23038  Abc_Print( -2, "\t-t : toggle proving target / computing don't-cares [default = %s]\n", fTarget? "yes": "no" );
23039  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
23040 // Abc_Print( -2, "\t-w : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
23041  Abc_Print( -2, "\t-h : print the command usage\n");
23042  return 1;
23043 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
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 fRefs, int fTarget, int fVerbose, int fVeryVerbose)
Definition: abcDar.c:3593
int Abc_CommandInduction ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23280 of file abc.c.

23281 {
23282  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
23283  int nTimeOut;
23284  int nFramesMax;
23285  int nConfMax;
23286  int fUnique;
23287  int fUniqueAll;
23288  int fGetCex;
23289  int fVerbose;
23290  int fVeryVerbose;
23291  int c;
23292  extern int Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nTimeOut, int nFramesMax, int nConfMax, int fUnique, int fUniqueAll, int fGetCex, int fVerbose, int fVeryVerbose );
23293  // set defaults
23294  nTimeOut = 0;
23295  nFramesMax = 0;
23296  nConfMax = 0;
23297  fUnique = 0;
23298  fUniqueAll = 0;
23299  fGetCex = 0;
23300  fVerbose = 0;
23301  fVeryVerbose = 0;
23303  while ( ( c = Extra_UtilGetopt( argc, argv, "FCTuaxvwh" ) ) != EOF )
23304  {
23305  switch ( c )
23306  {
23307  case 'F':
23308  if ( globalUtilOptind >= argc )
23309  {
23310  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
23311  goto usage;
23312  }
23313  nFramesMax = atoi(argv[globalUtilOptind]);
23314  globalUtilOptind++;
23315  if ( nFramesMax < 0 )
23316  goto usage;
23317  break;
23318  case 'C':
23319  if ( globalUtilOptind >= argc )
23320  {
23321  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
23322  goto usage;
23323  }
23324  nConfMax = atoi(argv[globalUtilOptind]);
23325  globalUtilOptind++;
23326  if ( nConfMax < 0 )
23327  goto usage;
23328  break;
23329  case 'T':
23330  if ( globalUtilOptind >= argc )
23331  {
23332  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
23333  goto usage;
23334  }
23335  nTimeOut = atoi(argv[globalUtilOptind]);
23336  globalUtilOptind++;
23337  if ( nTimeOut < 0 )
23338  goto usage;
23339  break;
23340  case 'u':
23341  fUnique ^= 1;
23342  break;
23343  case 'a':
23344  fUniqueAll ^= 1;
23345  break;
23346  case 'x':
23347  fGetCex ^= 1;
23348  break;
23349  case 'v':
23350  fVerbose ^= 1;
23351  break;
23352  case 'w':
23353  fVeryVerbose ^= 1;
23354  break;
23355  case 'h':
23356  goto usage;
23357  default:
23358  goto usage;
23359  }
23360  }
23361  if ( pNtk == NULL )
23362  {
23363  Abc_Print( -1, "Empty network.\n" );
23364  return 1;
23365  }
23366  if ( Abc_NtkIsComb(pNtk) )
23367  {
23368  Abc_Print( -1, "The network is combinational.\n" );
23369  return 0;
23370  }
23371  if ( !Abc_NtkIsStrash(pNtk) )
23372  {
23373  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
23374  return 0;
23375  }
23376  if ( Abc_NtkPoNum(pNtk) != 1 )
23377  {
23378  Abc_Print( -1, "Currently this command works only for single-output miter.\n" );
23379  return 0;
23380  }
23381  if ( fUnique && fUniqueAll )
23382  {
23383  Abc_Print( -1, "Only one of the options, \"-u\" or \"-a\", should be selected.\n" );
23384  return 0;
23385  }
23386 
23387  // modify the current network
23388  pAbc->Status = Abc_NtkDarInduction( pNtk, nTimeOut, nFramesMax, nConfMax, fUnique, fUniqueAll, fGetCex, fVerbose, fVeryVerbose );
23389  if ( fGetCex )
23390  {
23391  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
23392  Abc_Print( 1,"The current CEX in ABC is set to be the CEX to induction.\n" );
23393  }
23394  return 0;
23395 usage:
23396  Abc_Print( -2, "usage: ind [-FCT num] [-uaxvwh]\n" );
23397  Abc_Print( -2, "\t runs the inductive case of the K-step induction\n" );
23398  Abc_Print( -2, "\t-F num : the max number of timeframes [default = %d]\n", nFramesMax );
23399  Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver [default = %d]\n", nConfMax );
23400  Abc_Print( -2, "\t-T num : the limit on runtime per output in seconds [default = %d]\n", nTimeOut );
23401  Abc_Print( -2, "\t-u : toggle adding uniqueness constraints on demand [default = %s]\n", fUnique? "yes": "no" );
23402  Abc_Print( -2, "\t-a : toggle adding uniqueness constraints always [default = %s]\n", fUniqueAll? "yes": "no" );
23403  Abc_Print( -2, "\t-x : toggle returning CEX to induction for the top frame [default = %s]\n", fGetCex? "yes": "no" );
23404  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
23405  Abc_Print( -2, "\t-w : toggle printing additional verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
23406  Abc_Print( -2, "\t-h : print the command usage\n");
23407  return 1;
23408 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
int Abc_NtkDarInduction(Abc_Ntk_t *pNtk, int nTimeOut, int nFramesMax, int nConfMax, int fUnique, int fUniqueAll, int fGetCex, int fVerbose, int fVeryVerbose)
Definition: abcDar.c:3681
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandInit ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16517 of file abc.c.

16518 {
16519  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
16520  Abc_Obj_t * pObj;
16521  char * pInitStr = NULL;
16522  int fZeros = 0;
16523  int fOnes = 0;
16524  int fRandom = 0;
16525  int fDontCare = 0;
16526  int fUseCexCs = 0;
16527  int fUseCexNs = 0;
16528  int c, i;
16529  // set defaults
16531  while ( ( c = Extra_UtilGetopt( argc, argv, "Szordcnh" ) ) != EOF )
16532  {
16533  switch ( c )
16534  {
16535  case 'S':
16536  if ( globalUtilOptind >= argc )
16537  {
16538  Abc_Print( -1, "Command line switch \"-S\" should be followed by a file name.\n" );
16539  goto usage;
16540  }
16541  pInitStr = argv[globalUtilOptind];
16542  globalUtilOptind++;
16543  break;
16544  case 'z':
16545  fZeros ^= 1;
16546  break;
16547  case 'o':
16548  fOnes ^= 1;
16549  break;
16550  case 'r':
16551  fRandom ^= 1;
16552  break;
16553  case 'd':
16554  fDontCare ^= 1;
16555  break;
16556  case 'c':
16557  fUseCexCs ^= 1;
16558  break;
16559  case 'n':
16560  fUseCexNs ^= 1;
16561  break;
16562  case 'h':
16563  goto usage;
16564  default:
16565  goto usage;
16566  }
16567  }
16568 
16569  if ( pNtk == NULL )
16570  {
16571  Abc_Print( -1, "Empty network.\n" );
16572  return 1;
16573  }
16574 
16575  if ( Abc_NtkIsComb(pNtk) )
16576  {
16577  Abc_Print( -1, "The current network is combinational.\n" );
16578  return 0;
16579  }
16580 
16581  if ( pInitStr != NULL )
16582  {
16583  if ( (int)strlen(pInitStr) != Abc_NtkLatchNum(pNtk) )
16584  {
16585  Abc_Print( -1, "The length of init string (%d) differs from the number of flops (%d).\n", strlen(pInitStr), Abc_NtkLatchNum(pNtk) );
16586  return 1;
16587  }
16588  Abc_NtkForEachLatch( pNtk, pObj, i )
16589  if ( pInitStr[i] == '0' )
16590  Abc_LatchSetInit0( pObj );
16591  else if ( pInitStr[i] == '1' )
16592  Abc_LatchSetInit1( pObj );
16593  else
16594  Abc_LatchSetInitDc( pObj );
16595  return 0;
16596  }
16597 
16598  if ( fZeros )
16599  {
16600  Abc_NtkForEachLatch( pNtk, pObj, i )
16601  Abc_LatchSetInit0( pObj );
16602  }
16603  else if ( fOnes )
16604  {
16605  Abc_NtkForEachLatch( pNtk, pObj, i )
16606  Abc_LatchSetInit1( pObj );
16607  }
16608  else if ( fRandom )
16609  {
16610  srand( time(NULL) );
16611  Abc_NtkForEachLatch( pNtk, pObj, i )
16612  if ( rand() & 1 )
16613  Abc_LatchSetInit1( pObj );
16614  else
16615  Abc_LatchSetInit0( pObj );
16616  }
16617  else if ( fDontCare )
16618  {
16619  Abc_NtkForEachLatch( pNtk, pObj, i )
16620  Abc_LatchSetInitDc( pObj );
16621  }
16622  else if ( fUseCexCs || fUseCexNs )
16623  {
16624  extern Vec_Int_t * Saig_ManReturnFailingState( Aig_Man_t * pMan, Abc_Cex_t * p, int fNextOne );
16625  Aig_Man_t * pMan;
16626  Vec_Int_t * vFailState;
16627  if ( fUseCexCs && fUseCexNs )
16628  {
16629  Abc_Print( -1, "The two options (-c and -n) are incompatible.\n" );
16630  return 0;
16631  }
16632  if ( !Abc_NtkIsStrash(pNtk) )
16633  {
16634  Abc_Print( -1, "The current network should be an AIG.\n" );
16635  return 0;
16636  }
16637  if ( pAbc->pCex == NULL )
16638  {
16639  Abc_Print( -1, "The current CEX is not available.\n" );
16640  return 0;
16641  }
16642  pMan = Abc_NtkToDar( pNtk, 0, 1 );
16643  vFailState = Saig_ManReturnFailingState( pMan, pAbc->pCex, fUseCexNs );
16644  //Vec_IntPrint( vFailState );
16645  Aig_ManStop( pMan );
16646  Abc_NtkForEachLatch( pNtk, pObj, i )
16647  if ( Vec_IntEntry( vFailState, i ) )
16648  Abc_LatchSetInit1( pObj );
16649  else
16650  Abc_LatchSetInit0( pObj );
16651  Vec_IntFree( vFailState );
16652  }
16653  else
16654  Abc_Print( -1, "The initial states remain unchanged.\n" );
16655  return 0;
16656 
16657 usage:
16658  Abc_Print( -2, "usage: init [-zordcnh] [-S <init_string>]\n" );
16659  Abc_Print( -2, "\t resets initial states of all latches\n" );
16660  Abc_Print( -2, "\t-z : set zeros initial states [default = %s]\n", fZeros? "yes": "no" );
16661  Abc_Print( -2, "\t-o : set ones initial states [default = %s]\n", fOnes? "yes": "no" );
16662  Abc_Print( -2, "\t-d : set don't-care initial states [default = %s]\n", fDontCare? "yes": "no" );
16663  Abc_Print( -2, "\t-r : set random initial states [default = %s]\n", fRandom? "yes": "no" );
16664  Abc_Print( -2, "\t-c : set failure current state from the CEX (and run \"zero\") [default = %s]\n", fUseCexCs? "yes": "no" );
16665  Abc_Print( -2, "\t-n : set next state after failure from the CEX (and run \"zero\") [default = %s]\n", fUseCexNs? "yes": "no" );
16666  Abc_Print( -2, "\t-h : print the command usage\n");
16667  Abc_Print( -2, "\t-S str : (optional) initial state [default = unused]\n" );
16668  return 1;
16669 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
Vec_Int_t * Saig_ManReturnFailingState(Aig_Man_t *pAig, Abc_Cex_t *p, int fNextOne)
Definition: saigDup.c:345
static void Abc_LatchSetInitDc(Abc_Obj_t *pLatch)
Definition: abc.h:420
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
int globalUtilOptind
Definition: extraUtilUtil.c:45
long random()
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int * zeros(int n)
Definition: abcSaucy.c:200
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static void Abc_LatchSetInit1(Abc_Obj_t *pLatch)
Definition: abc.h:419
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int strlen()
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
Definition: abc.h:418
static DdNode * zero
Definition: cuddApa.c:100
static shot S[256]
Definition: kitPerm.c:40
int Abc_CommandInsWin ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 19909 of file abc.c.

19910 {
19911  Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
19912  int c;
19913  int nObjId;
19914  int nDist;
19915  int fVerbose;
19916 
19917  extern Abc_Ntk_t * Abc_NtkDarInsWin( Abc_Ntk_t * pNtk, Abc_Ntk_t * pWnd, int nObjId, int nDist, int fVerbose );
19918 
19919  pNtk = Abc_FrameReadNtk(pAbc);
19920  // set defaults
19921  nObjId = -1;
19922  nDist = 5;
19923  fVerbose = 0;
19925  while ( ( c = Extra_UtilGetopt( argc, argv, "NDvh" ) ) != EOF )
19926  {
19927  switch ( c )
19928  {
19929  case 'N':
19930  if ( globalUtilOptind >= argc )
19931  {
19932  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
19933  goto usage;
19934  }
19935  nObjId = atoi(argv[globalUtilOptind]);
19936  globalUtilOptind++;
19937  if ( nObjId <= 0 )
19938  goto usage;
19939  break;
19940  case 'D':
19941  if ( globalUtilOptind >= argc )
19942  {
19943  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
19944  goto usage;
19945  }
19946  nDist = atoi(argv[globalUtilOptind]);
19947  globalUtilOptind++;
19948  if ( nDist <= 0 )
19949  goto usage;
19950  break;
19951  case 'v':
19952  fVerbose ^= 1;
19953  break;
19954  case 'h':
19955  goto usage;
19956  default:
19957  goto usage;
19958  }
19959  }
19960  if ( pNtk == NULL )
19961  {
19962  Abc_Print( -1, "Empty network.\n" );
19963  return 1;
19964  }
19965  if ( !Abc_NtkIsStrash(pNtk) )
19966  {
19967  Abc_Print( -1, "Only works for structrally hashed networks.\n" );
19968  return 1;
19969  }
19970 
19971  if ( argc != globalUtilOptind + 1 )
19972  {
19973  Abc_Print( -1, "Not enough command-line arguments.\n" );
19974  return 1;
19975  }
19976  pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
19977  if ( pNtkCare == NULL )
19978  {
19979  Abc_Print( -1, "Reading care network has failed.\n" );
19980  return 1;
19981  }
19982  if ( !Abc_NtkIsStrash(pNtkCare) )
19983  {
19984  Abc_Ntk_t * pNtkTemp;
19985  pNtkCare = Abc_NtkStrash( pNtkTemp = pNtkCare, 0, 1, 0 );
19986  Abc_NtkDelete( pNtkTemp );
19987  }
19988  // modify the current network
19989  pNtkRes = Abc_NtkDarInsWin( pNtk, pNtkCare, nObjId, nDist, fVerbose );
19990  Abc_NtkDelete( pNtkCare );
19991  if ( pNtkRes == NULL )
19992  {
19993  Abc_Print( -1, "Inserting sequential window has failed.\n" );
19994  return 0;
19995  }
19996  // replace the current network
19997  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
19998  return 0;
19999 
20000 usage:
20001  Abc_Print( -2, "usage: inswin [-ND <num>] [-vh] <file>\n" );
20002  Abc_Print( -2, "\t inserts sequential window into the AIG\n" );
20003  Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
20004  Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
20005  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
20006  Abc_Print( -2, "\t-h : print the command usage\n");
20007  Abc_Print( -2, "\tfile : file with the AIG to be inserted\n");
20008  return 1;
20009 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
Abc_Ntk_t * Abc_NtkDarInsWin(Abc_Ntk_t *pNtk, Abc_Ntk_t *pCare, int nObjId, int nDist, int fVerbose)
Definition: abcDar.c:4189
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandInter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10245 of file abc.c.

10246 {
10247  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes = NULL;
10248  char ** pArgvNew;
10249  int nArgcNew;
10250  int c, fDelete1, fDelete2;
10251  int fRelation;
10252  int fVerbose;
10253  extern Abc_Ntk_t * Abc_NtkInter( Abc_Ntk_t * pNtkOn, Abc_Ntk_t * pNtkOff, int fRelation, int fVerbose );
10254 
10255  pNtk = Abc_FrameReadNtk(pAbc);
10256  // set defaults
10257  fRelation = 0;
10258  fVerbose = 0;
10260  while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
10261  {
10262  switch ( c )
10263  {
10264  case 'r':
10265  fRelation ^= 1;
10266  break;
10267  case 'v':
10268  fVerbose ^= 1;
10269  break;
10270  case 'h':
10271  goto usage;
10272  default:
10273  goto usage;
10274  }
10275  }
10276 
10277  pArgvNew = argv + globalUtilOptind;
10278  nArgcNew = argc - globalUtilOptind;
10279  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
10280  return 1;
10281  if ( nArgcNew == 0 )
10282  {
10283  Abc_Obj_t * pObj;
10284  int i;
10285  Abc_Print( -1, "Deriving new circuit structure for the current network.\n" );
10286  Abc_NtkForEachPo( pNtk2, pObj, i )
10287  Abc_ObjXorFaninC( pObj, 0 );
10288  }
10289  if ( fRelation && Abc_NtkCoNum(pNtk1) != 1 )
10290  {
10291  Abc_Print( -1, "Computation of interplants as a relation only works for single-output functions.\n" );
10292  Abc_Print( -1, "Use command \"cone\" to extract one output cone from the multi-output network.\n" );
10293  }
10294  else
10295  pNtkRes = Abc_NtkInter( pNtk1, pNtk2, fRelation, fVerbose );
10296  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
10297  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
10298 
10299  if ( pNtkRes == NULL )
10300  {
10301  Abc_Print( -1, "Command has failed.\n" );
10302  return 0;
10303  }
10304  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10305  return 0;
10306 
10307 usage:
10308  Abc_Print( -2, "usage: inter [-rvh] <onset.blif> <offset.blif>\n" );
10309  Abc_Print( -2, "\t derives interpolant of two networks representing onset and offset;\n" );
10310  Abc_Print( -2, "\t-r : toggle computing interpolant as a relation [default = %s]\n", fRelation? "yes": "no" );
10311  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
10312  Abc_Print( -2, "\t-h : print the command usage\n");
10313  Abc_Print( -2, "\t \n" );
10314  Abc_Print( -2, "\t Comments:\n" );
10315  Abc_Print( -2, "\t \n" );
10316  Abc_Print( -2, "\t The networks given on the command line should have the same CIs/COs.\n" );
10317  Abc_Print( -2, "\t If only one network is given on the command line, this network\n" );
10318  Abc_Print( -2, "\t is assumed to be the offset, while the current network is the onset.\n" );
10319  Abc_Print( -2, "\t If no network is given on the command line, the current network is\n" );
10320  Abc_Print( -2, "\t assumed to be the onset and its complement is taken to be the offset.\n" );
10321  Abc_Print( -2, "\t The resulting interpolant is stored as the current network.\n" );
10322  Abc_Print( -2, "\t To verify that the interpolant agrees with the onset and the offset,\n" );
10323  Abc_Print( -2, "\t save it in file \"inter.blif\" and run the following:\n" );
10324  Abc_Print( -2, "\t (a) \"miter -i <onset.blif> <inter.blif>; iprove\"\n" );
10325  Abc_Print( -2, "\t (b) \"miter -i <inter.blif> <offset_inv.blif>; iprove\"\n" );
10326  Abc_Print( -2, "\t where <offset_inv.blif> is the network derived by complementing the\n" );
10327  Abc_Print( -2, "\t outputs of <offset.blif>: \"r <offset.blif>; st -i; w <offset_inv.blif>\"\n" );
10328  return 1;
10329 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
if(last==0)
Definition: sparse_int.h:34
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Abc_Ntk_t * Abc_NtkInter(Abc_Ntk_t *pNtkOn, Abc_Ntk_t *pNtkOff, int fRelation, int fVerbose)
Definition: abcDar.c:3813
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static void Abc_ObjXorFaninC(Abc_Obj_t *pObj, int i)
Definition: abc.h:381
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
int Abc_CommandIProve ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12600 of file abc.c.

12601 {
12602  Prove_Params_t Params, * pParams = &Params;
12603  Abc_Ntk_t * pNtk, * pNtkTemp;
12604  int c, RetValue, iOut = -1;
12605  abctime clk;
12606 
12607  extern int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars );
12608 
12609  pNtk = Abc_FrameReadNtk(pAbc);
12610  // set defaults
12611  Prove_ParamsSetDefault( pParams );
12612  pParams->fUseRewriting = 1;
12613  pParams->fVerbose = 0;
12615  while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGLIrfbvh" ) ) != EOF )
12616  {
12617  switch ( c )
12618  {
12619  case 'N':
12620  if ( globalUtilOptind >= argc )
12621  {
12622  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
12623  goto usage;
12624  }
12625  pParams->nItersMax = atoi(argv[globalUtilOptind]);
12626  globalUtilOptind++;
12627  if ( pParams->nItersMax < 0 )
12628  goto usage;
12629  break;
12630  case 'C':
12631  if ( globalUtilOptind >= argc )
12632  {
12633  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
12634  goto usage;
12635  }
12636  pParams->nMiteringLimitStart = atoi(argv[globalUtilOptind]);
12637  globalUtilOptind++;
12638  if ( pParams->nMiteringLimitStart < 0 )
12639  goto usage;
12640  break;
12641  case 'F':
12642  if ( globalUtilOptind >= argc )
12643  {
12644  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
12645  goto usage;
12646  }
12647  pParams->nFraigingLimitStart = atoi(argv[globalUtilOptind]);
12648  globalUtilOptind++;
12649  if ( pParams->nFraigingLimitStart < 0 )
12650  goto usage;
12651  break;
12652  case 'G':
12653  if ( globalUtilOptind >= argc )
12654  {
12655  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
12656  goto usage;
12657  }
12658  pParams->nFraigingLimitMulti = (float)atoi(argv[globalUtilOptind]);
12659  globalUtilOptind++;
12660  if ( pParams->nFraigingLimitMulti < 0 )
12661  goto usage;
12662  break;
12663  case 'L':
12664  if ( globalUtilOptind >= argc )
12665  {
12666  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
12667  goto usage;
12668  }
12669  pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
12670  globalUtilOptind++;
12671  if ( pParams->nMiteringLimitLast < 0 )
12672  goto usage;
12673  break;
12674  case 'I':
12675  if ( globalUtilOptind >= argc )
12676  {
12677  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
12678  goto usage;
12679  }
12680  pParams->nTotalInspectLimit = atoi(argv[globalUtilOptind]);
12681  globalUtilOptind++;
12682  if ( pParams->nTotalInspectLimit < 0 )
12683  goto usage;
12684  break;
12685  case 'r':
12686  pParams->fUseRewriting ^= 1;
12687  break;
12688  case 'f':
12689  pParams->fUseFraiging ^= 1;
12690  break;
12691  case 'b':
12692  pParams->fUseBdds ^= 1;
12693  break;
12694  case 'v':
12695  pParams->fVerbose ^= 1;
12696  break;
12697  case 'h':
12698  goto usage;
12699  default:
12700  goto usage;
12701  }
12702  }
12703  if ( pNtk == NULL )
12704  {
12705  Abc_Print( -1, "Empty network.\n" );
12706  return 1;
12707  }
12708 
12709  if ( Abc_NtkLatchNum(pNtk) > 0 )
12710  {
12711  Abc_Print( -1, "The network has registers. Use \"dprove\".\n" );
12712  return 1;
12713  }
12714 
12715  clk = Abc_Clock();
12716 
12717  if ( Abc_NtkIsStrash(pNtk) )
12718  pNtkTemp = Abc_NtkDup( pNtk );
12719  else
12720  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
12721 
12722  RetValue = Abc_NtkIvyProve( &pNtkTemp, pParams );
12723 
12724  // verify that the pattern is correct
12725  if ( RetValue == 0 )
12726  {
12727  Abc_Obj_t * pObj;
12728  int i;
12729  int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtkTemp->pModel );
12730  Abc_NtkForEachCo( pNtk, pObj, i )
12731  if ( pSimInfo[i] == 1 )
12732  {
12733  iOut = i;
12734  break;
12735  }
12736  if ( i == Abc_NtkCoNum(pNtk) )
12737  Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
12738  ABC_FREE( pSimInfo );
12739  }
12740  pAbc->Status = RetValue;
12741  if ( RetValue == -1 )
12742  Abc_Print( 1, "UNDECIDED " );
12743  else if ( RetValue == 0 )
12744  Abc_Print( 1, "SATISFIABLE (output = %d) ", iOut );
12745  else
12746  Abc_Print( 1, "UNSATISFIABLE " );
12747  //Abc_Print( -1, "\n" );
12748 
12749  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
12750  // replace the current network
12751  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
12752  // update counter example
12753  if ( RetValue == 0 && Abc_NtkLatchNum(pNtkTemp) == 0 )
12754  {
12755  Abc_Cex_t * pCex = Abc_CexDeriveFromCombModel( pNtkTemp->pModel, Abc_NtkPiNum(pNtkTemp), 0, iOut );
12756  Abc_FrameReplaceCex( pAbc, &pCex );
12757  }
12758  return 0;
12759 
12760 usage:
12761  Abc_Print( -2, "usage: iprove [-NCFGLI num] [-rfbvh]\n" );
12762  Abc_Print( -2, "\t performs CEC using a new method\n" );
12763  Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
12764  Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
12765  Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
12766  Abc_Print( -2, "\t-G num : multiplicative coefficient for fraiging [default = %d]\n", (int)pParams->nFraigingLimitMulti );
12767  Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
12768  Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
12769  Abc_Print( -2, "\t-r : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
12770  Abc_Print( -2, "\t-f : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
12771  Abc_Print( -2, "\t-b : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
12772  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
12773  Abc_Print( -2, "\t-h : print the command usage\n");
12774  return 1;
12775 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
void Prove_ParamsSetDefault(Prove_Params_t *pParams)
FUNCTION DEFINITIONS ///.
Definition: fraigMan.c:46
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
int * pModel
Definition: abc.h:198
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkIvyProve(Abc_Ntk_t **ppNtk, void *pPars)
Definition: abcIvy.c:498
if(last==0)
Definition: sparse_int.h:34
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_INT64_T nTotalInspectLimit
Definition: ivyFraig.c:134
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
#define ABC_FREE(obj)
Definition: abc_global.h:232
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
Abc_Cex_t * Abc_CexDeriveFromCombModel(int *pModel, int nPis, int nRegs, int iPo)
Definition: utilCex.c:173
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
ABC_DLL int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
Definition: abcVerify.c:686
ABC_INT64_T abctime
Definition: abc_global.h:278
int Abc_CommandIResyn ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12130 of file abc.c.

12131 {
12132  Abc_Ntk_t * pNtk, * pNtkRes;
12133  int c, fUpdateLevel, fVerbose;
12134  extern Abc_Ntk_t * Abc_NtkIvyResyn( Abc_Ntk_t * pNtk, int fUpdateLevel, int fVerbose );
12135 
12136  pNtk = Abc_FrameReadNtk(pAbc);
12137  // set defaults
12138  fUpdateLevel = 1;
12139  fVerbose = 0;
12141  while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
12142  {
12143  switch ( c )
12144  {
12145  case 'l':
12146  fUpdateLevel ^= 1;
12147  break;
12148  case 'v':
12149  fVerbose ^= 1;
12150  break;
12151  case 'h':
12152  goto usage;
12153  default:
12154  goto usage;
12155  }
12156  }
12157  if ( pNtk == NULL )
12158  {
12159  Abc_Print( -1, "Empty network.\n" );
12160  return 1;
12161  }
12162  if ( !Abc_NtkIsStrash(pNtk) )
12163  {
12164  Abc_Print( -1, "This command works only for strashed networks.\n" );
12165  return 1;
12166  }
12167 
12168  pNtkRes = Abc_NtkIvyResyn( pNtk, fUpdateLevel, fVerbose );
12169  if ( pNtkRes == NULL )
12170  {
12171  Abc_Print( -1, "Command has failed.\n" );
12172  return 0;
12173  }
12174  // replace the current network
12175  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
12176  return 0;
12177 
12178 usage:
12179  Abc_Print( -2, "usage: iresyn [-lvh]\n" );
12180  Abc_Print( -2, "\t performs combinational resynthesis\n" );
12181  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
12182  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
12183  Abc_Print( -2, "\t-h : print the command usage\n");
12184  return 1;
12185 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Abc_Ntk_t * Abc_NtkIvyResyn(Abc_Ntk_t *pNtk, int fUpdateLevel, int fVerbose)
Definition: abcIvy.c:364
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandIRewrite ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11371 of file abc.c.

11372 {
11373  Abc_Ntk_t * pNtk, * pNtkRes;
11374  int c, fUpdateLevel, fUseZeroCost, fVerbose;
11375  extern Abc_Ntk_t * Abc_NtkIvyRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeroCost, int fVerbose );
11376 
11377  pNtk = Abc_FrameReadNtk(pAbc);
11378  // set defaults
11379  fUpdateLevel = 1;
11380  fUseZeroCost = 0;
11381  fVerbose = 0;
11383  while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
11384  {
11385  switch ( c )
11386  {
11387  case 'l':
11388  fUpdateLevel ^= 1;
11389  break;
11390  case 'z':
11391  fUseZeroCost ^= 1;
11392  break;
11393  case 'v':
11394  fVerbose ^= 1;
11395  break;
11396  case 'h':
11397  goto usage;
11398  default:
11399  goto usage;
11400  }
11401  }
11402  if ( pNtk == NULL )
11403  {
11404  Abc_Print( -1, "Empty network.\n" );
11405  return 1;
11406  }
11407  if ( !Abc_NtkIsStrash(pNtk) )
11408  {
11409  Abc_Print( -1, "This command works only for strashed networks.\n" );
11410  return 1;
11411  }
11412 
11413  pNtkRes = Abc_NtkIvyRewrite( pNtk, fUpdateLevel, fUseZeroCost, fVerbose );
11414  if ( pNtkRes == NULL )
11415  {
11416  Abc_Print( -1, "Command has failed.\n" );
11417  return 0;
11418  }
11419  // replace the current network
11420  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11421  return 0;
11422 
11423 usage:
11424  Abc_Print( -2, "usage: irw [-lzvh]\n" );
11425  Abc_Print( -2, "\t perform combinational AIG rewriting\n" );
11426  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
11427  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
11428  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
11429  Abc_Print( -2, "\t-h : print the command usage\n");
11430  return 1;
11431 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkIvyRewrite(Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeroCost, int fVerbose)
Definition: abcIvy.c:285
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandIRewriteSeq ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12057 of file abc.c.

12058 {
12059  Abc_Ntk_t * pNtk, * pNtkRes;
12060  int c, fUpdateLevel, fUseZeroCost, fVerbose;
12061  extern Abc_Ntk_t * Abc_NtkIvyRewriteSeq( Abc_Ntk_t * pNtk, int fUseZeroCost, int fVerbose );
12062 
12063  pNtk = Abc_FrameReadNtk(pAbc);
12064  // set defaults
12065  fUpdateLevel = 0;
12066  fUseZeroCost = 0;
12067  fVerbose = 0;
12069  while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
12070  {
12071  switch ( c )
12072  {
12073  case 'l':
12074  fUpdateLevel ^= 1;
12075  break;
12076  case 'z':
12077  fUseZeroCost ^= 1;
12078  break;
12079  case 'v':
12080  fVerbose ^= 1;
12081  break;
12082  case 'h':
12083  goto usage;
12084  default:
12085  goto usage;
12086  }
12087  }
12088  if ( pNtk == NULL )
12089  {
12090  Abc_Print( -1, "Empty network.\n" );
12091  return 1;
12092  }
12093  if ( !Abc_NtkIsStrash(pNtk) )
12094  {
12095  Abc_Print( -1, "This command works only for strashed networks.\n" );
12096  return 1;
12097  }
12098 
12099  pNtkRes = Abc_NtkIvyRewriteSeq( pNtk, fUseZeroCost, fVerbose );
12100  if ( pNtkRes == NULL )
12101  {
12102  Abc_Print( -1, "Command has failed.\n" );
12103  return 0;
12104  }
12105  // replace the current network
12106  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
12107  return 0;
12108 
12109 usage:
12110  Abc_Print( -2, "usage: irws [-zvh]\n" );
12111  Abc_Print( -2, "\t perform sequential AIG rewriting\n" );
12112 // Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
12113  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
12114  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
12115  Abc_Print( -2, "\t-h : print the command usage\n");
12116  return 1;
12117 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkIvyRewriteSeq(Abc_Ntk_t *pNtk, int fUseZeroCost, int fVerbose)
Definition: abcIvy.c:311
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandISat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12198 of file abc.c.

12199 {
12200  Abc_Ntk_t * pNtk, * pNtkRes;
12201  int c, fUpdateLevel, fVerbose;
12202  int nConfLimit;
12203 
12204  extern Abc_Ntk_t * Abc_NtkIvySat( Abc_Ntk_t * pNtk, int nConfLimit, int fVerbose );
12205 
12206  pNtk = Abc_FrameReadNtk(pAbc);
12207  // set defaults
12208  nConfLimit = 100000;
12209  fUpdateLevel = 1;
12210  fVerbose = 0;
12212  while ( ( c = Extra_UtilGetopt( argc, argv, "Clzvh" ) ) != EOF )
12213  {
12214  switch ( c )
12215  {
12216  case 'C':
12217  if ( globalUtilOptind >= argc )
12218  {
12219  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
12220  goto usage;
12221  }
12222  nConfLimit = atoi(argv[globalUtilOptind]);
12223  globalUtilOptind++;
12224  if ( nConfLimit < 0 )
12225  goto usage;
12226  break;
12227  case 'l':
12228  fUpdateLevel ^= 1;
12229  break;
12230  case 'v':
12231  fVerbose ^= 1;
12232  break;
12233  case 'h':
12234  goto usage;
12235  default:
12236  goto usage;
12237  }
12238  }
12239  if ( pNtk == NULL )
12240  {
12241  Abc_Print( -1, "Empty network.\n" );
12242  return 1;
12243  }
12244  if ( !Abc_NtkIsStrash(pNtk) )
12245  {
12246  Abc_Print( -1, "This command works only for strashed networks.\n" );
12247  return 1;
12248  }
12249 
12250  pNtkRes = Abc_NtkIvySat( pNtk, nConfLimit, fVerbose );
12251  if ( pNtkRes == NULL )
12252  {
12253  Abc_Print( -1, "Command has failed.\n" );
12254  return 0;
12255  }
12256  // replace the current network
12257  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
12258  return 0;
12259 
12260 usage:
12261  Abc_Print( -2, "usage: isat [-C num] [-vh]\n" );
12262  Abc_Print( -2, "\t tries to prove the miter constant 0\n" );
12263  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
12264 // Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
12265  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
12266  Abc_Print( -2, "\t-h : print the command usage\n");
12267  return 1;
12268 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Abc_Ntk_t * Abc_NtkIvySat(Abc_Ntk_t *pNtk, int nConfLimit, int fVerbose)
Definition: abcIvy.c:389
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandIso ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25205 of file abc.c.

25206 {
25207  Abc_Ntk_t * pNtk, * pNtkNew = NULL;
25208  Aig_Man_t * pAig, * pTemp;
25209  Vec_Ptr_t * vPosEquivs = NULL;
25210  int c, fVerbose = 0;
25212  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
25213  {
25214  switch ( c )
25215  {
25216  case 'v':
25217  fVerbose ^= 1;
25218  break;
25219  case 'h':
25220  goto usage;
25221  default:
25222  Abc_Print( -2, "Unknown switch.\n");
25223  goto usage;
25224  }
25225  }
25226 
25227  // check the main AIG
25228  pNtk = Abc_FrameReadNtk(pAbc);
25229  if ( pNtk == NULL )
25230  {
25231  Abc_Print( 1, "Main AIG: There is no current network.\n");
25232  return 0;
25233  }
25234  if ( !Abc_NtkIsStrash(pNtk) )
25235  {
25236  Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
25237  return 0;
25238  }
25239  if ( Abc_NtkPoNum(pNtk) == 1 )
25240  {
25241  Abc_Print( 1, "Current AIG has only one PO. Transformation is not performed.\n");
25242  return 0;
25243  }
25244 
25245  // transform
25246  pAig = Abc_NtkToDar( pNtk, 0, 1 );
25247  pTemp = Saig_ManIsoReduce( pAig, &vPosEquivs, fVerbose );
25248  pNtkNew = Abc_NtkFromAigPhase( pTemp );
25249  Aig_ManStop( pTemp );
25250  Aig_ManStop( pAig );
25251 
25252  // update the internal storage of PO equivalences
25253  Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
25254 
25255  // replace the current network
25256  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
25257  return 0;
25258 
25259 usage:
25260  Abc_Print( -2, "usage: iso [-vh]\n" );
25261  Abc_Print( -2, "\t removes POs with isomorphic sequential COI\n" );
25262  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
25263  Abc_Print( -2, "\t-h : print the command usage\n");
25264  return 1;
25265 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_FrameReplacePoEquivs(Abc_Frame_t *pAbc, Vec_Ptr_t **pvPoEquivs)
Definition: abc.c:537
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Aig_Man_t * Saig_ManIsoReduce(Aig_Man_t *pAig, Vec_Ptr_t **pvCosEquivs, int fVerbose)
Definition: saigIso.c:561
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandIStrash ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11249 of file abc.c.

11250 {
11251  Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
11252  int c;
11253  extern Abc_Ntk_t * Abc_NtkIvyStrash( Abc_Ntk_t * pNtk );
11254 
11255  pNtk = Abc_FrameReadNtk(pAbc);
11256  // set defaults
11258  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
11259  {
11260  switch ( c )
11261  {
11262  case 'h':
11263  goto usage;
11264  default:
11265  goto usage;
11266  }
11267  }
11268  if ( pNtk == NULL )
11269  {
11270  Abc_Print( -1, "Empty network.\n" );
11271  return 1;
11272  }
11273  if ( !Abc_NtkIsStrash(pNtk) )
11274  {
11275  pNtkTemp = Abc_NtkStrash( pNtk, 0, 1, 0 );
11276  pNtkRes = Abc_NtkIvyStrash( pNtkTemp );
11277  Abc_NtkDelete( pNtkTemp );
11278  }
11279  else
11280  pNtkRes = Abc_NtkIvyStrash( pNtk );
11281  if ( pNtkRes == NULL )
11282  {
11283  Abc_Print( -1, "Command has failed.\n" );
11284  return 0;
11285  }
11286  // replace the current network
11287  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11288  return 0;
11289 
11290 usage:
11291  Abc_Print( -2, "usage: istrash [-h]\n" );
11292  Abc_Print( -2, "\t perform sequential structural hashing\n" );
11293  Abc_Print( -2, "\t-h : print the command usage\n");
11294  return 1;
11295 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
Abc_Ntk_t * Abc_NtkIvyStrash(Abc_Ntk_t *pNtk)
Definition: abcIvy.c:173
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandLcorr ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 18614 of file abc.c.

18615 {
18616  Abc_Ntk_t * pNtk, * pNtkRes;
18617  int c;
18618  int nFramesP;
18619  int nConfMax;
18620  int nVarsMax;
18621  int fNewAlgor;
18622  int fVerbose;
18623  extern Abc_Ntk_t * Abc_NtkDarLcorr( Abc_Ntk_t * pNtk, int nFramesP, int nConfMax, int fVerbose );
18624  extern Abc_Ntk_t * Abc_NtkDarLcorrNew( Abc_Ntk_t * pNtk, int nVarsMax, int nConfMax, int fVerbose );
18625 
18626  pNtk = Abc_FrameReadNtk(pAbc);
18627 
18628 
18629 
18630  // set defaults
18631  nFramesP = 0;
18632  nConfMax = 1000;
18633  nVarsMax = 1000;
18634  fNewAlgor = 1;
18635  fVerbose = 0;
18637  while ( ( c = Extra_UtilGetopt( argc, argv, "PCSnvh" ) ) != EOF )
18638  {
18639  switch ( c )
18640  {
18641  case 'P':
18642  if ( globalUtilOptind >= argc )
18643  {
18644  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
18645  goto usage;
18646  }
18647  nFramesP = atoi(argv[globalUtilOptind]);
18648  globalUtilOptind++;
18649  if ( nFramesP < 0 )
18650  goto usage;
18651  break;
18652  case 'C':
18653  if ( globalUtilOptind >= argc )
18654  {
18655  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
18656  goto usage;
18657  }
18658  nConfMax = atoi(argv[globalUtilOptind]);
18659  globalUtilOptind++;
18660  if ( nConfMax < 0 )
18661  goto usage;
18662  break;
18663  case 'S':
18664  if ( globalUtilOptind >= argc )
18665  {
18666  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
18667  goto usage;
18668  }
18669  nVarsMax = atoi(argv[globalUtilOptind]);
18670  globalUtilOptind++;
18671  if ( nVarsMax < 0 )
18672  goto usage;
18673  break;
18674  case 'n':
18675  fNewAlgor ^= 1;
18676  break;
18677  case 'v':
18678  fVerbose ^= 1;
18679  break;
18680  case 'h':
18681  goto usage;
18682  default:
18683  goto usage;
18684  }
18685  }
18686 
18687  if ( pNtk == NULL )
18688  {
18689  Abc_Print( -1, "Empty network.\n" );
18690  return 1;
18691  }
18692 
18693  if ( Abc_NtkIsComb(pNtk) )
18694  {
18695  Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
18696  return 0;
18697  }
18698 
18699  if ( !Abc_NtkIsStrash(pNtk) )
18700  {
18701  Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
18702  return 0;
18703  }
18704 
18705  // get the new network
18706  if ( fNewAlgor )
18707  pNtkRes = Abc_NtkDarLcorrNew( pNtk, nVarsMax, nConfMax, fVerbose );
18708  else
18709  pNtkRes = Abc_NtkDarLcorr( pNtk, nFramesP, nConfMax, fVerbose );
18710  if ( pNtkRes == NULL )
18711  {
18712  Abc_Print( -1, "Sequential sweeping has failed.\n" );
18713  return 1;
18714  }
18715  // replace the current network
18716  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
18717  return 0;
18718 
18719 usage:
18720  Abc_Print( -2, "usage: lcorr [-PCS num] [-nvh]\n" );
18721  Abc_Print( -2, "\t computes latch correspondence using 1-step induction\n" );
18722  Abc_Print( -2, "\t-P num : number of time frames to use as the prefix [default = %d]\n", nFramesP );
18723  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfMax );
18724  Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", nVarsMax );
18725  Abc_Print( -2, "\t-n : toggle using new algorithm [default = %s]\n", fNewAlgor? "yes": "no" );
18726  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
18727  Abc_Print( -2, "\t-h : print the command usage\n");
18728  return 1;
18729 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Ntk_t * Abc_NtkDarLcorrNew(Abc_Ntk_t *pNtk, int nVarsMax, int nConfMax, int fVerbose)
Definition: abcDar.c:2200
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDarLcorr(Abc_Ntk_t *pNtk, int nFramesP, int nConfMax, int fVerbose)
Definition: abcDar.c:2163
int Abc_CommandLogic ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6579 of file abc.c.

6580 {
6581  Abc_Ntk_t * pNtk, * pNtkRes;
6582  int c;
6583 
6584  pNtk = Abc_FrameReadNtk(pAbc);
6585  // set defaults
6587  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
6588  {
6589  switch ( c )
6590  {
6591  case 'h':
6592  goto usage;
6593  default:
6594  goto usage;
6595  }
6596  }
6597 
6598  if ( pNtk == NULL )
6599  {
6600  Abc_Print( -1, "Empty network.\n" );
6601  return 1;
6602  }
6603 
6604  if ( !Abc_NtkIsStrash( pNtk ) )
6605  {
6606  Abc_Print( -1, "This command is only applicable to strashed networks.\n" );
6607  return 1;
6608  }
6609 
6610  // get the new network
6611  pNtkRes = Abc_NtkToLogic( pNtk );
6612  if ( pNtkRes == NULL )
6613  {
6614  Abc_Print( -1, "Converting to a logic network has failed.\n" );
6615  return 1;
6616  }
6617  // replace the current network
6618  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
6619  return 0;
6620 
6621 usage:
6622  Abc_Print( -2, "usage: logic [-h]\n" );
6623  Abc_Print( -2, "\t transforms an AIG into a logic network with SOPs\n" );
6624  Abc_Print( -2, "\t-h : print the command usage\n");
6625  return 1;
6626 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcNetlist.c:52
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandLutmin ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4389 of file abc.c.

4390 {
4391  Abc_Ntk_t * pNtk, * pNtkRes;
4392  int c;
4393  int nLutSize;
4394  int fVerbose;
4395  extern Abc_Ntk_t * Abc_NtkLutmin( Abc_Ntk_t * pNtk, int nLutSize, int fVerbose );
4396 
4397  pNtk = Abc_FrameReadNtk(pAbc);
4398  // set defaults
4399  nLutSize = 4;
4400  fVerbose = 0;
4402  while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != EOF )
4403  {
4404  switch ( c )
4405  {
4406  case 'K':
4407  if ( globalUtilOptind >= argc )
4408  {
4409  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
4410  goto usage;
4411  }
4412  nLutSize = atoi(argv[globalUtilOptind]);
4413  globalUtilOptind++;
4414  break;
4415  case 'v':
4416  fVerbose ^= 1;
4417  break;
4418  case 'h':
4419  goto usage;
4420  default:
4421  goto usage;
4422  }
4423  }
4424  if ( pNtk == NULL )
4425  {
4426  Abc_Print( -1, "Empty network.\n" );
4427  return 1;
4428  }
4429  // modify the current network
4430  pNtkRes = Abc_NtkLutmin( pNtk, nLutSize, fVerbose );
4431  if ( pNtkRes == NULL )
4432  {
4433  Abc_Print( -1, "The command has failed.\n" );
4434  return 1;
4435  }
4436  // replace the current network
4437  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
4438  return 0;
4439 
4440 usage:
4441  Abc_Print( -2, "usage: lutmin [-K <num>] [-vh]\n" );
4442  Abc_Print( -2, "\t perform FPGA mapping while minimizing the LUT count\n" );
4443  Abc_Print( -2, "\t as described in the paper T. Sasao and A. Mishchenko:\n" );
4444  Abc_Print( -2, "\t \"On the number of LUTs to implement logic functions\".\n" );
4445  Abc_Print( -2, "\t-K <num> : the LUT size to use for the mapping (2 <= num) [default = %d]\n", nLutSize );
4446  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
4447  Abc_Print( -2, "\t-h : print the command usage\n");
4448  return 1;
4449 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Ntk_t * Abc_NtkLutmin(Abc_Ntk_t *pNtkInit, int nLutSize, int fVerbose)
Definition: abcLutmin.c:716
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandLutpack ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4241 of file abc.c.

4242 {
4243  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
4244  Lpk_Par_t Pars, * pPars = &Pars;
4245  int c;
4246 
4247  pNtk = Abc_FrameReadNtk(pAbc);
4248  // set defaults
4249  memset( pPars, 0, sizeof(Lpk_Par_t) );
4250  pPars->nLutsMax = 4; // (N) the maximum number of LUTs in the structure
4251  pPars->nLutsOver = 3; // (Q) the maximum number of LUTs not in the MFFC
4252  pPars->nVarsShared = 0; // (S) the maximum number of shared variables (crossbars)
4253  pPars->nGrowthLevel = 0; // (L) the maximum number of increased levels
4254  pPars->fSatur = 1;
4255  pPars->fZeroCost = 0;
4256  pPars->fFirst = 0;
4257  pPars->fOldAlgo = 0;
4258  pPars->fVerbose = 0;
4259  pPars->fVeryVerbose = 0;
4261  while ( ( c = Extra_UtilGetopt( argc, argv, "NQSLszfovwh" ) ) != EOF )
4262  {
4263  switch ( c )
4264  {
4265  case 'N':
4266  if ( globalUtilOptind >= argc )
4267  {
4268  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
4269  goto usage;
4270  }
4271  pPars->nLutsMax = atoi(argv[globalUtilOptind]);
4272  globalUtilOptind++;
4273  if ( pPars->nLutsMax < 2 || pPars->nLutsMax > 8 )
4274  goto usage;
4275  break;
4276  case 'Q':
4277  if ( globalUtilOptind >= argc )
4278  {
4279  Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
4280  goto usage;
4281  }
4282  pPars->nLutsOver = atoi(argv[globalUtilOptind]);
4283  globalUtilOptind++;
4284  if ( pPars->nLutsOver < 0 || pPars->nLutsOver > 8 )
4285  goto usage;
4286  break;
4287  case 'S':
4288  if ( globalUtilOptind >= argc )
4289  {
4290  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
4291  goto usage;
4292  }
4293  pPars->nVarsShared = atoi(argv[globalUtilOptind]);
4294  globalUtilOptind++;
4295  if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 4 )
4296  goto usage;
4297  break;
4298  case 'L':
4299  if ( globalUtilOptind >= argc )
4300  {
4301  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
4302  goto usage;
4303  }
4304  pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
4305  globalUtilOptind++;
4306  if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
4307  goto usage;
4308  break;
4309  case 's':
4310  pPars->fSatur ^= 1;
4311  break;
4312  case 'z':
4313  pPars->fZeroCost ^= 1;
4314  break;
4315  case 'f':
4316  pPars->fFirst ^= 1;
4317  break;
4318  case 'o':
4319  pPars->fOldAlgo ^= 1;
4320  break;
4321  case 'v':
4322  pPars->fVerbose ^= 1;
4323  break;
4324  case 'w':
4325  pPars->fVeryVerbose ^= 1;
4326  break;
4327  case 'h':
4328  goto usage;
4329  default:
4330  goto usage;
4331  }
4332  }
4333 
4334  if ( pNtk == NULL )
4335  {
4336  Abc_Print( -1, "Empty network.\n" );
4337  return 1;
4338  }
4339  if ( !Abc_NtkIsLogic(pNtk) )
4340  {
4341  Abc_Print( -1, "This command can only be applied to a logic network.\n" );
4342  return 1;
4343  }
4344  if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 3 )
4345  {
4346  Abc_Print( -1, "The number of shared variables (%d) is not in the range 0 <= S <= 3.\n", pPars->nVarsShared );
4347  return 1;
4348  }
4349 
4350  // modify the current network
4351  if ( !Lpk_Resynthesize( pNtk, pPars ) )
4352  {
4353  Abc_Print( -1, "Resynthesis has failed.\n" );
4354  return 1;
4355  }
4356  return 0;
4357 
4358 usage:
4359  Abc_Print( -2, "usage: lutpack [-NQSL <num>] [-szfovwh]\n" );
4360  Abc_Print( -2, "\t performs \"rewriting\" for LUT network;\n" );
4361  Abc_Print( -2, "\t determines LUT size as the max fanin count of a node;\n" );
4362  Abc_Print( -2, "\t if the network is not LUT-mapped, packs it into 6-LUTs\n" );
4363  Abc_Print( -2, "\t (there is another command for resynthesis after LUT mapping, \"imfs\")\n" );
4364  Abc_Print( -2, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
4365  Abc_Print( -2, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
4366  Abc_Print( -2, "\t-S <num> : the max number of LUT inputs shared (0 <= num <= 3) [default = %d]\n", pPars->nVarsShared );
4367  Abc_Print( -2, "\t-L <num> : max level increase after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
4368  Abc_Print( -2, "\t-s : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
4369  Abc_Print( -2, "\t-z : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
4370  Abc_Print( -2, "\t-f : toggle using only first node and first cut [default = %s]\n", pPars->fFirst? "yes": "no" );
4371  Abc_Print( -2, "\t-o : toggle using old implementation [default = %s]\n", pPars->fOldAlgo? "yes": "no" );
4372  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
4373  Abc_Print( -2, "\t-w : toggle detailed printout of decomposed functions [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
4374  Abc_Print( -2, "\t-h : print the command usage\n");
4375  return 1;
4376 }
char * memset()
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
int Lpk_Resynthesize(Abc_Ntk_t *pNtk, Lpk_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: lpkCore.c:505
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Lpk_Par_t_ Lpk_Par_t
INCLUDES ///.
Definition: lpk.h:42
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
int Abc_CommandMap ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14315 of file abc.c.

14316 {
14317  Abc_Ntk_t * pNtk, * pNtkRes;
14318  char Buffer[100];
14319  double DelayTarget;
14320  double AreaMulti;
14321  double DelayMulti;
14322  float LogFan = 0;
14323  float Slew = 0; // choose based on the library
14324  float Gain = 250;
14325  int nGatesMin = 4;
14326  int fAreaOnly;
14327  int fRecovery;
14328  int fSweep;
14329  int fSwitching;
14330  int fVerbose;
14331  int c;
14332  extern Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti, double DelayMulti, float LogFan, float Slew, float Gain, int nGatesMin, int fRecovery, int fSwitching, int fVerbose );
14333  extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
14334 
14335  pNtk = Abc_FrameReadNtk(pAbc);
14336  // set defaults
14337  DelayTarget =-1;
14338  AreaMulti = 0;
14339  DelayMulti = 0;
14340  fAreaOnly = 0;
14341  fRecovery = 1;
14342  fSweep = 0;
14343  fSwitching = 0;
14344  fVerbose = 0;
14346  while ( ( c = Extra_UtilGetopt( argc, argv, "DABFSGMarspvh" ) ) != EOF )
14347  {
14348  switch ( c )
14349  {
14350  case 'D':
14351  if ( globalUtilOptind >= argc )
14352  {
14353  Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
14354  goto usage;
14355  }
14356  DelayTarget = (float)atof(argv[globalUtilOptind]);
14357  globalUtilOptind++;
14358  if ( DelayTarget <= 0.0 )
14359  goto usage;
14360  break;
14361  case 'A':
14362  if ( globalUtilOptind >= argc )
14363  {
14364  Abc_Print( -1, "Command line switch \"-A\" should be followed by a floating point number.\n" );
14365  goto usage;
14366  }
14367  AreaMulti = (float)atof(argv[globalUtilOptind]);
14368  globalUtilOptind++;
14369  break;
14370  case 'B':
14371  if ( globalUtilOptind >= argc )
14372  {
14373  Abc_Print( -1, "Command line switch \"-B\" should be followed by a floating point number.\n" );
14374  goto usage;
14375  }
14376  DelayMulti = (float)atof(argv[globalUtilOptind]);
14377  globalUtilOptind++;
14378  break;
14379  case 'F':
14380  if ( globalUtilOptind >= argc )
14381  {
14382  Abc_Print( -1, "Command line switch \"-F\" should be followed by a floating point number.\n" );
14383  goto usage;
14384  }
14385  LogFan = (float)atof(argv[globalUtilOptind]);
14386  globalUtilOptind++;
14387  if ( LogFan < 0.0 )
14388  goto usage;
14389  break;
14390  case 'S':
14391  if ( globalUtilOptind >= argc )
14392  {
14393  Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
14394  goto usage;
14395  }
14396  Slew = (float)atof(argv[globalUtilOptind]);
14397  globalUtilOptind++;
14398  if ( Slew <= 0.0 )
14399  goto usage;
14400  break;
14401  case 'G':
14402  if ( globalUtilOptind >= argc )
14403  {
14404  Abc_Print( -1, "Command line switch \"-G\" should be followed by a floating point number.\n" );
14405  goto usage;
14406  }
14407  Gain = (float)atof(argv[globalUtilOptind]);
14408  globalUtilOptind++;
14409  if ( Gain <= 0.0 )
14410  goto usage;
14411  break;
14412  case 'M':
14413  if ( globalUtilOptind >= argc )
14414  {
14415  Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
14416  goto usage;
14417  }
14418  nGatesMin = atoi(argv[globalUtilOptind]);
14419  globalUtilOptind++;
14420  if ( nGatesMin < 0 )
14421  goto usage;
14422  break;
14423  case 'a':
14424  fAreaOnly ^= 1;
14425  break;
14426  case 'r':
14427  fRecovery ^= 1;
14428  break;
14429  case 's':
14430  fSweep ^= 1;
14431  break;
14432  case 'p':
14433  fSwitching ^= 1;
14434  break;
14435  case 'v':
14436  fVerbose ^= 1;
14437  break;
14438  case 'h':
14439  goto usage;
14440  default:
14441  goto usage;
14442  }
14443  }
14444 
14445  if ( pNtk == NULL )
14446  {
14447  Abc_Print( -1, "Empty network.\n" );
14448  return 1;
14449  }
14450 
14451  if ( fAreaOnly )
14452  DelayTarget = ABC_INFINITY;
14453 
14454  if ( !Abc_NtkIsStrash(pNtk) )
14455  {
14456  pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
14457  if ( pNtk == NULL )
14458  {
14459  Abc_Print( -1, "Strashing before mapping has failed.\n" );
14460  return 1;
14461  }
14462  pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
14463  Abc_NtkDelete( pNtkRes );
14464  if ( pNtk == NULL )
14465  {
14466  Abc_Print( -1, "Balancing before mapping has failed.\n" );
14467  return 1;
14468  }
14469  Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
14470  // get the new network
14471  pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, DelayMulti, LogFan, Slew, Gain, nGatesMin, fRecovery, fSwitching, fVerbose );
14472  if ( pNtkRes == NULL )
14473  {
14474  Abc_NtkDelete( pNtk );
14475  Abc_Print( -1, "Mapping has failed.\n" );
14476  return 1;
14477  }
14478  Abc_NtkDelete( pNtk );
14479  }
14480  else
14481  {
14482  // get the new network
14483  pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, DelayMulti, LogFan, Slew, Gain, nGatesMin, fRecovery, fSwitching, fVerbose );
14484  if ( pNtkRes == NULL )
14485  {
14486  Abc_Print( -1, "Mapping has failed.\n" );
14487  return 1;
14488  }
14489  }
14490 
14491  if ( fSweep )
14492  {
14493  Abc_NtkFraigSweep( pNtkRes, 0, 0, 0, 0 );
14494  if ( Abc_NtkHasMapping(pNtkRes) )
14495  {
14496  pNtkRes = Abc_NtkDupDfs( pNtk = pNtkRes );
14497  Abc_NtkDelete( pNtk );
14498  }
14499  }
14500 
14501  // replace the current network
14502  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
14503  return 0;
14504 
14505 usage:
14506  if ( DelayTarget == -1 )
14507  sprintf(Buffer, "not used" );
14508  else
14509  sprintf(Buffer, "%.3f", DelayTarget );
14510  Abc_Print( -2, "usage: map [-DABFSG float] [-M num] [-arspvh]\n" );
14511  Abc_Print( -2, "\t performs standard cell mapping of the current network\n" );
14512  Abc_Print( -2, "\t-D float : sets the global required times [default = %s]\n", Buffer );
14513  Abc_Print( -2, "\t-A float : \"area multiplier\" to bias gate selection [default = %.2f]\n", AreaMulti );
14514  Abc_Print( -2, "\t-B float : \"delay multiplier\" to bias gate selection [default = %.2f]\n", DelayMulti );
14515  Abc_Print( -2, "\t-F float : the logarithmic fanout delay parameter [default = %.2f]\n", LogFan );
14516  Abc_Print( -2, "\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
14517  Abc_Print( -2, "\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
14518  Abc_Print( -2, "\t-M num : skip gate classes whose size is less than this [default = %d]\n", nGatesMin );
14519  Abc_Print( -2, "\t-a : toggles area-only mapping [default = %s]\n", fAreaOnly? "yes": "no" );
14520  Abc_Print( -2, "\t-r : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
14521  Abc_Print( -2, "\t-s : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
14522  Abc_Print( -2, "\t-p : optimizes power by minimizing switching [default = %s]\n", fSwitching? "yes": "no" );
14523  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
14524  Abc_Print( -2, "\t-h : print the command usage\n");
14525  return 1;
14526 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
Definition: abc.h:256
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Abc_NtkFraigSweep(Abc_Ntk_t *pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcSweep.c:60
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_NtkDupDfs(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:476
double atof()
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition: abcBalance.c:53
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
Abc_Ntk_t * Abc_NtkMap(Abc_Ntk_t *pNtk, double DelayTarget, double AreaMulti, double DelayMulti, float LogFan, float Slew, float Gain, int nGatesMin, int fRecovery, int fSwitching, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcMap.c:59
int Abc_CommandMatch ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21171 of file abc.c.

21172 {
21173  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
21174  int fDelete1, fDelete2;
21175  char ** pArgvNew;
21176  int nArgcNew, c;
21177  int fMiter;
21178  int nDist;
21179  int fVerbose;
21180 
21181  extern Abc_Ntk_t * Abc_NtkDarMatch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nDist, int fVerbose );
21182 
21183  pNtk = Abc_FrameReadNtk(pAbc);
21184  // set defaults
21185  fMiter = 0;
21186  nDist = 0;
21187  fVerbose = 1;
21189  while ( ( c = Extra_UtilGetopt( argc, argv, "Dmvh" ) ) != EOF )
21190  {
21191  switch ( c )
21192  {
21193  case 'D':
21194  if ( globalUtilOptind >= argc )
21195  {
21196  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
21197  goto usage;
21198  }
21199  nDist = atoi(argv[globalUtilOptind]);
21200  globalUtilOptind++;
21201  if ( nDist < 0 )
21202  goto usage;
21203  break;
21204  case 'm':
21205  fMiter ^= 1;
21206  break;
21207  case 'v':
21208  fVerbose ^= 1;
21209  break;
21210  default:
21211  goto usage;
21212  }
21213  }
21214 
21215  if ( fMiter )
21216  {
21217 // Abc_Ntk_t * pNtkA, * pNtkB;
21218  if ( !Abc_NtkIsStrash(pNtk) )
21219  {
21220  Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
21221  return 0;
21222  }
21223  pNtkRes = Abc_NtkDarMatch( pNtk, NULL, nDist, fVerbose );
21224 /*
21225  pNtkA = Abc_NtkDup( pNtk );
21226  pNtkB = Abc_NtkDup( pNtk );
21227  Abc_NtkDarSimSec( pNtkA, pNtkB, pPars );
21228  Abc_NtkDelete( pNtkA );
21229  Abc_NtkDelete( pNtkB );
21230 */
21231  }
21232  else
21233  {
21234  pArgvNew = argv + globalUtilOptind;
21235  nArgcNew = argc - globalUtilOptind;
21236  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
21237  return 1;
21238  if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
21239  {
21240  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
21241  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
21242  Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
21243  return 0;
21244  }
21245  // perform verification
21246  pNtkRes = Abc_NtkDarMatch( pNtk1, pNtk2, nDist, fVerbose );
21247  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
21248  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
21249  }
21250  if ( pNtkRes == NULL )
21251  {
21252  Abc_Print( -1, "Matching has failed.\n" );
21253  return 1;
21254  }
21255  // replace the current network
21256  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
21257  return 0;
21258 
21259 usage:
21260  Abc_Print( -2, "usage: match [-D num] [-mv] <file1> <file2>\n" );
21261  Abc_Print( -2, "\t detects structural similarity using simulation\n" );
21262  Abc_Print( -2, "\t replaces the current network by the miter of differences\n" );
21263  Abc_Print( -2, "\t-D num : the distance for extending differences [default = %d]\n", nDist );
21264  Abc_Print( -2, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
21265  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
21266  Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
21267  Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
21268  Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
21269  Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
21270  return 1;
21271 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
Abc_Ntk_t * Abc_NtkDarMatch(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nDist, int fVerbose)
Definition: abcDar.c:3151
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandMfs ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4590 of file abc.c.

4591 {
4592  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
4593  Mfs_Par_t Pars, * pPars = &Pars;
4594  int c;
4595  // set defaults
4596  Abc_NtkMfsParsDefault( pPars );
4598  while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCdraestpgvwh" ) ) != EOF )
4599  {
4600  switch ( c )
4601  {
4602  case 'W':
4603  if ( globalUtilOptind >= argc )
4604  {
4605  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
4606  goto usage;
4607  }
4608  pPars->nWinTfoLevs = atoi(argv[globalUtilOptind]);
4609  globalUtilOptind++;
4610  if ( pPars->nWinTfoLevs < 0 )
4611  goto usage;
4612  break;
4613  case 'F':
4614  if ( globalUtilOptind >= argc )
4615  {
4616  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
4617  goto usage;
4618  }
4619  pPars->nFanoutsMax = atoi(argv[globalUtilOptind]);
4620  globalUtilOptind++;
4621  if ( pPars->nFanoutsMax < 0 )
4622  goto usage;
4623  break;
4624  case 'D':
4625  if ( globalUtilOptind >= argc )
4626  {
4627  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
4628  goto usage;
4629  }
4630  pPars->nDepthMax = atoi(argv[globalUtilOptind]);
4631  globalUtilOptind++;
4632  if ( pPars->nDepthMax < 0 )
4633  goto usage;
4634  break;
4635  case 'M':
4636  if ( globalUtilOptind >= argc )
4637  {
4638  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
4639  goto usage;
4640  }
4641  pPars->nWinMax = atoi(argv[globalUtilOptind]);
4642  globalUtilOptind++;
4643  if ( pPars->nWinMax < 0 )
4644  goto usage;
4645  break;
4646  case 'L':
4647  if ( globalUtilOptind >= argc )
4648  {
4649  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
4650  goto usage;
4651  }
4652  pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
4653  globalUtilOptind++;
4654  if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
4655  goto usage;
4656  break;
4657  case 'C':
4658  if ( globalUtilOptind >= argc )
4659  {
4660  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
4661  goto usage;
4662  }
4663  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
4664  globalUtilOptind++;
4665  if ( pPars->nBTLimit < 0 )
4666  goto usage;
4667  break;
4668  case 'd':
4669  pPars->fRrOnly ^= 1;
4670  break;
4671  case 'r':
4672  pPars->fResub ^= 1;
4673  break;
4674  case 'a':
4675  pPars->fArea ^= 1;
4676  break;
4677  case 'e':
4678  pPars->fMoreEffort ^= 1;
4679  break;
4680  case 's':
4681  pPars->fSwapEdge ^= 1;
4682  break;
4683  case 't':
4684  pPars->fOneHotness ^= 1;
4685  break;
4686  case 'p':
4687  pPars->fPower ^= 1;
4688  break;
4689  case 'g':
4690  pPars->fGiaSat ^= 1;
4691  break;
4692  case 'v':
4693  pPars->fVerbose ^= 1;
4694  break;
4695  case 'w':
4696  pPars->fVeryVerbose ^= 1;
4697  break;
4698  case 'h':
4699  goto usage;
4700  default:
4701  goto usage;
4702  }
4703  }
4704 
4705  if ( pNtk == NULL )
4706  {
4707  Abc_Print( -1, "Empty network.\n" );
4708  return 1;
4709  }
4710  if ( !Abc_NtkIsLogic(pNtk) )
4711  {
4712  Abc_Print( -1, "This command can only be applied to a logic network.\n" );
4713  return 1;
4714  }
4715 
4716  // modify the current network
4717  if ( !Abc_NtkMfs( pNtk, pPars ) )
4718  {
4719  Abc_Print( -1, "Resynthesis has failed.\n" );
4720  return 1;
4721  }
4722  return 0;
4723 
4724 usage:
4725  Abc_Print( -2, "usage: mfs [-WFDMLC <num>] [-draestpgvh]\n" );
4726  Abc_Print( -2, "\t performs don't-care-based optimization of logic networks\n" );
4727  Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
4728  Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
4729  Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
4730  Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinMax );
4731  Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
4732  Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
4733  Abc_Print( -2, "\t-d : toggle performing redundancy removal [default = %s]\n", pPars->fRrOnly? "yes": "no" );
4734  Abc_Print( -2, "\t-r : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
4735  Abc_Print( -2, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
4736  Abc_Print( -2, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
4737  Abc_Print( -2, "\t-s : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
4738  Abc_Print( -2, "\t-t : toggle using artificial one-hotness conditions [default = %s]\n", pPars->fOneHotness? "yes": "no" );
4739  Abc_Print( -2, "\t-p : toggle power-aware optimization [default = %s]\n", pPars->fPower? "yes": "no" );
4740  Abc_Print( -2, "\t-g : toggle using new SAT solver [default = %s]\n", pPars->fGiaSat? "yes": "no" );
4741  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
4742  Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
4743  Abc_Print( -2, "\t-h : print the command usage\n");
4744  return 1;
4745 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
typedefABC_NAMESPACE_HEADER_START struct Mfs_Par_t_ Mfs_Par_t
INCLUDES ///.
Definition: mfs.h:42
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkMfsParsDefault(Mfs_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: mfsCore.c:47
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_NtkMfs(Abc_Ntk_t *pNtk, Mfs_Par_t *pPars)
Definition: mfsCore.c:377
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
int Abc_CommandMfs2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4758 of file abc.c.

4759 {
4760  extern int Abc_NtkPerformMfs( Abc_Ntk_t * pNtk, Sfm_Par_t * pPars );
4761  extern int Abc_NtkMfsAfterICheck( Abc_Ntk_t * p, int nFrames, int nFramesAdd, Vec_Int_t * vFlops, Sfm_Par_t * pPars );
4762  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
4763  Sfm_Par_t Pars, * pPars = &Pars;
4764  int c, fIndDCs = 0, fUseAllFfs = 0, nFramesAdd = 0;
4765  // set defaults
4766  Sfm_ParSetDefault( pPars );
4768  while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCZNIdaeijvwh" ) ) != EOF )
4769  {
4770  switch ( c )
4771  {
4772  case 'W':
4773  if ( globalUtilOptind >= argc )
4774  {
4775  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
4776  goto usage;
4777  }
4778  pPars->nTfoLevMax = atoi(argv[globalUtilOptind]);
4779  globalUtilOptind++;
4780  if ( pPars->nTfoLevMax < 0 )
4781  goto usage;
4782  break;
4783  case 'F':
4784  if ( globalUtilOptind >= argc )
4785  {
4786  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
4787  goto usage;
4788  }
4789  pPars->nFanoutMax = atoi(argv[globalUtilOptind]);
4790  globalUtilOptind++;
4791  if ( pPars->nFanoutMax < 0 )
4792  goto usage;
4793  break;
4794  case 'D':
4795  if ( globalUtilOptind >= argc )
4796  {
4797  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
4798  goto usage;
4799  }
4800  pPars->nDepthMax = atoi(argv[globalUtilOptind]);
4801  globalUtilOptind++;
4802  if ( pPars->nDepthMax < 0 )
4803  goto usage;
4804  break;
4805  case 'M':
4806  if ( globalUtilOptind >= argc )
4807  {
4808  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
4809  goto usage;
4810  }
4811  pPars->nWinSizeMax = atoi(argv[globalUtilOptind]);
4812  globalUtilOptind++;
4813  if ( pPars->nWinSizeMax < 0 )
4814  goto usage;
4815  break;
4816  case 'L':
4817  if ( globalUtilOptind >= argc )
4818  {
4819  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
4820  goto usage;
4821  }
4822  pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
4823  globalUtilOptind++;
4824  if ( pPars->nGrowthLevel < -ABC_INFINITY || pPars->nGrowthLevel > ABC_INFINITY )
4825  goto usage;
4826  break;
4827  case 'C':
4828  if ( globalUtilOptind >= argc )
4829  {
4830  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
4831  goto usage;
4832  }
4833  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
4834  globalUtilOptind++;
4835  if ( pPars->nBTLimit < 0 )
4836  goto usage;
4837  break;
4838  case 'Z':
4839  if ( globalUtilOptind >= argc )
4840  {
4841  Abc_Print( -1, "Command line switch \"-Z\" should be followed by an integer.\n" );
4842  goto usage;
4843  }
4844  pPars->nFirstFixed = atoi(argv[globalUtilOptind]);
4845  globalUtilOptind++;
4846  if ( pPars->nFirstFixed < 0 )
4847  goto usage;
4848  break;
4849  case 'N':
4850  if ( globalUtilOptind >= argc )
4851  {
4852  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
4853  goto usage;
4854  }
4855  pPars->nNodesMax = atoi(argv[globalUtilOptind]);
4856  globalUtilOptind++;
4857  if ( pPars->nNodesMax < 0 )
4858  goto usage;
4859  break;
4860  case 'I':
4861  if ( globalUtilOptind >= argc )
4862  {
4863  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
4864  goto usage;
4865  }
4866  nFramesAdd = atoi(argv[globalUtilOptind]);
4867  globalUtilOptind++;
4868  if ( nFramesAdd < 0 )
4869  goto usage;
4870  break;
4871  case 'd':
4872  pPars->fRrOnly ^= 1;
4873  break;
4874  case 'a':
4875  pPars->fArea ^= 1;
4876  break;
4877  case 'e':
4878  pPars->fMoreEffort ^= 1;
4879  break;
4880  case 'i':
4881  fIndDCs ^= 1;
4882  break;
4883  case 'j':
4884  fUseAllFfs ^= 1;
4885  break;
4886  case 'v':
4887  pPars->fVerbose ^= 1;
4888  break;
4889  case 'w':
4890  pPars->fVeryVerbose ^= 1;
4891  break;
4892  case 'h':
4893  goto usage;
4894  default:
4895  goto usage;
4896  }
4897  }
4898  if ( pNtk == NULL )
4899  {
4900  Abc_Print( -1, "Empty network.\n" );
4901  return 1;
4902  }
4903  if ( !Abc_NtkIsLogic(pNtk) )
4904  {
4905  Abc_Print( -1, "This command can only be applied to a logic network.\n" );
4906  return 1;
4907  }
4908  if ( fIndDCs )
4909  {
4910  if ( fUseAllFfs )
4911  {
4912  pAbc->nIndFrames = 1;
4913  Vec_IntFreeP( &pAbc->vIndFlops );
4914  pAbc->vIndFlops = Vec_IntAlloc( Abc_NtkLatchNum(pNtk) );
4915  Vec_IntFill( pAbc->vIndFlops, Abc_NtkLatchNum(pNtk), 1 );
4916  }
4917  if ( pAbc->nIndFrames <= 0 )
4918  {
4919  Abc_Print( -1, "The number of k-inductive frames is not specified.\n" );
4920  return 0;
4921  }
4922  if ( pAbc->vIndFlops == NULL )
4923  {
4924  Abc_Print( -1, "The set of k-inductive flops is not specified.\n" );
4925  return 0;
4926  }
4927  if ( Vec_IntSize(pAbc->vIndFlops) != Abc_NtkLatchNum(pNtk) )
4928  {
4929  Abc_Print( -1, "The saved flop count (%d) does not match that of the current network (%d).\n",
4930  Vec_IntSize(pAbc->vIndFlops), Abc_NtkLatchNum(pNtk) );
4931  return 0;
4932  }
4933  // modify the current network
4934  if ( !Abc_NtkMfsAfterICheck( pNtk, pAbc->nIndFrames, nFramesAdd, pAbc->vIndFlops, pPars ) )
4935  {
4936  Abc_Print( -1, "Resynthesis has failed.\n" );
4937  return 1;
4938  }
4939  if ( fUseAllFfs )
4940  {
4941  pAbc->nIndFrames = 0;
4942  Vec_IntFreeP( &pAbc->vIndFlops );
4943  }
4944  }
4945  else
4946  {
4947  // modify the current network
4948  if ( !Abc_NtkPerformMfs( pNtk, pPars ) )
4949  {
4950  Abc_Print( -1, "Resynthesis has failed.\n" );
4951  return 1;
4952  }
4953  }
4954  return 0;
4955 
4956 usage:
4957  Abc_Print( -2, "usage: mfs2 [-WFDMLCZNI <num>] [-daeijvwh]\n" );
4958  Abc_Print( -2, "\t performs don't-care-based optimization of logic networks\n" );
4959  Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nTfoLevMax );
4960  Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutMax );
4961  Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
4962  Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinSizeMax );
4963  Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
4964  Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
4965  Abc_Print( -2, "\t-Z <num> : treat the first <num> logic nodes as fixed (0 = none) [default = %d]\n", pPars->nFirstFixed );
4966  Abc_Print( -2, "\t-N <num> : the max number of nodes to try (0 = all) [default = %d]\n", pPars->nNodesMax );
4967  Abc_Print( -2, "\t-d : toggle performing redundancy removal [default = %s]\n", pPars->fRrOnly? "yes": "no" );
4968  Abc_Print( -2, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
4969  Abc_Print( -2, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
4970  Abc_Print( -2, "\t-i : toggle using inductive don't-cares [default = %s]\n", fIndDCs? "yes": "no" );
4971  Abc_Print( -2, "\t-j : toggle using all flops when \"-i\" is enabled [default = %s]\n", fUseAllFfs? "yes": "no" );
4972  Abc_Print( -2, "\t-I : the number of additional frames inserted [default = %d]\n", nFramesAdd );
4973  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
4974  Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
4975  Abc_Print( -2, "\t-h : print the command usage\n");
4976  return 1;
4977 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
int fRrOnly
Definition: sfm.h:53
int Abc_NtkPerformMfs(Abc_Ntk_t *pNtk, Sfm_Par_t *pPars)
Definition: abcMfs.c:255
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int nNodesMax
Definition: sfm.h:51
int nFirstFixed
Definition: sfm.h:52
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int nBTLimit
Definition: sfm.h:50
Definition: sfm.h:43
int fArea
Definition: sfm.h:54
void Sfm_ParSetDefault(Sfm_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: sfmCore.c:45
int fMoreEffort
Definition: sfm.h:55
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int nDepthMax
Definition: sfm.h:47
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
int nGrowthLevel
Definition: sfm.h:49
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
int nTfoLevMax
Definition: sfm.h:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int fVerbose
Definition: sfm.h:56
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int fVeryVerbose
Definition: sfm.h:57
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
int nWinSizeMax
Definition: sfm.h:48
int Abc_NtkMfsAfterICheck(Abc_Ntk_t *p, int nFrames, int nFramesAdd, Vec_Int_t *vFlops, Sfm_Par_t *pPars)
Definition: abcMfs.c:430
int nFanoutMax
Definition: sfm.h:46
int Abc_CommandMinisat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13299 of file abc.c.

13300 {
13301 #ifdef USE_MINISAT22
13302  extern int MainSat(int argc, char** argv);
13303  MainSat( argc, argv );
13304 #else
13305  printf( "This command is currently disabled.\n" );
13306 #endif
13307  return 1;
13308 }
int MainSat(int argc, char **argv)
Definition: MainSat.cpp:71
int Abc_CommandMinisimp ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Definition at line 13309 of file abc.c.

13310 {
13311 #ifdef USE_MINISAT22
13312  extern int MainSimp(int argc, char** argv);
13313  MainSimp( argc, argv );
13314 #else
13315  printf( "This command is currently disabled.\n" );
13316 #endif
13317  return 1;
13318 }
int MainSimp(int argc, char **argv)
Definition: MainSimp.cpp:61
int Abc_CommandMiter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6723 of file abc.c.

6724 {
6725  char Buffer[32];
6726  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
6727  int fDelete1, fDelete2;
6728  char ** pArgvNew;
6729  int nArgcNew;
6730  int c;
6731  int fCheck;
6732  int fComb;
6733  int fImplic;
6734  int fMulti;
6735  int nPartSize;
6736  int fTrans;
6737  int fIgnoreNames;
6738 
6739  pNtk = Abc_FrameReadNtk(pAbc);
6740 
6741  // set defaults
6742  fComb = 0;
6743  fCheck = 1;
6744  fImplic = 0;
6745  fMulti = 0;
6746  nPartSize = 0;
6747  fTrans = 0;
6748  fIgnoreNames = 0;
6750  while ( ( c = Extra_UtilGetopt( argc, argv, "Pcmitnh" ) ) != EOF )
6751  {
6752  switch ( c )
6753  {
6754  case 'P':
6755  if ( globalUtilOptind >= argc )
6756  {
6757  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
6758  goto usage;
6759  }
6760  nPartSize = atoi(argv[globalUtilOptind]);
6761  globalUtilOptind++;
6762  if ( nPartSize < 0 )
6763  goto usage;
6764  break;
6765  case 'c':
6766  fComb ^= 1;
6767  break;
6768  case 'm':
6769  fMulti ^= 1;
6770  break;
6771  case 'i':
6772  fImplic ^= 1;
6773  break;
6774  case 't':
6775  fTrans ^= 1;
6776  break;
6777  case 'n':
6778  fIgnoreNames ^= 1;
6779  break;
6780  default:
6781  goto usage;
6782  }
6783  }
6784 
6785  if ( fTrans )
6786  {
6787  if ( (Abc_NtkPoNum(pNtk) & 1) == 1 )
6788  {
6789  Abc_Print( -1, "Abc_CommandMiter(): The number of outputs should be even.\n" );
6790  return 0;
6791  }
6792  // replace the current network
6793  pNtkRes = Abc_NtkDupTransformMiter( pNtk );
6794  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
6795  Abc_Print( 1, "The miter (current network) is transformed by XORing POs pair-wise.\n" );
6796  return 0;
6797  }
6798 
6799  pArgvNew = argv + globalUtilOptind;
6800  nArgcNew = argc - globalUtilOptind;
6801  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
6802  return 1;
6803 
6804  if ( fIgnoreNames )
6805  {
6806  if ( !fDelete1 )
6807  {
6808  pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
6809  fDelete1 = 1;
6810  }
6811  if ( !fDelete2 )
6812  {
6813  pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
6814  fDelete2 = 1;
6815  }
6816  Abc_NtkShortNames( pNtk1 );
6817  Abc_NtkShortNames( pNtk2 );
6818  }
6819  // compute the miter
6820  pNtkRes = Abc_NtkMiter( pNtk1, pNtk2, fComb, nPartSize, fImplic, fMulti );
6821  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
6822  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
6823 
6824  // get the new network
6825  if ( pNtkRes == NULL )
6826  {
6827  Abc_Print( -1, "Miter computation has failed.\n" );
6828  return 0;
6829  }
6830  // replace the current network
6831  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
6832  return 0;
6833 
6834 usage:
6835  if ( nPartSize == 0 )
6836  strcpy( Buffer, "unused" );
6837  else
6838  sprintf(Buffer, "%d", nPartSize );
6839  Abc_Print( -2, "usage: miter [-P <num>] [-cimtnh] <file1> <file2>\n" );
6840  Abc_Print( -2, "\t computes the miter of the two circuits\n" );
6841  Abc_Print( -2, "\t-P <num> : output partition size [default = %s]\n", Buffer );
6842  Abc_Print( -2, "\t-c : toggles deriving combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
6843  Abc_Print( -2, "\t-i : toggles deriving implication miter (file1 => file2) [default = %s]\n", fImplic? "yes": "no" );
6844  Abc_Print( -2, "\t-m : toggles creating multi-output miter [default = %s]\n", fMulti? "yes": "no" );
6845  Abc_Print( -2, "\t-t : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
6846  Abc_Print( -2, "\t-n : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
6847  Abc_Print( -2, "\t-h : print the command usage\n");
6848  Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
6849  Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
6850  Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
6851  Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
6852  return 1;
6853 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkShortNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:490
ABC_DLL Abc_Ntk_t * Abc_NtkDupTransformMiter(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:563
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Ntk_t * Abc_NtkMiter(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fComb, int nPartSize, int fImplic, int fMulti)
FUNCTION DEFINITIONS ///.
Definition: abcMiter.c:56
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
char * sprintf()
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
char * strcpy()
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandMoveNames ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9146 of file abc.c.

9147 {
9148  extern void Abc_NtkMoveNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pOld );
9149  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
9150  Abc_Ntk_t * pNtk2;
9151  char * FileName;
9152  int c;
9153  // set defaults
9155  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
9156  {
9157  switch ( c )
9158  {
9159  case 'h':
9160  goto usage;
9161  default:
9162  goto usage;
9163  }
9164  }
9165 
9166  // get the second network
9167  if ( argc != globalUtilOptind + 1 )
9168  {
9169  Abc_Print( -1, "The network to take names from is not given.\n" );
9170  return 1;
9171  }
9172 
9173  // read the second network
9174  FileName = argv[globalUtilOptind];
9175  pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
9176  if ( pNtk2 == NULL )
9177  return 1;
9178 
9179  // compare inputs/outputs
9180  if ( Abc_NtkPiNum(pNtk) != Abc_NtkPiNum(pNtk2) )
9181  {
9182  Abc_NtkDelete( pNtk2 );
9183  Abc_Print( -1, "The PI count (%d) of the first network is not equal to PI count (%d) of the second network.\n", Abc_NtkPiNum(pNtk), Abc_NtkPiNum(pNtk2) );
9184  return 0;
9185  }
9186  // compare inputs/outputs
9187  if ( Abc_NtkPoNum(pNtk) != Abc_NtkPoNum(pNtk2) )
9188  {
9189  Abc_NtkDelete( pNtk2 );
9190  Abc_Print( -1, "The PO count (%d) of the first network is not equal to PO count (%d) of the second network.\n", Abc_NtkPoNum(pNtk), Abc_NtkPoNum(pNtk2) );
9191  return 0;
9192  }
9193  // compare inputs/outputs
9194  if ( Abc_NtkLatchNum(pNtk) != Abc_NtkLatchNum(pNtk2) )
9195  {
9196  Abc_NtkDelete( pNtk2 );
9197  Abc_Print( -1, "The flop count (%d) of the first network is not equal to flop count (%d) of the second network.\n", Abc_NtkLatchNum(pNtk), Abc_NtkLatchNum(pNtk2) );
9198  return 0;
9199  }
9200  Abc_NtkMoveNames( pNtk, pNtk2 );
9201  Abc_NtkDelete( pNtk2 );
9202  return 0;
9203 
9204 usage:
9205  Abc_Print( -2, "usage: move_names [-h] <file>\n" );
9206  Abc_Print( -2, "\t moves PI/PO/latch names from the other network\n" );
9207  Abc_Print( -2, "\t-h : print the command usage\n");
9208  Abc_Print( -2, "\t<file> : file with network that has required names\n");
9209  return 1;
9210 }
void Abc_NtkMoveNames(Abc_Ntk_t *pNtk, Abc_Ntk_t *pOld)
Definition: abcNames.c:510
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandMulti ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3318 of file abc.c.

3319 {
3320  Abc_Ntk_t * pNtk, * pNtkRes;
3321  int nThresh, nFaninMax, c;
3322  int fCnf;
3323  int fMulti;
3324  int fSimple;
3325  int fFactor;
3326  extern Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor );
3327 
3328  pNtk = Abc_FrameReadNtk(pAbc);
3329 
3330  // set defaults
3331  nThresh = 1;
3332  nFaninMax = 20;
3333  fCnf = 0;
3334  fMulti = 1;
3335  fSimple = 0;
3336  fFactor = 0;
3338  while ( ( c = Extra_UtilGetopt( argc, argv, "TFmcsfh" ) ) != EOF )
3339  {
3340  switch ( c )
3341  {
3342  case 'T':
3343  if ( globalUtilOptind >= argc )
3344  {
3345  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
3346  goto usage;
3347  }
3348  nThresh = atoi(argv[globalUtilOptind]);
3349  globalUtilOptind++;
3350  if ( nThresh < 0 )
3351  goto usage;
3352  break;
3353  case 'F':
3354  if ( globalUtilOptind >= argc )
3355  {
3356  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
3357  goto usage;
3358  }
3359  nFaninMax = atoi(argv[globalUtilOptind]);
3360  globalUtilOptind++;
3361  if ( nFaninMax < 0 )
3362  goto usage;
3363  break;
3364  case 'c':
3365  fCnf ^= 1;
3366  break;
3367  case 'm':
3368  fMulti ^= 1;
3369  break;
3370  case 's':
3371  fSimple ^= 1;
3372  break;
3373  case 'f':
3374  fFactor ^= 1;
3375  break;
3376  case 'h':
3377  goto usage;
3378  default:
3379  goto usage;
3380  }
3381  }
3382 
3383  if ( pNtk == NULL )
3384  {
3385  Abc_Print( -1, "Empty network.\n" );
3386  return 1;
3387  }
3388  if ( !Abc_NtkIsStrash(pNtk) )
3389  {
3390  Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
3391  return 1;
3392  }
3393 
3394  // get the new network
3395  pNtkRes = Abc_NtkMulti( pNtk, nThresh, nFaninMax, fCnf, fMulti, fSimple, fFactor );
3396  if ( pNtkRes == NULL )
3397  {
3398  Abc_Print( -1, "Renoding has failed.\n" );
3399  return 1;
3400  }
3401  // replace the current network
3402  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
3403  return 0;
3404 
3405 usage:
3406  Abc_Print( -2, "usage: multi [-TF <num>] [-msfch]\n" );
3407  Abc_Print( -2, "\t transforms an AIG into a logic network by creating larger nodes\n" );
3408  Abc_Print( -2, "\t-F <num>: the maximum fanin size after renoding [default = %d]\n", nFaninMax );
3409  Abc_Print( -2, "\t-T <num>: the threshold for AIG node duplication [default = %d]\n", nThresh );
3410  Abc_Print( -2, "\t (an AIG node is the root of a new node after renoding\n" );
3411  Abc_Print( -2, "\t if this leads to duplication of no more than %d AIG nodes,\n", nThresh );
3412  Abc_Print( -2, "\t that is, if [(numFanouts(Node)-1) * size(MFFC(Node))] <= %d)\n", nThresh );
3413  Abc_Print( -2, "\t-m : creates multi-input AND graph [default = %s]\n", fMulti? "yes": "no" );
3414  Abc_Print( -2, "\t-s : creates a simple AIG (no renoding) [default = %s]\n", fSimple? "yes": "no" );
3415  Abc_Print( -2, "\t-f : creates a factor-cut network [default = %s]\n", fFactor? "yes": "no" );
3416  Abc_Print( -2, "\t-c : performs renoding to derive the CNF [default = %s]\n", fCnf? "yes": "no" );
3417  Abc_Print( -2, "\t-h : print the command usage\n");
3418  return 1;
3419 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkMulti(Abc_Ntk_t *pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor)
FUNCTION DEFINITIONS ///.
Definition: abcMulti.c:59
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandMuxes ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8247 of file abc.c.

8248 {
8249  Abc_Ntk_t * pNtk, * pNtkRes;
8250  int c;
8251 
8252  pNtk = Abc_FrameReadNtk(pAbc);
8253  // set defaults
8255  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
8256  {
8257  switch ( c )
8258  {
8259  case 'h':
8260  goto usage;
8261  default:
8262  goto usage;
8263  }
8264  }
8265 
8266  if ( pNtk == NULL )
8267  {
8268  Abc_Print( -1, "Empty network.\n" );
8269  return 1;
8270  }
8271 
8272  if ( !Abc_NtkIsBddLogic(pNtk) )
8273  {
8274  Abc_Print( -1, "Only a BDD logic network can be converted to MUXes.\n" );
8275  return 1;
8276  }
8277 
8278  // get the new network
8279  pNtkRes = Abc_NtkBddToMuxes( pNtk );
8280  if ( pNtkRes == NULL )
8281  {
8282  Abc_Print( -1, "Converting to MUXes has failed.\n" );
8283  return 1;
8284  }
8285  // replace the current network
8286  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
8287  return 0;
8288 
8289 usage:
8290  Abc_Print( -2, "usage: muxes [-h]\n" );
8291  Abc_Print( -2, "\t converts the current network into a network derived by\n" );
8292  Abc_Print( -2, "\t replacing all nodes by DAGs isomorphic to the local BDDs\n" );
8293  Abc_Print( -2, "\t-h : print the command usage\n");
8294  return 1;
8295 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL Abc_Ntk_t * Abc_NtkBddToMuxes(Abc_Ntk_t *pNtk)
Definition: abcNtbdd.c:125
int Abc_CommandMuxStruct ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3250 of file abc.c.

3251 {
3252  Abc_Ntk_t * pNtk, * pNtkRes;
3253  int c;
3254  int fVerbose;
3255 
3256  extern Abc_Ntk_t * Abc_NtkMuxRestructure( Abc_Ntk_t * pNtk, int fVerbose );
3257  pNtk = Abc_FrameReadNtk(pAbc);
3258 
3259  // set defaults
3260  fVerbose = 0;
3262  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
3263  {
3264  switch ( c )
3265  {
3266  case 'v':
3267  fVerbose ^= 1;
3268  break;
3269  case 'h':
3270  goto usage;
3271  default:
3272  goto usage;
3273  }
3274  }
3275 
3276  if ( pNtk == NULL )
3277  {
3278  Abc_Print( -1, "Empty network.\n" );
3279  return 1;
3280  }
3281  // get the new network
3282  if ( !Abc_NtkIsStrash(pNtk) )
3283  {
3284  Abc_Print( -1, "Does not work for a logic network.\n" );
3285  return 1;
3286  }
3287  // check if balancing worked
3288 // pNtkRes = Abc_NtkMuxRestructure( pNtk, fVerbose );
3289  pNtkRes = NULL;
3290  if ( pNtkRes == NULL )
3291  {
3292  Abc_Print( -1, "MUX restructuring has failed.\n" );
3293  return 1;
3294  }
3295  // replace the current network
3296  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
3297  return 0;
3298 
3299 usage:
3300  Abc_Print( -2, "usage: mux_struct [-vh]\n" );
3301  Abc_Print( -2, "\t performs MUX restructuring of the current network\n" );
3302  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
3303  Abc_Print( -2, "\t-h : print the command usage\n");
3304  return 1;
3305 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandNChooseK ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)

Definition at line 718 of file kliveness.c.

719 {
720  Abc_Ntk_t * pNtk, * pNtkTemp, *pNtkCombStabil;
721  Aig_Man_t * pAig, *pAigCombStabil;
722  int directive = -1;
723  int c;
724  int parameterizedCombK;
725 
726  pNtk = Abc_FrameReadNtk(pAbc);
727 
728 
729  /*************************************************
730  Extraction of Command Line Argument
731  *************************************************/
732  if( argc == 1 )
733  {
734  assert( directive == -1 );
735  directive = SIMPLE_kCS;
736  }
737  else
738  {
740  while ( ( c = Extra_UtilGetopt( argc, argv, "cmCgh" ) ) != EOF )
741  {
742  switch( c )
743  {
744  case 'c':
745  directive = kCS_WITH_SAFETY_INVARIANTS;
746  break;
747  case 'm':
749  break;
750  case 'C':
752  break;
753  case 'g':
755  break;
756  case 'h':
757  goto usage;
758  break;
759  default:
760  goto usage;
761  }
762  }
763  }
764  /*************************************************
765  Extraction of Command Line Argument Ends
766  *************************************************/
767 
768  if( !Abc_NtkIsStrash( pNtk ) )
769  {
770  printf("The input network was not strashed, strashing....\n");
771  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
772  pAig = Abc_NtkToDar( pNtkTemp, 0, 1 );
773  }
774  else
775  {
776  pAig = Abc_NtkToDar( pNtk, 0, 1 );
777  pNtkTemp = pNtk;
778  }
779 
780 /**********************Code for generation of nCk outputs**/
781  //combCount = countCombination(1000, 3);
782  //pAigCombStabil = generateDisjunctiveTester( pNtk, pAig, 7, 2 );
783  printf("Enter parameterizedCombK = " );
784  if( scanf("%d", &parameterizedCombK) != 1 )
785  {
786  printf("\nFailed to read integer!\n");
787  return 0;
788  }
789  printf("\n");
790 
791  pAigCombStabil = generateGeneralDisjunctiveTester( pNtk, pAig, parameterizedCombK );
792  Aig_ManPrintStats(pAigCombStabil);
793  pNtkCombStabil = Abc_NtkFromAigPhase( pAigCombStabil );
794  pNtkCombStabil->pName = Abc_UtilStrsav( pAigCombStabil->pName );
795  if ( !Abc_NtkCheck( pNtkCombStabil ) )
796  fprintf( stdout, "Abc_NtkCreateCone(): Network check has failed.\n" );
797  Abc_FrameSetCurrentNetwork( pAbc, pNtkCombStabil );
798 
799  Aig_ManStop( pAigCombStabil );
800  Aig_ManStop( pAig );
801 
802  return 1;
803  //printf("\ncombCount = %d\n", combCount);
804  //exit(0);
805 /**********************************************************/
806 
807  usage:
808  fprintf( stdout, "usage: nck [-cmgCh]\n" );
809  fprintf( stdout, "\tgenerates combinatorial signals for stabilization\n" );
810  fprintf( stdout, "\t-h : print usage\n");
811  return 1;
812 
813 }
ABC_NAMESPACE_IMPL_START Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
#define kCS_WITH_SAFETY_AND_USER_GIVEN_DCS_INVARIANTS
Definition: kliveness.c:61
ABC_DLL void Abc_FrameSetCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:396
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
void Aig_ManPrintStats(Aig_Man_t *p)
Definition: aigMan.c:379
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
#define kCS_WITH_SAFETY_AND_DCS_INVARIANTS
Definition: kliveness.c:60
Aig_Man_t * generateGeneralDisjunctiveTester(Abc_Ntk_t *pNtk, Aig_Man_t *pAig, int combK)
Definition: combination.c:321
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
#define kCS_WITH_DISCOVER_MONOTONE_SIGNALS
Definition: kliveness.c:59
#define kCS_WITH_SAFETY_INVARIANTS
Definition: kliveness.c:58
#define SIMPLE_kCS
Definition: kliveness.c:57
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define assert(ex)
Definition: util_old.h:213
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
char * pName
Definition: abc.h:158
int Abc_CommandNode ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8794 of file abc.c.

8795 {
8796  Abc_Ntk_t * pNtk, * pNtkRes;
8797  Abc_Obj_t * pNode;
8798  int c;
8799 
8800  pNtk = Abc_FrameReadNtk(pAbc);
8801  // set defaults
8803  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
8804  {
8805  switch ( c )
8806  {
8807  case 'h':
8808  goto usage;
8809  default:
8810  goto usage;
8811  }
8812  }
8813 
8814  if ( pNtk == NULL )
8815  {
8816  Abc_Print( -1, "Empty network.\n" );
8817  return 1;
8818  }
8819 
8820  if ( !Abc_NtkIsLogic(pNtk) )
8821  {
8822  Abc_Print( -1, "Currently can only be applied to a logic network.\n" );
8823  return 1;
8824  }
8825 
8826  if ( argc != globalUtilOptind + 1 )
8827  {
8828  Abc_Print( -1, "Wrong number of auguments.\n" );
8829  goto usage;
8830  }
8831 
8832  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
8833  if ( pNode == NULL )
8834  {
8835  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
8836  return 1;
8837  }
8838 
8839  pNtkRes = Abc_NtkCreateFromNode( pNtk, pNode );
8840 // pNtkRes = Abc_NtkDeriveFromBdd( pNtk->pManFunc, pNode->pData, NULL, NULL );
8841  if ( pNtkRes == NULL )
8842  {
8843  Abc_Print( -1, "Splitting one node has failed.\n" );
8844  return 1;
8845  }
8846  // replace the current network
8847  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
8848  return 0;
8849 
8850 usage:
8851  Abc_Print( -2, "usage: node [-h] <name>\n" );
8852  Abc_Print( -2, "\t replaces the current network by the network composed of one node\n" );
8853  Abc_Print( -2, "\t-h : print the command usage\n");
8854  Abc_Print( -2, "\tname : the node name\n");
8855  return 1;
8856 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL Abc_Ntk_t * Abc_NtkCreateFromNode(Abc_Ntk_t *pNtk, Abc_Obj_t *pNode)
Definition: abcNtk.c:1154
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandNodeDup ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10551 of file abc.c.

10552 {
10553  extern Abc_Ntk_t * Abc_NtkNodeDup( Abc_Ntk_t * pNtk, int nLimit, int fVerbose );
10554  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
10555  Abc_Ntk_t * pNtkRes;
10556  int c, nLimit = 30;
10557  int fVerbose = 0;
10558 
10559  // set defaults
10561  while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
10562  {
10563  switch ( c )
10564  {
10565  case 'N':
10566  if ( globalUtilOptind >= argc )
10567  {
10568  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
10569  goto usage;
10570  }
10571  nLimit = atoi(argv[globalUtilOptind]);
10572  globalUtilOptind++;
10573  break;
10574  case 'v':
10575  fVerbose ^= 1;
10576  break;
10577  case 'h':
10578  goto usage;
10579  default:
10580  goto usage;
10581  }
10582  }
10583  if ( pNtk == NULL )
10584  {
10585  Abc_Print( -1, "Empty network.\n" );
10586  return 1;
10587  }
10588  if ( Abc_NtkIsStrash(pNtk) )
10589  {
10590  Abc_Print( -1, "Only works for logic networks.\n" );
10591  return 1;
10592  }
10593  if ( nLimit < 2 )
10594  {
10595  Abc_Print( -1, "The fanout limit should be more than 1.\n" );
10596  return 1;
10597  }
10598  pNtkRes = Abc_NtkNodeDup( pNtk, nLimit, fVerbose );
10599  if ( pNtkRes == NULL )
10600  {
10601  Abc_Print( -1, "Command has failed.\n" );
10602  return 0;
10603  }
10604  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10605  return 0;
10606 
10607 usage:
10608  Abc_Print( -2, "usage: nodedup [-Nvh]\n" );
10609  Abc_Print( -2, "\t duplicates internal nodes with high fanout\n" );
10610  Abc_Print( -2, "\t-N num : the number of fanouts to start duplication [default = %d]\n", nLimit );
10611  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
10612  Abc_Print( -2, "\t-h : print the command usage\n");
10613  return 1;
10614 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkNodeDup(Abc_Ntk_t *pNtkInit, int nLimit, int fVerbose)
Definition: abcNtk.c:2079
int Abc_CommandNpnLoad ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13015 of file abc.c.

13016 {
13017  extern void Npn_ManLoad( char * pFileName );
13018  char * pFileName;
13019  int c;
13021  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
13022  {
13023  switch ( c )
13024  {
13025  case 'h':
13026  goto usage;
13027  default:
13028  goto usage;
13029  }
13030  }
13031  if ( argc != globalUtilOptind + 1 )
13032  goto usage;
13033  pFileName = argv[globalUtilOptind];
13034  Npn_ManLoad( pFileName );
13035  return 0;
13036 
13037 usage:
13038  Abc_Print( -2, "usage: npnload <filename>\n" );
13039  Abc_Print( -2, "\t loads previously saved 6-input function library from file\n" );
13040  Abc_Print( -2, "\t-h : print the command usage\n");
13041  return 1;
13042 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Npn_ManLoad(char *pFileName)
Definition: abcNpnSave.c:669
int Abc_CommandNpnSave ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13055 of file abc.c.

13056 {
13057  extern void Npn_ManSave( char * pFileName );
13058  char * pFileName;
13059  int c;
13061  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
13062  {
13063  switch ( c )
13064  {
13065  case 'h':
13066  goto usage;
13067  default:
13068  goto usage;
13069  }
13070  }
13071  if ( argc != globalUtilOptind + 1 )
13072  goto usage;
13073  pFileName = argv[globalUtilOptind];
13074  Npn_ManSave( pFileName );
13075  return 0;
13076 
13077 usage:
13078  Abc_Print( -2, "usage: npnsave <filename>\n" );
13079  Abc_Print( -2, "\t saves current 6-input function library into file\n" );
13080  Abc_Print( -2, "\t-h : print the command usage\n");
13081  return 1;
13082 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Npn_ManSave(char *pFileName)
Definition: abcNpnSave.c:692
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandOneHot ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16837 of file abc.c.

16838 {
16839  Abc_Ntk_t * pNtk, * pNtkRes;
16840  int c;
16841  extern Abc_Ntk_t * Abc_NtkConvertOnehot( Abc_Ntk_t * pNtk );
16842 
16843  pNtk = Abc_FrameReadNtk(pAbc);
16844  // set defaults
16846  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
16847  {
16848  switch ( c )
16849  {
16850  case 'h':
16851  goto usage;
16852  default:
16853  goto usage;
16854  }
16855  }
16856  if ( pNtk == NULL )
16857  {
16858  Abc_Print( -1, "Empty network.\n" );
16859  return 1;
16860  }
16861  if ( Abc_NtkIsComb(pNtk) )
16862  {
16863  Abc_Print( -1, "The current network is combinational.\n" );
16864  return 0;
16865  }
16866  if ( !Abc_NtkIsLogic(pNtk) )
16867  {
16868  Abc_Print( -1, "This command works only for logic networks.\n" );
16869  return 0;
16870  }
16871  // get the new network
16872  pNtkRes = Abc_NtkConvertOnehot( pNtk );
16873  if ( pNtkRes == NULL )
16874  {
16875  Abc_Print( -1, "Converting to one-hot encoding has failed.\n" );
16876  return 1;
16877  }
16878  // replace the current network
16879  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
16880  return 0;
16881 
16882 usage:
16883  Abc_Print( -2, "usage: onehot [-h]\n" );
16884  Abc_Print( -2, "\t converts natural encoding into one-hot encoding\n" );
16885  Abc_Print( -2, "\t-h : print the command usage\n");
16886  return 1;
16887 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkConvertOnehot(Abc_Ntk_t *pNtk)
Definition: abcLatch.c:421
int Abc_CommandOrder ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8164 of file abc.c.

8165 {
8166  FILE * pFile;
8167  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
8168  char * pFileName;
8169  int c;
8170  int fReverse;
8171  int fVerbose;
8172  extern void Abc_NtkImplementCiOrder( Abc_Ntk_t * pNtk, char * pFileName, int fReverse, int fVerbose );
8173  extern void Abc_NtkFindCiOrder( Abc_Ntk_t * pNtk, int fReverse, int fVerbose );
8174 
8175  // set defaults
8176  fReverse = 0;
8177  fVerbose = 0;
8179  while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
8180  {
8181  switch ( c )
8182  {
8183  case 'r':
8184  fReverse ^= 1;
8185  break;
8186  case 'v':
8187  fVerbose ^= 1;
8188  break;
8189  case 'h':
8190  goto usage;
8191  default:
8192  goto usage;
8193  }
8194  }
8195 
8196  if ( pNtk == NULL )
8197  {
8198  Abc_Print( -1, "Empty network.\n" );
8199  return 1;
8200  }
8201 // if ( Abc_NtkLatchNum(pNtk) > 0 )
8202 // {
8203 // Abc_Print( -1, "Currently this procedure does not work for sequential networks.\n" );
8204 // return 1;
8205 // }
8206 
8207  // if the var order file is given, implement this order
8208  pFileName = NULL;
8209  if ( argc == globalUtilOptind + 1 )
8210  {
8211  pFileName = argv[globalUtilOptind];
8212  pFile = fopen( pFileName, "r" );
8213  if ( pFile == NULL )
8214  {
8215  Abc_Print( -1, "Cannot open file \"%s\" with the BDD variable order.\n", pFileName );
8216  return 1;
8217  }
8218  fclose( pFile );
8219  }
8220  if ( pFileName )
8221  Abc_NtkImplementCiOrder( pNtk, pFileName, fReverse, fVerbose );
8222  else
8223  Abc_NtkFindCiOrder( pNtk, fReverse, fVerbose );
8224  return 0;
8225 
8226 usage:
8227  Abc_Print( -2, "usage: order [-rvh] <file>\n" );
8228  Abc_Print( -2, "\t computes a good static CI variable order\n" );
8229  Abc_Print( -2, "\t-r : toggle reverse ordering [default = %s]\n", fReverse? "yes": "no" );
8230  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
8231  Abc_Print( -2, "\t-h : print the command usage\n");
8232  Abc_Print( -2, "\t<file> : (optional) file with the given variable order\n" );
8233  return 1;
8234 }
void Abc_NtkImplementCiOrder(Abc_Ntk_t *pNtk, char *pFileName, int fReverse, int fVerbose)
Definition: abcOrder.c:66
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NtkFindCiOrder(Abc_Ntk_t *pNtk, int fReverse, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcOrder.c:47
int Abc_CommandOrPos ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6964 of file abc.c.

6965 {
6966  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
6967  int fReverse = 0;
6968  int fComb = 0;
6969  int fXor = 0;
6970  int c;
6971  extern int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd, int fXor );
6972 
6973  // set defaults
6975  while ( ( c = Extra_UtilGetopt( argc, argv, "rxh" ) ) != EOF )
6976  {
6977  switch ( c )
6978  {
6979  case 'r':
6980  fReverse ^= 1;
6981  break;
6982  case 'x':
6983  fXor ^= 1;
6984  break;
6985  case 'c':
6986  fComb ^= 1;
6987  break;
6988  default:
6989  goto usage;
6990  }
6991  }
6992 
6993  if ( pNtk == NULL )
6994  {
6995  Abc_Print( -1, "Empty network.\n" );
6996  return 1;
6997  }
6998  if ( !Abc_NtkIsStrash(pNtk) )
6999  {
7000  Abc_Print( -1, "The network is not strashed.\n" );
7001  return 1;
7002  }
7003  // get the new network
7004  if ( fReverse )
7005  {
7006  extern Aig_Man_t * Abc_NtkToDarBmc( Abc_Ntk_t * pNtk, Vec_Int_t ** pvMap );
7007  Aig_Man_t * pMan = Abc_NtkToDarBmc( pNtk, NULL );
7008  Abc_Ntk_t * pNtkRes = Abc_NtkFromAigPhase( pMan );
7009  Aig_ManStop( pMan );
7010  // perform expansion
7011  if ( Abc_NtkPoNum(pNtk) != Abc_NtkPoNum(pNtkRes) )
7012  Abc_Print( 1,"Expanded %d outputs into %d outputs using OR decomposition.\n", Abc_NtkPoNum(pNtk), Abc_NtkPoNum(pNtkRes) );
7013  else
7014  Abc_Print( 1,"The output(s) cannot be structurally decomposed.\n" );
7015  // clear counter-example
7016  if ( pAbc->pCex )
7017  ABC_FREE( pAbc->pCex );
7018  // replace the current network
7019  ABC_FREE( pNtkRes->pName );
7020  pNtkRes->pName = Extra_UtilStrsav(pNtk->pName);
7021  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7022  }
7023  else
7024  {
7025  if ( !Abc_NtkCombinePos( pNtk, 0, fXor ) )
7026  {
7027  Abc_Print( -1, "ORing the POs has failed.\n" );
7028  return 1;
7029  }
7030  // update counter-example
7031  if ( pAbc->pCex )
7032  pAbc->pCex->iPo = 0;
7033  // replace the current network
7034  // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7035  }
7036  return 0;
7037 
7038 usage:
7039  Abc_Print( -2, "usage: orpos [-rxh]\n" );
7040  Abc_Print( -2, "\t creates single-output miter by ORing the POs of the current network\n" );
7041  Abc_Print( -2, "\t-r : performs the reverse transform (OR decomposition) [default = %s]\n", fReverse? "yes": "no" );
7042  Abc_Print( -2, "\t-x : toggles combining the PO using XOR [default = %s]\n", fXor? "yes": "no" );
7043  Abc_Print( -2, "\t-h : print the command usage\n");
7044  return 1;
7045 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
ABC_DLL int Abc_NtkCombinePos(Abc_Ntk_t *pNtk, int fAnd, int fXor)
Definition: abcMiter.c:1151
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Aig_Man_t * Abc_NtkToDarBmc(Abc_Ntk_t *pNtk, Vec_Int_t **pvMap)
Definition: abcDar.c:111
char * pName
Definition: abc.h:158
int Abc_CommandOutdec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10475 of file abc.c.

10476 {
10477  extern Abc_Ntk_t * Abc_NtkDarOutdec( Abc_Ntk_t * pNtk, int nLits, int fVerbose );
10478  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
10479  Abc_Ntk_t * pNtkRes;
10480  int c, nLits = 1;
10481  int fVerbose = 0;
10482 
10483  // set defaults
10485  while ( ( c = Extra_UtilGetopt( argc, argv, "Lvh" ) ) != EOF )
10486  {
10487  switch ( c )
10488  {
10489  case 'L':
10490  if ( globalUtilOptind >= argc )
10491  {
10492  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
10493  goto usage;
10494  }
10495  nLits = atoi(argv[globalUtilOptind]);
10496  globalUtilOptind++;
10497  if ( nLits < 1 || nLits > 2 )
10498  {
10499  Abc_Print( 1,"Currently, command \"outdec\" works for 1-lit and 2-lit primes only.\n" );
10500  goto usage;
10501  }
10502  break;
10503  case 'v':
10504  fVerbose ^= 1;
10505  break;
10506  case 'h':
10507  goto usage;
10508  default:
10509  goto usage;
10510  }
10511  }
10512  if ( pNtk == NULL )
10513  {
10514  Abc_Print( -1, "Empty network.\n" );
10515  return 1;
10516  }
10517  if ( !Abc_NtkIsStrash(pNtk) )
10518  {
10519  Abc_Print( -1, "Only works for strashed networks.\n" );
10520  return 1;
10521  }
10522  pNtkRes = Abc_NtkDarOutdec( pNtk, nLits, fVerbose );
10523  if ( pNtkRes == NULL )
10524  {
10525  Abc_Print( -1, "Command has failed.\n" );
10526  return 0;
10527  }
10528  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10529  return 0;
10530 
10531 usage:
10532  Abc_Print( -2, "usage: outdec [-Lvh]\n" );
10533  Abc_Print( -2, "\t performs prime decomposition of the first output\n" );
10534  Abc_Print( -2, "\t-L num : the number of literals in the primes [default = %d]\n", nLits );
10535  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
10536  Abc_Print( -2, "\t-h : print the command usage\n");
10537  return 1;
10538 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkDarOutdec(Abc_Ntk_t *pNtk, int nLits, int fVerbose)
Definition: abcDar.c:4485
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPdr ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24283 of file abc.c.

24284 {
24285  extern int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars );
24286  Pdr_Par_t Pars, * pPars = &Pars;
24287  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
24288  int c;
24289  Pdr_ManSetDefaultParams( pPars );
24291  while ( ( c = Extra_UtilGetopt( argc, argv, "MFCRTHGaxrmsipdgvwzh" ) ) != EOF )
24292  {
24293  switch ( c )
24294  {
24295  case 'M':
24296  if ( globalUtilOptind >= argc )
24297  {
24298  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
24299  goto usage;
24300  }
24301  pPars->nRecycle = atoi(argv[globalUtilOptind]);
24302  globalUtilOptind++;
24303  if ( pPars->nRecycle < 0 )
24304  goto usage;
24305  break;
24306  case 'F':
24307  if ( globalUtilOptind >= argc )
24308  {
24309  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
24310  goto usage;
24311  }
24312  pPars->nFrameMax = atoi(argv[globalUtilOptind]);
24313  globalUtilOptind++;
24314  if ( pPars->nFrameMax < 0 )
24315  goto usage;
24316  break;
24317  case 'C':
24318  if ( globalUtilOptind >= argc )
24319  {
24320  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
24321  goto usage;
24322  }
24323  pPars->nConfLimit = atoi(argv[globalUtilOptind]);
24324  globalUtilOptind++;
24325  if ( pPars->nConfLimit < 0 )
24326  goto usage;
24327  break;
24328  case 'R':
24329  if ( globalUtilOptind >= argc )
24330  {
24331  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
24332  goto usage;
24333  }
24334  pPars->nRestLimit = atoi(argv[globalUtilOptind]);
24335  globalUtilOptind++;
24336  if ( pPars->nRestLimit < 0 )
24337  goto usage;
24338  break;
24339  case 'T':
24340  if ( globalUtilOptind >= argc )
24341  {
24342  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
24343  goto usage;
24344  }
24345  pPars->nTimeOut = atoi(argv[globalUtilOptind]);
24346  globalUtilOptind++;
24347  if ( pPars->nTimeOut < 0 )
24348  goto usage;
24349  break;
24350  case 'H':
24351  if ( globalUtilOptind >= argc )
24352  {
24353  Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
24354  goto usage;
24355  }
24356  pPars->nTimeOutOne = atoi(argv[globalUtilOptind]);
24357  globalUtilOptind++;
24358  if ( pPars->nTimeOutOne < 0 )
24359  goto usage;
24360  break;
24361  case 'G':
24362  if ( globalUtilOptind >= argc )
24363  {
24364  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
24365  goto usage;
24366  }
24367  pPars->nTimeOutGap = atoi(argv[globalUtilOptind]);
24368  globalUtilOptind++;
24369  if ( pPars->nTimeOutGap < 0 )
24370  goto usage;
24371  break;
24372  case 'a':
24373  pPars->fSolveAll ^= 1;
24374  break;
24375  case 'x':
24376  pPars->fStoreCex ^= 1;
24377  break;
24378  case 'r':
24379  pPars->fTwoRounds ^= 1;
24380  break;
24381  case 'm':
24382  pPars->fMonoCnf ^= 1;
24383  break;
24384  case 's':
24385  pPars->fShortest ^= 1;
24386  break;
24387  case 'i':
24388  pPars->fShiftStart ^= 1;
24389  break;
24390  case 'p':
24391  pPars->fReuseProofOblig ^= 1;
24392  break;
24393  case 'd':
24394  pPars->fDumpInv ^= 1;
24395  break;
24396  case 'g':
24397  pPars->fSkipGeneral ^= 1;
24398  break;
24399  case 'v':
24400  pPars->fVerbose ^= 1;
24401  break;
24402  case 'w':
24403  pPars->fVeryVerbose ^= 1;
24404  break;
24405  case 'z':
24406  pPars->fNotVerbose ^= 1;
24407  break;
24408  case 'h':
24409  default:
24410  goto usage;
24411  }
24412  }
24413  if ( pNtk == NULL )
24414  {
24415  Abc_Print( -2, "There is no current network.\n");
24416  return 0;
24417  }
24418  if ( Abc_NtkLatchNum(pNtk) == 0 )
24419  {
24420  Abc_Print( -2, "The current network is combinational.\n");
24421  return 0;
24422  }
24423  if ( !Abc_NtkIsStrash(pNtk) )
24424  {
24425  Abc_Print( -2, "The current network is not an AIG (run \"strash\").\n");
24426  return 0;
24427  }
24428  // run the procedure
24429  pPars->fUseBridge = pAbc->fBridgeMode;
24430  pAbc->Status = Abc_NtkDarPdr( pNtk, pPars );
24431  pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
24432  Abc_FrameReplacePoStatuses( pAbc, &pPars->vOutMap );
24433  if ( pNtk->vSeqModelVec )
24434  Abc_FrameReplaceCexVec( pAbc, &pNtk->vSeqModelVec );
24435  else
24436  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
24437  return 0;
24438 
24439 usage:
24440  Abc_Print( -2, "usage: pdr [-MFCRTHG <num>] [-axrmsipdgvwzh]\n" );
24441  Abc_Print( -2, "\t model checking using property directed reachability (aka IC3)\n" );
24442  Abc_Print( -2, "\t pioneered by Aaron Bradley (http://ecee.colorado.edu/~bradleya/ic3/)\n" );
24443  Abc_Print( -2, "\t with improvements by Niklas Een (http://een.se/niklas/)\n" );
24444  Abc_Print( -2, "\t-M num : limit on unused vars to trigger SAT solver recycling [default = %d]\n", pPars->nRecycle );
24445  Abc_Print( -2, "\t-F num : limit on timeframes explored to stop computation [default = %d]\n", pPars->nFrameMax );
24446  Abc_Print( -2, "\t-C num : limit on conflicts in one SAT call (0 = no limit) [default = %d]\n", pPars->nConfLimit );
24447  Abc_Print( -2, "\t-R num : limit on proof obligations before a restart (0 = no limit) [default = %d]\n", pPars->nRestLimit );
24448  Abc_Print( -2, "\t-T num : runtime limit, in seconds (0 = no limit) [default = %d]\n", pPars->nTimeOut );
24449  Abc_Print( -2, "\t-H num : runtime limit per output, in miliseconds (with \"-a\") [default = %d]\n", pPars->nTimeOutOne );
24450  Abc_Print( -2, "\t-G num : runtime gap since the last CEX (0 = no limit) [default = %d]\n", pPars->nTimeOutGap );
24451  Abc_Print( -2, "\t-a : toggle solving all outputs even if one of them is SAT [default = %s]\n", pPars->fSolveAll? "yes": "no" );
24452  Abc_Print( -2, "\t-x : toggle storing CEXes when solving all outputs [default = %s]\n", pPars->fStoreCex? "yes": "no" );
24453  Abc_Print( -2, "\t-r : toggle using more effort in generalization [default = %s]\n", pPars->fTwoRounds? "yes": "no" );
24454  Abc_Print( -2, "\t-m : toggle using monolythic CNF computation [default = %s]\n", pPars->fMonoCnf? "yes": "no" );
24455  Abc_Print( -2, "\t-s : toggle creating only shortest counter-examples [default = %s]\n", pPars->fShortest? "yes": "no" );
24456  Abc_Print( -2, "\t-i : toggle clause pushing from an intermediate timeframe [default = %s]\n", pPars->fShiftStart? "yes": "no" );
24457  Abc_Print( -2, "\t-p : toggle reusing proof-obligations in the last timeframe [default = %s]\n", pPars->fReuseProofOblig? "yes": "no" );
24458  Abc_Print( -2, "\t-d : toggle dumping invariant (valid if init state is all-0) [default = %s]\n", pPars->fDumpInv? "yes": "no" );
24459  Abc_Print( -2, "\t-g : toggle skipping expensive generalization step [default = %s]\n", pPars->fSkipGeneral? "yes": "no" );
24460  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
24461  Abc_Print( -2, "\t-w : toggle printing detailed stats default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
24462  Abc_Print( -2, "\t-z : toggle suppressing report about solved outputs [default = %s]\n", pPars->fNotVerbose? "yes": "no" );
24463  Abc_Print( -2, "\t-h : print the command usage\n");
24464  return 1;
24465 }
void Abc_FrameReplaceCexVec(Abc_Frame_t *pAbc, Vec_Ptr_t **pvCexVec)
Definition: abc.c:515
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Vec_Ptr_t * vSeqModelVec
Definition: abc.h:200
void Pdr_ManSetDefaultParams(Pdr_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: pdrCore.c:48
typedefABC_NAMESPACE_HEADER_START struct Pdr_Par_t_ Pdr_Par_t
INCLUDES ///.
Definition: pdr.h:40
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Abc_NtkDarPdr(Abc_Ntk_t *pNtk, Pdr_Par_t *pPars)
Definition: abcDar.c:2965
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_FrameReplacePoStatuses(Abc_Frame_t *pAbc, Vec_Int_t **pvStatuses)
Definition: abc.c:556
int Abc_CommandPermute ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20023 of file abc.c.

20024 {
20025  extern Abc_Ntk_t * Abc_NtkRestrashRandom( Abc_Ntk_t * pNtk );
20026  Abc_Ntk_t * pNtk = pAbc->pNtkCur, * pNtkRes = NULL;
20027  char * pFlopPermFile = NULL;
20028  int fInputs = 1;
20029  int fOutputs = 1;
20030  int fFlops = 1;
20031  int fNodes = 1;
20032  int c;
20034  while ( ( c = Extra_UtilGetopt( argc, argv, "Fiofnh" ) ) != EOF )
20035  {
20036  switch ( c )
20037  {
20038  case 'F':
20039  if ( globalUtilOptind >= argc )
20040  {
20041  Abc_Print( -1, "Command line switch \"-F\" should be followed by a file name.\n" );
20042  goto usage;
20043  }
20044  pFlopPermFile = argv[globalUtilOptind];
20045  globalUtilOptind++;
20046  break;
20047  case 'i':
20048  fInputs ^= 1;
20049  break;
20050  case 'o':
20051  fOutputs ^= 1;
20052  break;
20053  case 'f':
20054  fFlops ^= 1;
20055  break;
20056  case 'n':
20057  fNodes ^= 1;
20058  break;
20059  case 'h':
20060  goto usage;
20061  default:
20062  Abc_Print( -2, "Unknown switch.\n");
20063  goto usage;
20064  }
20065  }
20066  if ( pNtk == NULL )
20067  {
20068  Abc_Print( -1, "Empty network.\n" );
20069  return 1;
20070  }
20071  if ( fNodes && !Abc_NtkIsStrash(pNtk) )
20072  {
20073  Abc_Print( -1, "To permute nodes, the network should be structurally hashed.\n" );
20074  return 1;
20075  }
20076  if ( fNodes )
20077  pNtkRes = Abc_NtkRestrashRandom( pNtk );
20078  else
20079  pNtkRes = Abc_NtkDup( pNtk );
20080  if ( pNtkRes == NULL )
20081  {
20082  Abc_Print( -1, "Command \"permute\" has failed.\n" );
20083  return 1;
20084  }
20085  Abc_NtkPermute( pNtkRes, fInputs, fOutputs, fFlops, pFlopPermFile );
20086  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
20087  return 0;
20088 
20089 usage:
20090  Abc_Print( -2, "usage: permute [-iofnh] [-F filename]\n" );
20091  Abc_Print( -2, "\t performs random permutation of inputs/outputs/flops\n" );
20092  Abc_Print( -2, "\t-i : toggle permuting primary inputs [default = %s]\n", fInputs? "yes": "no" );
20093  Abc_Print( -2, "\t-o : toggle permuting primary outputs [default = %s]\n", fOutputs? "yes": "no" );
20094  Abc_Print( -2, "\t-f : toggle permuting flip-flops [default = %s]\n", fFlops? "yes": "no" );
20095  Abc_Print( -2, "\t-n : toggle deriving new topological ordering of nodes [default = %s]\n", fNodes? "yes": "no" );
20096  Abc_Print( -2, "\t-h : print the command usage\n");
20097  Abc_Print( -2, "\t-F <filename> : (optional) file with the flop permutation\n" );
20098  return 1;
20099 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Ntk_t * Abc_NtkRestrashRandom(Abc_Ntk_t *pNtk)
Definition: abcStrash.c:138
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL void Abc_NtkPermute(Abc_Ntk_t *pNtk, int fInputs, int fOutputs, int fFlops, char *pFlopPermFile)
Definition: abcNtk.c:1906
int Abc_CommandPipe ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16900 of file abc.c.

16901 {
16902  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
16903  int c;
16904  int nLatches;
16905  extern void Abc_NtkLatchPipe( Abc_Ntk_t * pNtk, int nLatches );
16906  // set defaults
16907  nLatches = 5;
16909  while ( ( c = Extra_UtilGetopt( argc, argv, "Lh" ) ) != EOF )
16910  {
16911  switch ( c )
16912  {
16913  case 'L':
16914  if ( globalUtilOptind >= argc )
16915  {
16916  Abc_Print( -1, "Command line switch \"-L\" should be followed by a positive integer.\n" );
16917  goto usage;
16918  }
16919  nLatches = atoi(argv[globalUtilOptind]);
16920  globalUtilOptind++;
16921  if ( nLatches < 0 )
16922  goto usage;
16923  break;
16924  case 'h':
16925  goto usage;
16926  default:
16927  goto usage;
16928  }
16929  }
16930 
16931  if ( pNtk == NULL )
16932  {
16933  Abc_Print( -1, "Empty network.\n" );
16934  return 1;
16935  }
16936 
16937  if ( Abc_NtkIsComb(pNtk) )
16938  {
16939  Abc_Print( -1, "The current network is combinational.\n" );
16940  return 0;
16941  }
16942 
16943  // update the network
16944  Abc_NtkLatchPipe( pNtk, nLatches );
16945  return 0;
16946 
16947 usage:
16948  Abc_Print( -2, "usage: pipe [-L num] [-h]\n" );
16949  Abc_Print( -2, "\t inserts the given number of latches at each PI for pipelining\n" );
16950  Abc_Print( -2, "\t-L num : the number of latches to insert [default = %d]\n", nLatches );
16951  Abc_Print( -2, "\t-h : print the command usage\n");
16952  return 1;
16953 }
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
void Abc_NtkLatchPipe(Abc_Ntk_t *pNtk, int nLatches)
Definition: abcLatch.c:145
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPowerdown ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5162 of file abc.c.

5163 {
5164  Abc_Ntk_t * pNtk, * pNtkRes;
5165  int c;
5166  int fUseLutLib;
5167  int Percentage;
5168  int Degree;
5169  int fVerbose;
5170  int fVeryVerbose;
5171  extern Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
5172 
5173  pNtk = Abc_FrameReadNtk(pAbc);
5174  // set defaults
5175  fUseLutLib = 0;
5176  Percentage =10;
5177  Degree = 2;
5178  fVerbose = 0;
5179  fVeryVerbose = 0;
5181  while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
5182  {
5183  switch ( c )
5184  {
5185  case 'P':
5186  if ( globalUtilOptind >= argc )
5187  {
5188  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
5189  goto usage;
5190  }
5191  Percentage = atoi(argv[globalUtilOptind]);
5192  globalUtilOptind++;
5193  if ( Percentage < 1 || Percentage > 100 )
5194  goto usage;
5195  break;
5196  case 'N':
5197  if ( globalUtilOptind >= argc )
5198  {
5199  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
5200  goto usage;
5201  }
5202  Degree = atoi(argv[globalUtilOptind]);
5203  globalUtilOptind++;
5204  if ( Degree < 1 || Degree > 5 )
5205  goto usage;
5206  break;
5207  case 'l':
5208  fUseLutLib ^= 1;
5209  break;
5210  case 'v':
5211  fVerbose ^= 1;
5212  break;
5213  case 'w':
5214  fVeryVerbose ^= 1;
5215  break;
5216  case 'h':
5217  goto usage;
5218  default:
5219  goto usage;
5220  }
5221  }
5222 
5223  if ( pNtk == NULL )
5224  {
5225  Abc_Print( -1, "Empty network.\n" );
5226  return 1;
5227  }
5228  if ( !Abc_NtkIsLogic(pNtk) )
5229  {
5230  Abc_Print( -1, "This command can only be applied to a logic network.\n" );
5231  return 1;
5232  }
5233 
5234  // modify the current network
5235  pNtkRes = Abc_NtkPowerdown( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
5236  if ( pNtkRes == NULL )
5237  {
5238  Abc_Print( -1, "The command has failed.\n" );
5239  return 1;
5240  }
5241  // replace the current network
5242  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
5243  return 0;
5244 
5245 usage:
5246  Abc_Print( -2, "usage: powerdown [-PN <num>] [-vwh]\n" );
5247  Abc_Print( -2, "\t transforms LUT-mapped network into an AIG with choices;\n" );
5248  Abc_Print( -2, "\t the choices are added to power down the next round of mapping\n" );
5249  Abc_Print( -2, "\t-P <num> : switching propability delta defining power critical edges [default = %d%%]\n", Percentage );
5250  Abc_Print( -2, "\t (e.g. 5% means hot wires switch with probability: 0.45 <= p <= 0.50 (max)\n" );
5251  Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
5252 // Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
5253  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
5254  Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
5255  Abc_Print( -2, "\t-h : print the command usage\n");
5256  return 1;
5257 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Abc_Ntk_t * Abc_NtkPowerdown(Abc_Ntk_t *pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose)
Definition: abcSpeedup.c:811
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintAuto ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1981 of file abc.c.

1982 {
1983  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1984  int c;
1985  int Output;
1986  int fNaive;
1987  int fVerbose;
1988  extern void Abc_NtkAutoPrint( Abc_Ntk_t * pNtk, int Output, int fNaive, int fVerbose );
1989 
1990  // set defaults
1991  Output = -1;
1992  fNaive = 0;
1993  fVerbose = 0;
1995  while ( ( c = Extra_UtilGetopt( argc, argv, "Onvh" ) ) != EOF )
1996  {
1997  switch ( c )
1998  {
1999  case 'O':
2000  if ( globalUtilOptind >= argc )
2001  {
2002  Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
2003  goto usage;
2004  }
2005  Output = atoi(argv[globalUtilOptind]);
2006  globalUtilOptind++;
2007  if ( Output < 0 )
2008  goto usage;
2009  break;
2010  case 'n':
2011  fNaive ^= 1;
2012  break;
2013  case 'v':
2014  fVerbose ^= 1;
2015  break;
2016  case 'h':
2017  goto usage;
2018  default:
2019  goto usage;
2020  }
2021  }
2022  if ( pNtk == NULL )
2023  {
2024  Abc_Print( -1, "Empty network.\n" );
2025  return 1;
2026  }
2027  if ( !Abc_NtkIsStrash(pNtk) )
2028  {
2029  Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
2030  return 1;
2031  }
2032 
2033 
2034  Abc_NtkAutoPrint( pNtk, Output, fNaive, fVerbose );
2035  return 0;
2036 
2037 usage:
2038  Abc_Print( -2, "usage: print_auto [-O <num>] [-nvh]\n" );
2039  Abc_Print( -2, "\t computes autosymmetries of the PO functions\n" );
2040  Abc_Print( -2, "\t-O <num> : (optional) the 0-based number of the output [default = all]\n");
2041  Abc_Print( -2, "\t-n : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
2042  Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
2043  Abc_Print( -2, "\t-h : print the command usage\n");
2044  return 1;
2045 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NtkAutoPrint(Abc_Ntk_t *pNtk, int Output, int fNaive, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcAuto.c:49
int Abc_CommandPrintCone ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2430 of file abc.c.

2431 {
2432  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2433  int c;
2434  int fUseLibrary;
2435 
2436  // set defaults
2437  fUseLibrary = 1;
2439  while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
2440  {
2441  switch ( c )
2442  {
2443  case 'l':
2444  fUseLibrary ^= 1;
2445  break;
2446  case 'h':
2447  goto usage;
2448  default:
2449  goto usage;
2450  }
2451  }
2452  if ( pNtk == NULL )
2453  {
2454  Abc_Print( -1, "Empty network.\n" );
2455  return 1;
2456  }
2457  if ( Abc_NtkLatchNum(pNtk) == 0 )
2458  {
2459  Abc_Print( -1, "The network is combinational.\n" );
2460  return 1;
2461  }
2462  Abc_NtkDarPrintCone( pNtk );
2463  return 0;
2464 
2465 usage:
2466  Abc_Print( -2, "usage: print_cone [-h]\n" );
2467  Abc_Print( -2, "\t prints cones of influence info for each primary output\n" );
2468 // Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
2469  Abc_Print( -2, "\t-h : print the command usage\n");
2470  return 1;
2471 }
ABC_DLL int Abc_NtkDarPrintCone(Abc_Ntk_t *pNtk)
Definition: abcDar.c:3911
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintDelay ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2625 of file abc.c.

2626 {
2627  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2628  Abc_Obj_t * pObjIn = NULL, * pObjOut = NULL;
2629  int c;
2630  // set defaults
2632  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
2633  {
2634  switch ( c )
2635  {
2636  case 'h':
2637  goto usage;
2638  default:
2639  goto usage;
2640  }
2641  }
2642  if ( pNtk == NULL )
2643  {
2644  Abc_Print( -1, "Empty network.\n" );
2645  return 1;
2646  }
2647  if ( !Abc_NtkIsMappedLogic(pNtk) )
2648  {
2649  Abc_Print( -1, "Delay trace works only for network mapped into standard cells.\n" );
2650  return 1;
2651  }
2652  if ( argc > globalUtilOptind + 2 )
2653  {
2654  Abc_Print( -1, "Wrong number of auguments.\n" );
2655  goto usage;
2656  }
2657  // collect the first name (PO name)
2658  if ( argc >= globalUtilOptind + 1 )
2659  {
2660  int Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind], ABC_OBJ_PO );
2661  if ( Num < 0 )
2662  Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind], ABC_OBJ_BI );
2663  if ( Num >= 0 )
2664  pObjOut = Abc_NtkObj( pNtk, Num );
2665  if ( pObjOut == NULL )
2666  {
2667  Abc_Print( 1, "Cannot find combinational output \"%s\".\n", argv[globalUtilOptind] );
2668  return 1;
2669  }
2670  }
2671  // collect the second name (PI name)
2672  if ( argc == globalUtilOptind + 2 )
2673  {
2674  int Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind+1], ABC_OBJ_PI );
2675  if ( Num < 0 )
2676  Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind+1], ABC_OBJ_BO );
2677  if ( Num >= 0 )
2678  pObjIn = Abc_NtkObj( pNtk, Num );
2679  if ( pObjIn == NULL )
2680  {
2681  Abc_Print( 1, "Cannot find combinational input \"%s\".\n", argv[globalUtilOptind+1] );
2682  return 1;
2683  }
2684  }
2685  Abc_NtkDelayTrace( pNtk, pObjOut, pObjIn, 1 );
2686  return 0;
2687 
2688 usage:
2689  Abc_Print( -2, "usage: print_delay [-h] <CO_name> <CI_name>\n" );
2690  Abc_Print( -2, "\t prints one critical path of the mapped network\n" );
2691  Abc_Print( -2, "\t-h : print the command usage\n");
2692  Abc_Print( -2, "\t<CO_name> : (optional) the sink of the critical path (primary output or flop input)\n");
2693  Abc_Print( -2, "\t<CI_name> : (optional) the source of the critical path (primary input or flop output)\n");
2694  Abc_Print( -2, "\t (if CO and/or CI are not given, uses the most critical ones)\n");
2695  return 1;
2696 }
int Nm_ManFindIdByName(Nm_Man_t *p, char *pName, int Type)
Definition: nmApi.c:219
Definition: abc.h:91
Nm_Man_t * pManName
Definition: abc.h:160
ABC_DLL float Abc_NtkDelayTrace(Abc_Ntk_t *pNtk, Abc_Obj_t *pOut, Abc_Obj_t *pIn, int fPrint)
Definition: abcTiming.c:919
static Abc_Obj_t * Abc_NtkObj(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:314
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkIsMappedLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:267
Definition: abc.h:89
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Definition: abc.h:90
Definition: abc.h:92
int Abc_CommandPrintDsd ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2308 of file abc.c.

2309 {
2310  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2311  int c;
2312  int fCofactor;
2313  int nCofLevel;
2314  int fProfile;
2315  int fPrintDec;
2316 
2317  extern void Kit_DsdTest( unsigned * pTruth, int nVars );
2318  extern void Kit_DsdPrintCofactors( unsigned * pTruth, int nVars, int nCofLevel, int fVerbose );
2319  extern void Dau_DecTrySets( word * p, int nVars, int fVerbose );
2320 
2321  // set defaults
2322  nCofLevel = 1;
2323  fCofactor = 0;
2324  fProfile = 0;
2325  fPrintDec = 0;
2327  while ( ( c = Extra_UtilGetopt( argc, argv, "Npcdh" ) ) != EOF )
2328  {
2329  switch ( c )
2330  {
2331  case 'N':
2332  if ( globalUtilOptind >= argc )
2333  {
2334  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
2335  goto usage;
2336  }
2337  nCofLevel = atoi(argv[globalUtilOptind]);
2338  globalUtilOptind++;
2339  if ( nCofLevel < 0 )
2340  goto usage;
2341  break;
2342  case 'p':
2343  fProfile ^= 1;
2344  break;
2345  case 'c':
2346  fCofactor ^= 1;
2347  break;
2348  case 'd':
2349  fPrintDec ^= 1;
2350  break;
2351  case 'h':
2352  goto usage;
2353  default:
2354  goto usage;
2355  }
2356  }
2357 
2358  if ( pNtk == NULL )
2359  {
2360  Abc_Print( -1, "Empty network.\n" );
2361  return 1;
2362  }
2363  // get the truth table of the first output
2364  if ( !Abc_NtkIsLogic(pNtk) )
2365  {
2366  Abc_Print( -1, "Currently works only for logic networks.\n" );
2367  return 1;
2368  }
2369  Abc_NtkToAig( pNtk );
2370  // convert it to truth table
2371  {
2372  Abc_Obj_t * pObj = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
2373  Vec_Int_t * vMemory;
2374  unsigned * pTruth;
2375  if ( !Abc_ObjIsNode(pObj) )
2376  {
2377  Abc_Print( -1, "The fanin of the first PO node does not have a logic function.\n" );
2378  return 1;
2379  }
2380  if ( Abc_ObjFaninNum(pObj) > 16 )
2381  {
2382  Abc_Print( -1, "Currently works only for up to 16 inputs.\n" );
2383  return 1;
2384  }
2385  vMemory = Vec_IntAlloc(0);
2386  pTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNtk->pManFunc, Hop_Regular((Hop_Obj_t *)pObj->pData), Abc_ObjFaninNum(pObj), vMemory, 0 );
2387  if ( Hop_IsComplement((Hop_Obj_t *)pObj->pData) )
2388  Extra_TruthNot( pTruth, pTruth, Abc_ObjFaninNum(pObj) );
2389 // Extra_PrintBinary( stdout, pTruth, 1 << Abc_ObjFaninNum(pObj) );
2390 // Abc_Print( -1, "\n" );
2391  if ( fPrintDec )//&&Abc_ObjFaninNum(pObj) <= 6 )
2392  {
2393  word * pTruthW = (word *)pTruth;
2394  if ( Abc_ObjFaninNum(pObj) < 6 )
2395  pTruthW[0] = Abc_Tt6Stretch( pTruthW[0], Abc_ObjFaninNum(pObj) );
2396  Dau_DecTrySets( (word *)pTruth, Abc_ObjFaninNum(pObj), 1 );
2397  }
2398  if ( fProfile )
2399  Kit_TruthPrintProfile( pTruth, Abc_ObjFaninNum(pObj) );
2400  else if ( fCofactor )
2401  Kit_DsdPrintCofactors( pTruth, Abc_ObjFaninNum(pObj), nCofLevel, 1 );
2402  else
2403  Kit_DsdTest( pTruth, Abc_ObjFaninNum(pObj) );
2404  Vec_IntFree( vMemory );
2405  }
2406  return 0;
2407 
2408 usage:
2409  Abc_Print( -2, "usage: print_dsd [-pcdh] [-N <num>]\n" );
2410  Abc_Print( -2, "\t print DSD formula for a single-output function with less than 16 variables\n" );
2411  Abc_Print( -2, "\t-p : toggle printing profile [default = %s]\n", fProfile? "yes": "no" );
2412  Abc_Print( -2, "\t-c : toggle recursive cofactoring [default = %s]\n", fCofactor? "yes": "no" );
2413  Abc_Print( -2, "\t-d : toggle printing decompositions [default = %s]\n", fPrintDec? "yes": "no" );
2414  Abc_Print( -2, "\t-N <num> : the number of levels to cofactor [default = %d]\n", nCofLevel );
2415  Abc_Print( -2, "\t-h : print the command usage\n");
2416  return 1;
2417 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
void Kit_TruthPrintProfile(unsigned *pTruth, int nVars)
Definition: kitTruth.c:2203
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
Definition: hop.h:65
void Dau_DecTrySets(word *pInit, int nVars, int fVerbose)
Definition: dauNonDsd.c:831
void * pManFunc
Definition: abc.h:191
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
static word Abc_Tt6Stretch(word t, int nVars)
Definition: utilTruth.h:708
int globalUtilOptind
Definition: extraUtilUtil.c:45
static int Hop_IsComplement(Hop_Obj_t *p)
Definition: hop.h:129
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Kit_DsdTest(unsigned *pTruth, int nVars)
Definition: kitDsd.c:2514
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
unsigned * Hop_ManConvertAigToTruth(Hop_Man_t *p, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, int fMsbFirst)
Definition: hopTruth.c:143
void * pData
Definition: abc.h:145
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static Hop_Obj_t * Hop_Regular(Hop_Obj_t *p)
Definition: hop.h:126
void Kit_DsdPrintCofactors(unsigned *pTruth, int nVars, int nCofLevel, int fVerbose)
Definition: kitDsd.c:2803
static void Extra_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
Definition: extra.h:320
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
int Abc_CommandPrintExdc ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1266 of file abc.c.

1267 {
1268  Abc_Ntk_t * pNtk, * pNtkTemp;
1269  double Percentage;
1270  int fShort;
1271  int c;
1272  int fPrintDc;
1273  extern double Abc_NtkSpacePercentage( Abc_Obj_t * pNode );
1274  pNtk = Abc_FrameReadNtk(pAbc);
1275 
1276  // set the defaults
1277  fShort = 1;
1278  fPrintDc = 0;
1280  while ( ( c = Extra_UtilGetopt( argc, argv, "sdh" ) ) != EOF )
1281  {
1282  switch ( c )
1283  {
1284  case 's':
1285  fShort ^= 1;
1286  break;
1287  case 'd':
1288  fPrintDc ^= 1;
1289  break;
1290  case 'h':
1291  goto usage;
1292  default:
1293  goto usage;
1294  }
1295  }
1296 
1297  if ( pNtk == NULL )
1298  {
1299  Abc_Print( -1, "Empty network.\n" );
1300  return 1;
1301  }
1302  if ( pNtk->pExdc == NULL )
1303  {
1304  Abc_Print( -1, "Network has no EXDC.\n" );
1305  return 1;
1306  }
1307 
1308  if ( fPrintDc )
1309  {
1310  if ( !Abc_NtkIsStrash(pNtk->pExdc) )
1311  {
1312  pNtkTemp = Abc_NtkStrash(pNtk->pExdc, 0, 0, 0);
1313  Percentage = Abc_NtkSpacePercentage( Abc_ObjChild0( Abc_NtkPo(pNtkTemp, 0) ) );
1314  Abc_NtkDelete( pNtkTemp );
1315  }
1316  else
1317  Percentage = Abc_NtkSpacePercentage( Abc_ObjChild0( Abc_NtkPo(pNtk->pExdc, 0) ) );
1318 
1319  Abc_Print( 1, "EXDC network statistics: " );
1320  Abc_Print( 1, "(" );
1321  if ( Percentage > 0.05 && Percentage < 99.95 )
1322  Abc_Print( 1, "%.2f", Percentage );
1323  else if ( Percentage > 0.000005 && Percentage < 99.999995 )
1324  Abc_Print( 1, "%.6f", Percentage );
1325  else
1326  Abc_Print( 1, "%f", Percentage );
1327  Abc_Print( 1, " %% don't-cares)\n" );
1328  }
1329  else
1330  Abc_Print( 1, "EXDC network statistics: \n" );
1331  Abc_NtkPrintStats( pNtk->pExdc, 0, 0, 0, 0, 0, 0, 0, 0 );
1332  return 0;
1333 
1334 usage:
1335  Abc_Print( -2, "usage: print_exdc [-dh]\n" );
1336  Abc_Print( -2, "\t prints the EXDC network statistics\n" );
1337  Abc_Print( -2, "\t-d : toggles printing don't-care percentage [default = %s]\n", fPrintDc? "yes": "no" );
1338  Abc_Print( -2, "\t-h : print the command usage\n");
1339  return 1;
1340 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * pExdc
Definition: abc.h:201
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
Definition: abc.h:383
ABC_DLL void Abc_NtkPrintStats(Abc_Ntk_t *pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch, int fSkipBuf)
Definition: abcPrint.c:207
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
double Abc_NtkSpacePercentage(Abc_Obj_t *pNode)
Definition: abcNtbdd.c:517
int Abc_CommandPrintFactor ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1583 of file abc.c.

1584 {
1585  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1586  Abc_Obj_t * pNode;
1587  int c;
1588  int fUseRealNames;
1589 
1590  // set defaults
1591  fUseRealNames = 1;
1593  while ( ( c = Extra_UtilGetopt( argc, argv, "nh" ) ) != EOF )
1594  {
1595  switch ( c )
1596  {
1597  case 'n':
1598  fUseRealNames ^= 1;
1599  break;
1600  case 'h':
1601  goto usage;
1602  default:
1603  goto usage;
1604  }
1605  }
1606 
1607  if ( pNtk == NULL )
1608  {
1609  Abc_Print( -1, "Empty network.\n" );
1610  return 1;
1611  }
1612 
1613  if ( !Abc_NtkIsSopLogic(pNtk) )
1614  {
1615  Abc_Print( -1, "Printing factored forms can be done for SOP networks.\n" );
1616  return 1;
1617  }
1618 
1619  if ( argc > globalUtilOptind + 1 )
1620  {
1621  Abc_Print( -1, "Wrong number of auguments.\n" );
1622  goto usage;
1623  }
1624 
1625  if ( argc == globalUtilOptind + 1 )
1626  {
1627  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
1628  if ( pNode == NULL )
1629  {
1630  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
1631  return 1;
1632  }
1633  Abc_NodePrintFactor( stdout, pNode, fUseRealNames );
1634  return 0;
1635  }
1636  // print the nodes
1637  Abc_NtkPrintFactor( stdout, pNtk, fUseRealNames );
1638  return 0;
1639 
1640 usage:
1641  Abc_Print( -2, "usage: print_factor [-nh] <node>\n" );
1642  Abc_Print( -2, "\t prints the factored forms of nodes\n" );
1643  Abc_Print( -2, "\t-n : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
1644  Abc_Print( -2, "\t-h : print the command usage\n");
1645  Abc_Print( -2, "\tnode : (optional) one node to consider\n");
1646  return 1;
1647 }
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
ABC_DLL void Abc_NodePrintFactor(FILE *pFile, Abc_Obj_t *pNode, int fUseRealNames)
Definition: abcPrint.c:825
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL void Abc_NtkPrintFactor(FILE *pFile, Abc_Ntk_t *pNtk, int fUseRealNames)
Definition: abcPrint.c:805
int Abc_CommandPrintFanio ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1476 of file abc.c.

1477 {
1478  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1479  int c;
1480  int fUsePis = 0;
1481  int fMffc = 0;
1482  int fVerbose = 0;
1484  while ( ( c = Extra_UtilGetopt( argc, argv, "imvh" ) ) != EOF )
1485  {
1486  switch ( c )
1487  {
1488  case 'i':
1489  fUsePis ^= 1;
1490  break;
1491  case 'm':
1492  fMffc ^= 1;
1493  break;
1494  case 'v':
1495  fVerbose ^= 1;
1496  break;
1497  case 'h':
1498  goto usage;
1499  default:
1500  goto usage;
1501  }
1502  }
1503  if ( pNtk == NULL )
1504  {
1505  Abc_Print( -1, "Empty network.\n" );
1506  return 1;
1507  }
1508  // print the nodes
1509  if ( fVerbose )
1510  Abc_NtkPrintFanio( stdout, pNtk, fUsePis );
1511  else
1512  Abc_NtkPrintFanioNew( stdout, pNtk, fMffc );
1513  return 0;
1514 
1515 usage:
1516  Abc_Print( -2, "usage: print_fanio [-imvh]\n" );
1517  Abc_Print( -2, "\t prints the statistics about fanins/fanouts of all nodes\n" );
1518  Abc_Print( -2, "\t-i : toggles considering fanouts of primary inputs only [default = %s]\n", fUsePis? "yes": "no" );
1519  Abc_Print( -2, "\t-m : toggles printing MFFC sizes instead of fanouts [default = %s]\n", fMffc? "yes": "no" );
1520  Abc_Print( -2, "\t-v : toggles verbose way of printing the stats [default = %s]\n", fVerbose? "yes": "no" );
1521  Abc_Print( -2, "\t-h : print the command usage\n");
1522  return 1;
1523 }
ABC_DLL void Abc_NtkPrintFanio(FILE *pFile, Abc_Ntk_t *pNtk, int fUsePis)
Definition: abcPrint.c:546
ABC_DLL void Abc_NtkPrintFanioNew(FILE *pFile, Abc_Ntk_t *pNtk, int fMffc)
Definition: abcPrint.c:625
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintGates ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2146 of file abc.c.

2147 {
2148  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2149  int c;
2150  int fUseLibrary;
2151 
2152  extern void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary );
2153 
2154  // set defaults
2155  fUseLibrary = 1;
2157  while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
2158  {
2159  switch ( c )
2160  {
2161  case 'l':
2162  fUseLibrary ^= 1;
2163  break;
2164  case 'h':
2165  goto usage;
2166  default:
2167  goto usage;
2168  }
2169  }
2170 
2171  if ( pNtk == NULL )
2172  {
2173  Abc_Print( -1, "Empty network.\n" );
2174  return 1;
2175  }
2176  if ( Abc_NtkHasAig(pNtk) )
2177  {
2178  Abc_Print( -1, "Printing gates does not work for AIGs and sequential AIGs.\n" );
2179  return 1;
2180  }
2181 
2182  Abc_NtkPrintGates( pNtk, fUseLibrary );
2183  return 0;
2184 
2185 usage:
2186  Abc_Print( -2, "usage: print_gates [-lh]\n" );
2187  Abc_Print( -2, "\t prints statistics about gates used in the network\n" );
2188  Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
2189  Abc_Print( -2, "\t-h : print the command usage\n");
2190  return 1;
2191 }
void Abc_NtkPrintGates(Abc_Ntk_t *pNtk, int fUseLibrary)
Definition: abcPrint.c:1055
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
Definition: abc.h:255
int Abc_CommandPrintIo ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1353 of file abc.c.

1354 {
1355  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1356  Abc_Obj_t * pNode;
1357  int c, fPrintFlops = 1;
1358 
1359  // set defaults
1361  while ( ( c = Extra_UtilGetopt( argc, argv, "fh" ) ) != EOF )
1362  {
1363  switch ( c )
1364  {
1365  case 'f':
1366  fPrintFlops ^= 1;
1367  break;
1368  case 'h':
1369  goto usage;
1370  default:
1371  goto usage;
1372  }
1373  }
1374 
1375  if ( pNtk == NULL )
1376  {
1377  Abc_Print( -1, "Empty network.\n" );
1378  return 1;
1379  }
1380 
1381  if ( argc > globalUtilOptind + 1 )
1382  {
1383  Abc_Print( -1, "Wrong number of auguments.\n" );
1384  goto usage;
1385  }
1386 
1387  if ( argc == globalUtilOptind + 1 )
1388  {
1389  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
1390  if ( pNode == NULL )
1391  {
1392  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
1393  return 1;
1394  }
1395  Abc_NodePrintFanio( stdout, pNode );
1396  return 0;
1397  }
1398  // print the nodes
1399  Abc_NtkPrintIo( stdout, pNtk, fPrintFlops );
1400  return 0;
1401 
1402 usage:
1403  Abc_Print( -2, "usage: print_io [-fh] <node>\n" );
1404  Abc_Print( -2, "\t prints the PIs/POs/flops or fanins/fanouts of a node\n" );
1405  Abc_Print( -2, "\t-f : toggles printing flops [default = %s]\n", fPrintFlops? "yes": "no" );
1406  Abc_Print( -2, "\t-h : print the command usage\n");
1407  Abc_Print( -2, "\tnode : the node to print fanins/fanouts\n");
1408  return 1;
1409 }
ABC_DLL void Abc_NtkPrintIo(FILE *pFile, Abc_Ntk_t *pNtk, int fPrintFlops)
Definition: abcPrint.c:436
ABC_DLL void Abc_NodePrintFanio(FILE *pFile, Abc_Obj_t *pNode)
Definition: abcPrint.c:752
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintKMap ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2058 of file abc.c.

2059 {
2060  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2061  Abc_Obj_t * pNode;
2062  int c;
2063  int fUseRealNames;
2064 
2065  extern void Abc_NodePrintKMap( Abc_Obj_t * pNode, int fUseRealNames );
2066 
2067  // set defaults
2068  fUseRealNames = 1;
2070  while ( ( c = Extra_UtilGetopt( argc, argv, "nh" ) ) != EOF )
2071  {
2072  switch ( c )
2073  {
2074  case 'n':
2075  fUseRealNames ^= 1;
2076  break;
2077  case 'h':
2078  goto usage;
2079  default:
2080  goto usage;
2081  }
2082  }
2083  if ( argc == globalUtilOptind + 2 )
2084  {
2085  Abc_NtkShow6VarFunc( argv[globalUtilOptind], argv[globalUtilOptind+1] );
2086  return 0;
2087  }
2088 
2089  if ( pNtk == NULL )
2090  {
2091  Abc_Print( -1, "Empty network.\n" );
2092  return 1;
2093  }
2094  if ( !Abc_NtkIsLogic(pNtk) )
2095  {
2096  Abc_Print( -1, "Visualization of Karnaugh maps works for logic networks.\n" );
2097  return 1;
2098  }
2099  if ( argc > globalUtilOptind + 1 )
2100  {
2101  Abc_Print( -1, "Wrong number of auguments.\n" );
2102  goto usage;
2103  }
2104  if ( argc == globalUtilOptind )
2105  {
2106  pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
2107  if ( !Abc_ObjIsNode(pNode) )
2108  {
2109  Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
2110  return 1;
2111  }
2112  }
2113  else
2114  {
2115  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
2116  if ( pNode == NULL )
2117  {
2118  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
2119  return 1;
2120  }
2121  }
2122  Abc_NtkToBdd(pNtk);
2123  Abc_NodePrintKMap( pNode, fUseRealNames );
2124  return 0;
2125 
2126 usage:
2127  Abc_Print( -2, "usage: print_kmap [-nh] <node>\n" );
2128  Abc_Print( -2, "\t shows the truth table of the node\n" );
2129  Abc_Print( -2, "\t-n : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
2130  Abc_Print( -2, "\t-h : print the command usage\n");
2131  Abc_Print( -2, "\t<node>: the node to consider (default = the driver of the first PO)\n");
2132  return 1;
2133 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Abc_NtkShow6VarFunc(char *pF0, char *pF1)
Definition: abcPrint.c:1590
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
void Abc_NodePrintKMap(Abc_Obj_t *pNode, int fUseRealNames)
Definition: abcPrint.c:1028
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL int Abc_NtkToBdd(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1160
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintLatch ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1422 of file abc.c.

1423 {
1424  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1425  int c;
1426  int fPrintSccs;
1427  extern void Abc_NtkPrintSccs( Abc_Ntk_t * pNtk, int fVerbose );
1428 
1429  // set defaults
1430  fPrintSccs = 0;
1432  while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
1433  {
1434  switch ( c )
1435  {
1436  case 's':
1437  fPrintSccs ^= 1;
1438  break;
1439  case 'h':
1440  goto usage;
1441  default:
1442  goto usage;
1443  }
1444  }
1445 
1446  if ( pNtk == NULL )
1447  {
1448  Abc_Print( -1, "Empty network.\n" );
1449  return 1;
1450  }
1451  // print the nodes
1452  Abc_NtkPrintLatch( stdout, pNtk );
1453  if ( fPrintSccs )
1454  Abc_NtkPrintSccs( pNtk, 0 );
1455  return 0;
1456 
1457 usage:
1458  Abc_Print( -2, "usage: print_latch [-sh]\n" );
1459  Abc_Print( -2, "\t prints information about latches\n" );
1460  Abc_Print( -2, "\t-s : toggles printing SCCs of registers [default = %s]\n", fPrintSccs? "yes": "no" );
1461  Abc_Print( -2, "\t-h : print the command usage\n");
1462  return 1;
1463 }
void Abc_NtkPrintSccs(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcDar.c:3888
ABC_DLL void Abc_NtkPrintLatch(FILE *pFile, Abc_Ntk_t *pNtk)
Definition: abcPrint.c:473
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintLevel ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1660 of file abc.c.

1661 {
1662  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1663  Abc_Obj_t * pNode;
1664  int c;
1665  int fListNodes;
1666  int fProfile;
1667  int fVerbose;
1668 
1669  // set defaults
1670  fListNodes = 0;
1671  fProfile = 1;
1672  fVerbose = 0;
1674  while ( ( c = Extra_UtilGetopt( argc, argv, "npvh" ) ) != EOF )
1675  {
1676  switch ( c )
1677  {
1678  case 'n':
1679  fListNodes ^= 1;
1680  break;
1681  case 'p':
1682  fProfile ^= 1;
1683  break;
1684  case 'v':
1685  fVerbose ^= 1;
1686  break;
1687  case 'h':
1688  goto usage;
1689  default:
1690  goto usage;
1691  }
1692  }
1693 
1694  if ( pNtk == NULL )
1695  {
1696  Abc_Print( -1, "Empty network.\n" );
1697  return 1;
1698  }
1699 
1700  if ( !fProfile && !Abc_NtkIsStrash(pNtk) )
1701  {
1702  Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
1703  return 1;
1704  }
1705 
1706  if ( argc > globalUtilOptind + 1 )
1707  {
1708  Abc_Print( -1, "Wrong number of auguments.\n" );
1709  goto usage;
1710  }
1711 
1712  if ( argc == globalUtilOptind + 1 )
1713  {
1714  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
1715  if ( pNode == NULL )
1716  {
1717  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
1718  return 1;
1719  }
1720  Abc_NodePrintLevel( stdout, pNode );
1721  return 0;
1722  }
1723  // process all COs
1724  Abc_NtkPrintLevel( stdout, pNtk, fProfile, fListNodes, fVerbose );
1725  return 0;
1726 
1727 usage:
1728  Abc_Print( -2, "usage: print_level [-npvh] <node>\n" );
1729  Abc_Print( -2, "\t prints information about node level and cone size\n" );
1730  Abc_Print( -2, "\t-n : toggles printing nodes by levels [default = %s]\n", fListNodes? "yes": "no" );
1731  Abc_Print( -2, "\t-p : toggles printing level profile [default = %s]\n", fProfile? "yes": "no" );
1732  Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
1733  Abc_Print( -2, "\t-h : print the command usage\n");
1734  Abc_Print( -2, "\tnode : (optional) one node to consider\n");
1735  return 1;
1736 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Abc_NtkPrintLevel(FILE *pFile, Abc_Ntk_t *pNtk, int fProfile, int fListNodes, int fVerbose)
Definition: abcPrint.c:866
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL void Abc_NodePrintLevel(FILE *pFile, Abc_Obj_t *pNode)
Definition: abcPrint.c:985
int Abc_CommandPrintMffc ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1536 of file abc.c.

1537 {
1538  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1539  int c;
1540  extern void Abc_NtkPrintMffc( FILE * pFile, Abc_Ntk_t * pNtk );
1541 
1542  // set defaults
1544  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
1545  {
1546  switch ( c )
1547  {
1548  case 'h':
1549  goto usage;
1550  default:
1551  goto usage;
1552  }
1553  }
1554 
1555  if ( pNtk == NULL )
1556  {
1557  Abc_Print( -1, "Empty network.\n" );
1558  return 1;
1559  }
1560 
1561  // print the nodes
1562  Abc_NtkPrintMffc( stdout, pNtk );
1563  return 0;
1564 
1565 usage:
1566  Abc_Print( -2, "usage: print_mffc [-h]\n" );
1567  Abc_Print( -2, "\t prints the MFFC of each node in the network\n" );
1568  Abc_Print( -2, "\t-h : print the command usage\n");
1569  return 1;
1570 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NtkPrintMffc(FILE *pFile, Abc_Ntk_t *pNtk)
Definition: abcPrint.c:784
int Abc_CommandPrintMiter ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2485 of file abc.c.

2486 {
2487  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2488  int c;
2489  int fUseLibrary;
2490 
2491  extern void Abc_NtkPrintMiter( Abc_Ntk_t * pNtk );
2492 
2493  // set defaults
2494  fUseLibrary = 1;
2496  while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
2497  {
2498  switch ( c )
2499  {
2500  case 'l':
2501  fUseLibrary ^= 1;
2502  break;
2503  case 'h':
2504  goto usage;
2505  default:
2506  goto usage;
2507  }
2508  }
2509  if ( pNtk == NULL )
2510  {
2511  Abc_Print( -1, "Empty network.\n" );
2512  return 1;
2513  }
2514  if ( !Abc_NtkIsStrash(pNtk) )
2515  {
2516  Abc_Print( -1, "The network is should be structurally hashed.\n" );
2517  return 1;
2518  }
2519  Abc_NtkPrintMiter( pNtk );
2520  return 0;
2521 
2522 usage:
2523  Abc_Print( -2, "usage: print_miter [-h]\n" );
2524  Abc_Print( -2, "\t prints the status of the miter\n" );
2525  Abc_Print( -2, "\t-h : print the command usage\n");
2526  return 1;
2527 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_NtkPrintMiter(Abc_Ntk_t *pNtk)
Definition: abcPrint.c:1361
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintSharing ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2204 of file abc.c.

2205 {
2206  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2207  int c;
2208  int fUseLibrary;
2209 
2210  extern void Abc_NtkPrintSharing( Abc_Ntk_t * pNtk );
2211 
2212  // set defaults
2213  fUseLibrary = 1;
2215  while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
2216  {
2217  switch ( c )
2218  {
2219  case 'l':
2220  fUseLibrary ^= 1;
2221  break;
2222  case 'h':
2223  goto usage;
2224  default:
2225  goto usage;
2226  }
2227  }
2228 
2229  if ( pNtk == NULL )
2230  {
2231  Abc_Print( -1, "Empty network.\n" );
2232  return 1;
2233  }
2234  Abc_NtkPrintSharing( pNtk );
2235  return 0;
2236 
2237 usage:
2238  Abc_Print( -2, "usage: print_sharing [-h]\n" );
2239  Abc_Print( -2, "\t prints the number of shared nodes in the TFI cones of the COs\n" );
2240 // Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
2241  Abc_Print( -2, "\t-h : print the command usage\n");
2242  return 1;
2243 }
void Abc_NtkPrintSharing(Abc_Ntk_t *pNtk)
Definition: abcPrint.c:1179
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintStats ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

DECLARATIONS ///.

CFile****************************************************************

FileName [abc.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Command file.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
abc.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1155 of file abc.c.

1156 {
1157  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1158  int fFactor;
1159  int fSaveBest;
1160  int fDumpResult;
1161  int fUseLutLib;
1162  int fPrintTime;
1163  int fPrintMuxes;
1164  int fPower;
1165  int fGlitch;
1166  int fSkipBuf;
1167  int c;
1168 
1169  pNtk = Abc_FrameReadNtk(pAbc);
1170 
1171  // set the defaults
1172  fFactor = 0;
1173  fSaveBest = 0;
1174  fDumpResult = 0;
1175  fUseLutLib = 0;
1176  fPrintTime = 0;
1177  fPrintMuxes = 0;
1178  fPower = 0;
1179  fGlitch = 0;
1180  fSkipBuf = 0;
1182  while ( ( c = Extra_UtilGetopt( argc, argv, "fbdltmpgsh" ) ) != EOF )
1183  {
1184  switch ( c )
1185  {
1186  case 'f':
1187  fFactor ^= 1;
1188  break;
1189  case 'b':
1190  fSaveBest ^= 1;
1191  break;
1192  case 'd':
1193  fDumpResult ^= 1;
1194  break;
1195  case 'l':
1196  fUseLutLib ^= 1;
1197  break;
1198  case 't':
1199  fPrintTime ^= 1;
1200  break;
1201  case 'm':
1202  fPrintMuxes ^= 1;
1203  break;
1204  case 'p':
1205  fPower ^= 1;
1206  break;
1207  case 'g':
1208  fGlitch ^= 1;
1209  break;
1210  case 's':
1211  fSkipBuf ^= 1;
1212  break;
1213  case 'h':
1214  goto usage;
1215  default:
1216  goto usage;
1217  }
1218  }
1219 
1220  if ( pNtk == NULL )
1221  {
1222  Abc_Print( -1, "Empty network.\n" );
1223  return 1;
1224  }
1225  if ( !Abc_NtkIsLogic(pNtk) && fUseLutLib )
1226  {
1227  Abc_Print( -1, "Cannot print LUT delay for a non-logic network.\n" );
1228  return 1;
1229  }
1230  Abc_NtkPrintStats( pNtk, fFactor, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch, fSkipBuf );
1231  if ( fPrintTime )
1232  {
1233  pAbc->TimeTotal += pAbc->TimeCommand;
1234  Abc_Print( 1, "elapse: %3.2f seconds, total: %3.2f seconds\n", pAbc->TimeCommand, pAbc->TimeTotal );
1235  pAbc->TimeCommand = 0.0;
1236  }
1237  return 0;
1238 
1239 usage:
1240  Abc_Print( -2, "usage: print_stats [-fbdltmpgsh]\n" );
1241  Abc_Print( -2, "\t prints the network statistics\n" );
1242  Abc_Print( -2, "\t-f : toggles printing the literal count in the factored forms [default = %s]\n", fFactor? "yes": "no" );
1243  Abc_Print( -2, "\t-b : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
1244  Abc_Print( -2, "\t-d : toggles dumping statistics about the network into file [default = %s]\n", fDumpResult? "yes": "no" );
1245  Abc_Print( -2, "\t-l : toggles printing delay of LUT mapping using LUT library [default = %s]\n", fSaveBest? "yes": "no" );
1246  Abc_Print( -2, "\t-t : toggles printing runtime statistics [default = %s]\n", fPrintTime? "yes": "no" );
1247  Abc_Print( -2, "\t-m : toggles printing MUX statistics [default = %s]\n", fPrintMuxes? "yes": "no" );
1248  Abc_Print( -2, "\t-p : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
1249  Abc_Print( -2, "\t-g : toggles printing percentage of increased power due to glitching [default = %s]\n", fGlitch? "yes": "no" );
1250  Abc_Print( -2, "\t-s : toggles not counting single-output nodes as nodes [default = %s]\n", fSkipBuf? "yes": "no" );
1251  Abc_Print( -2, "\t-h : print the command usage\n");
1252  return 1;
1253 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Abc_NtkPrintStats(Abc_Ntk_t *pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch, int fSkipBuf)
Definition: abcPrint.c:207
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintStatus ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2540 of file abc.c.

2541 {
2542  int c, fShort = 1;
2543  // set defaults
2545  while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
2546  {
2547  switch ( c )
2548  {
2549  case 's':
2550  fShort ^= 1;
2551  break;
2552  case 'h':
2553  goto usage;
2554  default:
2555  goto usage;
2556  }
2557  }
2558  Abc_Print( 1,"Status = %d Frames = %d ", pAbc->Status, pAbc->nFrames );
2559  if ( pAbc->pCex == NULL && pAbc->vCexVec == NULL )
2560  Abc_Print( 1,"Cex is not defined.\n" );
2561  else
2562  {
2563  if ( pAbc->pCex )
2564  Abc_CexPrintStats( pAbc->pCex );
2565  if ( pAbc->vCexVec )
2566  {
2567  Abc_Cex_t * pTemp;
2568  int nCexes = 0;
2569  int Counter = 0;
2570  printf( "\n" );
2571  Vec_PtrForEachEntry( Abc_Cex_t *, pAbc->vCexVec, pTemp, c )
2572  {
2573  if ( pTemp == (void *)(ABC_PTRINT_T)1 )
2574  {
2575  Counter++;
2576  continue;
2577  }
2578  if ( pTemp )
2579  {
2580  printf( "%4d : ", ++nCexes );
2581  Abc_CexPrintStats( pTemp );
2582  }
2583  }
2584  if ( Counter )
2585  printf( "In total, %d (out of %d) outputs are \"sat\" but CEXes are not recorded.\n", Counter, Vec_PtrSize(pAbc->vCexVec) );
2586  }
2587  }
2588  if ( pAbc->vStatuses )
2589  {
2590  if ( fShort )
2591  {
2592  printf( "Status array contains %d SAT, %d UNSAT, and %d UNDEC entries (out of %d).",
2593  Vec_IntCountEntry(pAbc->vStatuses, 0), Vec_IntCountEntry(pAbc->vStatuses, 1),
2594  Vec_IntCountEntry(pAbc->vStatuses, -1), Vec_IntSize(pAbc->vStatuses) );
2595  }
2596  else
2597  {
2598  int i, Entry;
2599  Vec_IntForEachEntry( pAbc->vStatuses, Entry, i )
2600  printf( "%d=%d ", i, Entry );
2601  }
2602  printf( "\n" );
2603  }
2604  return 0;
2605 
2606 usage:
2607  Abc_Print( -2, "usage: print_status [-sh]\n" );
2608  Abc_Print( -2, "\t prints verification status\n" );
2609  Abc_Print( -2, "\t-s : toggle using short print-out [default = %s]\n", fShort? "yes": "no" );
2610  Abc_Print( -2, "\t-h : print the command usage\n");
2611  return 1;
2612 }
static ABC_NAMESPACE_IMPL_START bool toggle
Definition: reduce.c:24
static int Vec_IntCountEntry(Vec_Int_t *p, int Entry)
Definition: vecInt.h:1156
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Abc_CexPrintStats(Abc_Cex_t *p)
Definition: utilCex.c:256
static int Counter
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
int Abc_CommandPrintSupport ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1749 of file abc.c.

1750 {
1751  Vec_Ptr_t * vSuppFun;
1752  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1753  int c;
1754  int fStruct;
1755  int fVerbose;
1756  int fVeryVerbose;
1757  extern Vec_Ptr_t * Sim_ComputeFunSupp( Abc_Ntk_t * pNtk, int fVerbose );
1758  extern void Abc_NtkPrintStrSupports( Abc_Ntk_t * pNtk, int fMatrix );
1759 
1760  // set defaults
1761  fStruct = 1;
1762  fVerbose = 0;
1763  fVeryVerbose = 0;
1765  while ( ( c = Extra_UtilGetopt( argc, argv, "svwh" ) ) != EOF )
1766  {
1767  switch ( c )
1768  {
1769  case 's':
1770  fStruct ^= 1;
1771  break;
1772  case 'v':
1773  fVerbose ^= 1;
1774  break;
1775  case 'w':
1776  fVeryVerbose ^= 1;
1777  break;
1778  case 'h':
1779  goto usage;
1780  default:
1781  goto usage;
1782  }
1783  }
1784 
1785  if ( pNtk == NULL )
1786  {
1787  Abc_Print( -1, "Empty network.\n" );
1788  return 1;
1789  }
1790 
1791  // print support information
1792  if ( fStruct )
1793  {
1794  Abc_NtkPrintStrSupports( pNtk, fVeryVerbose );
1795  return 0;
1796  }
1797 
1798  if ( !Abc_NtkIsComb(pNtk) )
1799  {
1800  Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
1801  return 1;
1802  }
1803  if ( !Abc_NtkIsStrash(pNtk) )
1804  {
1805  Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
1806  return 1;
1807  }
1808  vSuppFun = Sim_ComputeFunSupp( pNtk, fVerbose );
1809  ABC_FREE( vSuppFun->pArray[0] );
1810  Vec_PtrFree( vSuppFun );
1811  return 0;
1812 
1813 usage:
1814  Abc_Print( -2, "usage: print_supp [-svwh]\n" );
1815  Abc_Print( -2, "\t prints the supports of the CO nodes\n" );
1816  Abc_Print( -2, "\t-s : toggle printing structural support only [default = %s].\n", fStruct? "yes": "no" );
1817  Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
1818  Abc_Print( -2, "\t-w : enable printing CI/CO dependency matrix [default = %s].\n", fVeryVerbose? "yes": "no" );
1819  Abc_Print( -2, "\t-h : print the command usage\n");
1820  return 1;
1821 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
void Abc_NtkPrintStrSupports(Abc_Ntk_t *pNtk, int fMatrix)
Definition: abcPrint.c:1236
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Vec_Ptr_t * Sim_ComputeFunSupp(Abc_Ntk_t *pNtk, int fVerbose)
Definition: simSupp.c:103
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Abc_CommandPrintSymms ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1834 of file abc.c.

1835 {
1836  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1837  int c;
1838  int fUseBdds;
1839  int fNaive;
1840  int fReorder;
1841  int fVerbose;
1842  extern void Abc_NtkSymmetries( Abc_Ntk_t * pNtk, int fUseBdds, int fNaive, int fReorder, int fVerbose );
1843 
1844  // set defaults
1845  fUseBdds = 0;
1846  fNaive = 0;
1847  fReorder = 1;
1848  fVerbose = 0;
1850  while ( ( c = Extra_UtilGetopt( argc, argv, "bnrvh" ) ) != EOF )
1851  {
1852  switch ( c )
1853  {
1854  case 'b':
1855  fUseBdds ^= 1;
1856  break;
1857  case 'n':
1858  fNaive ^= 1;
1859  break;
1860  case 'r':
1861  fReorder ^= 1;
1862  break;
1863  case 'v':
1864  fVerbose ^= 1;
1865  break;
1866  case 'h':
1867  goto usage;
1868  default:
1869  goto usage;
1870  }
1871  }
1872  if ( pNtk == NULL )
1873  {
1874  Abc_Print( -1, "Empty network.\n" );
1875  return 1;
1876  }
1877  if ( !Abc_NtkIsComb(pNtk) )
1878  {
1879  Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
1880  return 1;
1881  }
1882  if ( Abc_NtkIsStrash(pNtk) )
1883  Abc_NtkSymmetries( pNtk, fUseBdds, fNaive, fReorder, fVerbose );
1884  else
1885  {
1886  pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
1887  Abc_NtkSymmetries( pNtk, fUseBdds, fNaive, fReorder, fVerbose );
1888  Abc_NtkDelete( pNtk );
1889  }
1890  return 0;
1891 
1892 usage:
1893  Abc_Print( -2, "usage: print_symm [-bnrvh]\n" );
1894  Abc_Print( -2, "\t computes symmetries of the PO functions\n" );
1895  Abc_Print( -2, "\t-b : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
1896  Abc_Print( -2, "\t-n : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
1897  Abc_Print( -2, "\t-r : enable dynamic BDD variable reordering [default = %s].\n", fReorder? "yes": "no" );
1898  Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
1899  Abc_Print( -2, "\t-h : print the command usage\n");
1900  return 1;
1901 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
void Abc_NtkSymmetries(Abc_Ntk_t *pNtk, int fUseBdds, int fNaive, int fReorder, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcSymm.c:52
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintUnate ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1914 of file abc.c.

1915 {
1916  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
1917  int c;
1918  int fUseBdds;
1919  int fUseNaive;
1920  int fVerbose;
1921  extern void Abc_NtkPrintUnate( Abc_Ntk_t * pNtk, int fUseBdds, int fUseNaive, int fVerbose );
1922 
1923  // set defaults
1924  fUseBdds = 1;
1925  fUseNaive = 0;
1926  fVerbose = 0;
1928  while ( ( c = Extra_UtilGetopt( argc, argv, "bnvh" ) ) != EOF )
1929  {
1930  switch ( c )
1931  {
1932  case 'b':
1933  fUseBdds ^= 1;
1934  break;
1935  case 'n':
1936  fUseNaive ^= 1;
1937  break;
1938  case 'v':
1939  fVerbose ^= 1;
1940  break;
1941  case 'h':
1942  goto usage;
1943  default:
1944  goto usage;
1945  }
1946  }
1947  if ( pNtk == NULL )
1948  {
1949  Abc_Print( -1, "Empty network.\n" );
1950  return 1;
1951  }
1952  if ( !Abc_NtkIsStrash(pNtk) )
1953  {
1954  Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
1955  return 1;
1956  }
1957  Abc_NtkPrintUnate( pNtk, fUseBdds, fUseNaive, fVerbose );
1958  return 0;
1959 
1960 usage:
1961  Abc_Print( -2, "usage: print_unate [-bnvh]\n" );
1962  Abc_Print( -2, "\t computes unate variables of the PO functions\n" );
1963  Abc_Print( -2, "\t-b : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
1964  Abc_Print( -2, "\t-n : toggle naive BDD-based computation [default = %s].\n", fUseNaive? "yes": "no" );
1965  Abc_Print( -2, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
1966  Abc_Print( -2, "\t-h : print the command usage\n");
1967  return 1;
1968 }
void Abc_NtkPrintUnate(Abc_Ntk_t *pNtk, int fUseBdds, int fUseNaive, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcUnate.c:49
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandPrintXCut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2256 of file abc.c.

2257 {
2258  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2259  int c;
2260  int fUseLibrary;
2261 
2262  extern int Abc_NtkCrossCut( Abc_Ntk_t * pNtk );
2263 
2264  // set defaults
2265  fUseLibrary = 1;
2267  while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
2268  {
2269  switch ( c )
2270  {
2271  case 'l':
2272  fUseLibrary ^= 1;
2273  break;
2274  case 'h':
2275  goto usage;
2276  default:
2277  goto usage;
2278  }
2279  }
2280 
2281  if ( pNtk == NULL )
2282  {
2283  Abc_Print( -1, "Empty network.\n" );
2284  return 1;
2285  }
2286  Abc_NtkCrossCut( pNtk );
2287  return 0;
2288 
2289 usage:
2290  Abc_Print( -2, "usage: print_xcut [-h]\n" );
2291  Abc_Print( -2, "\t prints the size of the cross cut of the current network\n" );
2292 // Abc_Print( -2, "\t-l : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
2293  Abc_Print( -2, "\t-h : print the command usage\n");
2294  return 1;
2295 }
int Abc_NtkCrossCut(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:2009
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandProve ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21764 of file abc.c.

21765 {
21766  Abc_Ntk_t * pNtk, * pNtkTemp;
21767  Prove_Params_t Params, * pParams = &Params;
21768  int c, RetValue;
21769  abctime clk;
21770 
21771  pNtk = Abc_FrameReadNtk(pAbc);
21772  // set defaults
21773  Prove_ParamsSetDefault( pParams );
21775  while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGLIrfbvh" ) ) != EOF )
21776  {
21777  switch ( c )
21778  {
21779  case 'N':
21780  if ( globalUtilOptind >= argc )
21781  {
21782  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
21783  goto usage;
21784  }
21785  pParams->nItersMax = atoi(argv[globalUtilOptind]);
21786  globalUtilOptind++;
21787  if ( pParams->nItersMax < 0 )
21788  goto usage;
21789  break;
21790  case 'C':
21791  if ( globalUtilOptind >= argc )
21792  {
21793  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
21794  goto usage;
21795  }
21796  pParams->nMiteringLimitStart = atoi(argv[globalUtilOptind]);
21797  globalUtilOptind++;
21798  if ( pParams->nMiteringLimitStart < 0 )
21799  goto usage;
21800  break;
21801  case 'F':
21802  if ( globalUtilOptind >= argc )
21803  {
21804  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
21805  goto usage;
21806  }
21807  pParams->nFraigingLimitStart = atoi(argv[globalUtilOptind]);
21808  globalUtilOptind++;
21809  if ( pParams->nFraigingLimitStart < 0 )
21810  goto usage;
21811  break;
21812  case 'G':
21813  if ( globalUtilOptind >= argc )
21814  {
21815  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
21816  goto usage;
21817  }
21818  pParams->nFraigingLimitMulti = (float)atoi(argv[globalUtilOptind]);
21819  globalUtilOptind++;
21820  if ( pParams->nFraigingLimitMulti < 0 )
21821  goto usage;
21822  break;
21823  case 'L':
21824  if ( globalUtilOptind >= argc )
21825  {
21826  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
21827  goto usage;
21828  }
21829  pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
21830  globalUtilOptind++;
21831  if ( pParams->nMiteringLimitLast < 0 )
21832  goto usage;
21833  break;
21834  case 'I':
21835  if ( globalUtilOptind >= argc )
21836  {
21837  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
21838  goto usage;
21839  }
21840  pParams->nTotalInspectLimit = atoi(argv[globalUtilOptind]);
21841  globalUtilOptind++;
21842  if ( pParams->nTotalInspectLimit < 0 )
21843  goto usage;
21844  break;
21845  case 'r':
21846  pParams->fUseRewriting ^= 1;
21847  break;
21848  case 'f':
21849  pParams->fUseFraiging ^= 1;
21850  break;
21851  case 'b':
21852  pParams->fUseBdds ^= 1;
21853  break;
21854  case 'v':
21855  pParams->fVerbose ^= 1;
21856  break;
21857  case 'h':
21858  goto usage;
21859  default:
21860  goto usage;
21861  }
21862  }
21863 
21864  if ( pNtk == NULL )
21865  {
21866  Abc_Print( -1, "Empty network.\n" );
21867  return 1;
21868  }
21869  if ( Abc_NtkLatchNum(pNtk) > 0 )
21870  {
21871  Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
21872  return 0;
21873  }
21874  if ( Abc_NtkCoNum(pNtk) != 1 )
21875  {
21876  Abc_Print( -1, "Currently can only solve the miter with one output.\n" );
21877  return 0;
21878  }
21879  clk = Abc_Clock();
21880 
21881  if ( Abc_NtkIsStrash(pNtk) )
21882  pNtkTemp = Abc_NtkDup( pNtk );
21883  else
21884  pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
21885 
21886  RetValue = Abc_NtkMiterProve( &pNtkTemp, pParams );
21887 
21888  // verify that the pattern is correct
21889  if ( RetValue == 0 )
21890  {
21891  int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtkTemp->pModel );
21892  if ( pSimInfo[0] != 1 )
21893  Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
21894  ABC_FREE( pSimInfo );
21895  }
21896  pAbc->Status = RetValue;
21897  if ( RetValue == -1 )
21898  Abc_Print( 1, "UNDECIDED " );
21899  else if ( RetValue == 0 )
21900  Abc_Print( 1, "SATISFIABLE " );
21901  else
21902  Abc_Print( 1, "UNSATISFIABLE " );
21903  //Abc_Print( -1, "\n" );
21904 
21905  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
21906  // replace the current network
21907  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
21908  return 0;
21909 
21910 usage:
21911  Abc_Print( -2, "usage: prove [-NCFGLI num] [-rfbvh]\n" );
21912  Abc_Print( -2, "\t solves combinational miter by rewriting, FRAIGing, and SAT\n" );
21913  Abc_Print( -2, "\t replaces the current network by the cone modified by rewriting\n" );
21914  Abc_Print( -2, "\t (there is also newer CEC command \"iprove\")\n" );
21915  Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
21916  Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
21917  Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
21918  Abc_Print( -2, "\t-G num : multiplicative coefficient for fraiging [default = %d]\n", (int)pParams->nFraigingLimitMulti );
21919  Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
21920  Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
21921  Abc_Print( -2, "\t-r : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
21922  Abc_Print( -2, "\t-f : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
21923  Abc_Print( -2, "\t-b : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
21924  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
21925  Abc_Print( -2, "\t-h : print the command usage\n");
21926  return 1;
21927 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
void Prove_ParamsSetDefault(Prove_Params_t *pParams)
FUNCTION DEFINITIONS ///.
Definition: fraigMan.c:46
ABC_DLL int Abc_NtkMiterProve(Abc_Ntk_t **ppNtk, void *pParams)
FUNCTION DEFINITIONS ///.
Definition: abcProve.c:59
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
int * pModel
Definition: abc.h:198
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_INT64_T nTotalInspectLimit
Definition: ivyFraig.c:134
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
Definition: abcVerify.c:686
ABC_INT64_T abctime
Definition: abc_global.h:278
int Abc_CommandPSat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21605 of file abc.c.

21606 {
21607  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
21608  int RetValue;
21609  int c;
21610  int nAlgo;
21611  int nPartSize;
21612  int nConfPart;
21613  int nConfTotal;
21614  int fAlignPol;
21615  int fSynthesize;
21616  int fVerbose;
21617  abctime clk;
21618 
21619  extern int Abc_NtkPartitionedSat( Abc_Ntk_t * pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose );
21620  // set defaults
21621  nAlgo = 0;
21622  nPartSize = 10000;
21623  nConfPart = 0;
21624  nConfTotal = 1000000;
21625  fAlignPol = 1;
21626  fSynthesize = 0;
21627  fVerbose = 1;
21629  while ( ( c = Extra_UtilGetopt( argc, argv, "APCpsvh" ) ) != EOF )
21630  {
21631  switch ( c )
21632  {
21633  case 'A':
21634  if ( globalUtilOptind >= argc )
21635  {
21636  Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
21637  goto usage;
21638  }
21639  nAlgo = atoi(argv[globalUtilOptind]);
21640  globalUtilOptind++;
21641  if ( nAlgo < 0 )
21642  goto usage;
21643  break;
21644  case 'P':
21645  if ( globalUtilOptind >= argc )
21646  {
21647  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
21648  goto usage;
21649  }
21650  nPartSize = atoi(argv[globalUtilOptind]);
21651  globalUtilOptind++;
21652  if ( nPartSize < 0 )
21653  goto usage;
21654  break;
21655  case 'C':
21656  if ( globalUtilOptind >= argc )
21657  {
21658  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
21659  goto usage;
21660  }
21661  nConfTotal = atoi(argv[globalUtilOptind]);
21662  globalUtilOptind++;
21663  if ( nConfTotal < 0 )
21664  goto usage;
21665  break;
21666  case 'p':
21667  fAlignPol ^= 1;
21668  break;
21669  case 's':
21670  fSynthesize ^= 1;
21671  break;
21672  case 'v':
21673  fVerbose ^= 1;
21674  break;
21675  case 'h':
21676  goto usage;
21677  default:
21678  goto usage;
21679  }
21680  }
21681 
21682  if ( pNtk == NULL )
21683  {
21684  Abc_Print( -1, "Empty network.\n" );
21685  return 1;
21686  }
21687  if ( Abc_NtkLatchNum(pNtk) > 0 )
21688  {
21689  Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
21690  return 0;
21691  }
21692  if ( !Abc_NtkIsStrash(pNtk) )
21693  {
21694  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
21695  return 0;
21696  }
21697 
21698  clk = Abc_Clock();
21699  RetValue = Abc_NtkPartitionedSat( pNtk, nAlgo, nPartSize, nConfPart, nConfTotal, fAlignPol, fSynthesize, fVerbose );
21700  // verify that the pattern is correct
21701  if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
21702  {
21703  //int i;
21704  //Abc_Obj_t * pObj;
21705  int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
21706  if ( pSimInfo[0] != 1 )
21707  Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
21708  ABC_FREE( pSimInfo );
21709  /*
21710  // print model
21711  Abc_NtkForEachPi( pNtk, pObj, i )
21712  {
21713  Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
21714  if ( i == 70 )
21715  break;
21716  }
21717  Abc_Print( -1, "\n" );
21718  */
21719  }
21720 
21721  if ( RetValue == -1 )
21722  Abc_Print( 1, "UNDECIDED " );
21723  else if ( RetValue == 0 )
21724  Abc_Print( 1, "SATISFIABLE " );
21725  else
21726  Abc_Print( 1, "UNSATISFIABLE " );
21727  //Abc_Print( -1, "\n" );
21728  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
21729  return 0;
21730 
21731 usage:
21732  Abc_Print( -2, "usage: psat [-APC num] [-psvh]\n" );
21733  Abc_Print( -2, "\t solves the combinational miter using partitioning\n" );
21734  Abc_Print( -2, "\t (derives CNF from the current network and leave it unchanged)\n" );
21735  Abc_Print( -2, "\t for multi-output miters, tries to prove that the AND of POs is always 0\n" );
21736  Abc_Print( -2, "\t (if POs should be ORed instead of ANDed, use command \"orpos\")\n" );
21737  Abc_Print( -2, "\t-A num : partitioning algorithm [default = %d]\n", nAlgo );
21738  Abc_Print( -2, "\t 0 : no partitioning\n" );
21739  Abc_Print( -2, "\t 1 : partitioning by level\n" );
21740  Abc_Print( -2, "\t 2 : DFS post-order\n" );
21741  Abc_Print( -2, "\t 3 : DFS pre-order\n" );
21742  Abc_Print( -2, "\t 4 : bit-slicing\n" );
21743  Abc_Print( -2, "\t partitions are ordered by level (high level first)\n" );
21744  Abc_Print( -2, "\t-P num : limit on the partition size [default = %d]\n", nPartSize );
21745  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfTotal );
21746  Abc_Print( -2, "\t-p : align polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
21747  Abc_Print( -2, "\t-s : apply logic synthesis to each partition [default = %s]\n", fSynthesize? "yes": "no" );
21748  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
21749  Abc_Print( -2, "\t-h : print the command usage\n");
21750  return 1;
21751 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int Abc_NtkPartitionedSat(Abc_Ntk_t *pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose)
Definition: abcDar.c:1829
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static abctime Abc_Clock()
Definition: abc_global.h:279
int * pModel
Definition: abc.h:198
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
Definition: abcVerify.c:686
ABC_INT64_T abctime
Definition: abc_global.h:278
int Abc_CommandPutOnTop ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7583 of file abc.c.

7584 {
7585  extern Abc_Ntk_t * Abc_NtkPutOnTop( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtk2 );
7586 
7587  Abc_Ntk_t * pNtk, * pNtk2, * pNtkRes;
7588  char * FileName;
7589  int fComb = 0;
7590  int c;
7591  pNtk = Abc_FrameReadNtk(pAbc);
7592 
7593  // set defaults
7595  while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
7596  {
7597  switch ( c )
7598  {
7599  case 'c':
7600  fComb ^= 1;
7601  break;
7602  default:
7603  goto usage;
7604  }
7605  }
7606 
7607  // get the second network
7608  if ( argc != globalUtilOptind + 1 )
7609  {
7610  Abc_Print( -1, "The network to append is not given.\n" );
7611  return 1;
7612  }
7613 
7614  if ( !Abc_NtkIsLogic(pNtk) )
7615  {
7616  Abc_Print( -1, "The base network should be in the logic form.\n" );
7617  return 1;
7618  }
7619 
7620  // check if the second network is combinational
7621  if ( Abc_NtkLatchNum(pNtk) )
7622  {
7623  Abc_Print( -1, "The current network has latches. This command does not work for such networks.\n" );
7624  return 0;
7625  }
7626 
7627  // read the second network
7628  FileName = argv[globalUtilOptind];
7629  pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
7630  if ( pNtk2 == NULL )
7631  return 1;
7632 
7633  // check if the second network is combinational
7634  if ( Abc_NtkLatchNum(pNtk2) )
7635  {
7636  Abc_NtkDelete( pNtk2 );
7637  Abc_Print( -1, "The second network has latches. This command does not work for such networks.\n" );
7638  return 0;
7639  }
7640  // compare inputs/outputs
7641  if ( Abc_NtkPoNum(pNtk) != Abc_NtkPiNum(pNtk2) )
7642  {
7643  Abc_NtkDelete( pNtk2 );
7644  Abc_Print( -1, "The PO count (%d) of the first network is not equal to PI count (%d) of the second network.\n", Abc_NtkPoNum(pNtk), Abc_NtkPiNum(pNtk2) );
7645  return 0;
7646  }
7647 
7648  // get the new network
7649  pNtkRes = Abc_NtkPutOnTop( pNtk, pNtk2 );
7650  Abc_NtkDelete( pNtk2 );
7651  // replace the current network
7652  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7653  return 0;
7654 
7655 usage:
7656  Abc_Print( -2, "usage: putontop [-h] <file>\n" );
7657  Abc_Print( -2, "\t connects PIs of network in <file> to POs of current network\n" );
7658  Abc_Print( -2, "\t-h : print the command usage\n");
7659  Abc_Print( -2, "\t<file> : file name with the second network\n");
7660  return 1;
7661 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
Abc_Ntk_t * Abc_NtkPutOnTop(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtk2)
Definition: abcStrash.c:791
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandQbf ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso [] Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 12909 of file abc.c.

12910 {
12911  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
12912  int c;
12913  int nPars;
12914  int nIters;
12915  int fDumpCnf;
12916  int fVerbose;
12917 
12918  extern void Abc_NtkQbf( Abc_Ntk_t * pNtk, int nPars, int nIters, int fDumpCnf, int fVerbose );
12919  // set defaults
12920  nPars = -1;
12921  nIters = 500;
12922  fDumpCnf = 0;
12923  fVerbose = 0;
12925  while ( ( c = Extra_UtilGetopt( argc, argv, "PIdvh" ) ) != EOF )
12926  {
12927  switch ( c )
12928  {
12929  case 'P':
12930  if ( globalUtilOptind >= argc )
12931  {
12932  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
12933  goto usage;
12934  }
12935  nPars = atoi(argv[globalUtilOptind]);
12936  globalUtilOptind++;
12937  if ( nPars < 0 )
12938  goto usage;
12939  break;
12940  case 'I':
12941  if ( globalUtilOptind >= argc )
12942  {
12943  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
12944  goto usage;
12945  }
12946  nIters = atoi(argv[globalUtilOptind]);
12947  globalUtilOptind++;
12948  if ( nIters < 0 )
12949  goto usage;
12950  break;
12951  case 'd':
12952  fDumpCnf ^= 1;
12953  break;
12954  case 'v':
12955  fVerbose ^= 1;
12956  break;
12957  case 'h':
12958  goto usage;
12959  default:
12960  goto usage;
12961  }
12962  }
12963  if ( pNtk == NULL )
12964  {
12965  Abc_Print( -1, "Empty network.\n" );
12966  return 1;
12967  }
12968  if ( !Abc_NtkIsComb(pNtk) )
12969  {
12970  Abc_Print( -1, "Works only for combinational networks.\n" );
12971  return 1;
12972  }
12973  if ( Abc_NtkPoNum(pNtk) != 1 )
12974  {
12975  Abc_Print( -1, "The miter should have one primary output.\n" );
12976  return 1;
12977  }
12978  if ( !(nPars > 0 && nPars < Abc_NtkPiNum(pNtk)) )
12979  {
12980  Abc_Print( -1, "The number of parameter variables is invalid (should be > 0 and < PI num).\n" );
12981  return 1;
12982  }
12983  if ( Abc_NtkIsStrash(pNtk) )
12984  Abc_NtkQbf( pNtk, nPars, nIters, fDumpCnf, fVerbose );
12985  else
12986  {
12987  pNtk = Abc_NtkStrash( pNtk, 0, 1, 0 );
12988  Abc_NtkQbf( pNtk, nPars, nIters, fDumpCnf, fVerbose );
12989  Abc_NtkDelete( pNtk );
12990  }
12991  return 0;
12992 
12993 usage:
12994  Abc_Print( -2, "usage: qbf [-PI num] [-dvh]\n" );
12995  Abc_Print( -2, "\t solves QBF problem EpVxM(p,x)\n" );
12996  Abc_Print( -2, "\t-P num : number of parameters p (should be the first PIs) [default = %d]\n", nPars );
12997  Abc_Print( -2, "\t-I num : quit after the given iteration even if unsolved [default = %d]\n", nIters );
12998  Abc_Print( -2, "\t-d : toggle dumping QDIMACS file instead of solving [default = %s]\n", fDumpCnf? "yes": "no" );
12999  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
13000  Abc_Print( -2, "\t-h : print the command usage\n");
13001  return 1;
13002 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Abc_NtkQbf(Abc_Ntk_t *pNtk, int nPars, int nItersMax, int fDumpCnf, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcQbf.c:64
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandQuaReach ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11064 of file abc.c.

11065 {
11066  Abc_Ntk_t * pNtk, * pNtkRes;
11067  int c, nIters, fVerbose;
11068  extern Abc_Ntk_t * Abc_NtkReachability( Abc_Ntk_t * pNtk, int nIters, int fVerbose );
11069 
11070  pNtk = Abc_FrameReadNtk(pAbc);
11071  // set defaults
11072  nIters = 256;
11073  fVerbose = 0;
11075  while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
11076  {
11077  switch ( c )
11078  {
11079  case 'I':
11080  if ( globalUtilOptind >= argc )
11081  {
11082  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
11083  goto usage;
11084  }
11085  nIters = atoi(argv[globalUtilOptind]);
11086  globalUtilOptind++;
11087  if ( nIters < 0 )
11088  goto usage;
11089  break;
11090  case 'v':
11091  fVerbose ^= 1;
11092  break;
11093  case 'h':
11094  goto usage;
11095  default:
11096  goto usage;
11097  }
11098  }
11099  if ( pNtk == NULL )
11100  {
11101  Abc_Print( -1, "Empty network.\n" );
11102  return 1;
11103  }
11104  if ( Abc_NtkGetChoiceNum( pNtk ) )
11105  {
11106  Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
11107  return 1;
11108  }
11109  if ( !Abc_NtkIsComb(pNtk) )
11110  {
11111  Abc_Print( -1, "This command works only for combinational transition relations.\n" );
11112  return 1;
11113  }
11114  if ( !Abc_NtkIsStrash(pNtk) )
11115  {
11116  Abc_Print( -1, "This command works only for strashed networks.\n" );
11117  return 1;
11118  }
11119  if ( Abc_NtkPoNum(pNtk) > 1 )
11120  {
11121  Abc_Print( -1, "The transition relation should have one output.\n" );
11122  return 1;
11123  }
11124  if ( Abc_NtkPiNum(pNtk) % 2 != 0 )
11125  {
11126  Abc_Print( -1, "The transition relation should have an even number of inputs.\n" );
11127  return 1;
11128  }
11129 
11130  pNtkRes = Abc_NtkReachability( pNtk, nIters, fVerbose );
11131  if ( pNtkRes == NULL )
11132  {
11133  Abc_Print( -1, "Command has failed.\n" );
11134  return 0;
11135  }
11136  // replace the current network
11137  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11138  return 0;
11139 
11140 usage:
11141  Abc_Print( -2, "usage: qreach [-I num] [-vh]\n" );
11142  Abc_Print( -2, "\t computes unreachable states using AIG-based quantification\n" );
11143  Abc_Print( -2, "\t assumes that the current network is a transition relation\n" );
11144  Abc_Print( -2, "\t assumes that the initial state is composed of all zeros\n" );
11145  Abc_Print( -2, "\t-I num : the number of image computations to perform [default = %d]\n", nIters );
11146  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
11147  Abc_Print( -2, "\t-h : print the command usage\n");
11148  return 1;
11149 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
Abc_Ntk_t * Abc_NtkReachability(Abc_Ntk_t *pNtkRel, int nIters, int fVerbose)
Definition: abcQuant.c:326
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandQuaRel ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10969 of file abc.c.

10970 {
10971  Abc_Ntk_t * pNtk, * pNtkRes;
10972  int c, iVar, fInputs, fVerbose;
10973  extern Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose );
10974 
10975  pNtk = Abc_FrameReadNtk(pAbc);
10976  // set defaults
10977  iVar = 0;
10978  fInputs = 1;
10979  fVerbose = 0;
10981  while ( ( c = Extra_UtilGetopt( argc, argv, "Iqvh" ) ) != EOF )
10982  {
10983  switch ( c )
10984  {
10985  case 'I':
10986  if ( globalUtilOptind >= argc )
10987  {
10988  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
10989  goto usage;
10990  }
10991  iVar = atoi(argv[globalUtilOptind]);
10992  globalUtilOptind++;
10993  if ( iVar < 0 )
10994  goto usage;
10995  break;
10996  case 'q':
10997  fInputs ^= 1;
10998  break;
10999  case 'v':
11000  fVerbose ^= 1;
11001  break;
11002  case 'h':
11003  goto usage;
11004  default:
11005  goto usage;
11006  }
11007  }
11008  if ( pNtk == NULL )
11009  {
11010  Abc_Print( -1, "Empty network.\n" );
11011  return 1;
11012  }
11013  if ( Abc_NtkGetChoiceNum( pNtk ) )
11014  {
11015  Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
11016  return 1;
11017  }
11018  if ( Abc_NtkIsComb(pNtk) )
11019  {
11020  Abc_Print( -1, "This command works only for sequential circuits.\n" );
11021  return 1;
11022  }
11023 
11024  // get the strashed network
11025  if ( !Abc_NtkIsStrash(pNtk) )
11026  {
11027  pNtk = Abc_NtkStrash( pNtk, 0, 1, 0 );
11028  pNtkRes = Abc_NtkTransRel( pNtk, fInputs, fVerbose );
11029  Abc_NtkDelete( pNtk );
11030  }
11031  else
11032  pNtkRes = Abc_NtkTransRel( pNtk, fInputs, fVerbose );
11033  // check if the result is available
11034  if ( pNtkRes == NULL )
11035  {
11036  Abc_Print( -1, "Command has failed.\n" );
11037  return 0;
11038  }
11039  // replace the current network
11040  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
11041  return 0;
11042 
11043 usage:
11044  Abc_Print( -2, "usage: qrel [-qvh]\n" );
11045  Abc_Print( -2, "\t computes transition relation of the sequential network\n" );
11046 // Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
11047  Abc_Print( -2, "\t-q : perform quantification of inputs [default = %s]\n", fInputs? "yes": "no" );
11048  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
11049  Abc_Print( -2, "\t-h : print the command usage\n");
11050  return 1;
11051 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Ntk_t * Abc_NtkTransRel(Abc_Ntk_t *pNtk, int fInputs, int fVerbose)
Definition: abcQuant.c:159
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandQuaVar ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10882 of file abc.c.

10883 {
10884  Abc_Ntk_t * pNtk, * pNtkRes;
10885  int c, iVar, fUniv, fVerbose, RetValue;
10886  extern int Abc_NtkQuantify( Abc_Ntk_t * pNtk, int fUniv, int iVar, int fVerbose );
10887 
10888  pNtk = Abc_FrameReadNtk(pAbc);
10889  // set defaults
10890  iVar = 0;
10891  fUniv = 0;
10892  fVerbose = 0;
10894  while ( ( c = Extra_UtilGetopt( argc, argv, "Iuvh" ) ) != EOF )
10895  {
10896  switch ( c )
10897  {
10898  case 'I':
10899  if ( globalUtilOptind >= argc )
10900  {
10901  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
10902  goto usage;
10903  }
10904  iVar = atoi(argv[globalUtilOptind]);
10905  globalUtilOptind++;
10906  if ( iVar < 0 )
10907  goto usage;
10908  break;
10909  case 'u':
10910  fUniv ^= 1;
10911  break;
10912  case 'v':
10913  fVerbose ^= 1;
10914  break;
10915  case 'h':
10916  goto usage;
10917  default:
10918  goto usage;
10919  }
10920  }
10921  if ( pNtk == NULL )
10922  {
10923  Abc_Print( -1, "Empty network.\n" );
10924  return 1;
10925  }
10926  if ( Abc_NtkGetChoiceNum( pNtk ) )
10927  {
10928  Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
10929  return 1;
10930  }
10931 
10932  // get the strashed network
10933  pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
10934  RetValue = Abc_NtkQuantify( pNtkRes, fUniv, iVar, fVerbose );
10935  // clean temporary storage for the cofactors
10936  Abc_NtkCleanData( pNtkRes );
10937  Abc_AigCleanup( (Abc_Aig_t *)pNtkRes->pManFunc );
10938  // check the result
10939  if ( !RetValue )
10940  {
10941  Abc_Print( -1, "Command has failed.\n" );
10942  return 0;
10943  }
10944  // replace the current network
10945  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10946  return 0;
10947 
10948 usage:
10949  Abc_Print( -2, "usage: qvar [-I num] [-uvh]\n" );
10950  Abc_Print( -2, "\t quantifies one variable using the AIG\n" );
10951  Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
10952  Abc_Print( -2, "\t-u : toggle universal quantification [default = %s]\n", fUniv? "yes": "no" );
10953  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
10954  Abc_Print( -2, "\t-h : print the command usage\n");
10955  return 1;
10956 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
DECLARATIONS ///.
Definition: abcAig.c:52
void * pManFunc
Definition: abc.h:191
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition: abcAig.c:194
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Abc_NtkQuantify(Abc_Ntk_t *pNtk, int fUniv, int iVar, int fVerbose)
Definition: abcQuant.c:83
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL void Abc_NtkCleanData(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:534
int Abc_CommandReach ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8513 of file abc.c.

8514 {
8515  Saig_ParBbr_t Pars, * pPars = &Pars;
8516  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
8517  int c;
8518  char * pLogFileName = NULL;
8519 
8520  extern int Abc_NtkDarReach( Abc_Ntk_t * pNtk, Saig_ParBbr_t * pPars );
8521 
8522  // set defaults
8523  Bbr_ManSetDefaultParams( pPars );
8525  while ( ( c = Extra_UtilGetopt( argc, argv, "TBFLproyvh" ) ) != EOF )
8526  {
8527  switch ( c )
8528  {
8529  case 'T':
8530  if ( globalUtilOptind >= argc )
8531  {
8532  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
8533  goto usage;
8534  }
8535  pPars->TimeLimit = atoi(argv[globalUtilOptind]);
8536  globalUtilOptind++;
8537  if ( pPars->TimeLimit < 0 )
8538  goto usage;
8539  break;
8540  case 'B':
8541  if ( globalUtilOptind >= argc )
8542  {
8543  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
8544  goto usage;
8545  }
8546  pPars->nBddMax = atoi(argv[globalUtilOptind]);
8547  globalUtilOptind++;
8548  if ( pPars->nBddMax < 0 )
8549  goto usage;
8550  break;
8551  case 'F':
8552  if ( globalUtilOptind >= argc )
8553  {
8554  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
8555  goto usage;
8556  }
8557  pPars->nIterMax = atoi(argv[globalUtilOptind]);
8558  globalUtilOptind++;
8559  if ( pPars->nIterMax < 0 )
8560  goto usage;
8561  break;
8562  case 'L':
8563  if ( globalUtilOptind >= argc )
8564  {
8565  Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
8566  goto usage;
8567  }
8568  pLogFileName = argv[globalUtilOptind];
8569  globalUtilOptind++;
8570  break;
8571  case 'p':
8572  pPars->fPartition ^= 1;
8573  break;
8574  case 'r':
8575  pPars->fReorder ^= 1;
8576  break;
8577  case 'o':
8578  pPars->fReorderImage ^= 1;
8579  break;
8580  case 'y':
8581  pPars->fSkipOutCheck ^= 1;
8582  break;
8583  case 'v':
8584  pPars->fVerbose ^= 1;
8585  break;
8586  case 'h':
8587  goto usage;
8588  default:
8589  goto usage;
8590  }
8591  }
8592  if ( pNtk == NULL )
8593  {
8594  Abc_Print( -1, "Empty network.\n" );
8595  return 1;
8596  }
8597  if ( Abc_NtkLatchNum(pNtk) == 0 )
8598  {
8599  Abc_Print( -1, "The current network has no latches.\n" );
8600  return 0;
8601  }
8602  if ( !Abc_NtkIsStrash(pNtk) )
8603  {
8604  Abc_Print( -1, "Reachability analysis works only for AIGs (run \"strash\").\n" );
8605  return 1;
8606  }
8607  pAbc->Status = Abc_NtkDarReach( pNtk, pPars );
8608  pAbc->nFrames = pPars->iFrame;
8609  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
8610  if ( pLogFileName )
8611  Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "reach" );
8612  return 0;
8613 
8614 usage:
8615  Abc_Print( -2, "usage: reach [-TBF num] [-L file] [-proyvh]\n" );
8616  Abc_Print( -2, "\t verifies sequential miter using BDD-based reachability\n" );
8617  Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
8618  Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
8619  Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
8620  Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
8621  Abc_Print( -2, "\t-p : enable partitioned image computation [default = %s]\n", pPars->fPartition? "yes": "no" );
8622  Abc_Print( -2, "\t-r : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
8623  Abc_Print( -2, "\t-o : toggles BDD variable reordering during image computation [default = %s]\n", pPars->fReorderImage? "yes": "no" );
8624  Abc_Print( -2, "\t-y : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
8625  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
8626  Abc_Print( -2, "\t-h : print the command usage\n");
8627  return 1;
8628 }
int fReorder
Definition: saig.h:60
void Bbr_ManSetDefaultParams(Saig_ParBbr_t *p)
FUNCTION DEFINITIONS ///.
Definition: bbrReach.c:49
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int Abc_NtkDarReach(Abc_Ntk_t *pNtk, Saig_ParBbr_t *pPars)
Definition: abcDar.c:4321
int iFrame
Definition: saig.h:65
int fPartition
Definition: saig.h:59
int fSkipOutCheck
Definition: saig.h:64
int nBddMax
Definition: saig.h:57
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int nIterMax
Definition: saig.h:58
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int TimeLimit
Definition: saig.h:56
int fReorderImage
Definition: saig.h:61
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
Definition: abcLog.c:68
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fVerbose
Definition: saig.h:62
int Abc_CommandRecAdd3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14098 of file abc.c.

14099 {
14100  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
14101  int c;
14102  int fUseSOPB = 0;
14103  // set defaults
14105  while ( ( c = Extra_UtilGetopt( argc, argv, "gh" ) ) != EOF )
14106  {
14107  switch ( c )
14108  {
14109  case 'g':
14110  fUseSOPB = 1;
14111  break;
14112  case 'h':
14113  goto usage;
14114  default:
14115  goto usage;
14116  }
14117  }
14118  if ( !Abc_NtkIsStrash(pNtk) )
14119  {
14120  Abc_Print( -1, "This command works for AIGs.\n" );
14121  return 0;
14122  }
14123  if ( !Abc_NtkRecIsRunning3() )
14124  {
14125  Abc_Print( -1, "This command works for AIGs after calling \"rec_start2\".\n" );
14126  return 0;
14127  }
14128  Abc_NtkRecAdd3( pNtk, fUseSOPB );
14129  return 0;
14130 
14131 usage:
14132  Abc_Print( -2, "usage: rec_add3 [-h]\n" );
14133  Abc_Print( -2, "\t adds subgraphs from the current network to the set\n" );
14134  Abc_Print( -2, "\t-h : print the command usage\n");
14135  return 1;
14136 }
ABC_DLL void Abc_NtkRecAdd3(Abc_Ntk_t *pNtk, int fUseSOPB)
Definition: abcRec3.c:833
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRecDump3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14150 of file abc.c.

14151 {
14152  extern void Abc_NtkRecDumpTt3( char * pFileName, int fBinary );
14153  char * FileName;
14154  char ** pArgvNew;
14155  int nArgcNew;
14156  Gia_Man_t * pGia;
14157  int fAscii = 0;
14158  int fBinary = 0;
14159  int c;
14160 
14162  while ( ( c = Extra_UtilGetopt( argc, argv, "abh" ) ) != EOF )
14163  {
14164  switch ( c )
14165  {
14166  case 'a':
14167  fAscii ^= 1;
14168  break;
14169  case 'b':
14170  fBinary ^= 1;
14171  break;
14172  case 'h':
14173  goto usage;
14174  default:
14175  goto usage;
14176  }
14177  }
14178  if ( !Abc_NtkRecIsRunning3() )
14179  {
14180  Abc_Print( -1, "The AIG subgraph recording is not started.\n" );
14181  return 1;
14182  }
14183 
14184  pArgvNew = argv + globalUtilOptind;
14185  nArgcNew = argc - globalUtilOptind;
14186  if ( nArgcNew != 1 )
14187  {
14188  Abc_Print( -1, "File name is not given on the command line.\n" );
14189  return 1;
14190  }
14191  // get the input file name
14192  FileName = pArgvNew[0];
14193  if ( fAscii )
14194  Abc_NtkRecDumpTt3( FileName, 0 );
14195  else if ( fBinary )
14196  Abc_NtkRecDumpTt3( FileName, 1 );
14197  else
14198  {
14199  pGia = Abc_NtkRecGetGia3();
14200  if( pGia == NULL )
14201  {
14202  Abc_Print( 0, "Library AIG is not available.\n" );
14203  return 1;
14204  }
14205  if( Gia_ManPoNum(pGia) == 0 )
14206  {
14207  Abc_Print( 0, "No structure in the library.\n" );
14208  return 1;
14209  }
14210  Gia_AigerWrite( pGia, FileName, 0, 0 );
14211  }
14212  return 0;
14213 
14214 usage:
14215  Abc_Print( -2, "usage: rec_dump3 [-abh] <file>\n" );
14216  Abc_Print( -2, "\t-h : print the command usage\n");
14217  Abc_Print( -2, "\t-a : toggles dumping TTs into an ASCII file [default = %s]\n", fAscii? "yes": "no" );
14218  Abc_Print( -2, "\t-b : toggles dumping TTs into a binary file [default = %s]\n", fBinary? "yes": "no" );
14219  Abc_Print( -2, "\t<file> : AIGER file to write the library\n");
14220  return 1;
14221 }
ABC_DLL Gia_Man_t * Abc_NtkRecGetGia3()
Definition: abcRec3.c:1399
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact)
Definition: giaAiger.c:1024
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NtkRecDumpTt3(char *pFileName, int fBinary)
Definition: abcRec3.c:1335
int Abc_CommandRecMerge3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14234 of file abc.c.

14235 {
14236  int c;
14237  char * FileName, * pTemp;
14238  char ** pArgvNew;
14239  int nArgcNew;
14240  FILE * pFile;
14241  Gia_Man_t * pGia = NULL;
14242 
14243  // set defaults
14245  while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
14246  {
14247  switch ( c )
14248  {
14249  case 'h':
14250  goto usage;
14251  default:
14252  goto usage;
14253  }
14254  }
14255  if ( !Abc_NtkRecIsRunning3() )
14256  {
14257  Abc_Print( -1, "This command works for AIGs only after calling \"rec_start3\".\n" );
14258  return 0;
14259  }
14260  pArgvNew = argv + globalUtilOptind;
14261  nArgcNew = argc - globalUtilOptind;
14262  if ( nArgcNew != 1 )
14263  {
14264  Abc_Print( -1, "File name is not given on the command line.\n" );
14265  return 1;
14266  }
14267  else
14268  {
14269  // get the input file name
14270  FileName = pArgvNew[0];
14271  // fix the wrong symbol
14272  for ( pTemp = FileName; *pTemp; pTemp++ )
14273  if ( *pTemp == '>' )
14274  *pTemp = '\\';
14275  if ( (pFile = fopen( FileName, "r" )) == NULL )
14276  {
14277  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
14278  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
14279  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
14280  Abc_Print( 1, "\n" );
14281  return 1;
14282  }
14283  fclose( pFile );
14284  pGia = Gia_AigerRead( FileName, 1, 0 );
14285  if ( pGia == NULL )
14286  {
14287  Abc_Print( -1, "Reading AIGER has failed.\n" );
14288  return 0;
14289  }
14290  }
14291  Abc_NtkRecLibMerge3(pGia);
14292  Gia_ManStop( pGia );
14293  return 0;
14294 
14295 usage:
14296  Abc_Print( -2, "usage: rec_merge3 [-h] <file>\n" );
14297  Abc_Print( -2, "\t merge libraries\n" );
14298  Abc_Print( -2, "\t-h : print the command usage\n");
14299  Abc_Print( -2, "\t<file> : AIGER file with the library\n");
14300  return 1;
14301 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL void Abc_NtkRecLibMerge3(Gia_Man_t *pGia)
Definition: abcRec3.c:567
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandReconcile ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24478 of file abc.c.

24479 {
24480  extern Abc_Cex_t * Llb4_Nonlin4NormalizeCex( Aig_Man_t * pAigOrg, Aig_Man_t * pAigRpm, Abc_Cex_t * pCexRpm );
24481  Abc_Cex_t * pCex;
24482  Abc_Ntk_t * pNtk1 = NULL, * pNtk2 = NULL;
24483  Aig_Man_t * pAig1 = NULL, * pAig2 = NULL;
24484  int c;
24486  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
24487  {
24488  switch ( c )
24489  {
24490  case 'h':
24491  goto usage;
24492  default:
24493  Abc_Print( -2, "Unknown switch.\n");
24494  goto usage;
24495  }
24496  }
24497 
24498  if ( argc != globalUtilOptind + 2 && argc != globalUtilOptind )
24499  {
24500  Abc_Print( 1,"Does not seen to have two files names as arguments.\n" );
24501  return 1;
24502  }
24503  if ( pAbc->pCex == NULL )
24504  {
24505  Abc_Print( 1,"There is no current counter-example.\n" );
24506  return 1;
24507  }
24508 
24509  if ( argc == globalUtilOptind + 2 )
24510  {
24511  // derive networks
24512  pNtk1 = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
24513  if ( pNtk1 == NULL )
24514  return 1;
24515  pNtk2 = Io_Read( argv[globalUtilOptind+1], Io_ReadFileType(argv[globalUtilOptind+1]), 1, 0 );
24516  if ( pNtk2 == NULL )
24517  {
24518  Abc_NtkDelete( pNtk1 );
24519  return 1;
24520  }
24521  // create counter-examples
24522  pAig1 = Abc_NtkToDar( pNtk1, 0, 0 );
24523  pAig2 = Abc_NtkToDar( pNtk2, 0, 0 );
24524  }
24525  else if ( argc == globalUtilOptind )
24526  {
24527  if ( pAbc->pNtkCur == NULL )
24528  {
24529  Abc_Print( 1, "There is no AIG in the main-space.\n");
24530  return 0;
24531  }
24532  if ( pAbc->pGia == NULL )
24533  {
24534  Abc_Print( 1, "There is no AIG in the &-space.\n");
24535  return 0;
24536  }
24537  // create counter-examples
24538  pAig1 = Abc_NtkToDar( pAbc->pNtkCur, 0, 0 );
24539  pAig2 = Gia_ManToAigSimple( pAbc->pGia );
24540  }
24541  else assert( 0 );
24542  pCex = Llb4_Nonlin4NormalizeCex( pAig1, pAig2, pAbc->pCex );
24543  Aig_ManStop( pAig1 );
24544  Aig_ManStop( pAig2 );
24545  if ( pNtk2 ) Abc_NtkDelete( pNtk2 );
24546  if ( pCex == NULL )
24547  {
24548  Abc_Print( 1,"Counter-example computation has failed.\n" );
24549  if ( pNtk1 ) Abc_NtkDelete( pNtk1 );
24550  return 1;
24551  }
24552 
24553  // replace the current network
24554  if ( pNtk1 )
24555  Abc_FrameReplaceCurrentNetwork( pAbc, pNtk1 );
24556  // update the counter-example
24557  pAbc->nFrames = pCex->iFrame;
24558  Abc_FrameReplaceCex( pAbc, &pCex );
24559  return 0;
24560 
24561 usage:
24562  Abc_Print( -2, "usage: reconcile [-h] <fileOrigin> <fileReparam>\n" );
24563  Abc_Print( -2, "\t reconciles current CEX with <fileOrigin>\n" );
24564  Abc_Print( -2, "\t More specifically:\n" );
24565  Abc_Print( -2, "\t (i) assumes that <fileReparam> is an AIG derived by input\n" );
24566  Abc_Print( -2, "\t reparametrization of <fileOrigin> without seq synthesis;\n" );
24567  Abc_Print( -2, "\t (ii) assumes that current CEX is valid for <fileReparam>;\n" );
24568  Abc_Print( -2, "\t (iii) derives new CEX for <fileOrigin> and sets this CEX\n" );
24569  Abc_Print( -2, "\t and <fileOrigin> to be current CEX and current network\n" );
24570  Abc_Print( -2, "\t<fileOrigin> : file name with the original AIG\n");
24571  Abc_Print( -2, "\t<fileReparam> : file name with the reparametrized AIG\n");
24572  Abc_Print( -2, "\t (if both file names are not given on the command line,\n");
24573  Abc_Print( -2, "\t original/reparam AIG has to be in the main-space/&-space)\n");
24574  Abc_Print( -2, "\t-h : print the command usage\n");
24575  return 1;
24576 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
Abc_Cex_t * Llb4_Nonlin4NormalizeCex(Aig_Man_t *pAigOrg, Aig_Man_t *pAigRpm, Abc_Cex_t *pCexRpm)
Definition: llb4Cex.c:279
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
Definition: ioUtil.c:238
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
Definition: ioUtil.c:46
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
int Abc_CommandRecPs3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14054 of file abc.c.

14055 {
14056  int c, fPrintLib = 0;
14058  while ( ( c = Extra_UtilGetopt( argc, argv, "ph" ) ) != EOF )
14059  {
14060  switch ( c )
14061  {
14062  case 'p':
14063  fPrintLib ^= 1;
14064  break;
14065  case 'h':
14066  goto usage;
14067  default:
14068  goto usage;
14069  }
14070  }
14071  if ( !Abc_NtkRecIsRunning3() )
14072  {
14073  Abc_Print( -1, "This command works for AIGs only after calling \"rec_start2\".\n" );
14074  return 0;
14075  }
14076  Abc_NtkRecPs3(fPrintLib);
14077  return 0;
14078 
14079 usage:
14080  Abc_Print( -2, "usage: rec_ps3 [-h]\n" );
14081  Abc_Print( -2, "\t prints statistics about the recorded AIG subgraphs\n" );
14082  Abc_Print( -2, "\t-h : print the command usage\n");
14083  return 1;
14084 }
ABC_DLL void Abc_NtkRecPs3(int fPrintLib)
Definition: abcRec3.c:1411
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRecStart3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13897 of file abc.c.

13898 {
13899  char * FileName, * pTemp;
13900  char ** pArgvNew;
13901  int c, nArgcNew;
13902  FILE * pFile;
13903  Gia_Man_t * pGia = NULL;
13904  int nVars = 6;
13905  int nCuts = 32;
13906  int fFuncOnly = 0;
13907  int fVerbose = 0;
13909  while ( ( c = Extra_UtilGetopt( argc, argv, "KCfvh" ) ) != EOF )
13910  {
13911  switch ( c )
13912  {
13913  case 'K':
13914  if ( globalUtilOptind >= argc )
13915  {
13916  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
13917  goto usage;
13918  }
13919  nVars = atoi(argv[globalUtilOptind]);
13920  globalUtilOptind++;
13921  if ( nVars < 1 )
13922  goto usage;
13923  break;
13924  case 'C':
13925  if ( globalUtilOptind >= argc )
13926  {
13927  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
13928  goto usage;
13929  }
13930  nCuts = atoi(argv[globalUtilOptind]);
13931  globalUtilOptind++;
13932  if ( nCuts < 1 )
13933  goto usage;
13934  break;
13935  case 'f':
13936  fFuncOnly ^= 1;
13937  break;
13938  case 'v':
13939  fVerbose ^= 1;
13940  break;
13941  case 'h':
13942  goto usage;
13943  default:
13944  goto usage;
13945  }
13946  }
13947  if ( !(nVars >= 3 && nVars <= 16) )
13948  {
13949  Abc_Print( -1, "The range of allowed values is 3 <= K <= 16.\n" );
13950  return 0;
13951  }
13952  if ( Abc_NtkRecIsRunning3() )
13953  {
13954  Abc_Print( -1, "The AIG subgraph recording is already started.\n" );
13955  return 0;
13956  }
13957  pArgvNew = argv + globalUtilOptind;
13958  nArgcNew = argc - globalUtilOptind;
13959  if ( nArgcNew != 1 )
13960  Abc_Print( 1, "File name is not given on the command line. Starting a new record.\n" );
13961  else
13962  {
13963  // get the input file name
13964  FileName = pArgvNew[0];
13965  // fix the wrong symbol
13966  for ( pTemp = FileName; *pTemp; pTemp++ )
13967  if ( *pTemp == '>' )
13968  *pTemp = '\\';
13969  if ( (pFile = fopen( FileName, "r" )) == NULL )
13970  {
13971  Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
13972  if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
13973  Abc_Print( 1, "Did you mean \"%s\"?", FileName );
13974  Abc_Print( 1, "\n" );
13975  return 1;
13976  }
13977  fclose( pFile );
13978  pGia = Gia_AigerRead( FileName, 1, 0 );
13979  if ( pGia == NULL )
13980  {
13981  Abc_Print( -1, "Reading AIGER has failed.\n" );
13982  return 0;
13983  }
13984  }
13985  Abc_NtkRecStart3( pGia, nVars, nCuts, fFuncOnly, fVerbose );
13986  return 0;
13987 
13988 usage:
13989  Abc_Print( -2, "usage: rec_start3 [-K num] [-C num] [-fvh] <file>\n" );
13990  Abc_Print( -2, "\t starts recording AIG subgraphs (should be called for\n" );
13991  Abc_Print( -2, "\t an empty network or after reading in a previous record)\n" );
13992  Abc_Print( -2, "\t-K num : the largest number of inputs [default = %d]\n", nVars );
13993  Abc_Print( -2, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCuts );
13994  Abc_Print( -2, "\t-f : toggles recording functions without AIG subgraphs [default = %s]\n", fFuncOnly? "yes": "no" );
13995  Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
13996  Abc_Print( -2, "\t-h : print the command usage\n");
13997  Abc_Print( -2, "\t<file> : AIGER file with the library\n");
13998  return 1;
13999 }
Gia_Man_t * Gia_AigerRead(char *pFileName, int fSkipStrash, int fCheck)
Definition: giaAiger.c:821
char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
Definition: extraUtilFile.c:71
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL void Abc_NtkRecStart3(Gia_Man_t *p, int nVars, int nCuts, int fFuncOnly, int fVerbose)
Definition: abcRec3.c:1415
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRecStop3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14013 of file abc.c.

14014 {
14015  int c;
14017  while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
14018  {
14019  switch ( c )
14020  {
14021  case 'h':
14022  goto usage;
14023  default:
14024  goto usage;
14025  }
14026  }
14027  if ( !Abc_NtkRecIsRunning3() )
14028  {
14029  Abc_Print( -1, "This command works only after calling \"rec_start3\".\n" );
14030  return 0;
14031  }
14032  Abc_NtkRecStop3();
14033  return 0;
14034 
14035 usage:
14036  Abc_Print( -2, "usage: rec_stop3 [-h]\n" );
14037  Abc_Print( -2, "\t cleans the internal storage for AIG subgraphs\n" );
14038  Abc_Print( -2, "\t-h : print the command usage\n");
14039  return 1;
14040 }
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL void Abc_NtkRecStop3()
Definition: abcRec3.c:1421
int Abc_CommandRefactor ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5868 of file abc.c.

5869 {
5870  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
5871  int c;
5872  int nNodeSizeMax;
5873  int nConeSizeMax;
5874  int fUpdateLevel;
5875  int fUseZeros;
5876  int fUseDcs;
5877  int fVerbose;
5878  extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose );
5879 
5880  // set defaults
5881  nNodeSizeMax = 10;
5882  nConeSizeMax = 16;
5883  fUpdateLevel = 1;
5884  fUseZeros = 0;
5885  fUseDcs = 0;
5886  fVerbose = 0;
5888  while ( ( c = Extra_UtilGetopt( argc, argv, "NClzdvh" ) ) != EOF )
5889  {
5890  switch ( c )
5891  {
5892  case 'N':
5893  if ( globalUtilOptind >= argc )
5894  {
5895  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
5896  goto usage;
5897  }
5898  nNodeSizeMax = atoi(argv[globalUtilOptind]);
5899  globalUtilOptind++;
5900  if ( nNodeSizeMax < 0 )
5901  goto usage;
5902  break;
5903  case 'C':
5904  if ( globalUtilOptind >= argc )
5905  {
5906  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
5907  goto usage;
5908  }
5909  nConeSizeMax = atoi(argv[globalUtilOptind]);
5910  globalUtilOptind++;
5911  if ( nConeSizeMax < 0 )
5912  goto usage;
5913  break;
5914  case 'l':
5915  fUpdateLevel ^= 1;
5916  break;
5917  case 'z':
5918  fUseZeros ^= 1;
5919  break;
5920  case 'd':
5921  fUseDcs ^= 1;
5922  break;
5923  case 'v':
5924  fVerbose ^= 1;
5925  break;
5926  case 'h':
5927  goto usage;
5928  default:
5929  goto usage;
5930  }
5931  }
5932 
5933  if ( pNtk == NULL )
5934  {
5935  Abc_Print( -1, "Empty network.\n" );
5936  return 1;
5937  }
5938  if ( !Abc_NtkIsStrash(pNtk) )
5939  {
5940  Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
5941  return 1;
5942  }
5943  if ( Abc_NtkGetChoiceNum(pNtk) )
5944  {
5945  Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
5946  return 1;
5947  }
5948 
5949  if ( fUseDcs && nNodeSizeMax >= nConeSizeMax )
5950  {
5951  Abc_Print( -1, "For don't-care to work, containing cone should be larger than collapsed node.\n" );
5952  return 1;
5953  }
5954 
5955  // modify the current network
5956  if ( !Abc_NtkRefactor( pNtk, nNodeSizeMax, nConeSizeMax, fUpdateLevel, fUseZeros, fUseDcs, fVerbose ) )
5957  {
5958  Abc_Print( -1, "Refactoring has failed.\n" );
5959  return 1;
5960  }
5961  return 0;
5962 
5963 usage:
5964  Abc_Print( -2, "usage: refactor [-NC <num>] [-lzdvh]\n" );
5965  Abc_Print( -2, "\t performs technology-independent refactoring of the AIG\n" );
5966  Abc_Print( -2, "\t-N <num> : the max support of the collapsed node [default = %d]\n", nNodeSizeMax );
5967  Abc_Print( -2, "\t-C <num> : the max support of the containing cone [default = %d]\n", nConeSizeMax );
5968  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
5969  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
5970  Abc_Print( -2, "\t-d : toggle using don't-cares [default = %s]\n", fUseDcs? "yes": "no" );
5971  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
5972  Abc_Print( -2, "\t-h : print the command usage\n");
5973  return 1;
5974 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkRefactor(Abc_Ntk_t *pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcRefactor.c:89
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRemovePo ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7292 of file abc.c.

7293 {
7294  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL;
7295  int c, iOutput = -1;
7296  int fRemoveConst0 = 1;
7297  extern void Abc_NtkRemovePo( Abc_Ntk_t * pNtk, int iOutput, int fRemoveConst0 );
7298 
7299  // set defaults
7301  while ( ( c = Extra_UtilGetopt( argc, argv, "Nzh" ) ) != EOF )
7302  {
7303  switch ( c )
7304  {
7305  case 'N':
7306  if ( globalUtilOptind >= argc )
7307  {
7308  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
7309  goto usage;
7310  }
7311  iOutput = atoi(argv[globalUtilOptind]);
7312  globalUtilOptind++;
7313  if ( iOutput < 0 )
7314  goto usage;
7315  break;
7316  case 'z':
7317  fRemoveConst0 ^= 1;
7318  break;
7319  default:
7320  goto usage;
7321  }
7322  }
7323 
7324  if ( pNtk == NULL )
7325  {
7326  Abc_Print( -1, "Empty network.\n" );
7327  return 1;
7328  }
7329 
7330  if ( !Abc_NtkIsStrash(pNtk) )
7331  {
7332  Abc_Print( -1, "The network is not strashed.\n" );
7333  return 1;
7334  }
7335  if ( iOutput < 0 )
7336  {
7337  Abc_Print( -1, "The output index is not specified.\n" );
7338  return 1;
7339  }
7340  if ( iOutput >= Abc_NtkPoNum(pNtk) )
7341  {
7342  Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
7343  return 1;
7344  }
7345 
7346  // get the new network
7347 // pNtkRes = Abc_NtkDup( pNtk );
7348 // Abc_NtkRemovePo( pNtkRes, iOutput );
7349 // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7350  Abc_NtkRemovePo( pNtk, iOutput, fRemoveConst0 );
7351  return 0;
7352 
7353 usage:
7354  Abc_Print( -2, "usage: removepo [-N <num>] [-zh]\n" );
7355  Abc_Print( -2, "\t remove PO with number <num> if it is const0\n" );
7356  Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to remove [default = %d]\n", iOutput );
7357  Abc_Print( -2, "\t-z : toggle removing const1 instead of const0 [default = %s]\n", fRemoveConst0? "const0": "const1" );
7358  Abc_Print( -2, "\t-h : print the command usage\n");
7359  return 1;
7360 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_NtkRemovePo(Abc_Ntk_t *pNtk, int iOutput, int fRemoveConst0)
Definition: abcNtk.c:1841
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRenode ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3432 of file abc.c.

3433 {
3434  Abc_Ntk_t * pNtk, * pNtkRes;
3435  int nLutSize, nCutsMax, c;
3436  int nFlowIters, nAreaIters;
3437  int fArea;
3438  int fUseBdds;
3439  int fUseSops;
3440  int fUseCnfs;
3441  int fUseMv;
3442  int fVerbose;
3443  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 );
3444 
3445  pNtk = Abc_FrameReadNtk(pAbc);
3446 
3447  // set defaults
3448  nLutSize = 8;
3449  nCutsMax = 4;
3450  nFlowIters = 1;
3451  nAreaIters = 1;
3452  fArea = 0;
3453  fUseBdds = 0;
3454  fUseSops = 0;
3455  fUseCnfs = 0;
3456  fUseMv = 0;
3457  fVerbose = 0;
3459  while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAabscivh" ) ) != EOF )
3460  {
3461  switch ( c )
3462  {
3463  case 'K':
3464  if ( globalUtilOptind >= argc )
3465  {
3466  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
3467  goto usage;
3468  }
3469  nLutSize = atoi(argv[globalUtilOptind]);
3470  globalUtilOptind++;
3471  if ( nLutSize < 0 )
3472  goto usage;
3473  break;
3474  case 'C':
3475  if ( globalUtilOptind >= argc )
3476  {
3477  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
3478  goto usage;
3479  }
3480  nCutsMax = atoi(argv[globalUtilOptind]);
3481  globalUtilOptind++;
3482  if ( nCutsMax < 0 )
3483  goto usage;
3484  break;
3485  case 'F':
3486  if ( globalUtilOptind >= argc )
3487  {
3488  Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
3489  goto usage;
3490  }
3491  nFlowIters = atoi(argv[globalUtilOptind]);
3492  globalUtilOptind++;
3493  if ( nFlowIters < 0 )
3494  goto usage;
3495  break;
3496  case 'A':
3497  if ( globalUtilOptind >= argc )
3498  {
3499  Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
3500  goto usage;
3501  }
3502  nAreaIters = atoi(argv[globalUtilOptind]);
3503  globalUtilOptind++;
3504  if ( nAreaIters < 0 )
3505  goto usage;
3506  break;
3507  case 'a':
3508  fArea ^= 1;
3509  break;
3510  case 'b':
3511  fUseBdds ^= 1;
3512  break;
3513  case 's':
3514  fUseSops ^= 1;
3515  break;
3516  case 'c':
3517  fUseCnfs ^= 1;
3518  break;
3519  case 'i':
3520  fUseMv ^= 1;
3521  break;
3522  case 'v':
3523  fVerbose ^= 1;
3524  break;
3525  case 'h':
3526  goto usage;
3527  default:
3528  goto usage;
3529  }
3530  }
3531 
3532  if ( fUseBdds + fUseSops + fUseCnfs + fUseMv > 1 )
3533  {
3534  Abc_Print( -1, "Cannot optimize two parameters at the same time.\n" );
3535  return 1;
3536  }
3537 
3538  if ( nLutSize < 2 || nLutSize > IF_MAX_FUNC_LUTSIZE )
3539  {
3540  Abc_Print( -1, "Incorrect LUT size (%d).\n", nLutSize );
3541  return 1;
3542  }
3543 
3544  if ( nCutsMax < 1 || nCutsMax >= (1<<12) )
3545  {
3546  Abc_Print( -1, "Incorrect number of cuts.\n" );
3547  return 1;
3548  }
3549 
3550  if ( pNtk == NULL )
3551  {
3552  Abc_Print( -1, "Empty network.\n" );
3553  return 1;
3554  }
3555  if ( !Abc_NtkIsStrash(pNtk) )
3556  {
3557  Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
3558  return 1;
3559  }
3560 
3561  // get the new network
3562  pNtkRes = Abc_NtkRenode( pNtk, nLutSize, nCutsMax, nFlowIters, nAreaIters, fArea, fUseBdds, fUseSops, fUseCnfs, fUseMv, fVerbose );
3563  if ( pNtkRes == NULL )
3564  {
3565  Abc_Print( -1, "Renoding has failed.\n" );
3566  return 1;
3567  }
3568  // replace the current network
3569  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
3570  return 0;
3571 
3572 usage:
3573  Abc_Print( -2, "usage: renode [-KCFA <num>] [-sbciav]\n" );
3574  Abc_Print( -2, "\t transforms the AIG into a logic network with larger nodes\n" );
3575  Abc_Print( -2, "\t while minimizing the number of FF literals of the node SOPs\n" );
3576  Abc_Print( -2, "\t-K <num>: the max cut size for renoding (2 < num < %d) [default = %d]\n", IF_MAX_FUNC_LUTSIZE+1, nLutSize );
3577  Abc_Print( -2, "\t-C <num>: the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCutsMax );
3578  Abc_Print( -2, "\t-F <num>: the number of area flow recovery iterations (num >= 0) [default = %d]\n", nFlowIters );
3579  Abc_Print( -2, "\t-A <num>: the number of exact area recovery iterations (num >= 0) [default = %d]\n", nAreaIters );
3580  Abc_Print( -2, "\t-s : toggles minimizing SOP cubes instead of FF lits [default = %s]\n", fUseSops? "yes": "no" );
3581  Abc_Print( -2, "\t-b : toggles minimizing BDD nodes instead of FF lits [default = %s]\n", fUseBdds? "yes": "no" );
3582  Abc_Print( -2, "\t-c : toggles minimizing CNF clauses instead of FF lits [default = %s]\n", fUseCnfs? "yes": "no" );
3583  Abc_Print( -2, "\t-i : toggles minimizing MV-SOP instead of FF lits [default = %s]\n", fUseMv? "yes": "no" );
3584  Abc_Print( -2, "\t-a : toggles area-oriented mapping [default = %s]\n", fArea? "yes": "no" );
3585  Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
3586  Abc_Print( -2, "\t-h : print the command usage\n");
3587  return 1;
3588 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
#define IF_MAX_FUNC_LUTSIZE
Definition: if.h:54
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
Abc_Ntk_t * Abc_NtkRenode(Abc_Ntk_t *pNtk, int nFaninMax, int nCubeMax, int nFlowIters, int nAreaIters, int fArea, int fUseBdds, int fUseSops, int fUseCnfs, int fUseMv, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcRenode.c:62
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandReorder ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8048 of file abc.c.

8049 {
8050  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
8051  int c;
8052  int fVerbose;
8053  extern void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose );
8054 
8055  // set defaults
8056  fVerbose = 0;
8058  while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
8059  {
8060  switch ( c )
8061  {
8062  case 'v':
8063  fVerbose ^= 1;
8064  break;
8065  case 'h':
8066  goto usage;
8067  default:
8068  goto usage;
8069  }
8070  }
8071 
8072  if ( pNtk == NULL )
8073  {
8074  Abc_Print( -1, "Empty network.\n" );
8075  return 1;
8076  }
8077 
8078  // get the new network
8079  if ( !Abc_NtkIsBddLogic(pNtk) )
8080  {
8081  Abc_Print( -1, "Variable reordering is possible when node functions are BDDs (run \"bdd\").\n" );
8082  return 1;
8083  }
8084  Abc_NtkBddReorder( pNtk, fVerbose );
8085  return 0;
8086 
8087 usage:
8088  Abc_Print( -2, "usage: reorder [-vh]\n" );
8089  Abc_Print( -2, "\t reorders local functions of the nodes using sifting\n" );
8090  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
8091  Abc_Print( -2, "\t-h : print the command usage\n");
8092  return 1;
8093 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NtkBddReorder(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcReorder.c:77
int Abc_CommandRestore ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Definition at line 13255 of file abc.c.

13256 {
13257  int c;
13258  // set defaults
13260  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
13261  {
13262  switch ( c )
13263  {
13264  case 'h':
13265  goto usage;
13266  default:
13267  goto usage;
13268  }
13269  }
13270 
13271  if ( pAbc->pNtkBackup == NULL )
13272  {
13273  Abc_Print( -1, "There is no backup network.\n" );
13274  return 1;
13275  }
13276  Abc_FrameReplaceCurrentNetwork( pAbc, Abc_NtkDup(pAbc->pNtkBackup) );
13277  pAbc->nFrames = -1;
13278  pAbc->Status = -1;
13279  return 0;
13280 
13281 usage:
13282  Abc_Print( -2, "usage: restore [-h]\n" );
13283  Abc_Print( -2, "\t restores the current network\n" );
13284  Abc_Print( -2, "\t-h : print the command usage\n");
13285  return 1;
13286 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRestructure ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5987 of file abc.c.

5988 {
5989  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
5990  int c;
5991  int nCutsMax;
5992  int fUpdateLevel;
5993  int fUseZeros;
5994  int fVerbose;
5995  extern int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutsMax, int fUpdateLevel, int fUseZeros, int fVerbose );
5996 
5997  // set defaults
5998  nCutsMax = 5;
5999  fUpdateLevel = 0;
6000  fUseZeros = 0;
6001  fVerbose = 0;
6003  while ( ( c = Extra_UtilGetopt( argc, argv, "Klzvh" ) ) != EOF )
6004  {
6005  switch ( c )
6006  {
6007  case 'K':
6008  if ( globalUtilOptind >= argc )
6009  {
6010  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
6011  goto usage;
6012  }
6013  nCutsMax = atoi(argv[globalUtilOptind]);
6014  globalUtilOptind++;
6015  if ( nCutsMax < 0 )
6016  goto usage;
6017  break;
6018  case 'l':
6019  fUpdateLevel ^= 1;
6020  break;
6021  case 'z':
6022  fUseZeros ^= 1;
6023  break;
6024  case 'v':
6025  fVerbose ^= 1;
6026  break;
6027  case 'h':
6028  goto usage;
6029  default:
6030  goto usage;
6031  }
6032  }
6033 
6034  if ( pNtk == NULL )
6035  {
6036  Abc_Print( -1, "Empty network.\n" );
6037  return 1;
6038  }
6039  if ( nCutsMax < 4 || nCutsMax > CUT_SIZE_MAX )
6040  {
6041  Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", 4, CUT_SIZE_MAX );
6042  return 1;
6043  }
6044  if ( !Abc_NtkIsStrash(pNtk) )
6045  {
6046  Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
6047  return 1;
6048  }
6049  if ( Abc_NtkGetChoiceNum(pNtk) )
6050  {
6051  Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
6052  return 1;
6053  }
6054 
6055  // modify the current network
6056  if ( !Abc_NtkRestructure( pNtk, nCutsMax, fUpdateLevel, fUseZeros, fVerbose ) )
6057  {
6058  Abc_Print( -1, "Refactoring has failed.\n" );
6059  return 1;
6060  }
6061  return 0;
6062 
6063 usage:
6064  Abc_Print( -2, "usage: restructure [-K <num>] [-lzvh]\n" );
6065  Abc_Print( -2, "\t performs technology-independent restructuring of the AIG\n" );
6066  Abc_Print( -2, "\t-K <num> : the max cut size (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, nCutsMax );
6067  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
6068  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
6069  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
6070  Abc_Print( -2, "\t-h : print the command usage\n");
6071  return 1;
6072 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
#define CUT_SIZE_MAX
Definition: cut.h:39
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
#define CUT_SIZE_MIN
INCLUDES ///.
Definition: cut.h:38
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Abc_NtkRestructure(Abc_Ntk_t *pNtk, int nCutMax, int fUpdateLevel, int fUseZeros, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcRestruct.c:101
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandResubstitute ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6085 of file abc.c.

6086 {
6087  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
6088  int RS_CUT_MIN = 4;
6089  int RS_CUT_MAX = 16;
6090  int c;
6091  int nCutsMax;
6092  int nNodesMax;
6093  int nLevelsOdc;
6094  int fUpdateLevel;
6095  int fUseZeros;
6096  int fVerbose;
6097  int fVeryVerbose;
6098  extern int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutsMax, int nNodesMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose );
6099 
6100  // set defaults
6101  nCutsMax = 8;
6102  nNodesMax = 1;
6103  nLevelsOdc = 0;
6104  fUpdateLevel = 1;
6105  fUseZeros = 0;
6106  fVerbose = 0;
6107  fVeryVerbose = 0;
6109  while ( ( c = Extra_UtilGetopt( argc, argv, "KNFlzvwh" ) ) != EOF )
6110  {
6111  switch ( c )
6112  {
6113  case 'K':
6114  if ( globalUtilOptind >= argc )
6115  {
6116  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
6117  goto usage;
6118  }
6119  nCutsMax = atoi(argv[globalUtilOptind]);
6120  globalUtilOptind++;
6121  if ( nCutsMax < 0 )
6122  goto usage;
6123  break;
6124  case 'N':
6125  if ( globalUtilOptind >= argc )
6126  {
6127  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
6128  goto usage;
6129  }
6130  nNodesMax = atoi(argv[globalUtilOptind]);
6131  globalUtilOptind++;
6132  if ( nNodesMax < 0 )
6133  goto usage;
6134  break;
6135  case 'F':
6136  if ( globalUtilOptind >= argc )
6137  {
6138  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
6139  goto usage;
6140  }
6141  nLevelsOdc = atoi(argv[globalUtilOptind]);
6142  globalUtilOptind++;
6143  if ( nLevelsOdc < 0 )
6144  goto usage;
6145  break;
6146  case 'l':
6147  fUpdateLevel ^= 1;
6148  break;
6149  case 'z':
6150  fUseZeros ^= 1;
6151  break;
6152  case 'v':
6153  fVerbose ^= 1;
6154  break;
6155  case 'w':
6156  fVeryVerbose ^= 1;
6157  break;
6158  case 'h':
6159  goto usage;
6160  default:
6161  goto usage;
6162  }
6163  }
6164 
6165  if ( pNtk == NULL )
6166  {
6167  Abc_Print( -1, "Empty network.\n" );
6168  return 1;
6169  }
6170  if ( nCutsMax < RS_CUT_MIN || nCutsMax > RS_CUT_MAX )
6171  {
6172  Abc_Print( -1, "Can only compute cuts for %d <= K <= %d.\n", RS_CUT_MIN, RS_CUT_MAX );
6173  return 1;
6174  }
6175  if ( nNodesMax < 0 || nNodesMax > 3 )
6176  {
6177  Abc_Print( -1, "Can only resubstitute at most 3 nodes.\n" );
6178  return 1;
6179  }
6180  if ( !Abc_NtkIsStrash(pNtk) )
6181  {
6182  Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
6183  return 1;
6184  }
6185  if ( Abc_NtkGetChoiceNum(pNtk) )
6186  {
6187  Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
6188  return 1;
6189  }
6190 
6191  // modify the current network
6192  if ( !Abc_NtkResubstitute( pNtk, nCutsMax, nNodesMax, nLevelsOdc, fUpdateLevel, fVerbose, fVeryVerbose ) )
6193  {
6194  Abc_Print( -1, "Refactoring has failed.\n" );
6195  return 1;
6196  }
6197  return 0;
6198 
6199 usage:
6200  Abc_Print( -2, "usage: resub [-KN <num>] [-lzvwh]\n" );
6201  Abc_Print( -2, "\t performs technology-independent restructuring of the AIG\n" );
6202  Abc_Print( -2, "\t-K <num> : the max cut size (%d <= num <= %d) [default = %d]\n", RS_CUT_MIN, RS_CUT_MAX, nCutsMax );
6203  Abc_Print( -2, "\t-N <num> : the max number of nodes to add (0 <= num <= 3) [default = %d]\n", nNodesMax );
6204  Abc_Print( -2, "\t-F <num> : the number of fanout levels for ODC computation [default = %d]\n", nLevelsOdc );
6205  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
6206  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
6207  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
6208  Abc_Print( -2, "\t-w : toggle verbose printout of ODC computation [default = %s]\n", fVeryVerbose? "yes": "no" );
6209  Abc_Print( -2, "\t-h : print the command usage\n");
6210  return 1;
6211 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int Abc_NtkResubstitute(Abc_Ntk_t *pNtk, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcResub.c:137
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRetime ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17104 of file abc.c.

17105 {
17106  Abc_Ntk_t * pNtk, * pNtkRes;
17107  int c, nMaxIters;
17108  int fForward;
17109  int fBackward;
17110  int fOneStep;
17111  int fVerbose;
17112  int Mode;
17113  int nDelayLim;
17114 
17115  pNtk = Abc_FrameReadNtk(pAbc);
17116  // set defaults
17117  Mode = 5;
17118  nDelayLim = 0;
17119  fForward = 0;
17120  fBackward = 0;
17121  fOneStep = 0;
17122  fVerbose = 0;
17123  nMaxIters = 15;
17125  while ( ( c = Extra_UtilGetopt( argc, argv, "MDfbsvh" ) ) != EOF )
17126  {
17127  switch ( c )
17128  {
17129  case 'M':
17130  if ( globalUtilOptind >= argc )
17131  {
17132  Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
17133  goto usage;
17134  }
17135  Mode = atoi(argv[globalUtilOptind]);
17136  globalUtilOptind++;
17137  if ( Mode < 0 )
17138  goto usage;
17139  break;
17140  case 'D':
17141  if ( globalUtilOptind >= argc )
17142  {
17143  Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
17144  goto usage;
17145  }
17146  nDelayLim = atoi(argv[globalUtilOptind]);
17147  globalUtilOptind++;
17148  if ( nDelayLim < 0 )
17149  goto usage;
17150  break;
17151  case 'f':
17152  fForward ^= 1;
17153  break;
17154  case 'b':
17155  fBackward ^= 1;
17156  break;
17157  case 's':
17158  fOneStep ^= 1;
17159  break;
17160  case 'v':
17161  fVerbose ^= 1;
17162  break;
17163  case 'h':
17164  goto usage;
17165  default:
17166  goto usage;
17167  }
17168  }
17169 
17170  if ( pNtk == NULL )
17171  {
17172  Abc_Print( -1, "Empty network.\n" );
17173  return 1;
17174  }
17175 
17176  if ( fForward && fBackward )
17177  {
17178  Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
17179  return 1;
17180  }
17181 
17182  if ( !Abc_NtkLatchNum(pNtk) )
17183  {
17184 // Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
17185  return 0;
17186  }
17187 
17188  if ( Mode < 0 || Mode > 6 )
17189  {
17190  Abc_Print( -1, "The mode (%d) is incorrect. Retiming is not performed.\n", Mode );
17191  return 0;
17192  }
17193 
17194  if ( Abc_NtkIsStrash(pNtk) )
17195  {
17196  if ( Abc_NtkGetChoiceNum(pNtk) )
17197  {
17198  Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
17199  return 0;
17200  }
17201  // convert the network into an SOP network
17202  pNtkRes = Abc_NtkToLogic( pNtk );
17203  // perform the retiming
17204  Abc_NtkRetime( pNtkRes, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
17205  // replace the current network
17206  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17207  return 0;
17208  }
17209 
17210  // get the network in the SOP form
17211  if ( !Abc_NtkToSop(pNtk, 0) )
17212  {
17213  Abc_Print( -1, "Converting to SOPs has failed.\n" );
17214  return 0;
17215  }
17216 
17217  if ( !Abc_NtkIsLogic(pNtk) )
17218  {
17219  Abc_Print( -1, "The network is not a logic network. Retiming is not performed.\n" );
17220  return 0;
17221  }
17222 
17223  // perform the retiming
17224  Abc_NtkRetime( pNtk, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
17225  return 0;
17226 
17227 usage:
17228  Abc_Print( -2, "usage: retime [-MD num] [-fbvh]\n" );
17229  Abc_Print( -2, "\t retimes the current network using one of the algorithms:\n" );
17230  Abc_Print( -2, "\t 1: most forward retiming\n" );
17231  Abc_Print( -2, "\t 2: most backward retiming\n" );
17232  Abc_Print( -2, "\t 3: forward and backward min-area retiming\n" );
17233  Abc_Print( -2, "\t 4: forward and backward min-delay retiming\n" );
17234  Abc_Print( -2, "\t 5: mode 3 followed by mode 4\n" );
17235  Abc_Print( -2, "\t 6: Pan's optimum-delay retiming using binary search\n" );
17236  Abc_Print( -2, "\t-M num : the retiming algorithm to use [default = %d]\n", Mode );
17237  Abc_Print( -2, "\t-D num : the minimum delay target (0=unused) [default = %d]\n", nDelayLim );
17238  Abc_Print( -2, "\t-f : enables forward-only retiming in modes 3,4,5 [default = %s]\n", fForward? "yes": "no" );
17239  Abc_Print( -2, "\t-b : enables backward-only retiming in modes 3,4,5 [default = %s]\n", fBackward? "yes": "no" );
17240  Abc_Print( -2, "\t-s : enables retiming one step only in mode 4 [default = %s]\n", fOneStep? "yes": "no" );
17241  Abc_Print( -2, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
17242  Abc_Print( -2, "\t-h : print the command usage\n");
17243  return 1;
17244 // Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
17245 // Abc_Print( -2, "\t-f : toggle forward retiming (for AIGs) [default = %s]\n", fForward? "yes": "no" );
17246 // Abc_Print( -2, "\t-b : toggle backward retiming (for AIGs) [default = %s]\n", fBackward? "yes": "no" );
17247 // Abc_Print( -2, "\t-i : toggle computation of initial state [default = %s]\n", fInitial? "yes": "no" );
17248 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int Abc_NtkRetime(Abc_Ntk_t *pNtk, int Mode, int nDelayLim, int fForwardOnly, int fBackwardOnly, int fOneStep, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: retCore.c:47
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcNetlist.c:52
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkToSop(Abc_Ntk_t *pNtk, int fDirect)
Definition: abcFunc.c:1124
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRewrite ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5765 of file abc.c.

5766 {
5767  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
5768  int c;
5769  int fUpdateLevel;
5770  int fPrecompute;
5771  int fUseZeros;
5772  int fVerbose;
5773  int fVeryVerbose;
5774  int fPlaceEnable;
5775  // external functions
5776  extern void Rwr_Precompute();
5777 
5778  // set defaults
5779  fUpdateLevel = 1;
5780  fPrecompute = 0;
5781  fUseZeros = 0;
5782  fVerbose = 0;
5783  fVeryVerbose = 0;
5784  fPlaceEnable = 0;
5786  while ( ( c = Extra_UtilGetopt( argc, argv, "lxzvwh" ) ) != EOF )
5787  {
5788  switch ( c )
5789  {
5790  case 'l':
5791  fUpdateLevel ^= 1;
5792  break;
5793  case 'x':
5794  fPrecompute ^= 1;
5795  break;
5796  case 'z':
5797  fUseZeros ^= 1;
5798  break;
5799  case 'v':
5800  fVerbose ^= 1;
5801  break;
5802  case 'w':
5803  fVeryVerbose ^= 1;
5804  break;
5805  case 'p':
5806  fPlaceEnable ^= 1;
5807  break;
5808  case 'h':
5809  goto usage;
5810  default:
5811  goto usage;
5812  }
5813  }
5814 
5815  if ( fPrecompute )
5816  {
5817  Rwr_Precompute();
5818  return 0;
5819  }
5820 
5821  if ( pNtk == NULL )
5822  {
5823  Abc_Print( -1, "Empty network.\n" );
5824  return 1;
5825  }
5826  if ( !Abc_NtkIsStrash(pNtk) )
5827  {
5828  Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
5829  return 1;
5830  }
5831  if ( Abc_NtkGetChoiceNum(pNtk) )
5832  {
5833  Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
5834  return 1;
5835  }
5836 
5837  // modify the current network
5838  if ( !Abc_NtkRewrite( pNtk, fUpdateLevel, fUseZeros, fVerbose, fVeryVerbose, fPlaceEnable ) )
5839  {
5840  Abc_Print( -1, "Rewriting has failed.\n" );
5841  return 1;
5842  }
5843  return 0;
5844 
5845 usage:
5846  Abc_Print( -2, "usage: rewrite [-lzvwh]\n" );
5847  Abc_Print( -2, "\t performs technology-independent rewriting of the AIG\n" );
5848  Abc_Print( -2, "\t-l : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
5849  Abc_Print( -2, "\t-z : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
5850  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
5851  Abc_Print( -2, "\t-w : toggle printout subgraph statistics [default = %s]\n", fVeryVerbose? "yes": "no" );
5852 // Abc_Print( -2, "\t-p : toggle placement-aware rewriting [default = %s]\n", fPlaceEnable? "yes": "no" );
5853  Abc_Print( -2, "\t-h : print the command usage\n");
5854  return 1;
5855 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkRewrite(Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
Definition: abcRewrite.c:61
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Rwr_Precompute()
Definition: rwrMan.c:310
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandRr ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6224 of file abc.c.

6225 {
6226  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
6227  int c, Window;
6228  int nFaninLevels;
6229  int nFanoutLevels;
6230  int fUseFanouts;
6231  int fVerbose;
6232  extern int Abc_NtkRR( Abc_Ntk_t * pNtk, int nFaninLevels, int nFanoutLevels, int fUseFanouts, int fVerbose );
6233 
6234  // set defaults
6235  nFaninLevels = 3;
6236  nFanoutLevels = 3;
6237  fUseFanouts = 0;
6238  fVerbose = 0;
6240  while ( ( c = Extra_UtilGetopt( argc, argv, "Wfvh" ) ) != EOF )
6241  {
6242  switch ( c )
6243  {
6244  case 'W':
6245  if ( globalUtilOptind >= argc )
6246  {
6247  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
6248  goto usage;
6249  }
6250  Window = atoi(argv[globalUtilOptind]);
6251  globalUtilOptind++;
6252  if ( Window < 0 )
6253  goto usage;
6254  nFaninLevels = Window / 10;
6255  nFanoutLevels = Window % 10;
6256  break;
6257  case 'f':
6258  fUseFanouts ^= 1;
6259  break;
6260  case 'v':
6261  fVerbose ^= 1;
6262  break;
6263  case 'h':
6264  goto usage;
6265  default:
6266  goto usage;
6267  }
6268  }
6269 
6270  if ( pNtk == NULL )
6271  {
6272  Abc_Print( -1, "Empty network.\n" );
6273  return 1;
6274  }
6275  if ( !Abc_NtkIsStrash(pNtk) )
6276  {
6277  Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
6278  return 1;
6279  }
6280  if ( Abc_NtkGetChoiceNum(pNtk) )
6281  {
6282  Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
6283  return 1;
6284  }
6285 
6286  // modify the current network
6287  if ( !Abc_NtkRR( pNtk, nFaninLevels, nFanoutLevels, fUseFanouts, fVerbose ) )
6288  {
6289  Abc_Print( -1, "Redundancy removal has failed.\n" );
6290  return 1;
6291  }
6292  return 0;
6293 
6294 usage:
6295  Abc_Print( -2, "usage: rr [-W NM] [-fvh]\n" );
6296  Abc_Print( -2, "\t removes combinational redundancies in the current network\n" );
6297  Abc_Print( -2, "\t-W NM : window size: TFI (N) and TFO (M) logic levels [default = %d%d]\n", nFaninLevels, nFanoutLevels );
6298  Abc_Print( -2, "\t-f : toggle RR w.r.t. fanouts [default = %s]\n", fUseFanouts? "yes": "no" );
6299  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
6300  Abc_Print( -2, "\t-h : print the command usage\n");
6301  return 1;
6302 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int Abc_NtkRR(Abc_Ntk_t *pNtk, int nFaninLevels, int nFanoutLevels, int fUseFanouts, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcRr.c:98
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSat ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21284 of file abc.c.

21285 {
21286  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
21287  int c;
21288  int RetValue;
21289  int fVerbose;
21290  int nConfLimit;
21291  int nInsLimit;
21292  abctime clk;
21293  // set defaults
21294  fVerbose = 0;
21295  nConfLimit = 0;
21296  nInsLimit = 0;
21298  while ( ( c = Extra_UtilGetopt( argc, argv, "CIvh" ) ) != EOF )
21299  {
21300  switch ( c )
21301  {
21302  case 'C':
21303  if ( globalUtilOptind >= argc )
21304  {
21305  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
21306  goto usage;
21307  }
21308  nConfLimit = atoi(argv[globalUtilOptind]);
21309  globalUtilOptind++;
21310  if ( nConfLimit < 0 )
21311  goto usage;
21312  break;
21313  case 'I':
21314  if ( globalUtilOptind >= argc )
21315  {
21316  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
21317  goto usage;
21318  }
21319  nInsLimit = atoi(argv[globalUtilOptind]);
21320  globalUtilOptind++;
21321  if ( nInsLimit < 0 )
21322  goto usage;
21323  break;
21324  case 'v':
21325  fVerbose ^= 1;
21326  break;
21327  case 'h':
21328  goto usage;
21329  default:
21330  goto usage;
21331  }
21332  }
21333 
21334  if ( pNtk == NULL )
21335  {
21336  Abc_Print( -1, "Empty network.\n" );
21337  return 1;
21338  }
21339  if ( Abc_NtkLatchNum(pNtk) > 0 )
21340  {
21341  Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
21342  return 0;
21343  }
21344 
21345  clk = Abc_Clock();
21346  if ( Abc_NtkIsStrash(pNtk) )
21347  {
21348  RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, fVerbose, NULL, NULL );
21349  }
21350  else
21351  {
21352  assert( Abc_NtkIsLogic(pNtk) );
21353  Abc_NtkToBdd( pNtk );
21354  RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, fVerbose, NULL, NULL );
21355  }
21356 
21357  // verify that the pattern is correct
21358  if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
21359  {
21360  //int i;
21361  //Abc_Obj_t * pObj;
21362  int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
21363  if ( pSimInfo[0] != 1 )
21364  Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
21365  ABC_FREE( pSimInfo );
21366  /*
21367  // print model
21368  Abc_NtkForEachPi( pNtk, pObj, i )
21369  {
21370  Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
21371  if ( i == 70 )
21372  break;
21373  }
21374  Abc_Print( -1, "\n" );
21375  */
21376  }
21377  pAbc->Status = RetValue;
21378  if ( RetValue == -1 )
21379  Abc_Print( 1, "UNDECIDED " );
21380  else if ( RetValue == 0 )
21381  Abc_Print( 1, "SATISFIABLE " );
21382  else
21383  Abc_Print( 1, "UNSATISFIABLE " );
21384  //Abc_Print( -1, "\n" );
21385  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
21386  return 0;
21387 
21388 usage:
21389  Abc_Print( -2, "usage: sat [-C num] [-I num] [-vh]\n" );
21390  Abc_Print( -2, "\t solves the combinational miter using SAT solver MiniSat-1.14\n" );
21391  Abc_Print( -2, "\t derives CNF from the current network and leave it unchanged\n" );
21392  Abc_Print( -2, "\t (there is also a newer SAT solving command \"dsat\")\n" );
21393  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
21394  Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
21395  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
21396  Abc_Print( -2, "\t-h : print the command usage\n");
21397  return 1;
21398 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static abctime Abc_Clock()
Definition: abc_global.h:279
int * pModel
Definition: abc.h:198
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkMiterSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
FUNCTION DEFINITIONS ///.
Definition: abcSat.c:53
int globalUtilOptind
Definition: extraUtilUtil.c:45
ABC_DLL int Abc_NtkToBdd(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1160
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define assert(ex)
Definition: util_old.h:213
ABC_DLL int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
Definition: abcVerify.c:686
ABC_INT64_T abctime
Definition: abc_global.h:278
int Abc_CommandSaucy ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24027 of file abc.c.

24028 {
24029  Abc_Ntk_t *pNtk;
24030  char * outputName = NULL;
24031  FILE * gFile = NULL;
24032  int fOutputsOneAtTime = 0;
24033  int fFixOutputs = 0;
24034  int fFixInputs = 0;
24035  int fLookForSwaps = 0;
24036  int fQuiet = 0;
24037  int fPrintTree = 0;
24038  int c;
24039 
24040  extern void saucyGateWay( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo, FILE * gFile, int fBooleanMatching,
24041  int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree);
24042 
24044  while ( ( c = Extra_UtilGetopt( argc, argv, "OFiosqvh" ) ) != EOF )
24045  {
24046  switch ( c )
24047  {
24048  case 'O':
24049  if ( globalUtilOptind >= argc )
24050  {
24051  Abc_Print( -1, "Command line switch \"-O\" should be followed by an output name or the keyword all.\n" );
24052  goto usage;
24053  }
24054  outputName = argv[globalUtilOptind];
24055  if ( !strcmp(argv[globalUtilOptind], "all") )
24056  fOutputsOneAtTime ^= 1;
24057  globalUtilOptind++;
24058  break;
24059  case 'F':
24060  if ( globalUtilOptind >= argc )
24061  {
24062  Abc_Print( -1, "Command line switch \"-F\" should be followed by a file name.\n" );
24063  goto usage;
24064  }
24065  if ( (gFile = fopen( argv[globalUtilOptind], "w" )) == NULL )
24066  {
24067  Abc_Print( -1, "Cannot create output file \"%s\". ", argv[globalUtilOptind] );
24068  return 1;
24069  }
24070  globalUtilOptind++;
24071  break;
24072  case 'i':
24073  fFixOutputs ^= 1;
24074  break;
24075  case 'o':
24076  fFixInputs ^= 1;
24077  break;
24078  case 's':
24079  fLookForSwaps ^= 1;
24080  break;
24081  case 'q':
24082  fQuiet ^= 1;
24083  break;
24084  case 'v':
24085  fPrintTree ^= 1;
24086  break;
24087  case 'h':
24088  goto usage;
24089  default:
24090  Abc_Print( -2, "Unknown switch.\n");
24091  goto usage;
24092  }
24093  }
24094 
24095  pNtk = Abc_FrameReadNtk(pAbc);
24096 
24097  if ( pNtk == NULL )
24098  {
24099  Abc_Print( -1, "Empty network.\n" );
24100  return 1;
24101  }
24102  if ( !Abc_NtkIsStrash(pNtk) )
24103  {
24104  Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
24105  return 1;
24106  }
24107 
24108  pNtk = Abc_NtkDup( pNtk );
24109  Abc_NtkOrderObjsByName( pNtk, 1 );
24110 
24111  if (fOutputsOneAtTime) {
24112  int i;
24113  Abc_Obj_t * pNodePo;
24114  FILE * hadi = fopen("hadi.txt", "w");
24115  Abc_NtkForEachPo( pNtk, pNodePo, i ) {
24116  printf("Ouput %s\n\n", Abc_ObjName(pNodePo));
24117  saucyGateWay( pNtk, pNodePo, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
24118  printf("----------------------------------------\n");
24119  }
24120  fclose(hadi);
24121  } else if (outputName != NULL) {
24122  int i;
24123  Abc_Obj_t * pNodePo;
24124  Abc_NtkForEachPo( pNtk, pNodePo, i ) {
24125  if (!strcmp(Abc_ObjName(pNodePo), outputName)) {
24126  saucyGateWay( pNtk, pNodePo, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
24127  Abc_NtkDelete( pNtk );
24128  return 0;
24129  }
24130  }
24131  Abc_Print( -1, "Output not found\n" );
24132  return 1;
24133  } else
24134  saucyGateWay( pNtk, NULL, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
24135 
24136  if (gFile != NULL) fclose(gFile);
24137  Abc_NtkDelete( pNtk );
24138  return 0;
24139 
24140 usage:
24141  Abc_Print( -2, "usage: saucy3 [-O <name>] [-F <file>] [-iosqvh]\n\n" );
24142  Abc_Print( -2, "\t computes functional symmetries of the netowrk\n" );
24143  Abc_Print( -2, "\t prints symmetry generators to the standard output\n" );
24144  Abc_Print( -2, "\t-O <name> : (optional) compute symmetries only for output given by name\n");
24145  Abc_Print( -2, "\t only inputs in the output cone are permuted\n");
24146  Abc_Print( -2, "\t (special case) name=all, compute symmetries for each\n" );
24147  Abc_Print( -2, "\t output, but only one output at a time\n" );
24148  Abc_Print( -2, "\t [default = compute symmetries by permuting all I/Os]\n" );
24149  Abc_Print( -2, "\t-F <file> : print symmetry generators to file [default = stdout]\n");
24150  Abc_Print( -2, "\t-i : permute just the inputs (fix the outputs) [default = no]\n");
24151  Abc_Print( -2, "\t-o : permute just the outputs (fix the inputs) [default = no]\n");
24152  Abc_Print( -2, "\t-s : only look for swaps of inputs [default = no]\n");
24153  Abc_Print( -2, "\t-q : quiet (do not print symmetry generators) [default = no]\n");
24154  Abc_Print( -2, "\t-v : verbose (print the search tree) [default = no]\n");
24155  Abc_Print( -2, "\t-h : print the command usage\n");
24156 
24157  Abc_Print( -2, "\t \n" );
24158  Abc_Print( -2, "\t This command was contributed by Hadi Katebi from U Michigan.\n" );
24159  Abc_Print( -2, "\t The paper describing the method: H. Katebi, K. Sakallah and\n");
24160  Abc_Print( -2, "\t I. L. Markov.\n" );
24161  Abc_Print( -2, "\t \"Generalized Boolean Symmetries Through Nested Partition\n");
24162  Abc_Print( -2, "\t Refinement\". Proc. ICCAD 2013. \n" );
24163  //Abc_Print( -2, "\t http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
24164  Abc_Print( -2, "\t Saucy webpage: http://vlsicad.eecs.umich.edu/BK/SAUCY/\n" );
24165 
24166  return 1;
24167 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void saucyGateWay(Abc_Ntk_t *pNtkOrig, Abc_Obj_t *pNodePo, FILE *gFile, int fBooleanMatching, int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree)
Definition: abcSaucy.c:3246
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
int strcmp()
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
ABC_DLL void Abc_NtkOrderObjsByName(Abc_Ntk_t *pNtk, int fComb)
Definition: abcNames.c:335
int Abc_CommandScut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9679 of file abc.c.

9680 {
9681  Cut_Params_t Params, * pParams = &Params;
9682  Cut_Man_t * pCutMan;
9683  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
9684  int c;
9685  extern Cut_Man_t * Abc_NtkSeqCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
9686 
9687  // set defaults
9688  memset( pParams, 0, sizeof(Cut_Params_t) );
9689  pParams->nVarsMax = 5; // the max cut size ("k" of the k-feasible cuts)
9690  pParams->nKeepMax = 1000; // the max number of cuts kept at a node
9691  pParams->fTruth = 0; // compute truth tables
9692  pParams->fFilter = 1; // filter dominated cuts
9693  pParams->fSeq = 1; // compute sequential cuts
9694  pParams->fVerbose = 0; // the verbosiness flag
9696  while ( ( c = Extra_UtilGetopt( argc, argv, "KMtvh" ) ) != EOF )
9697  {
9698  switch ( c )
9699  {
9700  case 'K':
9701  if ( globalUtilOptind >= argc )
9702  {
9703  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
9704  goto usage;
9705  }
9706  pParams->nVarsMax = atoi(argv[globalUtilOptind]);
9707  globalUtilOptind++;
9708  if ( pParams->nVarsMax < 0 )
9709  goto usage;
9710  break;
9711  case 'M':
9712  if ( globalUtilOptind >= argc )
9713  {
9714  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
9715  goto usage;
9716  }
9717  pParams->nKeepMax = atoi(argv[globalUtilOptind]);
9718  globalUtilOptind++;
9719  if ( pParams->nKeepMax < 0 )
9720  goto usage;
9721  break;
9722  case 't':
9723  pParams->fTruth ^= 1;
9724  break;
9725  case 'v':
9726  pParams->fVerbose ^= 1;
9727  break;
9728  case 'h':
9729  goto usage;
9730  default:
9731  goto usage;
9732  }
9733  }
9734 
9735  if ( pNtk == NULL )
9736  {
9737  Abc_Print( -1, "Empty network.\n" );
9738  return 1;
9739  }
9740 /*
9741  if ( !Abc_NtkIsSeq(pNtk) )
9742  {
9743  Abc_Print( -1, "Sequential cuts can be computed for sequential AIGs (run \"seq\").\n" );
9744  return 1;
9745  }
9746 */
9747  if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
9748  {
9749  Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
9750  return 1;
9751  }
9752 
9753  pCutMan = Abc_NtkSeqCuts( pNtk, pParams );
9754  Cut_ManStop( pCutMan );
9755  return 0;
9756 
9757 usage:
9758  Abc_Print( -2, "usage: scut [-K num] [-M num] [-tvh]\n" );
9759  Abc_Print( -2, "\t computes k-feasible cuts for the sequential AIG\n" );
9760  Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n", CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
9761  Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n", pParams->nKeepMax );
9762  Abc_Print( -2, "\t-t : toggle truth table computation [default = %s]\n", pParams->fTruth? "yes": "no" );
9763  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
9764  Abc_Print( -2, "\t-h : print the command usage\n");
9765  return 1;
9766 }
char * memset()
Cut_Man_t * Abc_NtkSeqCuts(Abc_Ntk_t *pNtk, Cut_Params_t *pParams)
#define CUT_SIZE_MAX
Definition: cut.h:39
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
#define CUT_SIZE_MIN
INCLUDES ///.
Definition: cut.h:38
void Cut_ManStop(Cut_Man_t *p)
Definition: cutMan.c:124
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSendAig ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13096 of file abc.c.

13097 {
13098 // const int BRIDGE_NETLIST = 106;
13099 // const int BRIDGE_ABS_NETLIST = 107;
13100 
13101  int c, fAndSpace = 1, fAbsNetlist = 0;
13103  while ( ( c = Extra_UtilGetopt( argc, argv, "ah" ) ) != EOF )
13104  {
13105  switch ( c )
13106  {
13107  case 'a':
13108  fAndSpace ^= 1;
13109  break;
13110  case 'b':
13111  fAbsNetlist ^= 1;
13112  break;
13113  case 'h':
13114  goto usage;
13115  default:
13116  goto usage;
13117  }
13118  }
13119  if ( !Abc_FrameIsBridgeMode() )
13120  {
13121  Abc_Print( -1, "The bridge mode is not available.\n" );
13122  return 1;
13123  }
13124  if ( fAndSpace )
13125  {
13126  if ( pAbc->pGia == NULL )
13127  {
13128  Abc_Print( -1, "There is no AIG in the &-space.\n" );
13129  return 1;
13130  }
13131  Gia_ManToBridgeAbsNetlist( stdout, pAbc->pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST );
13132  }
13133  else
13134  {
13135  Aig_Man_t * pAig;
13136  Gia_Man_t * pGia;
13137  if ( pAbc->pNtkCur == NULL )
13138  {
13139  Abc_Print( -1, "There is no network in the main-space.\n" );
13140  return 1;
13141  }
13142  if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
13143  {
13144  Abc_Print( -1, "The main-space network is not an AIG.\n" );
13145  return 1;
13146  }
13147  pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
13148  pGia = Gia_ManFromAig( pAig );
13149  Aig_ManStop( pAig );
13150  Gia_ManToBridgeAbsNetlist( stdout, pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST );
13151  Gia_ManStop( pGia );
13152  }
13153  return 0;
13154 
13155 usage:
13156  Abc_Print( -2, "usage: send_aig -a\n" );
13157  Abc_Print( -2, "\t sends current AIG to the bridge\n" );
13158  Abc_Print( -2, "\t-a : toggle sending AIG from &-space [default = %s]\n", fAndSpace? "yes": "no" );
13159  Abc_Print( -2, "\t-b : toggle sending netlist tagged as \"abstraction\". [default = %s]\n", fAbsNetlist? "yes": "no" );
13160  Abc_Print( -2, "\t-h : print the command usage\n");
13161  return 1;
13162 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL int Abc_FrameIsBridgeMode()
Definition: mainFrame.c:94
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
Definition: giaAig.c:73
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
#define BRIDGE_NETLIST
Definition: abc_global.h:294
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Gia_ManToBridgeAbsNetlist(FILE *pFile, void *p, int pkg_type)
Definition: utilBridge.c:189
#define BRIDGE_ABS_NETLIST
Definition: abc_global.h:295
int Abc_CommandSendStatus ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13175 of file abc.c.

13176 {
13177  extern int Gia_ManToBridgeResult( FILE * pFile, int Result, Abc_Cex_t * pCex, int iPoProved );
13178  int c;
13180  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
13181  {
13182  switch ( c )
13183  {
13184  case 'h':
13185  goto usage;
13186  default:
13187  goto usage;
13188  }
13189  }
13190  if ( !Abc_FrameIsBridgeMode() )
13191  {
13192  Abc_Print( -1, "The bridge mode is not available.\n" );
13193  return 1;
13194  }
13195  if ( pAbc->Status == 0 && pAbc->pCex == NULL )
13196  {
13197  Abc_Print( -1, "Status is \"sat\", but current CEX is not available.\n" );
13198  return 1;
13199  }
13200  Gia_ManToBridgeResult( stdout, pAbc->Status, pAbc->pCex, 0 );
13201  return 0;
13202 
13203 usage:
13204  Abc_Print( -2, "usage: send_status\n" );
13205  Abc_Print( -2, "\t sends current status to the bridge\n" );
13206  Abc_Print( -2, "\t-h : print the command usage\n");
13207  return 1;
13208 }
ABC_DLL int Abc_FrameIsBridgeMode()
Definition: mainFrame.c:94
int Gia_ManToBridgeResult(FILE *pFile, int Result, Abc_Cex_t *pCex, int iPoProved)
DECLARATIONS ///.
Definition: utilBridge.c:284
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
int Abc_CommandSenseInput ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 11162 of file abc.c.

11163 {
11164  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
11165  Vec_Int_t * vResult;
11166  int c, nConfLim, fVerbose;
11167 
11168  extern Vec_Int_t * Abc_NtkSensitivity( Abc_Ntk_t * pNtk, int nConfLim, int fVerbose );
11169  // set defaults
11170  nConfLim = 1000;
11171  fVerbose = 1;
11173  while ( ( c = Extra_UtilGetopt( argc, argv, "Cvh" ) ) != EOF )
11174  {
11175  switch ( c )
11176  {
11177  case 'C':
11178  if ( globalUtilOptind >= argc )
11179  {
11180  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
11181  goto usage;
11182  }
11183  nConfLim = atoi(argv[globalUtilOptind]);
11184  globalUtilOptind++;
11185  if ( nConfLim < 0 )
11186  goto usage;
11187  break;
11188  case 'v':
11189  fVerbose ^= 1;
11190  break;
11191  case 'h':
11192  goto usage;
11193  default:
11194  goto usage;
11195  }
11196  }
11197  if ( pNtk == NULL )
11198  {
11199  Abc_Print( -1, "Empty network.\n" );
11200  return 1;
11201  }
11202  if ( Abc_NtkGetChoiceNum( pNtk ) )
11203  {
11204  Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
11205  return 1;
11206  }
11207  if ( !Abc_NtkIsComb(pNtk) )
11208  {
11209  Abc_Print( -1, "This command works only for combinational transition relations.\n" );
11210  return 1;
11211  }
11212  if ( !Abc_NtkIsStrash(pNtk) )
11213  {
11214  Abc_Print( -1, "This command works only for strashed networks.\n" );
11215  return 1;
11216  }
11217  if ( Abc_NtkPoNum(pNtk) < 2 )
11218  {
11219  Abc_Print( -1, "The network should have at least two outputs.\n" );
11220  return 1;
11221  }
11222 
11223  vResult = Abc_NtkSensitivity( pNtk, nConfLim, fVerbose );
11224  Vec_IntFree( vResult );
11225  return 0;
11226 
11227 usage:
11228  Abc_Print( -2, "usage: senseinput [-C num] [-vh]\n" );
11229  Abc_Print( -2, "\t computes sensitivity of POs to PIs under constraint\n" );
11230  Abc_Print( -2, "\t constraint should be represented as the last PO\n" );
11231  Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfLim );
11232  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
11233  Abc_Print( -2, "\t-h : print the command usage\n");
11234  return 1;
11235 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Vec_Int_t * Abc_NtkSensitivity(Abc_Ntk_t *pNtk, int nConfLim, int fVerbose)
Definition: abcSense.c:160
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
int Abc_CommandSeq ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16966 of file abc.c.

16967 {
16968  Abc_Ntk_t * pNtk, * pNtkRes;
16969  int c;
16970 
16971  pNtk = Abc_FrameReadNtk(pAbc);
16972  // set defaults
16974  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
16975  {
16976  switch ( c )
16977  {
16978  case 'h':
16979  goto usage;
16980  default:
16981  goto usage;
16982  }
16983  }
16984 
16985  if ( pNtk == NULL )
16986  {
16987  Abc_Print( -1, "Empty network.\n" );
16988  return 1;
16989  }
16990 
16991  if ( Abc_NtkLatchNum(pNtk) == 0 )
16992  {
16993  Abc_Print( -1, "The network has no latches.\n" );
16994  return 0;
16995  }
16996 
16997  if ( !Abc_NtkIsStrash(pNtk) )
16998  {
16999  Abc_Print( -1, "Conversion to sequential AIG works only for combinational AIGs (run \"strash\").\n" );
17000  return 1;
17001  }
17002 
17003  // get the new network
17004 // pNtkRes = Abc_NtkAigToSeq( pNtk );
17005  pNtkRes = NULL;
17006  if ( pNtkRes == NULL )
17007  {
17008  Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
17009  return 1;
17010  }
17011  // replace the current network
17012  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17013  return 0;
17014 
17015 usage:
17016  Abc_Print( -2, "usage: seq [-h]\n" );
17017  Abc_Print( -2, "\t converts AIG into sequential AIG\n" );
17018  Abc_Print( -2, "\t-h : print the command usage\n");
17019  return 1;
17020 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSeqCleanup ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 18742 of file abc.c.

18743 {
18744  Abc_Ntk_t * pNtk, * pNtkRes;
18745  int c;
18746  int fLatchConst = 1;
18747  int fLatchEqual = 1;
18748  int fSaveNames = 1;
18749  int fUseMvSweep = 0;
18750  int nFramesSymb = 1;
18751  int nFramesSatur = 512;
18752  int fVerbose = 0;
18753  int fVeryVerbose = 0;
18754  pNtk = Abc_FrameReadNtk(pAbc);
18755 
18756  // set defaults
18758  while ( ( c = Extra_UtilGetopt( argc, argv, "cenmFSvwh" ) ) != EOF )
18759  {
18760  switch ( c )
18761  {
18762  case 'c':
18763  fLatchConst ^= 1;
18764  break;
18765  case 'e':
18766  fLatchEqual ^= 1;
18767  break;
18768  case 'n':
18769  fSaveNames ^= 1;
18770  break;
18771  case 'm':
18772  fUseMvSweep ^= 1;
18773  break;
18774  case 'F':
18775  if ( globalUtilOptind >= argc )
18776  {
18777  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
18778  goto usage;
18779  }
18780  nFramesSymb = atoi(argv[globalUtilOptind]);
18781  globalUtilOptind++;
18782  if ( nFramesSymb < 0 )
18783  goto usage;
18784  break;
18785  case 'S':
18786  if ( globalUtilOptind >= argc )
18787  {
18788  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
18789  goto usage;
18790  }
18791  nFramesSatur = atoi(argv[globalUtilOptind]);
18792  globalUtilOptind++;
18793  if ( nFramesSatur < 0 )
18794  goto usage;
18795  break;
18796  case 'v':
18797  fVerbose ^= 1;
18798  break;
18799  case 'w':
18800  fVeryVerbose ^= 1;
18801  break;
18802  case 'h':
18803  goto usage;
18804  default:
18805  goto usage;
18806  }
18807  }
18808  if ( pNtk == NULL )
18809  {
18810  Abc_Print( -1, "Empty network.\n" );
18811  return 1;
18812  }
18813  if ( !Abc_NtkIsStrash(pNtk) )
18814  {
18815  Abc_Print( -1, "Only works for structrally hashed networks.\n" );
18816  return 1;
18817  }
18818  if ( !Abc_NtkLatchNum(pNtk) )
18819  {
18820  Abc_Print( -1, "The network is combinational.\n" );
18821  return 0;
18822  }
18823  // modify the current network
18824  pNtkRes = Abc_NtkDarLatchSweep( pNtk, fLatchConst, fLatchEqual, fSaveNames, fUseMvSweep, nFramesSymb, nFramesSatur, fVerbose, fVeryVerbose );
18825  if ( pNtkRes == NULL )
18826  {
18827  Abc_Print( -1, "Sequential cleanup has failed.\n" );
18828  return 1;
18829  }
18830  // replace the current network
18831  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
18832  return 0;
18833 
18834 usage:
18835  Abc_Print( -2, "usage: scleanup [-cenmFSvwh]\n" );
18836  Abc_Print( -2, "\t performs sequential cleanup of the current network\n" );
18837  Abc_Print( -2, "\t by removing nodes and latches that do not feed into POs\n" );
18838  Abc_Print( -2, "\t-c : sweep stuck-at latches detected by ternary simulation [default = %s]\n", fLatchConst? "yes": "no" );
18839  Abc_Print( -2, "\t-e : merge equal latches (same data inputs and init states) [default = %s]\n", fLatchEqual? "yes": "no" );
18840  Abc_Print( -2, "\t-n : toggle preserving latch names [default = %s]\n", fSaveNames? "yes": "no" );
18841  Abc_Print( -2, "\t-m : toggle using hybrid ternary/symbolic simulation [default = %s]\n", fUseMvSweep? "yes": "no" );
18842  Abc_Print( -2, "\t-F num : the number of first frames simulated symbolically [default = %d]\n", nFramesSymb );
18843  Abc_Print( -2, "\t-S num : the number of frames when symbolic saturation begins [default = %d]\n", nFramesSatur );
18844  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
18845  Abc_Print( -2, "\t-w : toggle very verbose output [default = %s]\n", fVeryVerbose? "yes": "no" );
18846  Abc_Print( -2, "\t-h : print the command usage\n");
18847  return 1;
18848 }
ABC_DLL Abc_Ntk_t * Abc_NtkDarLatchSweep(Abc_Ntk_t *pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
Definition: abcDar.c:3203
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSeqFpga ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17627 of file abc.c.

17628 {
17629  Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
17630  int c, nMaxIters;
17631  int fVerbose;
17632 
17633  pNtk = Abc_FrameReadNtk(pAbc);
17634  // set defaults
17635  nMaxIters = 15;
17636  fVerbose = 0;
17638  while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
17639  {
17640  switch ( c )
17641  {
17642  case 'I':
17643  if ( globalUtilOptind >= argc )
17644  {
17645  Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
17646  goto usage;
17647  }
17648  nMaxIters = atoi(argv[globalUtilOptind]);
17649  globalUtilOptind++;
17650  if ( nMaxIters < 0 )
17651  goto usage;
17652  break;
17653  case 'v':
17654  fVerbose ^= 1;
17655  break;
17656  case 'h':
17657  goto usage;
17658  default:
17659  goto usage;
17660  }
17661  }
17662 
17663  if ( pNtk == NULL )
17664  {
17665  Abc_Print( -1, "Empty network.\n" );
17666  return 1;
17667  }
17668 
17669  if ( Abc_NtkHasAig(pNtk) )
17670  {
17671 /*
17672  // quit if there are choice nodes
17673  if ( Abc_NtkGetChoiceNum(pNtk) )
17674  {
17675  Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
17676  return 0;
17677  }
17678 */
17679 // if ( Abc_NtkIsStrash(pNtk) )
17680 // pNtkNew = Abc_NtkAigToSeq(pNtk);
17681 // else
17682 // pNtkNew = Abc_NtkDup(pNtk);
17683  pNtkNew = NULL;
17684  }
17685  else
17686  {
17687  // strash and balance the network
17688  pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
17689  if ( pNtkNew == NULL )
17690  {
17691  Abc_Print( -1, "Strashing before FPGA mapping/retiming has failed.\n" );
17692  return 1;
17693  }
17694 
17695  pNtkNew = Abc_NtkBalance( pNtkRes = pNtkNew, 0, 0, 1 );
17696  Abc_NtkDelete( pNtkRes );
17697  if ( pNtkNew == NULL )
17698  {
17699  Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
17700  return 1;
17701  }
17702 
17703  // convert into a sequential AIG
17704 // pNtkNew = Abc_NtkAigToSeq( pNtkRes = pNtkNew );
17705  pNtkNew = NULL;
17706  Abc_NtkDelete( pNtkRes );
17707  if ( pNtkNew == NULL )
17708  {
17709  Abc_Print( -1, "Converting into a seq AIG before FPGA mapping/retiming has failed.\n" );
17710  return 1;
17711  }
17712 
17713  Abc_Print( 1, "The network was strashed and balanced before FPGA mapping/retiming.\n" );
17714  }
17715 
17716  // get the new network
17717 // pNtkRes = Seq_NtkFpgaMapRetime( pNtkNew, nMaxIters, fVerbose );
17718  pNtkRes = NULL;
17719  if ( pNtkRes == NULL )
17720  {
17721 // Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
17722  Abc_NtkDelete( pNtkNew );
17723  return 0;
17724  }
17725  Abc_NtkDelete( pNtkNew );
17726  // replace the current network
17727  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17728  return 0;
17729 
17730 usage:
17731  Abc_Print( -2, "usage: sfpga [-I num] [-vh]\n" );
17732  Abc_Print( -2, "\t performs integrated sequential FPGA mapping/retiming\n" );
17733  Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
17734  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
17735  Abc_Print( -2, "\t-h : print the command usage\n");
17736  return 1;
17737 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition: abcBalance.c:53
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
Definition: abc.h:255
int Abc_CommandSeqMap ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17750 of file abc.c.

17751 {
17752  Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
17753  int c, nMaxIters;
17754  int fVerbose;
17755 
17756  pNtk = Abc_FrameReadNtk(pAbc);
17757  // set defaults
17758  nMaxIters = 15;
17759  fVerbose = 0;
17761  while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
17762  {
17763  switch ( c )
17764  {
17765  case 'I':
17766  if ( globalUtilOptind >= argc )
17767  {
17768  Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
17769  goto usage;
17770  }
17771  nMaxIters = atoi(argv[globalUtilOptind]);
17772  globalUtilOptind++;
17773  if ( nMaxIters < 0 )
17774  goto usage;
17775  break;
17776  case 'v':
17777  fVerbose ^= 1;
17778  break;
17779  case 'h':
17780  goto usage;
17781  default:
17782  goto usage;
17783  }
17784  }
17785 
17786  if ( pNtk == NULL )
17787  {
17788  Abc_Print( -1, "Empty network.\n" );
17789  return 1;
17790  }
17791 
17792  if ( Abc_NtkHasAig(pNtk) )
17793  {
17794 /*
17795  // quit if there are choice nodes
17796  if ( Abc_NtkGetChoiceNum(pNtk) )
17797  {
17798  Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
17799  return 0;
17800  }
17801 */
17802 // if ( Abc_NtkIsStrash(pNtk) )
17803 // pNtkNew = Abc_NtkAigToSeq(pNtk);
17804 // else
17805 // pNtkNew = Abc_NtkDup(pNtk);
17806  pNtkNew = NULL;
17807  }
17808  else
17809  {
17810  // strash and balance the network
17811  pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
17812  if ( pNtkNew == NULL )
17813  {
17814  Abc_Print( -1, "Strashing before SC mapping/retiming has failed.\n" );
17815  return 1;
17816  }
17817 
17818  pNtkNew = Abc_NtkBalance( pNtkRes = pNtkNew, 0, 0, 1 );
17819  Abc_NtkDelete( pNtkRes );
17820  if ( pNtkNew == NULL )
17821  {
17822  Abc_Print( -1, "Balancing before SC mapping/retiming has failed.\n" );
17823  return 1;
17824  }
17825 
17826  // convert into a sequential AIG
17827 // pNtkNew = Abc_NtkAigToSeq( pNtkRes = pNtkNew );
17828  pNtkNew = NULL;
17829  Abc_NtkDelete( pNtkRes );
17830  if ( pNtkNew == NULL )
17831  {
17832  Abc_Print( -1, "Converting into a seq AIG before SC mapping/retiming has failed.\n" );
17833  return 1;
17834  }
17835 
17836  Abc_Print( -1, "The network was strashed and balanced before SC mapping/retiming.\n" );
17837  }
17838 
17839  // get the new network
17840 // pNtkRes = Seq_MapRetime( pNtkNew, nMaxIters, fVerbose );
17841  pNtkRes = NULL;
17842  if ( pNtkRes == NULL )
17843  {
17844 // Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
17845  Abc_NtkDelete( pNtkNew );
17846  return 0;
17847  }
17848  Abc_NtkDelete( pNtkNew );
17849 
17850  // replace the current network
17851  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17852  return 0;
17853 
17854 usage:
17855  Abc_Print( -2, "usage: smap [-I num] [-vh]\n" );
17856  Abc_Print( -2, "\t performs integrated sequential standard-cell mapping/retiming\n" );
17857  Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
17858  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
17859  Abc_Print( -2, "\t-h : print the command usage\n");
17860  return 1;
17861 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition: abcBalance.c:53
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
Definition: abc.h:255
int Abc_CommandSeqSweep ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17874 of file abc.c.

17875 {
17876  Abc_Ntk_t * pNtk, * pNtkRes;
17877  Fra_Ssw_t Pars, * pPars = &Pars;
17878  int c;
17879  extern Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars );
17880 
17881  pNtk = Abc_FrameReadNtk(pAbc);
17882  // set defaults
17883  pPars->nPartSize = 0;
17884  pPars->nOverSize = 0;
17885  pPars->nFramesP = 0;
17886  pPars->nFramesK = 1;
17887  pPars->nMaxImps = 5000;
17888  pPars->nMaxLevs = 0;
17889  pPars->fUseImps = 0;
17890  pPars->fRewrite = 0;
17891  pPars->fFraiging = 0;
17892  pPars->fLatchCorr = 0;
17893  pPars->fWriteImps = 0;
17894  pPars->fUse1Hot = 0;
17895  pPars->fVerbose = 0;
17896  pPars->TimeLimit = 0;
17898  while ( ( c = Extra_UtilGetopt( argc, argv, "PQNFILirfletvh" ) ) != EOF )
17899  {
17900  switch ( c )
17901  {
17902  case 'P':
17903  if ( globalUtilOptind >= argc )
17904  {
17905  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
17906  goto usage;
17907  }
17908  pPars->nPartSize = atoi(argv[globalUtilOptind]);
17909  globalUtilOptind++;
17910  if ( pPars->nPartSize < 2 )
17911  goto usage;
17912  break;
17913  case 'Q':
17914  if ( globalUtilOptind >= argc )
17915  {
17916  Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
17917  goto usage;
17918  }
17919  pPars->nOverSize = atoi(argv[globalUtilOptind]);
17920  globalUtilOptind++;
17921  if ( pPars->nOverSize < 0 )
17922  goto usage;
17923  break;
17924  case 'N':
17925  if ( globalUtilOptind >= argc )
17926  {
17927  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
17928  goto usage;
17929  }
17930  pPars->nFramesP = atoi(argv[globalUtilOptind]);
17931  globalUtilOptind++;
17932  if ( pPars->nFramesP < 0 )
17933  goto usage;
17934  break;
17935  case 'F':
17936  if ( globalUtilOptind >= argc )
17937  {
17938  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
17939  goto usage;
17940  }
17941  pPars->nFramesK = atoi(argv[globalUtilOptind]);
17942  globalUtilOptind++;
17943  if ( pPars->nFramesK <= 0 )
17944  goto usage;
17945  break;
17946  case 'I':
17947  if ( globalUtilOptind >= argc )
17948  {
17949  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
17950  goto usage;
17951  }
17952  pPars->nMaxImps = atoi(argv[globalUtilOptind]);
17953  globalUtilOptind++;
17954  if ( pPars->nMaxImps <= 0 )
17955  goto usage;
17956  break;
17957  case 'L':
17958  if ( globalUtilOptind >= argc )
17959  {
17960  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
17961  goto usage;
17962  }
17963  pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
17964  globalUtilOptind++;
17965  if ( pPars->nMaxLevs <= 0 )
17966  goto usage;
17967  break;
17968  case 'i':
17969  pPars->fUseImps ^= 1;
17970  break;
17971  case 'r':
17972  pPars->fRewrite ^= 1;
17973  break;
17974  case 'f':
17975  pPars->fFraiging ^= 1;
17976  break;
17977  case 'l':
17978  pPars->fLatchCorr ^= 1;
17979  break;
17980  case 'e':
17981  pPars->fWriteImps ^= 1;
17982  break;
17983  case 't':
17984  pPars->fUse1Hot ^= 1;
17985  break;
17986  case 'v':
17987  pPars->fVerbose ^= 1;
17988  break;
17989  case 'h':
17990  goto usage;
17991  default:
17992  goto usage;
17993  }
17994  }
17995 
17996  if ( pNtk == NULL )
17997  {
17998  Abc_Print( -1, "Empty network.\n" );
17999  return 1;
18000  }
18001 
18002  if ( Abc_NtkIsComb(pNtk) )
18003  {
18004  Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
18005  return 0;
18006  }
18007 
18008  if ( !Abc_NtkIsStrash(pNtk) )
18009  {
18010  Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
18011  return 0;
18012  }
18013 
18014  if ( pPars->nFramesK > 1 && pPars->fUse1Hot )
18015  {
18016  Abc_Print( -1, "Currrently can only use one-hotness for simple induction (K=1).\n" );
18017  return 0;
18018  }
18019 
18020  if ( pPars->nFramesP && pPars->fUse1Hot )
18021  {
18022  Abc_Print( -1, "Currrently can only use one-hotness without prefix.\n" );
18023  return 0;
18024  }
18025 
18026  // get the new network
18027  pNtkRes = Abc_NtkDarSeqSweep( pNtk, pPars );
18028  if ( pNtkRes == NULL )
18029  {
18030  Abc_Print( -1, "Sequential sweeping has failed.\n" );
18031  return 1;
18032  }
18033  // replace the current network
18034  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
18035  return 0;
18036 
18037 usage:
18038  Abc_Print( -2, "usage: ssweep [-PQNFL <num>] [-lrfetvh]\n" );
18039  Abc_Print( -2, "\t performs sequential sweep using K-step induction\n" );
18040  Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
18041  Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
18042  Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
18043  Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
18044  Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
18045 // Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
18046 // Abc_Print( -2, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
18047  Abc_Print( -2, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
18048  Abc_Print( -2, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
18049  Abc_Print( -2, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
18050  Abc_Print( -2, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
18051  Abc_Print( -2, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
18052  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
18053  Abc_Print( -2, "\t-h : print the command usage\n");
18054  return 1;
18055 }
int fFraiging
Definition: fra.h:103
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
int fRewrite
Definition: fra.h:102
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int fUse1Hot
Definition: fra.h:106
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
float TimeLimit
Definition: fra.h:110
int nFramesP
Definition: fra.h:96
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fWriteImps
Definition: fra.h:105
int globalUtilOptind
Definition: extraUtilUtil.c:45
Definition: fra.h:92
Abc_Ntk_t * Abc_NtkDarSeqSweep(Abc_Ntk_t *pNtk, Fra_Ssw_t *pPars)
Definition: abcDar.c:1971
int nFramesK
Definition: fra.h:97
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nMaxImps
Definition: fra.h:98
int nOverSize
Definition: fra.h:95
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int nPartSize
Definition: fra.h:94
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fUseImps
Definition: fra.h:101
int fLatchCorr
Definition: fra.h:104
int fVerbose
Definition: fra.h:107
int nMaxLevs
Definition: fra.h:99
int Abc_CommandSeqSweep2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 18068 of file abc.c.

18069 {
18070  Abc_Ntk_t * pNtk, * pNtkRes;
18071  Ssw_Pars_t Pars, * pPars = &Pars;
18072  int nConstrs = 0;
18073  int c;
18074  extern Abc_Ntk_t * Abc_NtkDarSeqSweep2( Abc_Ntk_t * pNtk, Ssw_Pars_t * pPars );
18075 
18076  pNtk = Abc_FrameReadNtk(pAbc);
18077  // set defaults
18078  Ssw_ManSetDefaultParams( pPars );
18080  while ( ( c = Extra_UtilGetopt( argc, argv, "PQFCLSIVMNcmplkofdseqvwh" ) ) != EOF )
18081  {
18082  switch ( c )
18083  {
18084  case 'P':
18085  if ( globalUtilOptind >= argc )
18086  {
18087  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
18088  goto usage;
18089  }
18090  pPars->nPartSize = atoi(argv[globalUtilOptind]);
18091  globalUtilOptind++;
18092  if ( pPars->nPartSize < 2 )
18093  goto usage;
18094  break;
18095  case 'Q':
18096  if ( globalUtilOptind >= argc )
18097  {
18098  Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
18099  goto usage;
18100  }
18101  pPars->nOverSize = atoi(argv[globalUtilOptind]);
18102  globalUtilOptind++;
18103  if ( pPars->nOverSize < 0 )
18104  goto usage;
18105  break;
18106  case 'F':
18107  if ( globalUtilOptind >= argc )
18108  {
18109  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
18110  goto usage;
18111  }
18112  pPars->nFramesK = atoi(argv[globalUtilOptind]);
18113  globalUtilOptind++;
18114  if ( pPars->nFramesK <= 0 )
18115  goto usage;
18116  break;
18117  case 'C':
18118  if ( globalUtilOptind >= argc )
18119  {
18120  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
18121  goto usage;
18122  }
18123  pPars->nBTLimit = atoi(argv[globalUtilOptind]);
18124  globalUtilOptind++;
18125  if ( pPars->nBTLimit <= 0 )
18126  goto usage;
18127  break;
18128  case 'L':
18129  if ( globalUtilOptind >= argc )
18130  {
18131  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
18132  goto usage;
18133  }
18134  pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
18135  globalUtilOptind++;
18136  if ( pPars->nMaxLevs <= 0 )
18137  goto usage;
18138  break;
18139  case 'S':
18140  if ( globalUtilOptind >= argc )
18141  {
18142  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
18143  goto usage;
18144  }
18145  pPars->nFramesAddSim = atoi(argv[globalUtilOptind]);
18146  globalUtilOptind++;
18147  if ( pPars->nFramesAddSim < 0 )
18148  goto usage;
18149  break;
18150  case 'I':
18151  if ( globalUtilOptind >= argc )
18152  {
18153  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
18154  goto usage;
18155  }
18156  pPars->nItersStop = atoi(argv[globalUtilOptind]);
18157  globalUtilOptind++;
18158  if ( pPars->nItersStop < 0 )
18159  goto usage;
18160  break;
18161  case 'V':
18162  if ( globalUtilOptind >= argc )
18163  {
18164  Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
18165  goto usage;
18166  }
18167  pPars->nSatVarMax2 = atoi(argv[globalUtilOptind]);
18168  globalUtilOptind++;
18169  if ( pPars->nSatVarMax2 < 0 )
18170  goto usage;
18171  break;
18172  case 'M':
18173  if ( globalUtilOptind >= argc )
18174  {
18175  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
18176  goto usage;
18177  }
18178  pPars->nRecycleCalls2 = atoi(argv[globalUtilOptind]);
18179  globalUtilOptind++;
18180  if ( pPars->nRecycleCalls2 < 0 )
18181  goto usage;
18182  break;
18183  case 'N':
18184  if ( globalUtilOptind >= argc )
18185  {
18186  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
18187  goto usage;
18188  }
18189  nConstrs = atoi(argv[globalUtilOptind]);
18190  globalUtilOptind++;
18191  if ( nConstrs < 0 )
18192  goto usage;
18193  break;
18194  case 'c':
18195  pPars->fConstrs ^= 1;
18196  break;
18197  case 'm':
18198  pPars->fMergeFull ^= 1;
18199  break;
18200  case 'p':
18201  pPars->fPolarFlip ^= 1;
18202  break;
18203  case 'l':
18204  pPars->fLatchCorr ^= 1;
18205  break;
18206  case 'k':
18207  pPars->fConstCorr ^= 1;
18208  break;
18209  case 'o':
18210  pPars->fOutputCorr ^= 1;
18211  break;
18212  case 'f':
18213  pPars->fSemiFormal ^= 1;
18214  break;
18215  case 'd':
18216  pPars->fDynamic ^= 1;
18217  break;
18218  case 's':
18219  pPars->fLocalSim ^= 1;
18220  break;
18221  case 'e':
18222  pPars->fEquivDump ^= 1;
18223  break;
18224  case 'q':
18225  pPars->fStopWhenGone ^= 1;
18226  break;
18227  case 'v':
18228  pPars->fVerbose ^= 1;
18229  break;
18230  case 'w':
18231  pPars->fFlopVerbose ^= 1;
18232  break;
18233  case 'h':
18234  goto usage;
18235  default:
18236  goto usage;
18237  }
18238  }
18239 
18240  if ( pNtk == NULL )
18241  {
18242  Abc_Print( -1, "Empty network.\n" );
18243  return 1;
18244  }
18245 
18246  if ( Abc_NtkIsComb(pNtk) )
18247  {
18248  Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
18249  return 0;
18250  }
18251 
18252  if ( !Abc_NtkIsStrash(pNtk) )
18253  {
18254  Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
18255  return 0;
18256  }
18257 
18258  if ( Abc_NtkPiNum(pNtk) == 0 )
18259  {
18260  Abc_Print( 0, "This command works only for designs with primary inputs.\n" );
18261  return 0;
18262  }
18263 
18264  // if constraints are to be used, network should have no constraints
18265  if ( nConstrs > 0 )
18266  {
18267  if ( Abc_NtkConstrNum(pNtk) > 0 )
18268  {
18269  Abc_Print( -1, "The network already has %d constraints.\n", Abc_NtkConstrNum(pNtk) );
18270  return 0;
18271  }
18272  else
18273  {
18274  Abc_Print( 0, "Setting the number of constraints to be %d.\n", nConstrs );
18275  pNtk->nConstrs = nConstrs;
18276  }
18277  }
18278 
18279  if ( pPars->fConstrs )
18280  {
18281  if ( Abc_NtkConstrNum(pNtk) > 0 )
18282  Abc_Print( 0, "Performing scorr with %d constraints.\n", Abc_NtkConstrNum(pNtk) );
18283  else
18284  Abc_Print( 0, "Performing constraint-based scorr without constraints.\n" );
18285  }
18286 
18287  // get the new network
18288  pNtkRes = Abc_NtkDarSeqSweep2( pNtk, pPars );
18289  if ( pNtkRes == NULL )
18290  {
18291  Abc_Print( -1, "Sequential sweeping has failed.\n" );
18292  return 1;
18293  }
18294  // replace the current network
18295  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
18296  return 0;
18297 
18298 usage:
18299  Abc_Print( -2, "usage: scorr [-PQFCLSIVMN <num>] [-cmplkodseqvwh]\n" );
18300  Abc_Print( -2, "\t performs sequential sweep using K-step induction\n" );
18301  Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
18302  Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
18303  Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
18304  Abc_Print( -2, "\t-C num : max number of conflicts at a node (0=inifinite) [default = %d]\n", pPars->nBTLimit );
18305  Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
18306  Abc_Print( -2, "\t-N num : number of last POs treated as constraints (0=none) [default = %d]\n", pPars->fConstrs );
18307  Abc_Print( -2, "\t-S num : additional simulation frames for c-examples (0=none) [default = %d]\n", pPars->nFramesAddSim );
18308  Abc_Print( -2, "\t-I num : iteration number to stop and output SR-model (-1=none) [default = %d]\n", pPars->nItersStop );
18309  Abc_Print( -2, "\t-V num : min var num needed to recycle the SAT solver [default = %d]\n", pPars->nSatVarMax2 );
18310  Abc_Print( -2, "\t-M num : min call num needed to recycle the SAT solver [default = %d]\n", pPars->nRecycleCalls2 );
18311  Abc_Print( -2, "\t-N num : set last <num> POs to be constraints (use with -c) [default = %d]\n", nConstrs );
18312  Abc_Print( -2, "\t-c : toggle using explicit constraints [default = %s]\n", pPars->fConstrs? "yes": "no" );
18313  Abc_Print( -2, "\t-m : toggle full merge if constraints are present [default = %s]\n", pPars->fMergeFull? "yes": "no" );
18314  Abc_Print( -2, "\t-p : toggle aligning polarity of SAT variables [default = %s]\n", pPars->fPolarFlip? "yes": "no" );
18315  Abc_Print( -2, "\t-l : toggle doing latch correspondence [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
18316  Abc_Print( -2, "\t-k : toggle doing constant correspondence [default = %s]\n", pPars->fConstCorr? "yes": "no" );
18317  Abc_Print( -2, "\t-o : toggle doing \'PO correspondence\' [default = %s]\n", pPars->fOutputCorr? "yes": "no" );
18318 // Abc_Print( -2, "\t-f : toggle filtering using iterative BMC [default = %s]\n", pPars->fSemiFormal? "yes": "no" );
18319  Abc_Print( -2, "\t-d : toggle dynamic addition of constraints [default = %s]\n", pPars->fDynamic? "yes": "no" );
18320  Abc_Print( -2, "\t-s : toggle local simulation in the cone of influence [default = %s]\n", pPars->fLocalSim? "yes": "no" );
18321  Abc_Print( -2, "\t-e : toggle dumping disproved internal equivalences [default = %s]\n", pPars->fEquivDump? "yes": "no" );
18322  Abc_Print( -2, "\t-q : toggle quitting when PO is not a constant candidate [default = %s]\n", pPars->fStopWhenGone? "yes": "no" );
18323  Abc_Print( -2, "\t-w : toggle printout of flop equivalences [default = %s]\n", pPars->fFlopVerbose? "yes": "no" );
18324  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
18325  Abc_Print( -2, "\t-h : print the command usage\n");
18326  return 1;
18327 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
Definition: ssw.h:40
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
Definition: sswCore.c:45
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDarSeqSweep2(Abc_Ntk_t *pNtk, Ssw_Pars_t *pPars)
Definition: abcDar.c:2120
int nConstrs
Definition: abc.h:173
int Abc_CommandShortNames ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9103 of file abc.c.

9104 {
9105  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
9106  int c;
9107  // set defaults
9109  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
9110  {
9111  switch ( c )
9112  {
9113  case 'h':
9114  goto usage;
9115  default:
9116  goto usage;
9117  }
9118  }
9119 
9120  if ( pNtk == NULL )
9121  {
9122  Abc_Print( -1, "Empty network.\n" );
9123  return 1;
9124  }
9125  Abc_NtkShortNames( pNtk );
9126  return 0;
9127 
9128 usage:
9129  Abc_Print( -2, "usage: short_names [-h]\n" );
9130  Abc_Print( -2, "\t replaces PI/PO/latch names by short char strings\n" );
9131  Abc_Print( -2, "\t-h : print the command usage\n");
9132  return 1;
9133 }
ABC_DLL void Abc_NtkShortNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:490
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandShow ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2709 of file abc.c.

2710 {
2711  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2712  int c;
2713  int fSeq;
2714  int fGateNames;
2715  int fUseReverse;
2716  int fFlopDep;
2717  extern void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse );
2718  extern void Abc_NtkShowFlopDependency( Abc_Ntk_t * pNtk );
2719 
2720  // set defaults
2721  fSeq = 0;
2722  fGateNames = 0;
2723  fUseReverse = 1;
2724  fFlopDep = 0;
2726  while ( ( c = Extra_UtilGetopt( argc, argv, "rsgfh" ) ) != EOF )
2727  {
2728  switch ( c )
2729  {
2730  case 'r':
2731  fUseReverse ^= 1;
2732  break;
2733  case 's':
2734  fSeq ^= 1;
2735  break;
2736  case 'g':
2737  fGateNames ^= 1;
2738  break;
2739  case 'f':
2740  fFlopDep ^= 1;
2741  break;
2742  default:
2743  goto usage;
2744  }
2745  }
2746 
2747  if ( pNtk == NULL )
2748  {
2749  Abc_Print( -1, "Empty network.\n" );
2750  return 1;
2751  }
2752 
2753  if ( fFlopDep )
2754  Abc_NtkShowFlopDependency( pNtk );
2755  else
2756  Abc_NtkShow( pNtk, fGateNames, fSeq, fUseReverse );
2757  return 0;
2758 
2759 usage:
2760  Abc_Print( -2, "usage: show [-srgfh]\n" );
2761  Abc_Print( -2, " visualizes the network structure using DOT and GSVIEW\n" );
2762 #ifdef WIN32
2763  Abc_Print( -2, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
2764  Abc_Print( -2, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
2765 #endif
2766  Abc_Print( -2, "\t-s : toggles visualization of sequential networks [default = %s].\n", fSeq? "yes": "no" );
2767  Abc_Print( -2, "\t-r : toggles ordering nodes in reverse order [default = %s].\n", fUseReverse? "yes": "no" );
2768  Abc_Print( -2, "\t-g : toggles printing gate names for mapped network [default = %s].\n", fGateNames? "yes": "no" );
2769  Abc_Print( -2, "\t-f : toggles visualizing flop dependency graph [default = %s].\n", fFlopDep? "yes": "no" );
2770  Abc_Print( -2, "\t-h : print the command usage\n");
2771  return 1;
2772 }
void Abc_NtkShowFlopDependency(Abc_Ntk_t *pNtk)
Definition: abcShow.c:421
void Abc_NtkShow(Abc_Ntk_t *pNtk0, int fGateNames, int fSeq, int fUseReverse)
Definition: abcShow.c:182
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandShowBdd ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2785 of file abc.c.

2786 {
2787  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2788  Abc_Obj_t * pNode;
2789  int c;
2790  extern void Abc_NodeShowBdd( Abc_Obj_t * pNode );
2791 
2792  // set defaults
2794  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
2795  {
2796  switch ( c )
2797  {
2798  case 'h':
2799  goto usage;
2800  default:
2801  goto usage;
2802  }
2803  }
2804 
2805  if ( pNtk == NULL )
2806  {
2807  Abc_Print( -1, "Empty network.\n" );
2808  return 1;
2809  }
2810 
2811  if ( !Abc_NtkIsBddLogic(pNtk) )
2812  {
2813  Abc_Print( -1, "Visualizing BDDs can only be done for logic BDD networks (run \"bdd\").\n" );
2814  return 1;
2815  }
2816 
2817  if ( argc > globalUtilOptind + 1 )
2818  {
2819  Abc_Print( -1, "Wrong number of auguments.\n" );
2820  goto usage;
2821  }
2822  if ( argc == globalUtilOptind )
2823  {
2824  pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
2825  if ( !Abc_ObjIsNode(pNode) )
2826  {
2827  Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
2828  return 1;
2829  }
2830  }
2831  else
2832  {
2833  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
2834  if ( pNode == NULL )
2835  {
2836  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
2837  return 1;
2838  }
2839  }
2840  Abc_NodeShowBdd( pNode );
2841  return 0;
2842 
2843 usage:
2844  Abc_Print( -2, "usage: show_bdd [-h] <node>\n" );
2845  Abc_Print( -2, " visualizes the BDD of a node using DOT and GSVIEW\n" );
2846 #ifdef WIN32
2847  Abc_Print( -2, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
2848  Abc_Print( -2, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
2849 #endif
2850  Abc_Print( -2, "\t<node>: the node to consider [default = the driver of the first PO]\n");
2851  Abc_Print( -2, "\t-h : print the command usage\n");
2852  return 1;
2853 }
void Abc_NodeShowBdd(Abc_Obj_t *pNode)
FUNCTION DEFINITIONS ///.
Definition: abcShow.c:58
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandShowCut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 2866 of file abc.c.

2867 {
2868  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
2869  Abc_Obj_t * pNode;
2870  int c;
2871  int nNodeSizeMax;
2872  int nConeSizeMax;
2873  extern void Abc_NodeShowCut( Abc_Obj_t * pNode, int nNodeSizeMax, int nConeSizeMax );
2874 
2875  // set defaults
2876  nNodeSizeMax = 10;
2877  nConeSizeMax = ABC_INFINITY;
2879  while ( ( c = Extra_UtilGetopt( argc, argv, "NCh" ) ) != EOF )
2880  {
2881  switch ( c )
2882  {
2883  case 'N':
2884  if ( globalUtilOptind >= argc )
2885  {
2886  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
2887  goto usage;
2888  }
2889  nNodeSizeMax = atoi(argv[globalUtilOptind]);
2890  globalUtilOptind++;
2891  if ( nNodeSizeMax < 0 )
2892  goto usage;
2893  break;
2894  case 'C':
2895  if ( globalUtilOptind >= argc )
2896  {
2897  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
2898  goto usage;
2899  }
2900  nConeSizeMax = atoi(argv[globalUtilOptind]);
2901  globalUtilOptind++;
2902  if ( nConeSizeMax < 0 )
2903  goto usage;
2904  break;
2905  case 'h':
2906  goto usage;
2907  default:
2908  goto usage;
2909  }
2910  }
2911 
2912  if ( pNtk == NULL )
2913  {
2914  Abc_Print( -1, "Empty network.\n" );
2915  return 1;
2916  }
2917 
2918  if ( !Abc_NtkIsStrash(pNtk) )
2919  {
2920  Abc_Print( -1, "Visualizing cuts only works for AIGs (run \"strash\").\n" );
2921  return 1;
2922  }
2923  if ( argc != globalUtilOptind + 1 )
2924  {
2925  Abc_Print( -1, "Wrong number of auguments.\n" );
2926  goto usage;
2927  }
2928 
2929  pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
2930  if ( pNode == NULL )
2931  {
2932  Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
2933  return 1;
2934  }
2935  Abc_NodeShowCut( pNode, nNodeSizeMax, nConeSizeMax );
2936  return 0;
2937 
2938 usage:
2939  Abc_Print( -2, "usage: show_cut [-N <num>] [-C <num>] [-h] <node>\n" );
2940  Abc_Print( -2, " visualizes the cut of a node using DOT and GSVIEW\n" );
2941 #ifdef WIN32
2942  Abc_Print( -2, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
2943  Abc_Print( -2, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
2944 #endif
2945  Abc_Print( -2, "\t-N <num> : the max size of the cut to be computed [default = %d]\n", nNodeSizeMax );
2946  Abc_Print( -2, "\t-C <num> : the max support of the containing cone [default = %d]\n", nConeSizeMax );
2947  Abc_Print( -2, "\t<node> : the node to consider\n");
2948  Abc_Print( -2, "\t-h : print the command usage\n");
2949  return 1;
2950 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL Abc_Obj_t * Abc_NtkFindNode(Abc_Ntk_t *pNtk, char *pName)
Definition: abcObj.c:456
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_NodeShowCut(Abc_Obj_t *pNode, int nNodeSizeMax, int nConeSizeMax)
Definition: abcShow.c:122
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
int Abc_CommandSim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 19040 of file abc.c.

19041 {
19042  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
19043  int c;
19044  int fNew;
19045  int fComb;
19046  int nFrames;
19047  int nWords;
19048  int TimeOut;
19049  int fMiter;
19050  int fVerbose;
19051  char * pFileSim;
19052  extern int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, int fNew, int fMiter, int fVerbose, char * pFileSim );
19053  // set defaults
19054  fNew = 0;
19055  fComb = 0;
19056  nFrames = 32;
19057  nWords = 8;
19058  TimeOut = 30;
19059  fMiter = 1;
19060  fVerbose = 0;
19061  pFileSim = NULL;
19063  while ( ( c = Extra_UtilGetopt( argc, argv, "FWTAnmvh" ) ) != EOF )
19064  {
19065  switch ( c )
19066  {
19067  case 'F':
19068  if ( globalUtilOptind >= argc )
19069  {
19070  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
19071  goto usage;
19072  }
19073  nFrames = atoi(argv[globalUtilOptind]);
19074  globalUtilOptind++;
19075  if ( nFrames < 0 )
19076  goto usage;
19077  break;
19078  case 'W':
19079  if ( globalUtilOptind >= argc )
19080  {
19081  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
19082  goto usage;
19083  }
19084  nWords = atoi(argv[globalUtilOptind]);
19085  globalUtilOptind++;
19086  if ( nWords < 0 )
19087  goto usage;
19088  break;
19089  case 'T':
19090  if ( globalUtilOptind >= argc )
19091  {
19092  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
19093  goto usage;
19094  }
19095  TimeOut = atoi(argv[globalUtilOptind]);
19096  globalUtilOptind++;
19097  if ( TimeOut < 0 )
19098  goto usage;
19099  break;
19100  case 'A':
19101  if ( globalUtilOptind >= argc )
19102  {
19103  Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
19104  goto usage;
19105  }
19106  pFileSim = argv[globalUtilOptind];
19107  globalUtilOptind++;
19108  break;
19109  case 'n':
19110  fNew ^= 1;
19111  break;
19112  case 'm':
19113  fMiter ^= 1;
19114  break;
19115  case 'v':
19116  fVerbose ^= 1;
19117  break;
19118  case 'h':
19119  goto usage;
19120  default:
19121  goto usage;
19122  }
19123  }
19124  if ( pNtk == NULL )
19125  {
19126  Abc_Print( -1, "Empty network.\n" );
19127  return 1;
19128  }
19129  if ( !Abc_NtkIsStrash(pNtk) )
19130  {
19131  Abc_Print( -1, "Only works for strashed networks.\n" );
19132  return 1;
19133  }
19134  if ( pFileSim != NULL && Abc_NtkLatchNum(pNtk) )
19135  {
19136  Abc_Print( -1, "Currently simulation with user-specified patterns works only for comb miters.\n" );
19137  return 1;
19138  }
19139  ABC_FREE( pNtk->pSeqModel );
19140  pAbc->Status = Abc_NtkDarSeqSim( pNtk, nFrames, nWords, TimeOut, fNew, fMiter, fVerbose, pFileSim );
19141  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
19142  return 0;
19143 
19144 usage:
19145  Abc_Print( -2, "usage: sim [-FWT num] [-A file] [-nmvh]\n" );
19146  Abc_Print( -2, "\t performs random simulation of the sequential miter\n" );
19147  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
19148  Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", nWords );
19149  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", TimeOut );
19150  Abc_Print( -2, "\t-A file : text file name with user's patterns [default = random simulation]\n" );
19151  Abc_Print( -2, "\t (patterns are listed, one per line, as sequences of 0s and 1s)\n" );
19152  Abc_Print( -2, "\t-n : toggle new vs. old implementation [default = %s]\n", fNew? "new": "old" );
19153  Abc_Print( -2, "\t-m : toggle miter vs. any circuit [default = %s]\n", fMiter? "miter": "circuit" );
19154  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
19155  Abc_Print( -2, "\t-h : print the command usage\n");
19156  return 1;
19157 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
int nWords
Definition: abcNpn.c:127
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
Abc_Cex_t * pSeqModel
Definition: abc.h:199
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Abc_NtkDarSeqSim(Abc_Ntk_t *pNtk, int nFrames, int nWords, int TimeOut, int fNew, int fMiter, int fVerbose, char *pFileSim)
Definition: abcDar.c:3444
#define ABC_FREE(obj)
Definition: abc_global.h:232
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSim3 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 19171 of file abc.c.

19172 {
19173  extern int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, Ssw_RarPars_t * pPars );
19174  Ssw_RarPars_t Pars, * pPars = &Pars;
19175  Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
19176  Vec_Ptr_t * vSeqModelVec;
19177  int c;
19178  Ssw_RarSetDefaultParams( pPars );
19180  while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTGadivzh" ) ) != EOF )
19181  {
19182  switch ( c )
19183  {
19184  case 'F':
19185  if ( globalUtilOptind >= argc )
19186  {
19187  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
19188  goto usage;
19189  }
19190  pPars->nFrames = atoi(argv[globalUtilOptind]);
19191  globalUtilOptind++;
19192  if ( pPars->nFrames < 0 )
19193  goto usage;
19194  break;
19195  case 'W':
19196  if ( globalUtilOptind >= argc )
19197  {
19198  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
19199  goto usage;
19200  }
19201  pPars->nWords = atoi(argv[globalUtilOptind]);
19202  globalUtilOptind++;
19203  if ( pPars->nWords < 0 )
19204  goto usage;
19205  break;
19206  case 'B':
19207  if ( globalUtilOptind >= argc )
19208  {
19209  Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
19210  goto usage;
19211  }
19212  pPars->nBinSize = atoi(argv[globalUtilOptind]);
19213  globalUtilOptind++;
19214  if ( pPars->nBinSize < 0 )
19215  goto usage;
19216  break;
19217  case 'R':
19218  if ( globalUtilOptind >= argc )
19219  {
19220  Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
19221  goto usage;
19222  }
19223  pPars->nRounds = atoi(argv[globalUtilOptind]);
19224  globalUtilOptind++;
19225  if ( pPars->nRounds < 0 )
19226  goto usage;
19227  break;
19228  case 'S':
19229  if ( globalUtilOptind >= argc )
19230  {
19231  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
19232  goto usage;
19233  }
19234  pPars->nRestart = atoi(argv[globalUtilOptind]);
19235  globalUtilOptind++;
19236  if ( pPars->nRestart < 0 )
19237  goto usage;
19238  break;
19239  case 'N':
19240  if ( globalUtilOptind >= argc )
19241  {
19242  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
19243  goto usage;
19244  }
19245  pPars->nRandSeed = atoi(argv[globalUtilOptind]);
19246  globalUtilOptind++;
19247  if ( pPars->nRandSeed < 0 )
19248  goto usage;
19249  break;
19250  case 'T':
19251  if ( globalUtilOptind >= argc )
19252  {
19253  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
19254  goto usage;
19255  }
19256  pPars->TimeOut = atoi(argv[globalUtilOptind]);
19257  globalUtilOptind++;
19258  if ( pPars->TimeOut < 0 )
19259  goto usage;
19260  break;
19261  case 'G':
19262  if ( globalUtilOptind >= argc )
19263  {
19264  Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
19265  goto usage;
19266  }
19267  pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
19268  globalUtilOptind++;
19269  if ( pPars->TimeOutGap < 0 )
19270  goto usage;
19271  break;
19272  case 'a':
19273  pPars->fSolveAll ^= 1;
19274  break;
19275  case 'd':
19276  pPars->fDropSatOuts ^= 1;
19277  break;
19278  case 'i':
19279  pPars->fSetLastState ^= 1;
19280  break;
19281  case 'v':
19282  pPars->fVerbose ^= 1;
19283  break;
19284  case 'z':
19285  pPars->fNotVerbose ^= 1;
19286  break;
19287  case 'h':
19288  goto usage;
19289  default:
19290  goto usage;
19291  }
19292  }
19293  if ( pNtk == NULL )
19294  {
19295  Abc_Print( -1, "Empty network.\n" );
19296  return 1;
19297  }
19298  if ( !Abc_NtkIsStrash(pNtk) )
19299  {
19300  Abc_Print( -1, "Only works for strashed networks.\n" );
19301  return 1;
19302  }
19303  if ( Abc_NtkLatchNum(pNtk) == 0 )
19304  {
19305  Abc_Print( -1, "Only works for sequential networks.\n" );
19306  return 1;
19307  }
19308  ABC_FREE( pNtk->pSeqModel );
19309  pAbc->Status = Abc_NtkDarSeqSim3( pNtk, pPars );
19310  Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
19311  vSeqModelVec = pNtk->vSeqModelVec; pNtk->vSeqModelVec = NULL;
19312  if ( pPars->fSetLastState && pAbc->pNtkCur->pData )
19313  {
19314  Abc_Obj_t * pObj;
19315  Vec_Int_t * vInit = (Vec_Int_t *)pAbc->pNtkCur->pData;
19316  pAbc->pNtkCur->pData = NULL;
19317  Abc_NtkForEachLatch( pAbc->pNtkCur, pObj, c )
19318  if ( Vec_IntEntry(vInit, c) )
19319  Abc_LatchSetInit1( pObj );
19320  Vec_IntFree( vInit );
19321  pNtkRes = Abc_NtkRestrashZero( pAbc->pNtkCur, 0 );
19322  if ( pNtkRes == NULL )
19323  {
19324  Abc_Print( -1, "Removing SAT outputs has failed.\n" );
19325  return 1;
19326  }
19327  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
19328  pNtk = Abc_FrameReadNtk(pAbc);
19329  }
19330  if ( pPars->fSolveAll && pPars->fDropSatOuts )
19331  {
19332  if ( vSeqModelVec == NULL )
19333  Abc_Print( 1,"The array of counter-examples is not available.\n" );
19334  else if ( Vec_PtrSize(vSeqModelVec) != Abc_NtkPoNum(pNtk) )
19335  Abc_Print( 1,"The array size does not match the number of outputs.\n" );
19336  else
19337  {
19338  extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
19339  Abc_NtkDropSatOutputs( pNtk, vSeqModelVec, pPars->fVerbose );
19340  pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
19341  if ( pNtkRes == NULL )
19342  {
19343  Abc_Print( -1, "Removing SAT outputs has failed.\n" );
19344  return 1;
19345  }
19346  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
19347  }
19348  }
19349  if ( vSeqModelVec )
19350  {
19351  Abc_FrameReplaceCexVec( pAbc, &vSeqModelVec );
19352  pAbc->nFrames = -1;
19353  }
19354  return 0;
19355 
19356 usage:
19357  Abc_Print( -2, "usage: sim3 [-FWBRSNTG num] [-advzh]\n" );
19358  Abc_Print( -2, "\t performs random simulation of the sequential miter\n" );
19359  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nFrames );
19360  Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
19361  Abc_Print( -2, "\t-B num : the number of flops in one bin [default = %d]\n", pPars->nBinSize );
19362  Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n", pPars->nRounds );
19363  Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n", pPars->nRestart );
19364  Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n", pPars->nRandSeed );
19365  Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeOut );
19366  Abc_Print( -2, "\t-G num : approximate runtime gap in seconds since the last CEX [default = %d]\n", pPars->TimeOutGap );
19367  Abc_Print( -2, "\t-a : toggle solving all outputs (do not stop when one is SAT) [default = %s]\n", pPars->fSolveAll? "yes": "no" );
19368  Abc_Print( -2, "\t-d : toggle dropping (replacing by 0) SAT outputs [default = %s]\n", pPars->fDropSatOuts? "yes": "no" );
19369  Abc_Print( -2, "\t-i : toggle changing init state to a last rare state [default = %s]\n", pPars->fVerbose? "yes": "no" );
19370  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
19371  Abc_Print( -2, "\t-z : toggle suppressing report about solved outputs [default = %s]\n", pPars->fNotVerbose? "yes": "no" );
19372  Abc_Print( -2, "\t-h : print the command usage\n");
19373  return 1;
19374 }
ABC_DLL Abc_Ntk_t * Abc_NtkDarLatchSweep(Abc_Ntk_t *pNtk, int fLatchConst, int fLatchEqual, int fSaveNames, int fUseMvSweep, int nFramesSymb, int nFramesSatur, int fVerbose, int fVeryVerbose)
Definition: abcDar.c:3203
void Abc_FrameReplaceCexVec(Abc_Frame_t *pAbc, Vec_Ptr_t **pvCexVec)
Definition: abc.c:515
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
int fSetLastState
Definition: ssw.h:101
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
int nFrames
Definition: ssw.h:92
Vec_Ptr_t * vSeqModelVec
Definition: abc.h:200
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
int TimeOutGap
Definition: ssw.h:99
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL Abc_Ntk_t * Abc_NtkRestrashZero(Abc_Ntk_t *pNtk, int fCleanup)
Definition: abcStrash.c:181
void Abc_NtkDropSatOutputs(Abc_Ntk_t *pNtk, Vec_Ptr_t *vCexes, int fVerbose)
Definition: abcNtk.c:1737
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
int fNotVerbose
Definition: ssw.h:103
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int Abc_NtkDarSeqSim3(Abc_Ntk_t *pNtk, Ssw_RarPars_t *pPars)
Definition: abcDar.c:3542
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
int fVerbose
Definition: ssw.h:102
int TimeOut
Definition: ssw.h:98
int nRestart
Definition: ssw.h:96
int globalUtilOptind
Definition: extraUtilUtil.c:45
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
Abc_Cex_t * pSeqModel
Definition: abc.h:199
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nWords
Definition: ssw.h:93
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static void Abc_LatchSetInit1(Abc_Obj_t *pLatch)
Definition: abc.h:419
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Ssw_RarSetDefaultParams(Ssw_RarPars_t *p)
FUNCTION DEFINITIONS ///.
Definition: sswRarity.c:102
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fSolveAll
Definition: ssw.h:100
void * pData
Definition: abc.h:145
int nRandSeed
Definition: ssw.h:97
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
int fDropSatOuts
Definition: ssw.h:105
int nRounds
Definition: ssw.h:95
int nBinSize
Definition: ssw.h:94
int Abc_CommandSimSec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 21046 of file abc.c.

21047 {
21048  Ssw_Pars_t Pars, * pPars = &Pars;
21049  Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
21050  int fDelete1, fDelete2;
21051  char ** pArgvNew;
21052  int nArgcNew, c;
21053  int fMiter;
21054 
21055  extern int Abc_NtkDarSimSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Ssw_Pars_t * pPars );
21056 
21057  pNtk = Abc_FrameReadNtk(pAbc);
21058  // set defaults
21059  fMiter = 1;
21060  Ssw_ManSetDefaultParams( pPars );
21061  pPars->fPartSigCorr = 1;
21062  pPars->fVerbose = 1;
21064  while ( ( c = Extra_UtilGetopt( argc, argv, "FDcymvh" ) ) != EOF )
21065  {
21066  switch ( c )
21067  {
21068  case 'F':
21069  if ( globalUtilOptind >= argc )
21070  {
21071  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
21072  goto usage;
21073  }
21074  pPars->nFramesK = atoi(argv[globalUtilOptind]);
21075  globalUtilOptind++;
21076  if ( pPars->nFramesK < 0 )
21077  goto usage;
21078  break;
21079  case 'D':
21080  if ( globalUtilOptind >= argc )
21081  {
21082  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
21083  goto usage;
21084  }
21085  pPars->nIsleDist = atoi(argv[globalUtilOptind]);
21086  globalUtilOptind++;
21087  if ( pPars->nIsleDist < 0 )
21088  goto usage;
21089  break;
21090  case 'm':
21091  fMiter ^= 1;
21092  break;
21093  case 'c':
21094  pPars->fPartSigCorr ^= 1;
21095  break;
21096  case 'y':
21097  pPars->fDumpSRInit ^= 1;
21098  break;
21099  case 'v':
21100  pPars->fVerbose ^= 1;
21101  break;
21102  default:
21103  goto usage;
21104  }
21105  }
21106 
21107  if ( fMiter )
21108  {
21109 // Abc_Ntk_t * pNtkA, * pNtkB;
21110  if ( !Abc_NtkIsStrash(pNtk) )
21111  {
21112  Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
21113  return 0;
21114  }
21115  Abc_NtkDarSimSec( pNtk, NULL, pPars );
21116 /*
21117  pNtkA = Abc_NtkDup( pNtk );
21118  pNtkB = Abc_NtkDup( pNtk );
21119  Abc_NtkDarSimSec( pNtkA, pNtkB, pPars );
21120  Abc_NtkDelete( pNtkA );
21121  Abc_NtkDelete( pNtkB );
21122 */
21123  }
21124  else
21125  {
21126  pArgvNew = argv + globalUtilOptind;
21127  nArgcNew = argc - globalUtilOptind;
21128  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
21129  return 1;
21130  if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
21131  {
21132  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
21133  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
21134  Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
21135  return 0;
21136  }
21137  // perform verification
21138  Abc_NtkDarSimSec( pNtk1, pNtk2, pPars );
21139  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
21140  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
21141  }
21142  return 0;
21143 
21144 usage:
21145  Abc_Print( -2, "usage: simsec [-FD num] [-mcyv] <file1> <file2>\n" );
21146  Abc_Print( -2, "\t performs SEC using structural similarity\n" );
21147  Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pPars->nFramesK );
21148  Abc_Print( -2, "\t-D num : the distance for extending islands [default = %d]\n", pPars->nIsleDist );
21149  Abc_Print( -2, "\t-m : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
21150  Abc_Print( -2, "\t-c : uses partial vs. full signal correspondence [default = %s]\n", pPars->fPartSigCorr? "partial": "full" );
21151  Abc_Print( -2, "\t-y : dumps speculatively reduced miter of the classes [default = %s]\n", pPars->fDumpSRInit? "yes": "no" );
21152  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
21153  Abc_Print( -2, "\tfile1 : (optional) the file with the first network\n");
21154  Abc_Print( -2, "\tfile2 : (optional) the file with the second network\n");
21155  Abc_Print( -2, "\t if no files are given, uses the current network and its spec\n");
21156  Abc_Print( -2, "\t if one file is given, uses the current network and the file\n");
21157  return 1;
21158 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
Definition: ssw.h:40
int Abc_NtkDarSimSec(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, Ssw_Pars_t *pPars)
Definition: abcDar.c:3108
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
Definition: sswCore.c:45
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSop ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7871 of file abc.c.

7872 {
7873  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
7874  int fDirect;
7875  int c;
7876 
7877  // set defaults
7878  fDirect = 0;
7880  while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
7881  {
7882  switch ( c )
7883  {
7884  case 'd':
7885  fDirect ^= 1;
7886  break;
7887  case 'h':
7888  goto usage;
7889  default:
7890  goto usage;
7891  }
7892  }
7893  if ( pNtk == NULL )
7894  {
7895  Abc_Print( -1, "Empty network.\n" );
7896  return 1;
7897  }
7898  if ( !Abc_NtkIsLogic(pNtk) )
7899  {
7900  Abc_Print( -1, "Converting to SOP is possible only for logic networks.\n" );
7901  return 1;
7902  }
7903  if ( !Abc_NtkToSop(pNtk, fDirect) )
7904  {
7905  Abc_Print( -1, "Converting to SOP has failed.\n" );
7906  return 1;
7907  }
7908  return 0;
7909 
7910 usage:
7911  Abc_Print( -2, "usage: sop [-dh]\n" );
7912  Abc_Print( -2, "\t converts node functions to SOP\n" );
7913  Abc_Print( -2, "\t-d : toggles using both phases or only positive [default = %s]\n", fDirect? "direct": "both" );
7914  Abc_Print( -2, "\t-h : print the command usage\n");
7915  return 1;
7916 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkToSop(Abc_Ntk_t *pNtk, int fDirect)
Definition: abcFunc.c:1124
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSparsify ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4161 of file abc.c.

4162 {
4163  extern Abc_Ntk_t * Abc_NtkSparsify( Abc_Ntk_t * pNtk, int nPerc, int fVerbose );
4164  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkNew;
4165  int nPerc, fVerbose, c;
4166  // set defaults
4167  nPerc = 10;
4168  fVerbose = 0;
4170  while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
4171  {
4172  switch ( c )
4173  {
4174  case 'N':
4175  if ( globalUtilOptind >= argc )
4176  {
4177  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
4178  goto usage;
4179  }
4180  nPerc = atoi(argv[globalUtilOptind]);
4181  globalUtilOptind++;
4182  if ( nPerc < 1 || nPerc > 100 )
4183  goto usage;
4184  break;
4185  case 'v':
4186  fVerbose ^= 1;
4187  break;
4188  case 'h':
4189  goto usage;
4190  break;
4191  default:
4192  goto usage;
4193  }
4194  }
4195 
4196  if ( pNtk == NULL )
4197  {
4198  Abc_Print( -1, "Empty network.\n" );
4199  return 1;
4200  }
4201  if ( !Abc_NtkIsBddLogic( pNtk ) )
4202  {
4203  Abc_Print( -1, "This command is only applicable to logic BDD networks (run \"bdd\").\n" );
4204  return 1;
4205  }
4206  if ( Abc_NtkCiNum(pNtk) > 16 )
4207  {
4208  Abc_Print( -1, "The number of primary inputs is more than 16.\n" );
4209  return 1;
4210  }
4211  pNtkNew = Abc_NtkSparsify( pNtk, nPerc, fVerbose );
4212  if ( pNtkNew == NULL )
4213  {
4214  Abc_Print( -1, "Command has failed.\n" );
4215  return 1;
4216  }
4217  // replace the current network
4218  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
4219  return 0;
4220 
4221 usage:
4222  Abc_Print( -2, "usage: sparsify [-N num] [-vh]\n" );
4223  Abc_Print( -2, "\t creates incompletely-specified function\n" );
4224  Abc_Print( -2, "\t-N <num> : the percentage of on-set and off-set minterms (1 <= num <= 100) [default = %d]\n", nPerc );
4225  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
4226  Abc_Print( -2, "\t-h : print the command usage\n");
4227  return 1;
4228 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
Abc_Ntk_t * Abc_NtkSparsify(Abc_Ntk_t *pNtk, int nPerc, int fVerbose)
Definition: abcDsd.c:674
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSpeedup ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5055 of file abc.c.

5056 {
5057  Abc_Ntk_t * pNtk, * pNtkRes;
5058  int c;
5059  int fUseLutLib;
5060  int Percentage;
5061  int Degree;
5062  int fVerbose;
5063  int fVeryVerbose;
5064  extern Abc_Ntk_t * Abc_NtkSpeedup( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
5065  pNtk = Abc_FrameReadNtk(pAbc);
5066 
5067  // set defaults
5068  fUseLutLib = 0;
5069  Percentage = 5;
5070  Degree = 2;
5071  fVerbose = 0;
5072  fVeryVerbose = 0;
5074  while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
5075  {
5076  switch ( c )
5077  {
5078  case 'P':
5079  if ( globalUtilOptind >= argc )
5080  {
5081  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
5082  goto usage;
5083  }
5084  Percentage = atoi(argv[globalUtilOptind]);
5085  globalUtilOptind++;
5086  if ( Percentage < 1 || Percentage > 100 )
5087  goto usage;
5088  break;
5089  case 'N':
5090  if ( globalUtilOptind >= argc )
5091  {
5092  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
5093  goto usage;
5094  }
5095  Degree = atoi(argv[globalUtilOptind]);
5096  globalUtilOptind++;
5097  if ( Degree < 1 || Degree > 5 )
5098  goto usage;
5099  break;
5100  case 'l':
5101  fUseLutLib ^= 1;
5102  break;
5103  case 'v':
5104  fVerbose ^= 1;
5105  break;
5106  case 'w':
5107  fVeryVerbose ^= 1;
5108  break;
5109  case 'h':
5110  goto usage;
5111  default:
5112  goto usage;
5113  }
5114  }
5115 
5116  if ( pNtk == NULL )
5117  {
5118  Abc_Print( -1, "Empty network.\n" );
5119  return 1;
5120  }
5121  if ( !Abc_NtkIsLogic(pNtk) )
5122  {
5123  Abc_Print( -1, "This command can only be applied to a logic network.\n" );
5124  return 1;
5125  }
5126 
5127  // modify the current network
5128  pNtkRes = Abc_NtkSpeedup( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
5129  if ( pNtkRes == NULL )
5130  {
5131  Abc_Print( -1, "The command has failed.\n" );
5132  return 1;
5133  }
5134  // replace the current network
5135  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
5136  return 0;
5137 
5138 usage:
5139  Abc_Print( -2, "usage: speedup [-PN <num>] [-lvwh]\n" );
5140  Abc_Print( -2, "\t transforms LUT-mapped network into an AIG with choices;\n" );
5141  Abc_Print( -2, "\t the choices are added to speedup the next round of mapping\n" );
5142  Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
5143  Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
5144  Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
5145  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
5146  Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
5147  Abc_Print( -2, "\t-h : print the command usage\n");
5148  return 1;
5149 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkSpeedup(Abc_Ntk_t *pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose)
Definition: abcSpeedup.c:512
int Abc_CommandSplitSop ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8370 of file abc.c.

8371 {
8372  extern Abc_Ntk_t * Abc_NtkSplitSop( Abc_Ntk_t * pNtk, int nCubesMax, int fVerbose );
8373  Abc_Ntk_t * pNtk, * pNtkRes;
8374  int c, fVerbose = 0, nCubesMax = 100;
8375  pNtk = Abc_FrameReadNtk(pAbc);
8376  // set defaults
8378  while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
8379  {
8380  switch ( c )
8381  {
8382  case 'N':
8383  if ( globalUtilOptind >= argc )
8384  {
8385  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
8386  goto usage;
8387  }
8388  nCubesMax = atoi(argv[globalUtilOptind]);
8389  globalUtilOptind++;
8390  if ( nCubesMax < 0 )
8391  goto usage;
8392  break;
8393  case 'v':
8394  fVerbose ^= 1;
8395  break;
8396  case 'h':
8397  goto usage;
8398  default:
8399  goto usage;
8400  }
8401  }
8402 
8403  if ( pNtk == NULL )
8404  {
8405  Abc_Print( -1, "Empty network.\n" );
8406  return 1;
8407  }
8408 
8409  if ( !Abc_NtkIsSopLogic(pNtk) )
8410  {
8411  Abc_Print( -1, "Only a SOP logic network can be transformed into cubes.\n" );
8412  return 1;
8413  }
8414 
8415  // get the new network
8416  pNtkRes = Abc_NtkSplitSop( pNtk, nCubesMax, fVerbose );
8417  if ( pNtkRes == NULL )
8418  {
8419  Abc_Print( -1, "Converting to cubes has failed.\n" );
8420  return 1;
8421  }
8422  // replace the current network
8423  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
8424  return 0;
8425 
8426 usage:
8427  Abc_Print( -2, "usage: splitsop [-N num] [-vh]\n" );
8428  Abc_Print( -2, "\t splits nodes whose SOP size is larger than the given one\n" );
8429  Abc_Print( -2, "\t-N num : the maximum number of cubes after splitting [default = %d]\n", nCubesMax );
8430  Abc_Print( -2, "\t-v : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
8431  Abc_Print( -2, "\t-h : print the command usage\n");
8432  return 1;
8433 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsSopLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:264
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Abc_Ntk_t * Abc_NtkSplitSop(Abc_Ntk_t *pNtk, int nCubesMax, int fVerbose)
Definition: abcUtil.c:2765
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandStrash ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3064 of file abc.c.

3065 {
3066  Abc_Ntk_t * pNtk, * pNtkRes;
3067  Abc_Obj_t * pObj;
3068  int c;
3069  int fAllNodes;
3070  int fRecord;
3071  int fCleanup;
3072  int fComplOuts;
3073  pNtk = Abc_FrameReadNtk(pAbc);
3074  // set defaults
3075  fAllNodes = 0;
3076  fCleanup = 1;
3077  fRecord = 0;
3078  fComplOuts= 0;
3080  while ( ( c = Extra_UtilGetopt( argc, argv, "acrih" ) ) != EOF )
3081  {
3082  switch ( c )
3083  {
3084  case 'a':
3085  fAllNodes ^= 1;
3086  break;
3087  case 'c':
3088  fCleanup ^= 1;
3089  break;
3090  case 'r':
3091  fRecord ^= 1;
3092  break;
3093  case 'i':
3094  fComplOuts ^= 1;
3095  break;
3096  case 'h':
3097  goto usage;
3098  default:
3099  goto usage;
3100  }
3101  }
3102 
3103  if ( pNtk == NULL )
3104  {
3105  Abc_Print( -1, "Empty network.\n" );
3106  return 1;
3107  }
3108 
3109  // get the new network
3110  pNtkRes = Abc_NtkStrash( pNtk, fAllNodes, fCleanup, fRecord );
3111  if ( pNtkRes == NULL )
3112  {
3113  Abc_Print( -1, "Strashing has failed.\n" );
3114  return 1;
3115  }
3116  if ( fComplOuts )
3117  Abc_NtkForEachPo( pNtkRes, pObj, c )
3118  Abc_ObjXorFaninC( pObj, 0 );
3119  // replace the current network
3120  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
3121  return 0;
3122 
3123 usage:
3124  Abc_Print( -2, "usage: strash [-acrih]\n" );
3125  Abc_Print( -2, "\t transforms combinational logic into an AIG\n" );
3126  Abc_Print( -2, "\t-a : toggles between using all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "DFS" );
3127  Abc_Print( -2, "\t-c : toggles cleanup to remove the dagling AIG nodes [default = %s]\n", fCleanup? "all": "DFS" );
3128  Abc_Print( -2, "\t-r : toggles using the record of AIG subgraphs [default = %s]\n", fRecord? "yes": "no" );
3129  Abc_Print( -2, "\t-i : toggles complementing the POs of the AIG [default = %s]\n", fComplOuts? "yes": "no" );
3130  Abc_Print( -2, "\t-h : print the command usage\n");
3131  return 1;
3132 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void remove(V &ts, const T &t)
Definition: Alg.h:36
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
static void Abc_ObjXorFaninC(Abc_Obj_t *pObj, int i)
Definition: abc.h:381
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
int Abc_CommandSuperChoice ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14829 of file abc.c.

14830 {
14831  Abc_Ntk_t * pNtk, * pNtkRes;
14832  int c;
14833  extern Abc_Ntk_t * Abc_NtkSuperChoice( Abc_Ntk_t * pNtk );
14834 
14835  pNtk = Abc_FrameReadNtk(pAbc);
14836  // set defaults
14838  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
14839  {
14840  switch ( c )
14841  {
14842  case 'h':
14843  goto usage;
14844  default:
14845  goto usage;
14846  }
14847  }
14848 
14849  if ( pNtk == NULL )
14850  {
14851  Abc_Print( -1, "Empty network.\n" );
14852  return 1;
14853  }
14854 
14855  if ( !Abc_NtkIsStrash(pNtk) )
14856  {
14857  Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
14858  return 1;
14859  }
14860 
14861  // get the new network
14862  pNtkRes = Abc_NtkSuperChoice( pNtk );
14863  if ( pNtkRes == NULL )
14864  {
14865  Abc_Print( -1, "Superchoicing has failed.\n" );
14866  return 1;
14867  }
14868  // replace the current network
14869  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
14870  return 0;
14871 
14872 usage:
14873  Abc_Print( -2, "usage: superc [-h]\n" );
14874  Abc_Print( -2, "\t performs superchoicing\n" );
14875  Abc_Print( -2, "\t (accumulate: \"r file.blif; rsup; b; sc; f -ac; wb file_sc.blif\")\n" );
14876  Abc_Print( -2, "\t (map without supergate library: \"r file_sc.blif; ft; map\")\n" );
14877  Abc_Print( -2, "\t-h : print the command usage\n");
14878  return 1;
14879 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Abc_Ntk_t * Abc_NtkSuperChoice(Abc_Ntk_t *pNtk)
Definition: abcMap.c:480
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSuperChoiceLut ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14892 of file abc.c.

14893 {
14894  Abc_Ntk_t * pNtk, * pNtkRes;
14895  int c;
14896  int nLutSize;
14897  int nCutSizeMax;
14898  int fVerbose;
14899  extern int Abc_NtkSuperChoiceLut( Abc_Ntk_t * pNtk, int nLutSize, int nCutSizeMax, int fVerbose );
14900 
14901  pNtk = Abc_FrameReadNtk(pAbc);
14902  // set defaults
14903  fVerbose = 1;
14904  nLutSize = 4;
14905  nCutSizeMax = 10;
14907  while ( ( c = Extra_UtilGetopt( argc, argv, "KNh" ) ) != EOF )
14908  {
14909  switch ( c )
14910  {
14911  case 'K':
14912  if ( globalUtilOptind >= argc )
14913  {
14914  Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
14915  goto usage;
14916  }
14917  nLutSize = atoi(argv[globalUtilOptind]);
14918  globalUtilOptind++;
14919  if ( nLutSize < 0 )
14920  goto usage;
14921  break;
14922  case 'N':
14923  if ( globalUtilOptind >= argc )
14924  {
14925  Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
14926  goto usage;
14927  }
14928  nCutSizeMax = atoi(argv[globalUtilOptind]);
14929  globalUtilOptind++;
14930  if ( nCutSizeMax < 0 )
14931  goto usage;
14932  break;
14933  case 'v':
14934  fVerbose ^= 1;
14935  break;
14936  case 'h':
14937  goto usage;
14938  default:
14939  goto usage;
14940  }
14941  }
14942 
14943  if ( pNtk == NULL )
14944  {
14945  Abc_Print( -1, "Empty network.\n" );
14946  return 1;
14947  }
14948 
14949  if ( !Abc_NtkIsStrash(pNtk) )
14950  {
14951  Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
14952  return 1;
14953  }
14954 
14955  // convert the network into the SOP network
14956  pNtkRes = Abc_NtkToLogic( pNtk );
14957 
14958  // get the new network
14959  if ( !Abc_NtkSuperChoiceLut( pNtkRes, nLutSize, nCutSizeMax, fVerbose ) )
14960  {
14961  Abc_NtkDelete( pNtkRes );
14962  Abc_Print( -1, "Superchoicing has failed.\n" );
14963  return 1;
14964  }
14965  // replace the current network
14966  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
14967  return 0;
14968 
14969 usage:
14970  Abc_Print( -2, "usage: supercl [-K num] [-N num] [-vh]\n" );
14971  Abc_Print( -2, "\t performs superchoicing for K-LUTs\n" );
14972  Abc_Print( -2, "\t (accumulate: \"r file.blif; b; scl; f -ac; wb file_sc.blif\")\n" );
14973  Abc_Print( -2, "\t (FPGA map: \"r file_sc.blif; ft; read_lut lutlibK; fpga\")\n" );
14974  Abc_Print( -2, "\t-K num : the number of LUT inputs [default = %d]\n", nLutSize );
14975  Abc_Print( -2, "\t-N num : the max size of the cut [default = %d]\n", nCutSizeMax );
14976  Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
14977  Abc_Print( -2, "\t-h : print the command usage\n");
14978  return 1;
14979 }
int Abc_NtkSuperChoiceLut(Abc_Ntk_t *pNtk, int nLutSize, int nCutSizeMax, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcLut.c:81
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcNetlist.c:52
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSwapPos ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7217 of file abc.c.

7218 {
7219  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes;
7220  int c, iOutput = -1;
7221  extern void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput );
7222 
7223  // set defaults
7225  while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
7226  {
7227  switch ( c )
7228  {
7229  case 'N':
7230  if ( globalUtilOptind >= argc )
7231  {
7232  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
7233  goto usage;
7234  }
7235  iOutput = atoi(argv[globalUtilOptind]);
7236  globalUtilOptind++;
7237  if ( iOutput < 0 )
7238  goto usage;
7239  break;
7240  default:
7241  goto usage;
7242  }
7243  }
7244 
7245  if ( pNtk == NULL )
7246  {
7247  Abc_Print( -1, "Empty network.\n" );
7248  return 1;
7249  }
7250 
7251  if ( !Abc_NtkIsStrash(pNtk) )
7252  {
7253  Abc_Print( -1, "The network is not strashed.\n" );
7254  return 1;
7255  }
7256  if ( iOutput < 0 )
7257  {
7258  Abc_Print( -1, "The output index is not specified.\n" );
7259  return 1;
7260  }
7261  if ( iOutput >= Abc_NtkPoNum(pNtk) )
7262  {
7263  Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
7264  return 1;
7265  }
7266 
7267  // get the new network
7268  pNtkRes = Abc_NtkDup( pNtk );
7269  Abc_NtkSwapOneOutput( pNtkRes, iOutput );
7270  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7271  return 0;
7272 
7273 usage:
7274  Abc_Print( -2, "usage: swappos [-N <num>] [-h]\n" );
7275  Abc_Print( -2, "\t swap the 0-th PO with the <num>-th PO\n" );
7276  Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to swap [default = %d]\n", iOutput );
7277  Abc_Print( -2, "\t-h : print the command usage\n");
7278  return 1;
7279 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
void Abc_NtkSwapOneOutput(Abc_Ntk_t *pNtk, int iOutput)
Definition: abcNtk.c:1802
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSweep ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 3689 of file abc.c.

3690 {
3691  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
3692  int c;
3693  int fSingle = 0;
3694  int fVerbose = 0;
3695 
3696  // set defaults
3698  while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
3699  {
3700  switch ( c )
3701  {
3702  case 's':
3703  fSingle ^= 1;
3704  break;
3705  case 'v':
3706  fVerbose ^= 1;
3707  break;
3708  case 'h':
3709  goto usage;
3710  default:
3711  goto usage;
3712  }
3713  }
3714 
3715  if ( pNtk == NULL )
3716  {
3717  Abc_Print( -1, "Empty network.\n" );
3718  return 1;
3719  }
3720  if ( !Abc_NtkIsLogic(pNtk) )
3721  {
3722  Abc_Print( -1, "The classical (SIS-like) sweep can only be performed on a logic network.\n" );
3723  return 1;
3724  }
3725  // modify the current network
3726  if ( fSingle )
3727  Abc_NtkSweepBufsInvs( pNtk, fVerbose );
3728  else
3729  Abc_NtkSweep( pNtk, fVerbose );
3730  return 0;
3731 
3732 usage:
3733  Abc_Print( -2, "usage: sweep [-svh]\n" );
3734  Abc_Print( -2, "\t removes dangling nodes; propagates constant, buffers, inverters\n" );
3735  Abc_Print( -2, "\t-s : toggle sweeping buffers/inverters only [default = %s]\n", fSingle? "yes": "no" );
3736  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
3737  Abc_Print( -2, "\t-h : print the command usage\n");
3738  return 1;
3739 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkSweepBufsInvs(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcSweep.c:959
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
ABC_DLL int Abc_NtkSweep(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcSweep.c:574
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandSynch ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 19537 of file abc.c.

19538 {
19539  Abc_Ntk_t * pNtkRes, * pNtk1, * pNtk2, * pNtk;
19540  char ** pArgvNew;
19541  int nArgcNew;
19542  int fDelete1, fDelete2;
19543  int c;
19544  int nWords;
19545  int fVerbose;
19546 
19547  extern Abc_Ntk_t * Abc_NtkDarSynch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nWords, int fVerbose );
19548  extern Abc_Ntk_t * Abc_NtkDarSynchOne( Abc_Ntk_t * pNtk, int nWords, int fVerbose );
19549 
19550  pNtk = Abc_FrameReadNtk(pAbc);
19551  // set defaults
19552  nWords = 32;
19553  fVerbose = 1;
19555  while ( ( c = Extra_UtilGetopt( argc, argv, "Wvh" ) ) != EOF )
19556  {
19557  switch ( c )
19558  {
19559  case 'W':
19560  if ( globalUtilOptind >= argc )
19561  {
19562  Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
19563  goto usage;
19564  }
19565  nWords = atoi(argv[globalUtilOptind]);
19566  globalUtilOptind++;
19567  if ( nWords <= 0 )
19568  goto usage;
19569  break;
19570  case 'v':
19571  fVerbose ^= 1;
19572  break;
19573  case 'h':
19574  goto usage;
19575  default:
19576  goto usage;
19577  }
19578  }
19579 
19580  pArgvNew = argv + globalUtilOptind;
19581  nArgcNew = argc - globalUtilOptind;
19582  if ( nArgcNew == 0 )
19583  {
19584  if ( pNtk == NULL )
19585  {
19586  Abc_Print( -1, "Empty network.\n" );
19587  return 1;
19588  }
19589  pNtkRes = Abc_NtkDarSynchOne( pNtk, nWords, fVerbose );
19590  }
19591  else
19592  {
19593  if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
19594  return 1;
19595  if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
19596  {
19597  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
19598  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
19599  Abc_Print( -1, "The network has no latches..\n" );
19600  return 0;
19601  }
19602 
19603  // modify the current network
19604  pNtkRes = Abc_NtkDarSynch( pNtk1, pNtk2, nWords, fVerbose );
19605  if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
19606  if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
19607  }
19608  if ( pNtkRes == NULL )
19609  {
19610  Abc_Print( -1, "Synchronization has failed.\n" );
19611  return 0;
19612  }
19613  // replace the current network
19614  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
19615  return 0;
19616 
19617 usage:
19618  Abc_Print( -2, "usage: synch [-W <num>] [-vh] <file1> <file2>\n" );
19619  Abc_Print( -2, "\t derives and applies synchronization sequence\n" );
19620  Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", nWords );
19621  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
19622  Abc_Print( -2, "\t-h : print the command usage\n");
19623  Abc_Print( -2, "\tfile1 : (optional) the file with the first design\n");
19624  Abc_Print( -2, "\tfile2 : (optional) the file with the second design\n\n");
19625  Abc_Print( -2, "\t If no designs are given on the command line,\n" );
19626  Abc_Print( -2, "\t assumes the current network has no initial state,\n" );
19627  Abc_Print( -2, "\t derives synchronization sequence and applies it.\n\n" );
19628  Abc_Print( -2, "\t If two designs are given on the command line\n" );
19629  Abc_Print( -2, "\t assumes both of them have no initial state,\n" );
19630  Abc_Print( -2, "\t derives sequences for both designs, synchorinizes\n" );
19631  Abc_Print( -2, "\t them, and creates SEC miter comparing two designs.\n\n" );
19632  Abc_Print( -2, "\t If only one design is given on the command line,\n" );
19633  Abc_Print( -2, "\t considers the second design to be the current network,\n" );
19634  Abc_Print( -2, "\t and derives SEC miter for them, as described above.\n" );
19635  return 1;
19636 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
Abc_Ntk_t * Abc_NtkDarSynch(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int nWords, int fVerbose)
Definition: abcDar.c:4057
int nWords
Definition: abcNpn.c:127
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
Abc_Ntk_t * Abc_NtkDarSynchOne(Abc_Ntk_t *pNtk, int nWords, int fVerbose)
Definition: abcDar.c:4029
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
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)
Definition: abcUtil.c:1481
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTempor ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23139 of file abc.c.

23140 {
23141  extern Abc_Ntk_t * Abc_NtkDarTempor( Abc_Ntk_t * pNtk, int nFrames, int TimeOut, int nConfLimit, int fUseBmc, int fUseTransSigs, int fVerbose, int fVeryVerbose );
23142  Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
23143  int nFrames = 0;
23144  int TimeOut = 300;
23145  int nConfMax = 100000;
23146  int fUseBmc = 1;
23147  int fUseTransSigs = 0;
23148  int fUpdateCex = 0;
23149  int fVerbose = 0;
23150  int fVeryVerbose = 0;
23151  int c;
23153  while ( ( c = Extra_UtilGetopt( argc, argv, "FTCbscvwh" ) ) != EOF )
23154  {
23155  switch ( c )
23156  {
23157  case 'F':
23158  if ( globalUtilOptind >= argc )
23159  {
23160  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
23161  goto usage;
23162  }
23163  nFrames = atoi(argv[globalUtilOptind]);
23164  globalUtilOptind++;
23165  if ( nFrames < 0 )
23166  goto usage;
23167  break;
23168  case 'T':
23169  if ( globalUtilOptind >= argc )
23170  {
23171  Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
23172  goto usage;
23173  }
23174  TimeOut = atoi(argv[globalUtilOptind]);
23175  globalUtilOptind++;
23176  if ( TimeOut < 0 )
23177  goto usage;
23178  break;
23179  case 'C':
23180  if ( globalUtilOptind >= argc )
23181  {
23182  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
23183  goto usage;
23184  }
23185  nConfMax = atoi(argv[globalUtilOptind]);
23186  globalUtilOptind++;
23187  if ( nConfMax < 0 )
23188  goto usage;
23189  break;
23190  case 'b':
23191  fUseBmc ^= 1;
23192  break;
23193  case 's':
23194  fUseTransSigs ^= 1;
23195  break;
23196  case 'c':
23197  fUpdateCex ^= 1;
23198  break;
23199  case 'v':
23200  fVerbose ^= 1;
23201  break;
23202  case 'w':
23203  fVeryVerbose ^= 1;
23204  break;
23205  case 'h':
23206  default:
23207  goto usage;
23208  }
23209  }
23210  if ( pNtk == NULL )
23211  {
23212  Abc_Print( -2, "There is no current network.\n");
23213  return 0;
23214  }
23215  if ( !Abc_NtkIsStrash(pNtk) )
23216  {
23217  Abc_Print( -2, "The current network is not an AIG (run \"strash\").\n");
23218  return 0;
23219  }
23220  if ( Abc_NtkLatchNum(pNtk) == 0 )
23221  {
23222  Abc_Print( -2, "The current network is combinational.\n");
23223  return 0;
23224  }
23225  if ( fUpdateCex )
23226  {
23227  Abc_Cex_t * pCexNew;
23228  if ( pAbc->pCex == NULL )
23229  {
23230  Abc_Print( -1, "Counter-example is not available.\n" );
23231  return 1;
23232  }
23233  if ( pAbc->pCex->nPis % Abc_NtkPiNum(pNtk) != 0 )
23234  {
23235  Abc_Print( -1, "PI count of the CEX is not a multiple of PI count of the current AIG.\n" );
23236  return 1;
23237  }
23238  pCexNew = Abc_CexTransformTempor( pAbc->pCex, Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkLatchNum(pNtk) );
23239  Abc_FrameReplaceCex( pAbc, &pCexNew );
23240  return 0;
23241  }
23242  // modify the current network
23243  pNtkRes = Abc_NtkDarTempor( pNtk, nFrames, TimeOut, nConfMax, fUseBmc, fUseTransSigs, fVerbose, fVeryVerbose );
23244  if ( pNtkRes == NULL )
23245  {
23246  Abc_Print( -1, "Temporal decomposition has failed.\n" );
23247  return 1;
23248  }
23249  // replace the current network
23250  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
23251  return 0;
23252 
23253 usage:
23254  Abc_Print( -2, "usage: tempor [-FTC <num>] [-bscvwh]\n" );
23255  Abc_Print( -2, "\t performs temporal decomposition\n" );
23256  Abc_Print( -2, "\t-F <num> : init logic timeframe count (0 = use leading length) [default = %d]\n", nFrames );
23257  Abc_Print( -2, "\t-T <num> : runtime limit in seconds for BMC (0=unused) [default = %d]\n", TimeOut );
23258  Abc_Print( -2, "\t-C <num> : max number of SAT conflicts in BMC (0=unused) [default = %d]\n", nConfMax );
23259  Abc_Print( -2, "\t-b : toggle running BMC2 on the init frames [default = %s]\n", fUseBmc? "yes": "no" );
23260  Abc_Print( -2, "\t-s : toggle using transient signals [default = %s]\n", fUseTransSigs? "yes": "no" );
23261  Abc_Print( -2, "\t-c : update the current CEX derived for a new AIG after \"tempor\"\n" );
23262  Abc_Print( -2, "\t to match the current AIG (the one before \"tempor\") [default = %s]\n", fUpdateCex? "yes": "no" );
23263  Abc_Print( -2, "\t-v : toggle printing verbose output [default = %s]\n", fVerbose? "yes": "no" );
23264  Abc_Print( -2, "\t-w : toggle printing ternary state space [default = %s]\n", fVeryVerbose? "yes": "no" );
23265  Abc_Print( -2, "\t-h : print the command usage\n");
23266  return 1;
23267 }
Abc_Cex_t * Abc_CexTransformTempor(Abc_Cex_t *p, int nPisOld, int nPosOld, int nRegsOld)
Definition: utilCex.c:416
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
Definition: abc.c:490
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkDarTempor(Abc_Ntk_t *pNtk, int nFrames, int TimeOut, int nConfLimit, int fUseBmc, int fUseTransSigs, int fVerbose, int fVeryVerbose)
Definition: abcDar.c:3653
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
int Abc_CommandTest ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10645 of file abc.c.

10646 {
10647 // Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
10648  int nCutMax = 1;
10649  int nLeafMax = 4;
10650  int nDivMax = 2;
10651  int nDecMax = 20;
10652  int nNumOnes = 4;
10653  int fNewAlgo = 0;
10654  int fNewOrder = 0;
10655  int fVerbose = 0;
10656  int fVeryVerbose = 0;
10657  int c;
10659  while ( ( c = Extra_UtilGetopt( argc, argv, "CKDNMaovwh" ) ) != EOF )
10660  {
10661  switch ( c )
10662  {
10663  case 'C':
10664  if ( globalUtilOptind >= argc )
10665  {
10666  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
10667  goto usage;
10668  }
10669  nCutMax = atoi(argv[globalUtilOptind]);
10670  globalUtilOptind++;
10671  if ( nCutMax < 0 )
10672  goto usage;
10673  break;
10674  case 'K':
10675  if ( globalUtilOptind >= argc )
10676  {
10677  Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
10678  goto usage;
10679  }
10680  nLeafMax = atoi(argv[globalUtilOptind]);
10681  globalUtilOptind++;
10682  if ( nLeafMax < 0 )
10683  goto usage;
10684  break;
10685  case 'D':
10686  if ( globalUtilOptind >= argc )
10687  {
10688  Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
10689  goto usage;
10690  }
10691  nDivMax = atoi(argv[globalUtilOptind]);
10692  globalUtilOptind++;
10693  if ( nDivMax < 0 )
10694  goto usage;
10695  break;
10696  case 'N':
10697  if ( globalUtilOptind >= argc )
10698  {
10699  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
10700  goto usage;
10701  }
10702  nDecMax = atoi(argv[globalUtilOptind]);
10703  globalUtilOptind++;
10704  if ( nDecMax < 0 )
10705  goto usage;
10706  break;
10707  case 'M':
10708  if ( globalUtilOptind >= argc )
10709  {
10710  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
10711  goto usage;
10712  }
10713  nNumOnes = atoi(argv[globalUtilOptind]);
10714  globalUtilOptind++;
10715  if ( nNumOnes < 0 )
10716  goto usage;
10717  break;
10718  case 'a':
10719  fNewAlgo ^= 1;
10720  break;
10721  case 'o':
10722  fNewOrder ^= 1;
10723  break;
10724  case 'v':
10725  fVerbose ^= 1;
10726  break;
10727  case 'w':
10728  fVeryVerbose ^= 1;
10729  break;
10730  case 'h':
10731  goto usage;
10732  default:
10733  goto usage;
10734  }
10735  }
10736 /*
10737  if ( pNtk == NULL )
10738  {
10739  Abc_Print( -1, "Empty network.\n" );
10740  return 1;
10741  }
10742 
10743  if ( Abc_NtkIsStrash(pNtk) )
10744  {
10745  Abc_Print( -1, "This command works only for logic networks.\n" );
10746  return 1;
10747  }
10748 */
10749 /*
10750  if ( Abc_NtkLatchNum(pNtk) == 0 )
10751  {
10752  Abc_Print( -1, "Only works for sequential networks.\n" );
10753  return 1;
10754  }
10755 */
10756 
10757 /*
10758  if ( pNtk )
10759  {
10760  extern Abc_Ntk_t * Au_ManPerformTest( Abc_Ntk_t * p, int nCutMax, int nLeafMax, int nDivMax, int nDecMax, int fVerbose, int fVeryVerbose );
10761  Abc_Ntk_t * pNtkRes = Au_ManPerformTest( pNtk, nCutMax, nLeafMax, nDivMax, nDecMax, fVerbose, fVeryVerbose );
10762  if ( pNtkRes == NULL )
10763  {
10764  Abc_Print( -1, "Command has failed.\n" );
10765  return 1;
10766  }
10767  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10768  }
10769 */
10770 /*
10771  if ( pNtk )
10772  {
10773  Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
10774  Saig_ManBmcTerSimTestPo( pAig );
10775  Aig_ManStop( pAig );
10776  }
10777 */
10778 /*
10779  if ( !Abc_NtkIsTopo(pNtk) )
10780  {
10781  Abc_Print( -1, "Current network is not in a topological order.\n" );
10782  return 1;
10783  }
10784 */
10785 // if ( pNtk )
10786 // Abc_NtkMakeLegit( pNtk );
10787  {
10788 // extern void Ifd_ManDsdTest();
10789 // Ifd_ManDsdTest();
10790  }
10791 /*
10792  {
10793  extern void Abc_EnumerateCubeStates();
10794  extern void Abc_EnumerateCubeStatesZdd();
10795  if ( fNewAlgo )
10796  Abc_EnumerateCubeStatesZdd();
10797  else
10798  Abc_EnumerateCubeStates();
10799  return 0;
10800  }
10801 */
10802  {
10803 // extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose );
10804 // Abc_EnumerateFuncs( nDecMax, nDivMax, fVerbose );
10805  }
10806 /*
10807  if ( fNewAlgo )
10808  {
10809  extern void Abc_SuppTest( int nOnes, int nVars, int fUseSimple, int fCheck, int fVerbose );
10810  Abc_SuppTest( nNumOnes, nDecMax, fNewOrder, 0, fVerbose );
10811  }
10812  else
10813  {
10814  extern void Bmc_EcoMiterTest();
10815  Bmc_EcoMiterTest();
10816  }
10817 */
10818 
10819  {
10820 // extern void Nf_ManPrepareLibraryTest();
10821 // Nf_ManPrepareLibraryTest();
10822 // return 0;
10823  }
10824 /*
10825  if ( pNtk )
10826  {
10827 // extern Abc_Ntk_t * Abc_NtkBarBufsOnOffTest( Abc_Ntk_t * pNtk );
10828 // Abc_Ntk_t * pNtkRes = Abc_NtkBarBufsOnOffTest( pNtk );
10829  extern Abc_Ntk_t * Abc_NtkPcmTest( Abc_Ntk_t * pNtk, int fNewAlgo, int fVerbose );
10830 // extern Abc_Ntk_t * Abc_NtkPcmTestAig( Abc_Ntk_t * pNtk, int fVerbose );
10831  Abc_Ntk_t * pNtkRes;
10832 // if ( Abc_NtkIsLogic(pNtk) )
10833  pNtkRes = Abc_NtkPcmTest( pNtk, fNewAlgo, fVerbose );
10834 // else
10835 // pNtkRes = Abc_NtkPcmTestAig( pNtk, fVerbose );
10836  if ( pNtkRes == NULL )
10837  {
10838  Abc_Print( -1, "Command has failed.\n" );
10839  return 1;
10840  }
10841  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
10842  }
10843 */
10844 /*
10845  {
10846  extern void Abc_IsopTestNew();
10847  Abc_IsopTestNew();
10848  }
10849 */
10850  {
10851 // extern void Cba_PrsReadBlifTest();
10852 // Cba_PrsReadBlifTest();
10853  }
10854  return 0;
10855 usage:
10856  Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
10857  Abc_Print( -2, "\t testbench for new procedures\n" );
10858  Abc_Print( -2, "\t-C num : the max number of cuts [default = %d]\n", nCutMax );
10859  Abc_Print( -2, "\t-K num : the max number of leaves [default = %d]\n", nLeafMax );
10860  Abc_Print( -2, "\t-D num : the max number of divisors [default = %d]\n", nDivMax );
10861  Abc_Print( -2, "\t-N num : the max number of node inputs [default = %d]\n", nDecMax );
10862  Abc_Print( -2, "\t-M num : the max number of ones in the vector [default = %d]\n", nNumOnes );
10863  Abc_Print( -2, "\t-a : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
10864  Abc_Print( -2, "\t-o : toggle using new ordering [default = %s]\n", fNewOrder? "yes": "no" );
10865  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
10866  Abc_Print( -2, "\t-w : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
10867  Abc_Print( -2, "\t-h : print the command usage\n");
10868  return 1;
10869 }
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTestCex ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 24180 of file abc.c.

24181 {
24182  Abc_Ntk_t * pNtk;
24183  int c;
24184  int nOutputs = 0;
24185  int fCheckAnd = 1;
24187  while ( ( c = Extra_UtilGetopt( argc, argv, "Oah" ) ) != EOF )
24188  {
24189  switch ( c )
24190  {
24191  case 'O':
24192  if ( globalUtilOptind >= argc )
24193  {
24194  Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
24195  goto usage;
24196  }
24197  nOutputs = atoi(argv[globalUtilOptind]);
24198  globalUtilOptind++;
24199  if ( nOutputs < 0 )
24200  goto usage;
24201  break;
24202  case 'a':
24203  fCheckAnd ^= 1;
24204  break;
24205  case 'h':
24206  goto usage;
24207  default:
24208  Abc_Print( -2, "Unknown switch.\n");
24209  goto usage;
24210  }
24211  }
24212 
24213  if ( pAbc->pCex == NULL )
24214  {
24215  Abc_Print( 1, "There is no current cex.\n");
24216  return 0;
24217  }
24218 
24219  if ( !fCheckAnd )
24220  {
24221  // check the main AIG
24222  pNtk = Abc_FrameReadNtk(pAbc);
24223  if ( pNtk == NULL )
24224  Abc_Print( 1, "Main AIG: There is no current network.\n");
24225  else if ( !Abc_NtkIsStrash(pNtk) )
24226  Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
24227  else if ( Abc_NtkPiNum(pNtk) != pAbc->pCex->nPis )
24228  Abc_Print( 1, "Main AIG: The number of PIs (%d) is different from cex (%d).\n", Abc_NtkPiNum(pNtk), pAbc->pCex->nPis );
24229  else
24230  {
24231  extern int Abc_NtkVerifyCex( Abc_Ntk_t * pNtk, Abc_Cex_t * p );
24232  int iPoOld = pAbc->pCex->iPo;
24233  pAbc->pCex->iPo = Abc_NtkVerifyCex( pNtk, pAbc->pCex );
24234  if ( pAbc->pCex->iPo == -1 )
24235  Abc_Print( 1, "Main AIG: The cex does not fail any outputs.\n" );
24236  else if ( iPoOld != pAbc->pCex->iPo )
24237  Abc_Print( 1, "Main AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
24238  else
24239  Abc_Print( 1, "Main AIG: The cex is correct.\n" );
24240  }
24241  }
24242  else
24243  {
24244  // check the AND AIG
24245  if ( pAbc->pGia == NULL )
24246  Abc_Print( 1, "And AIG: There is no current network.\n");
24247  else if ( Gia_ManPiNum(pAbc->pGia) != pAbc->pCex->nPis )
24248  Abc_Print( 1, "And AIG: The number of PIs (%d) is different from cex (%d).\n", Gia_ManPiNum(pAbc->pGia), pAbc->pCex->nPis );
24249  else
24250  {
24251  int iPoOld = pAbc->pCex->iPo;
24252  pAbc->pCex->iPo = Gia_ManFindFailedPoCex( pAbc->pGia, pAbc->pCex, nOutputs );
24253  if ( pAbc->pCex->iPo == -1 )
24254  Abc_Print( 1, "And AIG: The cex does not fail any outputs.\n" );
24255  else if ( iPoOld != pAbc->pCex->iPo )
24256  Abc_Print( 1, "And AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
24257  else
24258  Abc_Print( 1, "And AIG: The cex is correct.\n" );
24259  }
24260  }
24261  return 0;
24262 
24263 usage:
24264  Abc_Print( -2, "usage: testcex [-O num] [-ah]\n" );
24265  Abc_Print( -2, "\t tests the current cex against the current AIG or the &-AIG\n" );
24266  Abc_Print( -2, "\t-O num : the number of real POs in the PO list [default = %d]\n", nOutputs );
24267  Abc_Print( -2, "\t-a : toggle checking the current AIG or the &-AIG [default = %s]\n", fCheckAnd ? "&-AIG": "current AIG" );
24268  Abc_Print( -2, "\t-h : print the command usage\n");
24269  return 1;
24270 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Gia_ManFindFailedPoCex(Gia_Man_t *pAig, Abc_Cex_t *p, int nOutputs)
Definition: giaCex.c:87
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Abc_NtkVerifyCex(Abc_Ntk_t *pNtk, Abc_Cex_t *p)
Definition: abcLatch.c:726
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
int Abc_CommandTestColor ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 10627 of file abc.c.

10628 {
10629  extern void Abc_ColorTest();
10630  Abc_ColorTest();
10631  return 1;
10632 }
ABC_NAMESPACE_IMPL_START void Abc_ColorTest()
DECLARATIONS ///.
Definition: utilColor.c:52
int Abc_CommandTestDec ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5497 of file abc.c.

5498 {
5499  extern int Abc_DecTest( char * pFileName, int DecType, int nVarNum, int fVerbose );
5500  char * pFileName;
5501  int c;
5502  int fVerbose = 0;
5503  int DecType = 0;
5504  int nVarNum = -1;
5506  while ( ( c = Extra_UtilGetopt( argc, argv, "ANvh" ) ) != EOF )
5507  {
5508  switch ( c )
5509  {
5510  case 'A':
5511  if ( globalUtilOptind >= argc )
5512  {
5513  Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
5514  goto usage;
5515  }
5516  DecType = atoi(argv[globalUtilOptind]);
5517  globalUtilOptind++;
5518  if ( DecType < 0 )
5519  goto usage;
5520  break;
5521  case 'N':
5522  if ( globalUtilOptind >= argc )
5523  {
5524  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
5525  goto usage;
5526  }
5527  nVarNum = atoi(argv[globalUtilOptind]);
5528  globalUtilOptind++;
5529  if ( nVarNum < 0 )
5530  goto usage;
5531  break;
5532  case 'v':
5533  fVerbose ^= 1;
5534  break;
5535  case 'h':
5536  goto usage;
5537  default:
5538  goto usage;
5539  }
5540  }
5541  if ( argc != globalUtilOptind + 1 )
5542  {
5543  Abc_Print( 1,"Input file is not given.\n" );
5544  return 0;
5545  }
5546  if ( nVarNum >= 0 && nVarNum < 6 )
5547  {
5548  Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
5549  return 0;
5550  }
5551  // get the output file name
5552  pFileName = argv[globalUtilOptind];
5553  // call the testbench
5554  Abc_DecTest( pFileName, DecType, nVarNum, fVerbose );
5555  return 0;
5556 
5557 usage:
5558  Abc_Print( -2, "usage: testdec [-AN <num>] [-vh] <file>\n" );
5559  Abc_Print( -2, "\t testbench for Boolean decomposition algorithms\n" );
5560  Abc_Print( -2, "\t-A <num> : decomposition algorithm [default = %d]\n", DecType );
5561  Abc_Print( -2, "\t 0: none (reading and writing the file)\n" );
5562  Abc_Print( -2, "\t 1: algebraic factoring applied to ISOP\n" );
5563  Abc_Print( -2, "\t 2: bi-decomposition with cofactoring\n" );
5564  Abc_Print( -2, "\t 3: disjoint-support decomposition with cofactoring\n" );
5565  Abc_Print( -2, "\t 4: updated disjoint-support decomposition with cofactoring\n" );
5566  Abc_Print( -2, "\t 5: enumerating decomposable variable sets\n" );
5567  Abc_Print( -2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n" );
5568  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
5569  Abc_Print( -2, "\t-h : print the command usage\n");
5570  Abc_Print( -2, "\t<file> : a text file with truth tables in hexadecimal, listed one per line,\n");
5571  Abc_Print( -2, "\t or a binary file with an array of truth tables (in this case,\n");
5572  Abc_Print( -2, "\t -N <num> is required to determine how many functions are stored)\n");
5573  return 1;
5574 }
int Abc_DecTest(char *pFileName, int DecType, int nVarNum, int fVerbose)
Definition: abcDec.c:626
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTestNpn ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5587 of file abc.c.

5588 {
5589  extern int Abc_NpnTest( char * pFileName, int NpnType, int nVarNum, int fDumpRes, int fBinary, int fVerbose );
5590  char * pFileName;
5591  int c;
5592  int fVerbose = 0;
5593  int NpnType = 0;
5594  int nVarNum = -1;
5595  int fDumpRes = 0;
5596  int fBinary = 0;
5598  while ( ( c = Extra_UtilGetopt( argc, argv, "ANdbvh" ) ) != EOF )
5599  {
5600  switch ( c )
5601  {
5602  case 'A':
5603  if ( globalUtilOptind >= argc )
5604  {
5605  Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
5606  goto usage;
5607  }
5608  NpnType = atoi(argv[globalUtilOptind]);
5609  globalUtilOptind++;
5610  if ( NpnType < 0 )
5611  goto usage;
5612  break;
5613  case 'N':
5614  if ( globalUtilOptind >= argc )
5615  {
5616  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
5617  goto usage;
5618  }
5619  nVarNum = atoi(argv[globalUtilOptind]);
5620  globalUtilOptind++;
5621  if ( nVarNum < 0 )
5622  goto usage;
5623  break;
5624  case 'd':
5625  fDumpRes ^= 1;
5626  break;
5627  case 'b':
5628  fBinary ^= 1;
5629  break;
5630  case 'v':
5631  fVerbose ^= 1;
5632  break;
5633  case 'h':
5634  goto usage;
5635  default:
5636  goto usage;
5637  }
5638  }
5639  if ( argc != globalUtilOptind + 1 )
5640  {
5641  Abc_Print( 1,"Input file is not given.\n" );
5642  return 0;
5643  }
5644  if ( nVarNum >= 0 && nVarNum < 6 )
5645  {
5646  Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
5647  return 0;
5648  }
5649  // get the output file name
5650  pFileName = argv[globalUtilOptind];
5651  // call the testbench
5652  Abc_NpnTest( pFileName, NpnType, nVarNum, fDumpRes, fBinary, fVerbose );
5653  return 0;
5654 
5655 usage:
5656  Abc_Print( -2, "usage: testnpn [-AN <num>] [-dbvh] <file>\n" );
5657  Abc_Print( -2, "\t testbench for computing (semi-)canonical forms\n" );
5658  Abc_Print( -2, "\t of completely-specified Boolean functions up to 16 varibles\n" );
5659  Abc_Print( -2, "\t-A <num> : semi-caninical form computation algorithm [default = %d]\n", NpnType );
5660  Abc_Print( -2, "\t 0: uniqifying truth tables\n" );
5661  Abc_Print( -2, "\t 1: exact NPN canonical form by brute-force enumeration\n" );
5662  Abc_Print( -2, "\t 2: semi-canonical form by counting 1s in cofactors\n" );
5663  Abc_Print( -2, "\t 3: Jake's hybrid semi-canonical form (fast)\n" );
5664  Abc_Print( -2, "\t 4: Jake's hybrid semi-canonical form (high-effort)\n" );
5665  Abc_Print( -2, "\t 5: new fast hybrid semi-canonical form\n" );
5666  Abc_Print( -2, "\t 6: new phase canonical form\n" );
5667  Abc_Print( -2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n" );
5668  Abc_Print( -2, "\t-d : toggle dumping resulting functions into a file [default = %s]\n", fDumpRes? "yes": "no" );
5669  Abc_Print( -2, "\t-b : toggle dumping in binary format [default = %s]\n", fBinary? "yes": "no" );
5670  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
5671  Abc_Print( -2, "\t-h : print the command usage\n");
5672  Abc_Print( -2, "\t<file> : a text file with truth tables in hexadecimal, listed one per line,\n");
5673  Abc_Print( -2, "\t or a binary file with an array of truth tables (in this case,\n");
5674  Abc_Print( -2, "\t -N <num> is required to determine how many functions are stored)\n");
5675  return 1;
5676 }
int Abc_NpnTest(char *pFileName, int NpnType, int nVarNum, int fDumpRes, int fBinary, int fVerbose)
Definition: abcNpn.c:351
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTestRPO ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 5689 of file abc.c.

5689  {
5690  extern int Abc_RpoTest(char * pFileName, int nVarNum, int nThreshold, int fVerbose);
5691  char * pFileName;
5692  int c;
5693  int nVarNum = -1;
5694  int fVerbose = 0;
5695  int nThreshold = -1;
5697  while ((c = Extra_UtilGetopt(argc, argv, "TNvh")) != EOF) {
5698  switch (c) {
5699  case 'N':
5700  if (globalUtilOptind >= argc) {
5701  Abc_Print(-1, "Command line switch \"-N\" should be followed by an integer.\n");
5702  goto usage;
5703  }
5704  nVarNum = atoi(argv[globalUtilOptind]);
5705  globalUtilOptind++;
5706  if (nVarNum < 0)
5707  goto usage;
5708  break;
5709  case 'T':
5710  if (globalUtilOptind >= argc) {
5711  Abc_Print(-1, "Command line switch \"-T\" should be followed by an integer.\n");
5712  goto usage;
5713  }
5714  nThreshold = atoi(argv[globalUtilOptind]);
5715  globalUtilOptind++;
5716  if (nThreshold < 0)
5717  goto usage;
5718  break;
5719  case 'v':
5720  fVerbose ^= 1;
5721  break;
5722  case 'h':
5723  goto usage;
5724  default:
5725  goto usage;
5726  }
5727  }
5728  if (argc != globalUtilOptind + 1)
5729  {
5730  Abc_Print(1, "Input file is not given.\n");
5731  goto usage;
5732  }
5733  // get the output file name
5734  pFileName = argv[globalUtilOptind];
5735  // call the testbench
5736  Abc_RpoTest( pFileName, nVarNum, nThreshold, fVerbose );
5737  return 0;
5738 
5739 usage:
5740  Abc_Print(-2, "usage: testrpo [-NT <num>] [-vh] <file>\n");
5741  Abc_Print(-2, "\t RPO algorithm developed and implemented by Mayler G. A. Martins,\n");
5742  Abc_Print(-2, "\t Vinicius Callegaro, Renato P. Ribas and Andre' I. Reis\n");
5743  Abc_Print(-2, "\t at Federal University of Rio Grande do Sul, Porto Alegre, Brazil\n");
5744  Abc_Print(-2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n");
5745  Abc_Print(-2, "\t-T <num> : the number of recursions accepted before abort [default = INFINITE]\n");
5746  Abc_Print(-2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose ? "yes" : "no");
5747  Abc_Print(-2, "\t-h : print the command usage\n");
5748  Abc_Print(-2, "\t<file> : a text file with truth tables in hexadecimal, listed one per line,\n");
5749  Abc_Print(-2, "\t or a binary file with an array of truth tables (in this case,\n");
5750  Abc_Print(-2, "\t -N <num> is required to determine how many functions are stored)\n");
5751  return 1;
5752 }
int Abc_RpoTest(char *pFileName, int nVarNum, int nThreshold, int fVerbose)
Definition: abcRpo.c:425
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTestScorr ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 18504 of file abc.c.

18505 {
18506  extern Abc_Ntk_t * Abc_NtkTestScorr( char * pFileNameIn, char * pFileNameOut, int nStepsMax, int nBTLimit, int fNewAlgo, int fFlopOnly, int fFfNdOnly, int fVerbose );
18507 
18508  Abc_Ntk_t * pNtkRes;
18509  int c;
18510  int nConfMax;
18511  int nStepsMax;
18512  int fNewAlgo;
18513  int fFlopOnly;
18514  int fFfNdOnly;
18515  int fVerbose;
18516  // set defaults
18517  nConfMax = 100;
18518  nStepsMax = -1;
18519  fNewAlgo = 0;
18520  fFlopOnly = 0;
18521  fFfNdOnly = 0;
18522  fVerbose = 0;
18524  while ( ( c = Extra_UtilGetopt( argc, argv, "CSnfsvh" ) ) != EOF )
18525  {
18526  switch ( c )
18527  {
18528  case 'C':
18529  if ( globalUtilOptind >= argc )
18530  {
18531  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
18532  goto usage;
18533  }
18534  nConfMax = atoi(argv[globalUtilOptind]);
18535  globalUtilOptind++;
18536  if ( nConfMax < 0 )
18537  goto usage;
18538  break;
18539  case 'S':
18540  if ( globalUtilOptind >= argc )
18541  {
18542  Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
18543  goto usage;
18544  }
18545  nStepsMax = atoi(argv[globalUtilOptind]);
18546  globalUtilOptind++;
18547  if ( nStepsMax < 0 )
18548  goto usage;
18549  break;
18550  case 'n':
18551  fNewAlgo ^= 1;
18552  break;
18553  case 'f':
18554  fFlopOnly ^= 1;
18555  break;
18556  case 's':
18557  fFfNdOnly ^= 1;
18558  break;
18559  case 'v':
18560  fVerbose ^= 1;
18561  break;
18562  default:
18563  goto usage;
18564  }
18565  }
18566  if ( argc != globalUtilOptind + 2 )
18567  {
18568  Abc_Print( -1, "Expecting two files names on the command line.\n" );
18569  goto usage;
18570  }
18571  if ( fFlopOnly && fFfNdOnly )
18572  {
18573  Abc_Print( -1, "These two options (-f and -s) are incompatible.\n" );
18574  goto usage;
18575  }
18576  // get the new network
18577  pNtkRes = Abc_NtkTestScorr( argv[globalUtilOptind], argv[globalUtilOptind+1], nStepsMax, nConfMax, fNewAlgo, fFlopOnly, fFfNdOnly, fVerbose );
18578  if ( pNtkRes == NULL )
18579  {
18580  Abc_Print( -1, "Sequential sweeping has failed.\n" );
18581  return 1;
18582  }
18583  // replace the current network
18584  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
18585  return 0;
18586 
18587 usage:
18588  Abc_Print( -2, "usage: testscorr [-CS num] [-nfsvh] <file_in> <file_out>\n" );
18589  Abc_Print( -2, "\t outputs the list of sequential equivalences into a file\n" );
18590  Abc_Print( -2, "\t (if <file_in> is in BENCH, init state file should be the same directory)\n" );
18591  Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfMax );
18592  Abc_Print( -2, "\t-S num : limit on refinement iterations (-1=no limit, 0=after BMC, etc) [default = %d]\n", nStepsMax );
18593  Abc_Print( -2, "\t-n : toggle between \"scorr\" and \"&scorr\" [default = %s]\n", fNewAlgo? "&scorr": "scorr" );
18594  Abc_Print( -2, "\t-f : toggle reporting only flop/flop equivs [default = %s]\n", fFlopOnly? "yes": "no" );
18595  Abc_Print( -2, "\t-s : toggle reporting only flop/flop and flop/node equivs [default = %s]\n", fFfNdOnly? "yes": "no" );
18596  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
18597  Abc_Print( -2, "\t-h : print the command usage\n");
18598  Abc_Print( -2, "\t<file_in> : input file with design for sequential equivalence computation\n");
18599  Abc_Print( -2, "\t<file_out> : output file with the list of pairs of equivalent signals\n");
18600  return 1;
18601 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
Abc_Ntk_t * Abc_NtkTestScorr(char *pFileNameIn, char *pFileNameOut, int nStepsMax, int nBTLimit, int fNewAlgo, int fFlopOnly, int fFfNdOnly, int fVerbose)
Definition: abcScorr.c:318
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTestSeqSweep ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 18340 of file abc.c.

18341 {
18342  char * pFileName;
18343  Fra_Ssw_t Pars, * pPars = &Pars;
18344  int c;
18345 // extern Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars );
18346  extern int Fra_FraigInductionTest( char * pFileName, Fra_Ssw_t * pParams );
18347 
18348  // set defaults
18349  pPars->nPartSize = 0;
18350  pPars->nOverSize = 0;
18351  pPars->nFramesP = 0;
18352  pPars->nFramesK = 1;
18353  pPars->nMaxImps = 5000;
18354  pPars->nMaxLevs = 0;
18355  pPars->fUseImps = 0;
18356  pPars->fRewrite = 0;
18357  pPars->fFraiging = 0;
18358  pPars->fLatchCorr = 0;
18359  pPars->fWriteImps = 0;
18360  pPars->fUse1Hot = 0;
18361  pPars->fVerbose = 0;
18362  pPars->TimeLimit = 0;
18364  while ( ( c = Extra_UtilGetopt( argc, argv, "PQNFILirfletvh" ) ) != EOF )
18365  {
18366  switch ( c )
18367  {
18368  case 'P':
18369  if ( globalUtilOptind >= argc )
18370  {
18371  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
18372  goto usage;
18373  }
18374  pPars->nPartSize = atoi(argv[globalUtilOptind]);
18375  globalUtilOptind++;
18376  if ( pPars->nPartSize < 2 )
18377  goto usage;
18378  break;
18379  case 'Q':
18380  if ( globalUtilOptind >= argc )
18381  {
18382  Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
18383  goto usage;
18384  }
18385  pPars->nOverSize = atoi(argv[globalUtilOptind]);
18386  globalUtilOptind++;
18387  if ( pPars->nOverSize < 0 )
18388  goto usage;
18389  break;
18390  case 'N':
18391  if ( globalUtilOptind >= argc )
18392  {
18393  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
18394  goto usage;
18395  }
18396  pPars->nFramesP = atoi(argv[globalUtilOptind]);
18397  globalUtilOptind++;
18398  if ( pPars->nFramesP < 0 )
18399  goto usage;
18400  break;
18401  case 'F':
18402  if ( globalUtilOptind >= argc )
18403  {
18404  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
18405  goto usage;
18406  }
18407  pPars->nFramesK = atoi(argv[globalUtilOptind]);
18408  globalUtilOptind++;
18409  if ( pPars->nFramesK <= 0 )
18410  goto usage;
18411  break;
18412  case 'I':
18413  if ( globalUtilOptind >= argc )
18414  {
18415  Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
18416  goto usage;
18417  }
18418  pPars->nMaxImps = atoi(argv[globalUtilOptind]);
18419  globalUtilOptind++;
18420  if ( pPars->nMaxImps <= 0 )
18421  goto usage;
18422  break;
18423  case 'L':
18424  if ( globalUtilOptind >= argc )
18425  {
18426  Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
18427  goto usage;
18428  }
18429  pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
18430  globalUtilOptind++;
18431  if ( pPars->nMaxLevs <= 0 )
18432  goto usage;
18433  break;
18434  case 'i':
18435  pPars->fUseImps ^= 1;
18436  break;
18437  case 'r':
18438  pPars->fRewrite ^= 1;
18439  break;
18440  case 'f':
18441  pPars->fFraiging ^= 1;
18442  break;
18443  case 'l':
18444  pPars->fLatchCorr ^= 1;
18445  break;
18446  case 'e':
18447  pPars->fWriteImps ^= 1;
18448  break;
18449  case 't':
18450  pPars->fUse1Hot ^= 1;
18451  break;
18452  case 'v':
18453  pPars->fVerbose ^= 1;
18454  break;
18455  case 'h':
18456  goto usage;
18457  default:
18458  goto usage;
18459  }
18460  }
18461  // get the input file name
18462  if ( argc == globalUtilOptind + 1 )
18463  pFileName = argv[globalUtilOptind];
18464  else
18465  {
18466  Abc_Print( -1, "File name should be given on the command line.\n" );
18467  return 1;
18468  }
18469  Fra_FraigInductionTest( pFileName, pPars );
18470  return 0;
18471 
18472 usage:
18473  Abc_Print( -2, "usage: testssw [-PQNFL num] [-lrfetvh] <file>\n" );
18474  Abc_Print( -2, "\t performs sequential sweep using K-step induction\n" );
18475  Abc_Print( -2, "\t (outputs a file with a set of pairs of equivalent nodes)\n" );
18476  Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
18477  Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
18478  Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
18479  Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
18480  Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
18481 // Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
18482 // Abc_Print( -2, "\t-i : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
18483  Abc_Print( -2, "\t-l : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
18484  Abc_Print( -2, "\t-r : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
18485  Abc_Print( -2, "\t-f : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
18486  Abc_Print( -2, "\t-e : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
18487  Abc_Print( -2, "\t-t : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
18488  Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
18489  Abc_Print( -2, "\t-h : print the command usage\n");
18490  return 1;
18491 }
int fFraiging
Definition: fra.h:103
int fRewrite
Definition: fra.h:102
int fUse1Hot
Definition: fra.h:106
float TimeLimit
Definition: fra.h:110
int nFramesP
Definition: fra.h:96
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int fWriteImps
Definition: fra.h:105
int Fra_FraigInductionTest(char *pFileName, Fra_Ssw_t *pParams)
Definition: fraInd.c:661
int globalUtilOptind
Definition: extraUtilUtil.c:45
Definition: fra.h:92
int nFramesK
Definition: fra.h:97
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nMaxImps
Definition: fra.h:98
int nOverSize
Definition: fra.h:95
int nPartSize
Definition: fra.h:94
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int fUseImps
Definition: fra.h:101
int fLatchCorr
Definition: fra.h:104
int fVerbose
Definition: fra.h:107
int nMaxLevs
Definition: fra.h:99
int Abc_CommandTopAnd ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8955 of file abc.c.

8956 {
8957  Abc_Ntk_t * pNtk, * pNtkRes;
8958  int c;
8959  extern Abc_Ntk_t * Abc_NtkTopAnd( Abc_Ntk_t * pNtk );
8960 
8961  pNtk = Abc_FrameReadNtk(pAbc);
8962  // set defaults
8964  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
8965  {
8966  switch ( c )
8967  {
8968  case 'h':
8969  goto usage;
8970  default:
8971  goto usage;
8972  }
8973  }
8974 
8975  if ( pNtk == NULL )
8976  {
8977  Abc_Print( -1, "Empty network.\n" );
8978  return 1;
8979  }
8980 
8981  if ( !Abc_NtkIsStrash(pNtk) )
8982  {
8983  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
8984  return 0;
8985  }
8986 
8987  if ( Abc_NtkLatchNum(pNtk) > 0 )
8988  {
8989  Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
8990  return 0;
8991  }
8992  if ( Abc_NtkPoNum(pNtk) != 1 )
8993  {
8994  Abc_Print( -1, "Currently expects a single-output miter.\n" );
8995  return 0;
8996  }
8997  if ( Abc_ObjFaninC0(Abc_NtkPo(pNtk, 0)) )
8998  {
8999  Abc_Print( -1, "The PO driver is complemented. AND-decomposition is impossible.\n" );
9000  return 0;
9001  }
9002  if ( !Abc_ObjIsNode(Abc_ObjChild0(Abc_NtkPo(pNtk, 0))) )
9003  {
9004  Abc_Print( -1, "The PO driver is not a node. AND-decomposition is impossible.\n" );
9005  return 0;
9006  }
9007  pNtkRes = Abc_NtkTopAnd( pNtk );
9008  if ( pNtkRes == NULL )
9009  {
9010  Abc_Print( -1, "The command has failed.\n" );
9011  return 1;
9012  }
9013  // replace the current network
9014  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
9015  return 0;
9016 
9017 usage:
9018  Abc_Print( -2, "usage: topand [-h]\n" );
9019  Abc_Print( -2, "\t performs AND-decomposition of single-output combinational miter\n" );
9020  Abc_Print( -2, "\t-h : print the command usage\n");
9021  Abc_Print( -2, "\tname : the node name\n");
9022  return 1;
9023 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
Abc_Ntk_t * Abc_NtkTopAnd(Abc_Ntk_t *pNtk)
Definition: abcStrash.c:660
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
Definition: abc.h:383
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTopmost ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 8870 of file abc.c.

8871 {
8872  Abc_Ntk_t * pNtk, * pNtkRes;
8873  int c, nLevels;
8874  extern Abc_Ntk_t * Abc_NtkTopmost( Abc_Ntk_t * pNtk, int nLevels );
8875 
8876  pNtk = Abc_FrameReadNtk(pAbc);
8877  // set defaults
8878  nLevels = 10;
8880  while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
8881  {
8882  switch ( c )
8883  {
8884  case 'N':
8885  if ( globalUtilOptind >= argc )
8886  {
8887  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
8888  goto usage;
8889  }
8890  nLevels = atoi(argv[globalUtilOptind]);
8891  globalUtilOptind++;
8892  if ( nLevels < 0 )
8893  goto usage;
8894  break;
8895  case 'h':
8896  goto usage;
8897  default:
8898  goto usage;
8899  }
8900  }
8901 
8902  if ( pNtk == NULL )
8903  {
8904  Abc_Print( -1, "Empty network.\n" );
8905  return 1;
8906  }
8907 
8908  if ( !Abc_NtkIsStrash(pNtk) )
8909  {
8910  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
8911  return 0;
8912  }
8913 
8914  if ( Abc_NtkLatchNum(pNtk) > 0 )
8915  {
8916  Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
8917  return 0;
8918  }
8919  if ( Abc_NtkPoNum(pNtk) != 1 )
8920  {
8921  Abc_Print( -1, "Currently expects a single-output miter.\n" );
8922  return 0;
8923  }
8924 
8925  pNtkRes = Abc_NtkTopmost( pNtk, nLevels );
8926  if ( pNtkRes == NULL )
8927  {
8928  Abc_Print( -1, "The command has failed.\n" );
8929  return 1;
8930  }
8931  // replace the current network
8932  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
8933  return 0;
8934 
8935 usage:
8936  Abc_Print( -2, "usage: topmost [-N num] [-h]\n" );
8937  Abc_Print( -2, "\t replaces the current network by several of its topmost levels\n" );
8938  Abc_Print( -2, "\t-N num : max number of levels [default = %d]\n", nLevels );
8939  Abc_Print( -2, "\t-h : print the command usage\n");
8940  Abc_Print( -2, "\tname : the node name\n");
8941  return 1;
8942 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL Abc_Ntk_t * Abc_NtkTopmost(Abc_Ntk_t *pNtk, int nLevels)
Definition: abcStrash.c:548
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTrace ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 4991 of file abc.c.

4992 {
4993  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
4994  int c;
4995  int fUseLutLib;
4996  int fVerbose;
4997  extern void Abc_NtkDelayTracePrint( Abc_Ntk_t * pNtk, int fUseLutLib, int fVerbose );
4998 
4999  // set defaults
5000  fUseLutLib = 0;
5001  fVerbose = 0;
5003  while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
5004  {
5005  switch ( c )
5006  {
5007  case 'l':
5008  fUseLutLib ^= 1;
5009  break;
5010  case 'v':
5011  fVerbose ^= 1;
5012  break;
5013  case 'h':
5014  goto usage;
5015  default:
5016  goto usage;
5017  }
5018  }
5019 
5020  if ( pNtk == NULL )
5021  {
5022  Abc_Print( -1, "Empty network.\n" );
5023  return 1;
5024  }
5025  if ( !Abc_NtkIsLogic(pNtk) )
5026  {
5027  Abc_Print( -1, "This command can only be applied to a logic network.\n" );
5028  return 1;
5029  }
5030 
5031  // modify the current network
5032  Abc_NtkDelayTracePrint( pNtk, fUseLutLib, fVerbose );
5033  return 0;
5034 
5035 usage:
5036  Abc_Print( -2, "usage: trace [-lvh]\n" );
5037  Abc_Print( -2, "\t performs delay trace of LUT-mapped network\n" );
5038  Abc_Print( -2, "\t-l : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
5039  Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
5040  Abc_Print( -2, "\t-h : print the command usage\n");
5041  return 1;
5042 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkDelayTracePrint(Abc_Ntk_t *pNtk, int fUseLutLib, int fVerbose)
Definition: abcSpeedup.c:244
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTraceCheck ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25333 of file abc.c.

25334 {
25335  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
25336  int c;
25337  // set defaults
25339  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
25340  {
25341  switch ( c )
25342  {
25343  case 'h':
25344  goto usage;
25345  default:
25346  goto usage;
25347  }
25348  }
25349 
25350  if ( pNtk == NULL )
25351  {
25352  Abc_Print( -1, "Empty network.\n" );
25353  return 1;
25354  }
25355  if ( !Abc_NtkIsStrash(pNtk) )
25356  {
25357  Abc_Print( -1, "This command is applicable to AIGs.\n" );
25358  return 1;
25359  }
25360 /*
25361  if ( !Abc_HManIsRunning(pNtk) )
25362  {
25363  Abc_Print( -1, "The tracing database is not available.\n" );
25364  return 1;
25365  }
25366 
25367  if ( !Abc_HManVerify( 1, pNtk->Id ) )
25368  Abc_Print( -1, "Verification failed.\n" );
25369  Abc_HManStop();
25370 */
25371  return 0;
25372 
25373 usage:
25374  Abc_Print( -2, "usage: trace_check [-h]\n" );
25375  Abc_Print( -2, "\t checks the current network using verification trace\n" );
25376  Abc_Print( -2, "\t-h : print the command usage\n");
25377  return 1;
25378 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTraceStart ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 25278 of file abc.c.

25279 {
25280  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
25281  int c;
25282  // set defaults
25284  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
25285  {
25286  switch ( c )
25287  {
25288  case 'h':
25289  goto usage;
25290  default:
25291  goto usage;
25292  }
25293  }
25294 
25295  if ( pNtk == NULL )
25296  {
25297  Abc_Print( -1, "Empty network.\n" );
25298  return 1;
25299  }
25300  if ( !Abc_NtkIsStrash(pNtk) )
25301  {
25302  Abc_Print( -1, "This command is applicable to AIGs.\n" );
25303  return 1;
25304  }
25305 /*
25306  Abc_HManStart();
25307  if ( !Abc_HManPopulate( pNtk ) )
25308  {
25309  Abc_Print( -1, "Failed to start the tracing database.\n" );
25310  return 1;
25311  }
25312 */
25313  return 0;
25314 
25315 usage:
25316  Abc_Print( -2, "usage: trace_start [-h]\n" );
25317  Abc_Print( -2, "\t starts verification tracing\n" );
25318  Abc_Print( -2, "\t-h : print the command usage\n");
25319  return 1;
25320 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandTrim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 9036 of file abc.c.

9037 {
9038  Abc_Ntk_t * pNtk, * pNtkRes;
9039  Gia_Man_t * pGia, * pNew;
9040  Aig_Man_t * pAig;
9041  int c;
9042  pNtk = Abc_FrameReadNtk(pAbc);
9044  while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
9045  {
9046  switch ( c )
9047  {
9048  case 'h':
9049  goto usage;
9050  default:
9051  goto usage;
9052  }
9053  }
9054  if ( pNtk == NULL )
9055  {
9056  Abc_Print( -1, "Empty network.\n" );
9057  return 1;
9058  }
9059  if ( !Abc_NtkIsStrash(pNtk) )
9060  {
9061  Abc_Print( -1, "Trimming works only for AIGs (run \"strash\").\n" );
9062  return 1;
9063  }
9064  // convert to GIA
9065  pAig = Abc_NtkToDar( pNtk, 0, 1 );
9066  pGia = Gia_ManFromAigSimple( pAig );
9067  Aig_ManStop( pAig );
9068  // perform trimming
9069  pNew = Gia_ManDupTrimmed( pGia, 1, 1, 0, -1 );
9070  Gia_ManStop( pGia );
9071  // convert back
9072  pAig = Gia_ManToAigSimple( pNew );
9073  Gia_ManStop( pNew );
9074  pNtkRes = Abc_NtkFromAigPhase( pAig );
9075  Aig_ManStop( pAig );
9076  // duplicate the name and the spec
9077  ABC_FREE( pNtkRes->pName );
9078  ABC_FREE( pNtkRes->pSpec );
9079  pNtkRes->pName = Extra_UtilStrsav(pNtk->pName);
9080  pNtkRes->pSpec = Extra_UtilStrsav(pNtk->pSpec);
9081  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
9082  return 0;
9083 
9084 usage:
9085  Abc_Print( -2, "usage: trim [-h]\n" );
9086  Abc_Print( -2, "\t removes POs fed by constants and PIs w/o fanout\n" );
9087  Abc_Print( -2, "\t-h : print the command usage\n");
9088  return 1;
9089 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
Gia_Man_t * Gia_ManDupTrimmed(Gia_Man_t *p, int fTrimCis, int fTrimCos, int fDualOut, int OutValue)
Definition: giaDup.c:1638
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Definition: giaAig.c:171
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
char * pSpec
Definition: abc.h:159
#define ABC_FREE(obj)
Definition: abc_global.h:232
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
char * pName
Definition: abc.h:158
int Abc_CommandUndc ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16747 of file abc.c.

16748 {
16749  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
16750  int c, fUseCex = 0;
16751  // set defaults
16753  while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
16754  {
16755  switch ( c )
16756  {
16757  case 'c':
16758  fUseCex ^= 1;
16759  break;
16760  case 'h':
16761  goto usage;
16762  default:
16763  goto usage;
16764  }
16765  }
16766 
16767  if ( pNtk == NULL )
16768  {
16769  Abc_Print( -1, "Empty network.\n" );
16770  return 1;
16771  }
16772 
16773  if ( fUseCex )
16774  {
16775  char * pInit;
16776  Abc_Cex_t * pTemp;
16777  int k, nFlopsX = 0;
16778  if ( pAbc->pCex == NULL )
16779  {
16780  Abc_Print( -1, "Current CEX is not available.\n" );
16781  return 1;
16782  }
16783  pInit = Abc_NtkCollectLatchValuesStr( pAbc->pNtkCur );
16784  // count the number of X-valued flops
16785  for ( k = 0; k < Abc_NtkLatchNum(pAbc->pNtkCur); k++ )
16786  nFlopsX += (int)(pInit[k] == 'x');
16787  // compare this value
16788  if ( Abc_NtkPiNum(pNtk) + nFlopsX != pAbc->pCex->nPis )
16789  {
16790  Abc_Print( -1, "The number of PIs (%d) plus X-valued flops (%d) in the original network does not match the number of PIs in the current CEX (%d).\n",
16791  Abc_NtkPiNum(pNtk), Abc_NtkLatchNum(pNtk), pAbc->pCex->nPis );
16792  return 1;
16793  }
16794  pAbc->pCex = Abc_CexTransformUndc( pTemp = pAbc->pCex, pInit );
16795  assert( pAbc->pCex->nPis == Abc_NtkPiNum(pAbc->pNtkCur) );
16796  assert( pAbc->pCex->nRegs == Abc_NtkLatchNum(pAbc->pNtkCur) );
16797  Abc_CexFree( pTemp );
16798  ABC_FREE( pInit );
16799  return 0;
16800  }
16801 
16802  if ( Abc_NtkIsComb(pNtk) )
16803  {
16804  Abc_Print( -1, "The current network is combinational.\n" );
16805  return 0;
16806  }
16807 
16808  if ( !Abc_NtkIsLogic(pNtk) )
16809  {
16810  Abc_Print( -1, "This command works only for logic networks.\n" );
16811  return 0;
16812  }
16813 
16814  // get the new network
16815  Abc_NtkConvertDcLatches( pNtk );
16816  return 0;
16817 
16818 usage:
16819  Abc_Print( -2, "usage: undc [-ch]\n" );
16820  Abc_Print( -2, "\t converts latches with DC init values into free PIs\n" );
16821  Abc_Print( -2, "\t-c : toggles transforming CEX after \"logic;undc;st;zero\" [default = %s]\n", fUseCex? "yes": "no" );
16822  Abc_Print( -2, "\t-h : print the command usage\n");
16823  return 1;
16824 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
Abc_Cex_t * Abc_CexTransformUndc(Abc_Cex_t *p, char *pInit)
Definition: utilCex.c:448
ABC_DLL void Abc_NtkConvertDcLatches(Abc_Ntk_t *pNtk)
Definition: abcLatch.c:314
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL char * Abc_NtkCollectLatchValuesStr(Abc_Ntk_t *pNtk)
Definition: abcLatch.c:209
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
#define ABC_FREE(obj)
Definition: abc_global.h:232
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
void Abc_CexFree(Abc_Cex_t *p)
Definition: utilCex.c:371
int Abc_CommandUnfold ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 23607 of file abc.c.

23608 {
23609  Abc_Ntk_t * pNtk, * pNtkRes;
23610  int nFrames;
23611  int nConfs;
23612  int nProps;
23613  int fStruct;
23614  int fOldAlgo;
23615  int fVerbose;
23616  int c;
23617  extern Abc_Ntk_t * Abc_NtkDarUnfold( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
23618  pNtk = Abc_FrameReadNtk(pAbc);
23619  // set defaults
23620  nFrames = 1;
23621  nConfs = 1000;
23622  nProps = 1000;
23623  fStruct = 0;
23624  fOldAlgo = 0;
23625  fVerbose = 0;
23627  while ( ( c = Extra_UtilGetopt( argc, argv, "FCPsavh" ) ) != EOF )
23628  {
23629  switch ( c )
23630  {
23631  case 'F':
23632  if ( globalUtilOptind >= argc )
23633  {
23634  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
23635  goto usage;
23636  }
23637  nFrames = atoi(argv[globalUtilOptind]);
23638  globalUtilOptind++;
23639  if ( nFrames < 0 )
23640  goto usage;
23641  break;
23642  case 'C':
23643  if ( globalUtilOptind >= argc )
23644  {
23645  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
23646  goto usage;
23647  }
23648  nConfs = atoi(argv[globalUtilOptind]);
23649  globalUtilOptind++;
23650  if ( nConfs < 0 )
23651  goto usage;
23652  break;
23653  case 'P':
23654  if ( globalUtilOptind >= argc )
23655  {
23656  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
23657  goto usage;
23658  }
23659  nProps = atoi(argv[globalUtilOptind]);
23660  globalUtilOptind++;
23661  if ( nProps < 0 )
23662  goto usage;
23663  break;
23664  case 's':
23665  fStruct ^= 1;
23666  break;
23667  case 'a':
23668  fOldAlgo ^= 1;
23669  break;
23670  case 'v':
23671  fVerbose ^= 1;
23672  break;
23673  case 'h':
23674  goto usage;
23675  default:
23676  goto usage;
23677  }
23678  }
23679  if ( pNtk == NULL )
23680  {
23681  Abc_Print( -1, "Empty network.\n" );
23682  return 1;
23683  }
23684  if ( Abc_NtkIsComb(pNtk) && Abc_NtkPoNum(pNtk) > 1 )
23685  {
23686  Abc_Print( -1, "Combinational miter has more than one PO.\n" );
23687  return 0;
23688  }
23689  if ( Abc_NtkIsComb(pNtk) )
23690  {
23691  extern Gia_Man_t * Gia_ManDupWithConstr( Gia_Man_t * p );
23692  Gia_Man_t * pNew;
23693  Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 0 );
23694  Gia_Man_t * pGia = Gia_ManFromAigSimple( pAig );
23695  Aig_ManStop( pAig );
23696  pNew = Gia_ManDupWithConstr( pGia );
23697  if ( pNew == NULL )
23698  {
23699  Abc_Print( -1, "Cannot extract constrains from the miter.\n" );
23700  return 0;
23701  }
23702  Gia_ManStop( pGia );
23703  pAig = Gia_ManToAigSimple( pNew );
23704  Gia_ManStop( pNew );
23705  pNtkRes = Abc_NtkFromAigPhase( pAig );
23706  Aig_ManStop( pAig );
23707  ABC_FREE( pNtkRes->pName );
23708  pNtkRes->pName = Extra_UtilStrsav( pNtk->pName );
23709  // replace the current network
23710  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
23711  return 0;
23712  }
23713  if ( !Abc_NtkIsStrash(pNtk) )
23714  {
23715  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
23716  return 0;
23717  }
23718  if ( Abc_NtkConstrNum(pNtk) > 0 )
23719  {
23720  Abc_Print( -1, "Constraints are already extracted.\n" );
23721  return 0;
23722  }
23723  if ( Abc_NtkPoNum(pNtk) > 1 && !fStruct )
23724  {
23725  Abc_Print( -1, "Functional constraint extraction works for single-output miters (use \"orpos\").\n" );
23726  return 0;
23727  }
23728  // modify the current network
23729  pNtkRes = Abc_NtkDarUnfold( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
23730  if ( pNtkRes == NULL )
23731  {
23732  Abc_Print( 1,"Transformation has failed.\n" );
23733  return 0;
23734  }
23735  // replace the current network
23736  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
23737  return 0;
23738 usage:
23739  Abc_Print( -2, "usage: unfold [-FCP num] [-savh]\n" );
23740  Abc_Print( -2, "\t unfold hidden constraints as separate outputs\n" );
23741  Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
23742  Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
23743  Abc_Print( -2, "\t-P num : the max number of constraint propagations [default = %d]\n", nProps );
23744  Abc_Print( -2, "\t-s : toggle detecting structural constraints [default = %s]\n", fStruct? "yes": "no" );
23745  Abc_Print( -2, "\t-a : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
23746  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
23747  Abc_Print( -2, "\t-h : print the command usage\n");
23748  return 1;
23749 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Definition: giaAig.c:367
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Definition: giaAig.c:171
char * Extra_UtilStrsav(const char *s)
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Definition: abcDar.c:233
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
Definition: abcDar.c:590
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
#define ABC_FREE(obj)
Definition: abc_global.h:232
Definition: gia.h:95
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDarUnfold(Abc_Ntk_t *pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose)
Definition: abcDar.c:4515
Gia_Man_t * Gia_ManDupWithConstr(Gia_Man_t *p)
Definition: giaDup.c:2946
char * pName
Definition: abc.h:158
static int Abc_CommandUnfold2 ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 13 of file abciUnfold2.c.

14 {
15  Abc_Ntk_t * pNtk, * pNtkRes;
16  int nFrames;
17  int nConfs;
18  int nProps;
19  int fStruct = 0;
20  int fOldAlgo = 0;
21  int fVerbose;
22  int c;
23  extern Abc_Ntk_t * Abc_NtkDarUnfold2( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
24  pNtk = Abc_FrameReadNtk(pAbc);
25  // set defaults
26  nFrames = 1;
27  nConfs = 1000;
28  nProps = 1000;
29  fVerbose = 0;
31  while ( ( c = Extra_UtilGetopt( argc, argv, "CPvh" ) ) != EOF )
32  {
33  switch ( c )
34  {
35  /* case 'F': */
36  /* if ( globalUtilOptind >= argc ) */
37  /* { */
38  /* Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" ); */
39  /* goto usage; */
40  /* } */
41  /* nFrames = atoi(argv[globalUtilOptind]); */
42  /* globalUtilOptind++; */
43  /* if ( nFrames < 0 ) */
44  /* goto usage; */
45  /* break; */
46  case 'C':
47  if ( globalUtilOptind >= argc )
48  {
49  Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
50  goto usage;
51  }
52  nConfs = atoi(argv[globalUtilOptind]);
54  if ( nConfs < 0 )
55  goto usage;
56  break;
57  case 'P':
58  if ( globalUtilOptind >= argc )
59  {
60  Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
61  goto usage;
62  }
63  nProps = atoi(argv[globalUtilOptind]);
65  if ( nProps < 0 )
66  goto usage;
67  break;
68  case 'v':
69  fVerbose ^= 1;
70  break;
71  case 'h':
72  goto usage;
73  default:
74  goto usage;
75  }
76  }
77  if ( pNtk == NULL )
78  {
79  Abc_Print( -1, "Empty network.\n" );
80  return 1;
81  }
82  if ( Abc_NtkIsComb(pNtk) )
83  {
84  Abc_Print( -1, "The network is combinational.\n" );
85  return 0;
86  }
87  if ( !Abc_NtkIsStrash(pNtk) )
88  {
89  Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
90  return 0;
91  }
92  if ( Abc_NtkConstrNum(pNtk) > 0 )
93  {
94  Abc_Print( -1, "Constraints are already extracted.\n" );
95  return 0;
96  }
97  if ( Abc_NtkPoNum(pNtk) > 1 && !fStruct )
98  {
99  Abc_Print( -1, "Functional constraint extraction works for single-output miters (use \"orpos\").\n" );
100  return 0;
101  }
102  // modify the current network
103  pNtkRes = Abc_NtkDarUnfold2( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
104  if ( pNtkRes == NULL )
105  {
106  Abc_Print( 1,"Transformation has failed.\n" );
107  return 0;
108  }
109  // replace the current network
110  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
111  return 0;
112 usage:
113  Abc_Print( -2, "usage: unfold2 [-FCP num] [-savh]\n" );
114  Abc_Print( -2, "\t unfold hidden constraints as separate outputs\n" );
115  Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
116  Abc_Print( -2, "\t-P num : the max number of constraint propagations [default = %d]\n", nProps );
117  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
118  Abc_Print( -2, "\t-h : print the command usage\n");
119  return 1;
120 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static int Abc_NtkConstrNum(Abc_Ntk_t *pNtk)
Definition: abc.h:299
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
Abc_Ntk_t * Abc_NtkDarUnfold2(Abc_Ntk_t *pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose)
Definition: abcDarUnfold2.c:13
int Abc_CommandUnmap ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 14719 of file abc.c.

14720 {
14721  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
14722  int c;
14723  // set defaults
14725  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
14726  {
14727  switch ( c )
14728  {
14729  case 'h':
14730  goto usage;
14731  default:
14732  goto usage;
14733  }
14734  }
14735 
14736  if ( pNtk == NULL )
14737  {
14738  Abc_Print( -1, "Empty network.\n" );
14739  return 1;
14740  }
14741  if ( !Abc_NtkHasMapping(pNtk) )
14742  {
14743  Abc_Print( -1, "Cannot unmap the network that is not mapped.\n" );
14744  return 1;
14745  }
14746 
14747  // get the new network
14748  if ( !Abc_NtkMapToSop( pNtk ) )
14749  {
14750  Abc_Print( -1, "Unmapping has failed.\n" );
14751  return 1;
14752  }
14753  return 0;
14754 
14755 usage:
14756  Abc_Print( -2, "usage: unmap [-h]\n" );
14757  Abc_Print( -2, "\t replaces the library gates by the logic nodes represented using SOPs\n" );
14758  Abc_Print( -2, "\t-h : print the command usage\n");
14759  return 1;
14760 }
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
Definition: abc.h:256
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
ABC_DLL int Abc_NtkMapToSop(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1073
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandUnpermute ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 20112 of file abc.c.

20113 {
20114  Abc_Ntk_t * pNtk = pAbc->pNtkCur, * pNtkRes = NULL;
20115  int c;
20117  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
20118  {
20119  switch ( c )
20120  {
20121  case 'h':
20122  goto usage;
20123  default:
20124  Abc_Print( -2, "Unknown switch.\n");
20125  goto usage;
20126  }
20127  }
20128  if ( pNtk == NULL )
20129  {
20130  Abc_Print( -1, "Empty network.\n" );
20131  return 1;
20132  }
20133  pNtkRes = Abc_NtkDup( pNtk );
20134  if ( pNtkRes == NULL )
20135  {
20136  Abc_Print( -1, "Command \"unpermute\" has failed.\n" );
20137  return 1;
20138  }
20139  Abc_NtkUnpermute( pNtkRes );
20140  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
20141  return 0;
20142 
20143 usage:
20144  Abc_Print( -2, "usage: unpermute [-h]\n" );
20145  Abc_Print( -2, "\t restores inputs/outputs/flops before the last permutation\n" );
20146  Abc_Print( -2, "\t-h : print the command usage\n");
20147  return 1;
20148 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void Abc_NtkUnpermute(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:2021
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandUnseq ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 17033 of file abc.c.

17034 {
17035  Abc_Ntk_t * pNtk, * pNtkRes;
17036  int c;
17037  int fShare;
17038 
17039  pNtk = Abc_FrameReadNtk(pAbc);
17040  // set defaults
17041  fShare = 1;
17043  while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
17044  {
17045  switch ( c )
17046  {
17047  case 's':
17048  fShare ^= 1;
17049  break;
17050  case 'h':
17051  goto usage;
17052  default:
17053  goto usage;
17054  }
17055  }
17056 
17057  if ( pNtk == NULL )
17058  {
17059  Abc_Print( -1, "Empty network.\n" );
17060  return 1;
17061  }
17062 /*
17063  if ( !Abc_NtkIsSeq(pNtk) )
17064  {
17065  Abc_Print( -1, "Conversion to combinational AIG works only for sequential AIG (run \"seq\").\n" );
17066  return 1;
17067  }
17068 */
17069  // share the latches on the fanout edges
17070 // if ( fShare )
17071 // Seq_NtkShareFanouts(pNtk);
17072 
17073  // get the new network
17074 // pNtkRes = Abc_NtkSeqToLogicSop( pNtk );
17075  pNtkRes = NULL;
17076  if ( pNtkRes == NULL )
17077  {
17078  Abc_Print( -1, "Converting sequential AIG into an SOP logic network has failed.\n" );
17079  return 1;
17080  }
17081  // replace the current network
17082  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
17083  return 0;
17084 
17085 usage:
17086  Abc_Print( -2, "usage: unseq [-sh]\n" );
17087  Abc_Print( -2, "\t converts sequential AIG into an SOP logic network\n" );
17088  Abc_Print( -2, "\t-s : toggle sharing latches [default = %s]\n", fShare? "yes": "no" );
17089  Abc_Print( -2, "\t-h : print the command usage\n");
17090  return 1;
17091 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandVarMin ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 6494 of file abc.c.

6495 {
6496  extern void Abc_SuppTest( int nOnes, int nVars, int fUseSimple, int fCheck, int fVerbose );
6497  extern void Abc_SuppReadMinTest( char * pFileName );
6498  int nOnes = 4;
6499  int nVars = 20;
6500  int fUseSimple = 0;
6501  int fCheck = 0;
6502  int fVerbose = 0;
6503  int c;
6505  while ( ( c = Extra_UtilGetopt( argc, argv, "MNocvh" ) ) != EOF )
6506  {
6507  switch ( c )
6508  {
6509  case 'M':
6510  if ( globalUtilOptind >= argc )
6511  {
6512  Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
6513  goto usage;
6514  }
6515  nOnes = atoi(argv[globalUtilOptind]);
6516  globalUtilOptind++;
6517  if ( nOnes < 0 )
6518  goto usage;
6519  break;
6520  case 'N':
6521  if ( globalUtilOptind >= argc )
6522  {
6523  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
6524  goto usage;
6525  }
6526  nVars = atoi(argv[globalUtilOptind]);
6527  globalUtilOptind++;
6528  if ( nVars < 0 )
6529  goto usage;
6530  break;
6531  case 'o':
6532  fUseSimple ^= 1;
6533  break;
6534  case 'c':
6535  fCheck ^= 1;
6536  break;
6537  case 'v':
6538  fVerbose ^= 1;
6539  break;
6540  case 'h':
6541  goto usage;
6542  default:
6543  goto usage;
6544  }
6545  }
6546  // get the file name
6547  if ( argc == globalUtilOptind + 1 )
6548  {
6550  return 0;
6551  }
6552  Abc_SuppTest( nOnes, nVars, fUseSimple, fCheck, fVerbose );
6553  return 0;
6554 
6555 usage:
6556  Abc_Print( -2, "usage: varmin [-MN <num>] [-ocvh]\n" );
6557  Abc_Print( -2, "\t performs support minimization\n" );
6558  Abc_Print( -2, "\t-M <num> : the number of ones in the combination [default = %d]\n", nOnes );
6559  Abc_Print( -2, "\t-N <num> : the number of variables in the problem [default = %d]\n", nVars );
6560  Abc_Print( -2, "\t-o : toggle computing reduced difference matrix [default = %s]\n", fUseSimple? "yes": "no" );
6561  Abc_Print( -2, "\t-c : toggle verifying the final result [default = %s]\n", fCheck? "yes": "no" );
6562  Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
6563  Abc_Print( -2, "\t-h : print the command usage\n");
6564  return 1;
6565 }
void Abc_SuppTest(int nOnes, int nVars, int fUseSimple, int fCheck, int fVerbose)
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
void Abc_SuppReadMinTest(char *pFileName)
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandXsim ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 18953 of file abc.c.

18954 {
18955  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
18956  int c;
18957  int nFrames;
18958  int fXInputs;
18959  int fXState;
18960  int fVerbose;
18961  extern void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXState, int fVerbose );
18962  // set defaults
18963  nFrames = 10;
18964  fXInputs = 0;
18965  fXState = 0;
18966  fVerbose = 0;
18968  while ( ( c = Extra_UtilGetopt( argc, argv, "Fisvh" ) ) != EOF )
18969  {
18970  switch ( c )
18971  {
18972  case 'F':
18973  if ( globalUtilOptind >= argc )
18974  {
18975  Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
18976  goto usage;
18977  }
18978  nFrames = atoi(argv[globalUtilOptind]);
18979  globalUtilOptind++;
18980  if ( nFrames < 0 )
18981  goto usage;
18982  break;
18983  case 'i':
18984  fXInputs ^= 1;
18985  break;
18986  case 's':
18987  fXState ^= 1;
18988  break;
18989  case 'v':
18990  fVerbose ^= 1;
18991  break;
18992  case 'h':
18993  goto usage;
18994  default:
18995  goto usage;
18996  }
18997  }
18998  if ( pNtk == NULL )
18999  {
19000  Abc_Print( -1, "Empty network.\n" );
19001  return 1;
19002  }
19003 
19004  if ( !Abc_NtkIsStrash(pNtk) )
19005  {
19006  Abc_Print( -1, "Only works for strashed networks.\n" );
19007  return 1;
19008  }
19009  if ( !Abc_NtkLatchNum(pNtk) )
19010  {
19011  Abc_Print( -1, "The network is combinational.\n" );
19012  return 0;
19013  }
19014  Abc_NtkXValueSimulate( pNtk, nFrames, fXInputs, fXState, fVerbose );
19015  return 0;
19016 
19017 usage:
19018  Abc_Print( -2, "usage: xsim [-F num] [-isvh]\n" );
19019  Abc_Print( -2, "\t performs X-valued simulation of the AIG\n" );
19020  Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
19021  Abc_Print( -2, "\t-i : toggle X-valued representation of inputs [default = %s]\n", fXInputs? "yes": "no" );
19022  Abc_Print( -2, "\t-s : toggle X-valued representation of state [default = %s]\n", fXState? "yes": "no" );
19023  Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
19024  Abc_Print( -2, "\t-h : print the command usage\n");
19025  return 1;
19026 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_NtkXValueSimulate(Abc_Ntk_t *pNtk, int nFrames, int fXInputs, int fXState, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcXsim.c:111
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandZero ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 16682 of file abc.c.

16683 {
16684  Abc_Ntk_t * pNtk, * pNtkRes;
16685  int c;
16686  pNtk = Abc_FrameReadNtk(pAbc);
16687  // set defaults
16689  while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
16690  {
16691  switch ( c )
16692  {
16693  case 'h':
16694  goto usage;
16695  default:
16696  goto usage;
16697  }
16698  }
16699 
16700  if ( pNtk == NULL )
16701  {
16702  Abc_Print( -1, "Empty network.\n" );
16703  return 1;
16704  }
16705 
16706  if ( Abc_NtkIsComb(pNtk) )
16707  {
16708  Abc_Print( -1, "The current network is combinational.\n" );
16709  return 0;
16710  }
16711 
16712  if ( !Abc_NtkIsStrash(pNtk) )
16713  {
16714  Abc_Print( -1, "This command works only for AIGs.\n" );
16715  return 0;
16716  }
16717 
16718  // get the new network
16719  pNtkRes = Abc_NtkRestrashZero( pNtk, 0 );
16720  if ( pNtkRes == NULL )
16721  {
16722  Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
16723  return 1;
16724  }
16725  // replace the current network
16726  Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
16727  return 0;
16728 
16729 usage:
16730  Abc_Print( -2, "usage: zero [-h]\n" );
16731  Abc_Print( -2, "\t converts latches to have const-0 initial value\n" );
16732  Abc_Print( -2, "\t-h : print the command usage\n");
16733  return 1;
16734 }
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
Definition: mainFrame.c:493
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
Definition: abc.h:297
ABC_DLL Abc_Ntk_t * Abc_NtkRestrashZero(Abc_Ntk_t *pNtk, int fCleanup)
Definition: abcStrash.c:181
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
int Abc_CommandZeroPo ( Abc_Frame_t pAbc,
int  argc,
char **  argv 
)
static

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 7131 of file abc.c.

7132 {
7133  Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL;
7134  int c, iOutput = -1;
7135  int fSkipSweep = 0;
7136  int fUseConst1 = 0;
7137  extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep, int fUseConst1 );
7138 
7139  // set defaults
7141  while ( ( c = Extra_UtilGetopt( argc, argv, "Nsoh" ) ) != EOF )
7142  {
7143  switch ( c )
7144  {
7145  case 'N':
7146  if ( globalUtilOptind >= argc )
7147  {
7148  Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
7149  goto usage;
7150  }
7151  iOutput = atoi(argv[globalUtilOptind]);
7152  globalUtilOptind++;
7153  if ( iOutput < 0 )
7154  goto usage;
7155  break;
7156  case 's':
7157  fSkipSweep ^= 1;
7158  break;
7159  case 'o':
7160  fUseConst1 ^= 1;
7161  break;
7162  default:
7163  goto usage;
7164  }
7165  }
7166 
7167  if ( pNtk == NULL )
7168  {
7169  Abc_Print( -1, "Empty network.\n" );
7170  return 1;
7171  }
7172 
7173  if ( !Abc_NtkIsStrash(pNtk) )
7174  {
7175  Abc_Print( -1, "The network is not strashed.\n" );
7176  return 1;
7177  }
7178  if ( iOutput < 0 )
7179  {
7180  Abc_Print( -1, "The output index is not specified.\n" );
7181  return 1;
7182  }
7183  if ( iOutput >= Abc_NtkPoNum(pNtk) )
7184  {
7185  Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
7186  return 1;
7187  }
7188 
7189  // get the new network
7190 // pNtkRes = Abc_NtkDup( pNtk );
7191 // Abc_NtkDropOneOutput( pNtkRes, iOutput );
7192 // Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
7193  Abc_NtkDropOneOutput( pNtk, iOutput, fSkipSweep, fUseConst1 );
7194  return 0;
7195 
7196 usage:
7197  Abc_Print( -2, "usage: zeropo [-N <num>] [-soh]\n" );
7198  Abc_Print( -2, "\t replaces the PO driver by constant 0\n" );
7199  Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to replace [default = %d]\n", iOutput );
7200  Abc_Print( -2, "\t-s : performs comb sweep after removimg a PO [default = %s]\n", !fSkipSweep? "yes": "no" );
7201  Abc_Print( -2, "\t-o : toggles using const 1 instead of const 0 [default = %s]\n", fUseConst1? "yes": "no" );
7202  Abc_Print( -2, "\t-h : print the command usage\n");
7203  return 1;
7204 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
void Abc_NtkDropOneOutput(Abc_Ntk_t *pNtk, int iOutput, int fSkipSweep, int fUseConst1)
Definition: abcNtk.c:1772
ABC_DLL void Extra_UtilGetoptReset()
Definition: extraUtilUtil.c:80
int globalUtilOptind
Definition: extraUtilUtil.c:45
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
int Extra_UtilGetopt(int argc, char *argv[], const char *optstring)
Definition: extraUtilUtil.c:98
void Abc_End ( Abc_Frame_t pAbc)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1108 of file abc.c.

1109 {
1112  Cnf_ManFree();
1113  {
1114  extern int Abc_NtkCompareAndSaveBest( Abc_Ntk_t * pNtk );
1115  Abc_NtkCompareAndSaveBest( NULL );
1116  }
1117  {
1118  extern void Dar_LibStop();
1119  Dar_LibStop();
1120  }
1121  {
1122  extern void Aig_RManQuit();
1123  Aig_RManQuit();
1124  }
1125  {
1126  extern void Npn_ManClean();
1127  Npn_ManClean();
1128  }
1129  {
1130  extern void Sdm_ManQuit();
1131  Sdm_ManQuit();
1132  }
1134  if ( Abc_FrameGetGlobalFrame()->pGia )
1136  if ( Abc_FrameGetGlobalFrame()->pGia2 )
1138  if ( Abc_FrameGetGlobalFrame()->pGiaBest )
1139  Gia_ManStop( Abc_FrameGetGlobalFrame()->pGiaBest );
1140  if ( Abc_NtkRecIsRunning3() )
1141  Abc_NtkRecStop3();
1142 }
int Abc_NtkCompareAndSaveBest(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcPrint.c:66
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
ABC_DLL int Abc_NtkRecIsRunning3()
Definition: abcRec3.c:1395
void Sdm_ManQuit()
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
void Cnf_ManFree()
Definition: cnfCore.c:58
void Abc_FrameClearDesign()
Definition: abc.c:601
void * Abc_FrameGetGlobalFrame()
Definition: mainFrame.c:593
void Dar_LibStop()
Definition: darLib.c:615
ABC_DLL void Abc_NtkFraigStoreClean()
Definition: abcFraig.c:762
void Npn_ManClean()
Definition: abcNpnSave.c:649
void Aig_RManQuit()
Definition: aigCanon.c:283
ABC_DLL void Abc_NtkRecStop3()
Definition: abcRec3.c:1421
void Abc_FrameClearDesign ( )

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 601 of file abc.c.

602 {
603 }
Vec_Int_t* Abc_FrameDeriveStatusArray ( Vec_Ptr_t vCexes)

Function*************************************************************

Synopsis [Derives array of statuses from the array of CEXes.]

Description []

SideEffects []

SeeAlso []

Definition at line 575 of file abc.c.

576 {
577  Vec_Int_t * vStatuses;
578  Abc_Cex_t * pCex;
579  int i;
580  if ( vCexes == NULL )
581  return NULL;
582  vStatuses = Vec_IntAlloc( Vec_PtrSize(vCexes) );
583  Vec_IntFill( vStatuses, Vec_PtrSize(vCexes), -1 ); // assume UNDEC
584  Vec_PtrForEachEntry( Abc_Cex_t *, vCexes, pCex, i )
585  if ( pCex != NULL )
586  Vec_IntWriteEntry( vStatuses, i, 0 ); // set this output as SAT
587  return vStatuses;
588 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
if(last==0)
Definition: sparse_int.h:34
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Definition: utilCex.h:39
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Gia_Man_t* Abc_FrameGetGia ( Abc_Frame_t pAbc)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 656 of file abc.c.

657 {
658  Gia_Man_t * pGia;
659  if ( pAbc->pGia2 )
660  Gia_ManStop( pAbc->pGia2 );
661  pAbc->pGia2 = NULL;
662  pGia = pAbc->pGia;
663  pAbc->pGia = NULL;
664  return pGia;
665 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
Definition: gia.h:95
void Abc_FrameReplaceCex ( Abc_Frame_t pAbc,
Abc_Cex_t **  ppCex 
)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 490 of file abc.c.

491 {
492  // update CEX
493  ABC_FREE( pAbc->pCex );
494  pAbc->pCex = *ppCex;
495  *ppCex = NULL;
496  // remove CEX vector
497  if ( pAbc->vCexVec )
498  {
499  Vec_PtrFreeFree( pAbc->vCexVec );
500  pAbc->vCexVec = NULL;
501  }
502 }
static void Vec_PtrFreeFree(Vec_Ptr_t *p)
Definition: vecPtr.h:569
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Abc_FrameReplaceCexVec ( Abc_Frame_t pAbc,
Vec_Ptr_t **  pvCexVec 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 515 of file abc.c.

516 {
517  // update CEX vector
518  if ( pAbc->vCexVec )
519  Vec_PtrFreeFree( pAbc->vCexVec );
520  pAbc->vCexVec = *pvCexVec;
521  *pvCexVec = NULL;
522  // remove CEX
523  ABC_FREE( pAbc->pCex );
524 }
static void Vec_PtrFreeFree(Vec_Ptr_t *p)
Definition: vecPtr.h:569
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Abc_FrameReplacePoEquivs ( Abc_Frame_t pAbc,
Vec_Ptr_t **  pvPoEquivs 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 537 of file abc.c.

538 {
539  if ( pAbc->vPoEquivs )
540  Vec_VecFree( (Vec_Vec_t *)pAbc->vPoEquivs );
541  pAbc->vPoEquivs = *pvPoEquivs;
542  *pvPoEquivs = NULL;
543 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
void Abc_FrameReplacePoStatuses ( Abc_Frame_t pAbc,
Vec_Int_t **  pvStatuses 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 556 of file abc.c.

557 {
558  if ( pAbc->vStatuses )
559  Vec_IntFree( pAbc->vStatuses );
560  pAbc->vStatuses = *pvStatuses;
561  *pvStatuses = NULL;
562 }
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Abc_FrameUpdateGia ( Abc_Frame_t pAbc,
Gia_Man_t pNew 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 616 of file abc.c.

617 {
618  if ( pNew == NULL )
619  {
620  Abc_Print( -1, "Abc_FrameUpdateGia(): Tranformation has failed.\n" );
621  return;
622  }
623  if ( Gia_ManPoNum(pNew) == 0 )
624  Abc_Print( 0, "The current GIA has no primary outputs. Some commands may not work correctly.\n" );
625  if ( pNew == pAbc->pGia )
626  return;
627  // transfer names
628  if (!pNew->vNamesIn && pAbc->pGia && pAbc->pGia->vNamesIn && Gia_ManCiNum(pNew) == Vec_PtrSize(pAbc->pGia->vNamesIn))
629  {
630  pNew->vNamesIn = pAbc->pGia->vNamesIn;
631  pAbc->pGia->vNamesIn = NULL;
632  }
633  if (!pNew->vNamesOut && pAbc->pGia && pAbc->pGia->vNamesOut && Gia_ManCoNum(pNew) == Vec_PtrSize(pAbc->pGia->vNamesOut))
634  {
635  pNew->vNamesOut = pAbc->pGia->vNamesOut;
636  pAbc->pGia->vNamesOut = NULL;
637  }
638  // update
639  if ( pAbc->pGia2 )
640  Gia_ManStop( pAbc->pGia2 );
641  pAbc->pGia2 = pAbc->pGia;
642  pAbc->pGia = pNew;
643 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
Vec_Ptr_t * vNamesOut
Definition: gia.h:156
static int Gia_ManCiNum(Gia_Man_t *p)
Definition: gia.h:383
Vec_Ptr_t * vNamesIn
Definition: gia.h:155
static int Gia_ManCoNum(Gia_Man_t *p)
Definition: gia.h:384
void Abc_Init ( Abc_Frame_t pAbc)

DECLARATIONS ///.

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 679 of file abc.c.

680 {
681  Cmd_CommandAdd( pAbc, "Printing", "print_stats", Abc_CommandPrintStats, 0 );
682  Cmd_CommandAdd( pAbc, "Printing", "print_exdc", Abc_CommandPrintExdc, 0 );
683  Cmd_CommandAdd( pAbc, "Printing", "print_io", Abc_CommandPrintIo, 0 );
684  Cmd_CommandAdd( pAbc, "Printing", "print_latch", Abc_CommandPrintLatch, 0 );
685  Cmd_CommandAdd( pAbc, "Printing", "print_fanio", Abc_CommandPrintFanio, 0 );
686  Cmd_CommandAdd( pAbc, "Printing", "print_mffc", Abc_CommandPrintMffc, 0 );
687  Cmd_CommandAdd( pAbc, "Printing", "print_factor", Abc_CommandPrintFactor, 0 );
688  Cmd_CommandAdd( pAbc, "Printing", "print_level", Abc_CommandPrintLevel, 0 );
689  Cmd_CommandAdd( pAbc, "Printing", "print_supp", Abc_CommandPrintSupport, 0 );
690  Cmd_CommandAdd( pAbc, "Printing", "print_symm", Abc_CommandPrintSymms, 0 );
691  Cmd_CommandAdd( pAbc, "Printing", "print_unate", Abc_CommandPrintUnate, 0 );
692  Cmd_CommandAdd( pAbc, "Printing", "print_auto", Abc_CommandPrintAuto, 0 );
693  Cmd_CommandAdd( pAbc, "Printing", "print_kmap", Abc_CommandPrintKMap, 0 );
694  Cmd_CommandAdd( pAbc, "Printing", "print_gates", Abc_CommandPrintGates, 0 );
695  Cmd_CommandAdd( pAbc, "Printing", "print_sharing", Abc_CommandPrintSharing, 0 );
696  Cmd_CommandAdd( pAbc, "Printing", "print_xcut", Abc_CommandPrintXCut, 0 );
697  Cmd_CommandAdd( pAbc, "Printing", "print_dsd", Abc_CommandPrintDsd, 0 );
698  Cmd_CommandAdd( pAbc, "Printing", "print_cone", Abc_CommandPrintCone, 0 );
699  Cmd_CommandAdd( pAbc, "Printing", "print_miter", Abc_CommandPrintMiter, 0 );
700  Cmd_CommandAdd( pAbc, "Printing", "print_status", Abc_CommandPrintStatus, 0 );
701  Cmd_CommandAdd( pAbc, "Printing", "print_delay", Abc_CommandPrintDelay, 0 );
702 
703  Cmd_CommandAdd( pAbc, "Printing", "show", Abc_CommandShow, 0 );
704  Cmd_CommandAdd( pAbc, "Printing", "show_bdd", Abc_CommandShowBdd, 0 );
705  Cmd_CommandAdd( pAbc, "Printing", "show_cut", Abc_CommandShowCut, 0 );
706 
707  Cmd_CommandAdd( pAbc, "Synthesis", "collapse", Abc_CommandCollapse, 1 );
708  Cmd_CommandAdd( pAbc, "Synthesis", "strash", Abc_CommandStrash, 1 );
709  Cmd_CommandAdd( pAbc, "Synthesis", "balance", Abc_CommandBalance, 1 );
710  Cmd_CommandAdd( pAbc, "Synthesis", "mux_struct", Abc_CommandMuxStruct, 1 );
711  Cmd_CommandAdd( pAbc, "Synthesis", "multi", Abc_CommandMulti, 1 );
712  Cmd_CommandAdd( pAbc, "Synthesis", "renode", Abc_CommandRenode, 1 );
713  Cmd_CommandAdd( pAbc, "Synthesis", "cleanup", Abc_CommandCleanup, 1 );
714  Cmd_CommandAdd( pAbc, "Synthesis", "sweep", Abc_CommandSweep, 1 );
715  Cmd_CommandAdd( pAbc, "Synthesis", "fx", Abc_CommandFastExtract, 1 );
716  Cmd_CommandAdd( pAbc, "Synthesis", "eliminate", Abc_CommandEliminate, 1 );
717  Cmd_CommandAdd( pAbc, "Synthesis", "dsd", Abc_CommandDisjoint, 1 );
718  Cmd_CommandAdd( pAbc, "Synthesis", "sparsify", Abc_CommandSparsify, 1 );
719  Cmd_CommandAdd( pAbc, "Synthesis", "lutpack", Abc_CommandLutpack, 1 );
720  Cmd_CommandAdd( pAbc, "Synthesis", "lutmin", Abc_CommandLutmin, 1 );
721 // Cmd_CommandAdd( pAbc, "Synthesis", "imfs", Abc_CommandImfs, 1 );
722  Cmd_CommandAdd( pAbc, "Synthesis", "mfs", Abc_CommandMfs, 1 );
723  Cmd_CommandAdd( pAbc, "Synthesis", "mfs2", Abc_CommandMfs2, 1 );
724  Cmd_CommandAdd( pAbc, "Synthesis", "trace", Abc_CommandTrace, 0 );
725  Cmd_CommandAdd( pAbc, "Synthesis", "speedup", Abc_CommandSpeedup, 1 );
726  Cmd_CommandAdd( pAbc, "Synthesis", "powerdown", Abc_CommandPowerdown, 1 );
727  Cmd_CommandAdd( pAbc, "Synthesis", "addbuffs", Abc_CommandAddBuffs, 1 );
728 // Cmd_CommandAdd( pAbc, "Synthesis", "merge", Abc_CommandMerge, 1 );
729  Cmd_CommandAdd( pAbc, "Synthesis", "testdec", Abc_CommandTestDec, 0 );
730  Cmd_CommandAdd( pAbc, "Synthesis", "testnpn", Abc_CommandTestNpn, 0 );
731  Cmd_CommandAdd( pAbc, "LogiCS", "testrpo", Abc_CommandTestRPO, 0 );
732 
733  Cmd_CommandAdd( pAbc, "Synthesis", "rewrite", Abc_CommandRewrite, 1 );
734  Cmd_CommandAdd( pAbc, "Synthesis", "refactor", Abc_CommandRefactor, 1 );
735 // Cmd_CommandAdd( pAbc, "Synthesis", "restructure", Abc_CommandRestructure, 1 );
736  Cmd_CommandAdd( pAbc, "Synthesis", "resub", Abc_CommandResubstitute, 1 );
737 // Cmd_CommandAdd( pAbc, "Synthesis", "rr", Abc_CommandRr, 1 );
738  Cmd_CommandAdd( pAbc, "Synthesis", "cascade", Abc_CommandCascade, 1 );
739  Cmd_CommandAdd( pAbc, "Synthesis", "extract", Abc_CommandExtract, 1 );
740  Cmd_CommandAdd( pAbc, "Synthesis", "varmin", Abc_CommandVarMin, 0 );
741 
742  Cmd_CommandAdd( pAbc, "Various", "logic", Abc_CommandLogic, 1 );
743  Cmd_CommandAdd( pAbc, "Various", "comb", Abc_CommandComb, 1 );
744  Cmd_CommandAdd( pAbc, "Various", "miter", Abc_CommandMiter, 1 );
745  Cmd_CommandAdd( pAbc, "Various", "demiter", Abc_CommandDemiter, 1 );
746  Cmd_CommandAdd( pAbc, "Various", "orpos", Abc_CommandOrPos, 1 );
747  Cmd_CommandAdd( pAbc, "Various", "andpos", Abc_CommandAndPos, 1 );
748  Cmd_CommandAdd( pAbc, "Various", "zeropo", Abc_CommandZeroPo, 1 );
749  Cmd_CommandAdd( pAbc, "Various", "swappos", Abc_CommandSwapPos, 1 );
750  Cmd_CommandAdd( pAbc, "Various", "removepo", Abc_CommandRemovePo, 1 );
751  Cmd_CommandAdd( pAbc, "Various", "dropsat", Abc_CommandDropSat, 1 );
752  Cmd_CommandAdd( pAbc, "Various", "addpi", Abc_CommandAddPi, 1 );
753  Cmd_CommandAdd( pAbc, "Various", "append", Abc_CommandAppend, 1 );
754  Cmd_CommandAdd( pAbc, "Various", "putontop", Abc_CommandPutOnTop, 1 );
755  Cmd_CommandAdd( pAbc, "Various", "frames", Abc_CommandFrames, 1 );
756  Cmd_CommandAdd( pAbc, "Various", "dframes", Abc_CommandDFrames, 1 );
757  Cmd_CommandAdd( pAbc, "Various", "sop", Abc_CommandSop, 0 );
758  Cmd_CommandAdd( pAbc, "Various", "bdd", Abc_CommandBdd, 0 );
759  Cmd_CommandAdd( pAbc, "Various", "aig", Abc_CommandAig, 0 );
760  Cmd_CommandAdd( pAbc, "Various", "reorder", Abc_CommandReorder, 0 );
761  Cmd_CommandAdd( pAbc, "Various", "bidec", Abc_CommandBidec, 1 );
762  Cmd_CommandAdd( pAbc, "Various", "order", Abc_CommandOrder, 0 );
763  Cmd_CommandAdd( pAbc, "Various", "muxes", Abc_CommandMuxes, 1 );
764  Cmd_CommandAdd( pAbc, "Various", "cubes", Abc_CommandCubes, 1 );
765  Cmd_CommandAdd( pAbc, "Various", "splitsop", Abc_CommandSplitSop, 1 );
766  Cmd_CommandAdd( pAbc, "Various", "ext_seq_dcs", Abc_CommandExtSeqDcs, 0 );
767  Cmd_CommandAdd( pAbc, "Various", "reach", Abc_CommandReach, 0 );
768  Cmd_CommandAdd( pAbc, "Various", "cone", Abc_CommandCone, 1 );
769  Cmd_CommandAdd( pAbc, "Various", "node", Abc_CommandNode, 1 );
770  Cmd_CommandAdd( pAbc, "Various", "topmost", Abc_CommandTopmost, 1 );
771  Cmd_CommandAdd( pAbc, "Various", "topand", Abc_CommandTopAnd, 1 );
772  Cmd_CommandAdd( pAbc, "Various", "trim", Abc_CommandTrim, 1 );
773  Cmd_CommandAdd( pAbc, "Various", "short_names", Abc_CommandShortNames, 0 );
774  Cmd_CommandAdd( pAbc, "Various", "move_names", Abc_CommandMoveNames, 0 );
775  Cmd_CommandAdd( pAbc, "Various", "exdc_free", Abc_CommandExdcFree, 1 );
776  Cmd_CommandAdd( pAbc, "Various", "exdc_get", Abc_CommandExdcGet, 1 );
777  Cmd_CommandAdd( pAbc, "Various", "exdc_set", Abc_CommandExdcSet, 1 );
778  Cmd_CommandAdd( pAbc, "Various", "care_set", Abc_CommandCareSet, 1 );
779  Cmd_CommandAdd( pAbc, "Various", "cut", Abc_CommandCut, 0 );
780  Cmd_CommandAdd( pAbc, "Various", "espresso", Abc_CommandEspresso, 1 );
781  Cmd_CommandAdd( pAbc, "Various", "gen", Abc_CommandGen, 0 );
782  Cmd_CommandAdd( pAbc, "Various", "genfsm", Abc_CommandGenFsm, 0 );
783  Cmd_CommandAdd( pAbc, "Various", "cover", Abc_CommandCover, 1 );
784  Cmd_CommandAdd( pAbc, "Various", "double", Abc_CommandDouble, 1 );
785  Cmd_CommandAdd( pAbc, "Various", "inter", Abc_CommandInter, 1 );
786  Cmd_CommandAdd( pAbc, "Various", "bb2wb", Abc_CommandBb2Wb, 0 );
787  Cmd_CommandAdd( pAbc, "Various", "outdec", Abc_CommandOutdec, 1 );
788  Cmd_CommandAdd( pAbc, "Various", "nodedup", Abc_CommandNodeDup, 1 );
789  Cmd_CommandAdd( pAbc, "Various", "testcolor", Abc_CommandTestColor, 0 );
790  Cmd_CommandAdd( pAbc, "Various", "test", Abc_CommandTest, 0 );
791 // Cmd_CommandAdd( pAbc, "Various", "qbf_solve", Abc_CommandTest, 0 );
792 
793  Cmd_CommandAdd( pAbc, "Various", "qvar", Abc_CommandQuaVar, 1 );
794  Cmd_CommandAdd( pAbc, "Various", "qrel", Abc_CommandQuaRel, 1 );
795  Cmd_CommandAdd( pAbc, "Various", "qreach", Abc_CommandQuaReach, 1 );
796  Cmd_CommandAdd( pAbc, "Various", "senseinput", Abc_CommandSenseInput, 1 );
797  Cmd_CommandAdd( pAbc, "Various", "npnload", Abc_CommandNpnLoad, 0 );
798  Cmd_CommandAdd( pAbc, "Various", "npnsave", Abc_CommandNpnSave, 0 );
799 
800  Cmd_CommandAdd( pAbc, "Various", "send_aig", Abc_CommandSendAig, 0 );
801  Cmd_CommandAdd( pAbc, "Various", "send_status", Abc_CommandSendStatus, 0 );
802 
803  Cmd_CommandAdd( pAbc, "Various", "backup", Abc_CommandBackup, 0 );
804  Cmd_CommandAdd( pAbc, "Various", "restore", Abc_CommandRestore, 0 );
805 
806  Cmd_CommandAdd( pAbc, "Various", "minisat", Abc_CommandMinisat, 0 );
807  Cmd_CommandAdd( pAbc, "Various", "minisimp", Abc_CommandMinisimp, 0 );
808 
809  Cmd_CommandAdd( pAbc, "New AIG", "istrash", Abc_CommandIStrash, 1 );
810  Cmd_CommandAdd( pAbc, "New AIG", "icut", Abc_CommandICut, 0 );
811  Cmd_CommandAdd( pAbc, "New AIG", "irw", Abc_CommandIRewrite, 1 );
812  Cmd_CommandAdd( pAbc, "New AIG", "drw", Abc_CommandDRewrite, 1 );
813  Cmd_CommandAdd( pAbc, "New AIG", "drf", Abc_CommandDRefactor, 1 );
814  Cmd_CommandAdd( pAbc, "New AIG", "dc2", Abc_CommandDc2, 1 );
815  Cmd_CommandAdd( pAbc, "New AIG", "dchoice", Abc_CommandDChoice, 1 );
816  Cmd_CommandAdd( pAbc, "New AIG", "dch", Abc_CommandDch, 1 );
817  Cmd_CommandAdd( pAbc, "New AIG", "drwsat", Abc_CommandDrwsat, 1 );
818  Cmd_CommandAdd( pAbc, "New AIG", "irws", Abc_CommandIRewriteSeq, 1 );
819  Cmd_CommandAdd( pAbc, "New AIG", "iresyn", Abc_CommandIResyn, 1 );
820  Cmd_CommandAdd( pAbc, "New AIG", "isat", Abc_CommandISat, 1 );
821  Cmd_CommandAdd( pAbc, "New AIG", "ifraig", Abc_CommandIFraig, 1 );
822  Cmd_CommandAdd( pAbc, "New AIG", "dfraig", Abc_CommandDFraig, 1 );
823  Cmd_CommandAdd( pAbc, "New AIG", "csweep", Abc_CommandCSweep, 1 );
824 // Cmd_CommandAdd( pAbc, "New AIG", "haig", Abc_CommandHaig, 1 );
825  Cmd_CommandAdd( pAbc, "New AIG", "qbf", Abc_CommandQbf, 0 );
826 
827  Cmd_CommandAdd( pAbc, "Fraiging", "fraig", Abc_CommandFraig, 1 );
828  Cmd_CommandAdd( pAbc, "Fraiging", "fraig_trust", Abc_CommandFraigTrust, 1 );
829  Cmd_CommandAdd( pAbc, "Fraiging", "fraig_store", Abc_CommandFraigStore, 0 );
830  Cmd_CommandAdd( pAbc, "Fraiging", "fraig_restore", Abc_CommandFraigRestore, 1 );
831  Cmd_CommandAdd( pAbc, "Fraiging", "fraig_clean", Abc_CommandFraigClean, 0 );
832  Cmd_CommandAdd( pAbc, "Fraiging", "fraig_sweep", Abc_CommandFraigSweep, 1 );
833  Cmd_CommandAdd( pAbc, "Fraiging", "dress", Abc_CommandFraigDress, 1 );
834 
835  Cmd_CommandAdd( pAbc, "Choicing", "rec_start3", Abc_CommandRecStart3, 0 );
836  Cmd_CommandAdd( pAbc, "Choicing", "rec_stop3", Abc_CommandRecStop3, 0 );
837  Cmd_CommandAdd( pAbc, "Choicing", "rec_ps3", Abc_CommandRecPs3, 0 );
838  Cmd_CommandAdd( pAbc, "Choicing", "rec_add3", Abc_CommandRecAdd3, 0 );
839  Cmd_CommandAdd( pAbc, "Choicing", "rec_dump3", Abc_CommandRecDump3, 0 );
840  Cmd_CommandAdd( pAbc, "Choicing", "rec_merge3", Abc_CommandRecMerge3, 0 );
841 
842  Cmd_CommandAdd( pAbc, "SC mapping", "map", Abc_CommandMap, 1 );
843  Cmd_CommandAdd( pAbc, "SC mapping", "amap", Abc_CommandAmap, 1 );
844  Cmd_CommandAdd( pAbc, "SC mapping", "unmap", Abc_CommandUnmap, 1 );
845  Cmd_CommandAdd( pAbc, "SC mapping", "attach", Abc_CommandAttach, 1 );
846  Cmd_CommandAdd( pAbc, "SC mapping", "superc", Abc_CommandSuperChoice, 1 );
847  Cmd_CommandAdd( pAbc, "SC mapping", "supercl", Abc_CommandSuperChoiceLut, 1 );
848 
849 // Cmd_CommandAdd( pAbc, "FPGA mapping", "fpga", Abc_CommandFpga, 1 );
850 // Cmd_CommandAdd( pAbc, "FPGA mapping", "ffpga", Abc_CommandFpgaFast, 1 );
851  Cmd_CommandAdd( pAbc, "FPGA mapping", "if", Abc_CommandIf, 1 );
852  Cmd_CommandAdd( pAbc, "FPGA mapping", "ifif", Abc_CommandIfif, 1 );
853 
854  Cmd_CommandAdd( pAbc, "DSD manager", "dsd_save", Abc_CommandDsdSave, 0 );
855  Cmd_CommandAdd( pAbc, "DSD manager", "dsd_load", Abc_CommandDsdLoad, 0 );
856  Cmd_CommandAdd( pAbc, "DSD manager", "dsd_free", Abc_CommandDsdFree, 0 );
857  Cmd_CommandAdd( pAbc, "DSD manager", "dsd_ps", Abc_CommandDsdPs, 0 );
858  Cmd_CommandAdd( pAbc, "DSD manager", "dsd_match", Abc_CommandDsdMatch, 0 );
859  Cmd_CommandAdd( pAbc, "DSD manager", "dsd_merge", Abc_CommandDsdMerge, 0 );
860  Cmd_CommandAdd( pAbc, "DSD manager", "dsd_filter", Abc_CommandDsdFilter, 0 );
861 
862 // Cmd_CommandAdd( pAbc, "Sequential", "scut", Abc_CommandScut, 0 );
863  Cmd_CommandAdd( pAbc, "Sequential", "init", Abc_CommandInit, 1 );
864  Cmd_CommandAdd( pAbc, "Sequential", "zero", Abc_CommandZero, 1 );
865  Cmd_CommandAdd( pAbc, "Sequential", "undc", Abc_CommandUndc, 1 );
866  Cmd_CommandAdd( pAbc, "Sequential", "onehot", Abc_CommandOneHot, 1 );
867 // Cmd_CommandAdd( pAbc, "Sequential", "pipe", Abc_CommandPipe, 1 );
868  Cmd_CommandAdd( pAbc, "Sequential", "retime", Abc_CommandRetime, 1 );
869  Cmd_CommandAdd( pAbc, "Sequential", "dretime", Abc_CommandDRetime, 1 );
870  Cmd_CommandAdd( pAbc, "Sequential", "fretime", Abc_CommandFlowRetime, 1 );
871  Cmd_CommandAdd( pAbc, "Sequential", "cretime", Abc_CommandCRetime, 1 );
872 // Cmd_CommandAdd( pAbc, "Sequential", "sfpga", Abc_CommandSeqFpga, 1 );
873 // Cmd_CommandAdd( pAbc, "Sequential", "smap", Abc_CommandSeqMap, 1 );
874  Cmd_CommandAdd( pAbc, "Sequential", "ssweep", Abc_CommandSeqSweep, 1 );
875  Cmd_CommandAdd( pAbc, "Sequential", "scorr", Abc_CommandSeqSweep2, 1 );
876  Cmd_CommandAdd( pAbc, "Sequential", "testssw", Abc_CommandTestSeqSweep, 0 );
877  Cmd_CommandAdd( pAbc, "Sequential", "testscorr", Abc_CommandTestScorr, 0 );
878  Cmd_CommandAdd( pAbc, "Sequential", "lcorr", Abc_CommandLcorr, 1 );
879  Cmd_CommandAdd( pAbc, "Sequential", "scleanup", Abc_CommandSeqCleanup, 1 );
880  Cmd_CommandAdd( pAbc, "Sequential", "cycle", Abc_CommandCycle, 1 );
881  Cmd_CommandAdd( pAbc, "Sequential", "xsim", Abc_CommandXsim, 0 );
882  Cmd_CommandAdd( pAbc, "Sequential", "sim", Abc_CommandSim, 0 );
883  Cmd_CommandAdd( pAbc, "Sequential", "sim3", Abc_CommandSim3, 0 );
884  Cmd_CommandAdd( pAbc, "Sequential", "phase", Abc_CommandDarPhase, 1 );
885  Cmd_CommandAdd( pAbc, "Sequential", "synch", Abc_CommandSynch, 1 );
886  Cmd_CommandAdd( pAbc, "Sequential", "clockgate", Abc_CommandClockGate, 1 );
887  Cmd_CommandAdd( pAbc, "Sequential", "extwin", Abc_CommandExtWin, 1 );
888  Cmd_CommandAdd( pAbc, "Sequential", "inswin", Abc_CommandInsWin, 1 );
889  Cmd_CommandAdd( pAbc, "Sequential", "permute", Abc_CommandPermute, 1 );
890  Cmd_CommandAdd( pAbc, "Sequential", "unpermute", Abc_CommandUnpermute, 1 );
891  Cmd_CommandAdd( pAbc, "Sequential", "cubeenum", Abc_CommandCubeEnum, 0 );
892 
893  Cmd_CommandAdd( pAbc, "Verification", "cec", Abc_CommandCec, 0 );
894  Cmd_CommandAdd( pAbc, "Verification", "dcec", Abc_CommandDCec, 0 );
895  Cmd_CommandAdd( pAbc, "Verification", "dsec", Abc_CommandDSec, 0 );
896  Cmd_CommandAdd( pAbc, "Verification", "dprove", Abc_CommandDProve, 0 );
897  Cmd_CommandAdd( pAbc, "Verification", "absec", Abc_CommandAbSec, 0 );
898  Cmd_CommandAdd( pAbc, "Verification", "simsec", Abc_CommandSimSec, 0 );
899  Cmd_CommandAdd( pAbc, "Verification", "match", Abc_CommandMatch, 0 );
900  Cmd_CommandAdd( pAbc, "Verification", "sat", Abc_CommandSat, 0 );
901  Cmd_CommandAdd( pAbc, "Verification", "dsat", Abc_CommandDSat, 0 );
902  Cmd_CommandAdd( pAbc, "Verification", "psat", Abc_CommandPSat, 0 );
903  Cmd_CommandAdd( pAbc, "Verification", "prove", Abc_CommandProve, 1 );
904  Cmd_CommandAdd( pAbc, "Verification", "iprove", Abc_CommandIProve, 1 );
905  Cmd_CommandAdd( pAbc, "Verification", "debug", Abc_CommandDebug, 0 );
906  Cmd_CommandAdd( pAbc, "Verification", "bmc", Abc_CommandBmc, 0 );
907  Cmd_CommandAdd( pAbc, "Verification", "bmc2", Abc_CommandBmc2, 0 );
908  Cmd_CommandAdd( pAbc, "Verification", "bmc3", Abc_CommandBmc3, 1 );
909  Cmd_CommandAdd( pAbc, "Verification", "int", Abc_CommandBmcInter, 1 );
910  Cmd_CommandAdd( pAbc, "Verification", "indcut", Abc_CommandIndcut, 0 );
911  Cmd_CommandAdd( pAbc, "Verification", "enlarge", Abc_CommandEnlarge, 1 );
912  Cmd_CommandAdd( pAbc, "Verification", "tempor", Abc_CommandTempor, 1 );
913  Cmd_CommandAdd( pAbc, "Verification", "ind", Abc_CommandInduction, 0 );
914  Cmd_CommandAdd( pAbc, "Verification", "constr", Abc_CommandConstr, 0 );
915  Cmd_CommandAdd( pAbc, "Verification", "unfold", Abc_CommandUnfold, 1 );
916  Cmd_CommandAdd( pAbc, "Verification", "fold", Abc_CommandFold, 1 );
917  Cmd_CommandAdd( pAbc, "Verification", "unfold2", Abc_CommandUnfold2, 1 ); // jlong
918  Cmd_CommandAdd( pAbc, "Verification", "fold2", Abc_CommandFold2, 1 ); // jlong
919  Cmd_CommandAdd( pAbc, "Verification", "bm", Abc_CommandBm, 1 );
920  Cmd_CommandAdd( pAbc, "Verification", "bm2", Abc_CommandBm2, 1 );
921  Cmd_CommandAdd( pAbc, "Verification", "saucy3", Abc_CommandSaucy, 1 );
922  Cmd_CommandAdd( pAbc, "Verification", "testcex", Abc_CommandTestCex, 0 );
923  Cmd_CommandAdd( pAbc, "Verification", "pdr", Abc_CommandPdr, 0 );
924  Cmd_CommandAdd( pAbc, "Verification", "reconcile", Abc_CommandReconcile, 1 );
925  Cmd_CommandAdd( pAbc, "Verification", "cexsave", Abc_CommandCexSave, 0 );
926  Cmd_CommandAdd( pAbc, "Verification", "cexload", Abc_CommandCexLoad, 0 );
927  Cmd_CommandAdd( pAbc, "Verification", "cexcut", Abc_CommandCexCut, 0 );
928  Cmd_CommandAdd( pAbc, "Verification", "cexmerge", Abc_CommandCexMerge, 0 );
929 // Cmd_CommandAdd( pAbc, "Verification", "cexmin", Abc_CommandCexMin, 0 );
930  Cmd_CommandAdd( pAbc, "Verification", "dualrail", Abc_CommandDualRail, 1 );
931  Cmd_CommandAdd( pAbc, "Verification", "blockpo", Abc_CommandBlockPo, 1 );
932  Cmd_CommandAdd( pAbc, "Verification", "iso", Abc_CommandIso, 1 );
933 
934  Cmd_CommandAdd( pAbc, "ABC9", "&get", Abc_CommandAbc9Get, 0 );
935  Cmd_CommandAdd( pAbc, "ABC9", "&put", Abc_CommandAbc9Put, 0 );
936  Cmd_CommandAdd( pAbc, "ABC9", "&save", Abc_CommandAbc9Save, 0 );
937  Cmd_CommandAdd( pAbc, "ABC9", "&load", Abc_CommandAbc9Load, 0 );
938  Cmd_CommandAdd( pAbc, "ABC9", "&r", Abc_CommandAbc9Read, 0 );
939  Cmd_CommandAdd( pAbc, "ABC9", "&read_blif", Abc_CommandAbc9ReadBlif, 0 );
940  Cmd_CommandAdd( pAbc, "ABC9", "&read_cblif", Abc_CommandAbc9ReadCBlif, 0 );
941  Cmd_CommandAdd( pAbc, "ABC9", "&read_stg", Abc_CommandAbc9ReadStg, 0 );
942  Cmd_CommandAdd( pAbc, "ABC9", "&read_ver", Abc_CommandAbc9ReadVer, 0 );
943  Cmd_CommandAdd( pAbc, "ABC9", "&write_ver", Abc_CommandAbc9WriteVer, 0 );
944  Cmd_CommandAdd( pAbc, "ABC9", "&w", Abc_CommandAbc9Write, 0 );
945  Cmd_CommandAdd( pAbc, "ABC9", "&ps", Abc_CommandAbc9Ps, 0 );
946  Cmd_CommandAdd( pAbc, "ABC9", "&pfan", Abc_CommandAbc9PFan, 0 );
947  Cmd_CommandAdd( pAbc, "ABC9", "&psig", Abc_CommandAbc9PSig, 0 );
948  Cmd_CommandAdd( pAbc, "ABC9", "&status", Abc_CommandAbc9Status, 0 );
949  Cmd_CommandAdd( pAbc, "ABC9", "&mux_profile", Abc_CommandAbc9MuxProfile, 0 );
950  Cmd_CommandAdd( pAbc, "ABC9", "&show", Abc_CommandAbc9Show, 0 );
951  Cmd_CommandAdd( pAbc, "ABC9", "&setregnum", Abc_CommandAbc9SetRegNum, 0 );
952  Cmd_CommandAdd( pAbc, "ABC9", "&st", Abc_CommandAbc9Strash, 0 );
953  Cmd_CommandAdd( pAbc, "ABC9", "&topand", Abc_CommandAbc9Topand, 0 );
954  Cmd_CommandAdd( pAbc, "ABC9", "&add1hot", Abc_CommandAbc9Add1Hot, 0 );
955  Cmd_CommandAdd( pAbc, "ABC9", "&cof", Abc_CommandAbc9Cof, 0 );
956  Cmd_CommandAdd( pAbc, "ABC9", "&trim", Abc_CommandAbc9Trim, 0 );
957  Cmd_CommandAdd( pAbc, "ABC9", "&dfs", Abc_CommandAbc9Dfs, 0 );
958  Cmd_CommandAdd( pAbc, "ABC9", "&sim", Abc_CommandAbc9Sim, 0 );
959  Cmd_CommandAdd( pAbc, "ABC9", "&sim3", Abc_CommandAbc9Sim3, 0 );
960  Cmd_CommandAdd( pAbc, "ABC9", "&resim", Abc_CommandAbc9Resim, 0 );
961  Cmd_CommandAdd( pAbc, "ABC9", "&speci", Abc_CommandAbc9SpecI, 0 );
962  Cmd_CommandAdd( pAbc, "ABC9", "&equiv", Abc_CommandAbc9Equiv, 0 );
963  Cmd_CommandAdd( pAbc, "ABC9", "&equiv2", Abc_CommandAbc9Equiv2, 0 );
964  Cmd_CommandAdd( pAbc, "ABC9", "&equiv3", Abc_CommandAbc9Equiv3, 0 );
965  Cmd_CommandAdd( pAbc, "ABC9", "&semi", Abc_CommandAbc9Semi, 0 );
966  Cmd_CommandAdd( pAbc, "ABC9", "&times", Abc_CommandAbc9Times, 0 );
967  Cmd_CommandAdd( pAbc, "ABC9", "&frames", Abc_CommandAbc9Frames, 0 );
968  Cmd_CommandAdd( pAbc, "ABC9", "&retime", Abc_CommandAbc9Retime, 0 );
969  Cmd_CommandAdd( pAbc, "ABC9", "&enable", Abc_CommandAbc9Enable, 0 );
970  Cmd_CommandAdd( pAbc, "ABC9", "&dc2", Abc_CommandAbc9Dc2, 0 );
971  Cmd_CommandAdd( pAbc, "ABC9", "&dsd", Abc_CommandAbc9Dsd, 0 );
972  Cmd_CommandAdd( pAbc, "ABC9", "&bidec", Abc_CommandAbc9Bidec, 0 );
973  Cmd_CommandAdd( pAbc, "ABC9", "&shrink", Abc_CommandAbc9Shrink, 0 );
974  Cmd_CommandAdd( pAbc, "ABC9", "&fx", Abc_CommandAbc9Fx, 0 );
975  Cmd_CommandAdd( pAbc, "ABC9", "&b", Abc_CommandAbc9Balance, 0 );
976  Cmd_CommandAdd( pAbc, "ABC9", "&blut", Abc_CommandAbc9BalanceLut, 0 );
977  Cmd_CommandAdd( pAbc, "ABC9", "&syn2", Abc_CommandAbc9Syn2, 0 );
978  Cmd_CommandAdd( pAbc, "ABC9", "&syn3", Abc_CommandAbc9Syn3, 0 );
979  Cmd_CommandAdd( pAbc, "ABC9", "&syn4", Abc_CommandAbc9Syn4, 0 );
980  Cmd_CommandAdd( pAbc, "ABC9", "&synch2", Abc_CommandAbc9Synch2, 0 );
981  Cmd_CommandAdd( pAbc, "ABC9", "&false", Abc_CommandAbc9False, 0 );
982  Cmd_CommandAdd( pAbc, "ABC9", "&miter", Abc_CommandAbc9Miter, 0 );
983  Cmd_CommandAdd( pAbc, "ABC9", "&miter2", Abc_CommandAbc9Miter2, 0 );
984  Cmd_CommandAdd( pAbc, "ABC9", "&append", Abc_CommandAbc9Append, 0 );
985  Cmd_CommandAdd( pAbc, "ABC9", "&scl", Abc_CommandAbc9Scl, 0 );
986  Cmd_CommandAdd( pAbc, "ABC9", "&lcorr", Abc_CommandAbc9Lcorr, 0 );
987  Cmd_CommandAdd( pAbc, "ABC9", "&scorr", Abc_CommandAbc9Scorr, 0 );
988  Cmd_CommandAdd( pAbc, "ABC9", "&choice", Abc_CommandAbc9Choice, 0 );
989  Cmd_CommandAdd( pAbc, "ABC9", "&sat", Abc_CommandAbc9Sat, 0 );
990  Cmd_CommandAdd( pAbc, "ABC9", "&satenum", Abc_CommandAbc9SatEnum, 0 );
991  Cmd_CommandAdd( pAbc, "ABC9", "&fraig", Abc_CommandAbc9Fraig, 0 );
992  Cmd_CommandAdd( pAbc, "ABC9", "&cfraig", Abc_CommandAbc9CFraig, 0 );
993  Cmd_CommandAdd( pAbc, "ABC9", "&srm", Abc_CommandAbc9Srm, 0 );
994  Cmd_CommandAdd( pAbc, "ABC9", "&srm2", Abc_CommandAbc9Srm2, 0 );
995  Cmd_CommandAdd( pAbc, "ABC9", "&filter", Abc_CommandAbc9Filter, 0 );
996  Cmd_CommandAdd( pAbc, "ABC9", "&reduce", Abc_CommandAbc9Reduce, 0 );
997  Cmd_CommandAdd( pAbc, "ABC9", "&equiv_mark", Abc_CommandAbc9EquivMark, 0 );
998  Cmd_CommandAdd( pAbc, "ABC9", "&equiv_filter", Abc_CommandAbc9EquivFilter, 0 );
999  Cmd_CommandAdd( pAbc, "ABC9", "&cec", Abc_CommandAbc9Cec, 0 );
1000  Cmd_CommandAdd( pAbc, "ABC9", "&verify", Abc_CommandAbc9Verify, 0 );
1001  Cmd_CommandAdd( pAbc, "ABC9", "&sweep", Abc_CommandAbc9Sweep, 0 );
1002  Cmd_CommandAdd( pAbc, "ABC9", "&force", Abc_CommandAbc9Force, 0 );
1003  Cmd_CommandAdd( pAbc, "ABC9", "&embed", Abc_CommandAbc9Embed, 0 );
1004  Cmd_CommandAdd( pAbc, "ABC9", "&sopb", Abc_CommandAbc9Sopb, 0 );
1005  Cmd_CommandAdd( pAbc, "ABC9", "&dsdb", Abc_CommandAbc9Dsdb, 0 );
1006  Cmd_CommandAdd( pAbc, "ABC9", "&flow", Abc_CommandAbc9Flow, 0 );
1007  Cmd_CommandAdd( pAbc, "ABC9", "&flow2", Abc_CommandAbc9Flow2, 0 );
1008  Cmd_CommandAdd( pAbc, "ABC9", "&if", Abc_CommandAbc9If, 0 );
1009  Cmd_CommandAdd( pAbc, "ABC9", "&iff", Abc_CommandAbc9Iff, 0 );
1010  Cmd_CommandAdd( pAbc, "ABC9", "&if2", Abc_CommandAbc9If2, 0 );
1011  Cmd_CommandAdd( pAbc, "ABC9", "&jf", Abc_CommandAbc9Jf, 0 );
1012  Cmd_CommandAdd( pAbc, "ABC9", "&kf", Abc_CommandAbc9Kf, 0 );
1013  Cmd_CommandAdd( pAbc, "ABC9", "&lf", Abc_CommandAbc9Lf, 0 );
1014  Cmd_CommandAdd( pAbc, "ABC9", "&mf", Abc_CommandAbc9Mf, 0 );
1015  Cmd_CommandAdd( pAbc, "ABC9", "&nf", Abc_CommandAbc9Nf, 0 );
1016  Cmd_CommandAdd( pAbc, "ABC9", "&unmap", Abc_CommandAbc9Unmap, 0 );
1017  Cmd_CommandAdd( pAbc, "ABC9", "&struct", Abc_CommandAbc9Struct, 0 );
1018  Cmd_CommandAdd( pAbc, "ABC9", "&trace", Abc_CommandAbc9Trace, 0 );
1019  Cmd_CommandAdd( pAbc, "ABC9", "&speedup", Abc_CommandAbc9Speedup, 0 );
1020  Cmd_CommandAdd( pAbc, "ABC9", "&era", Abc_CommandAbc9Era, 0 );
1021  Cmd_CommandAdd( pAbc, "ABC9", "&dch", Abc_CommandAbc9Dch, 0 );
1022  Cmd_CommandAdd( pAbc, "ABC9", "&rpm", Abc_CommandAbc9Rpm, 0 );
1023  Cmd_CommandAdd( pAbc, "ABC9", "&back_reach", Abc_CommandAbc9BackReach, 0 );
1024  Cmd_CommandAdd( pAbc, "ABC9", "&posplit", Abc_CommandAbc9Posplit, 0 );
1025  Cmd_CommandAdd( pAbc, "ABC9", "&reachm", Abc_CommandAbc9ReachM, 0 );
1026  Cmd_CommandAdd( pAbc, "ABC9", "&reachp", Abc_CommandAbc9ReachP, 0 );
1027  Cmd_CommandAdd( pAbc, "ABC9", "&reachn", Abc_CommandAbc9ReachN, 0 );
1028  Cmd_CommandAdd( pAbc, "ABC9", "&reachy", Abc_CommandAbc9ReachY, 0 );
1029  Cmd_CommandAdd( pAbc, "ABC9", "&undo", Abc_CommandAbc9Undo, 0 );
1030  Cmd_CommandAdd( pAbc, "ABC9", "&iso", Abc_CommandAbc9Iso, 0 );
1031  Cmd_CommandAdd( pAbc, "ABC9", "&cexinfo", Abc_CommandAbc9CexInfo, 0 );
1032  Cmd_CommandAdd( pAbc, "ABC9", "&cycle", Abc_CommandAbc9Cycle, 0 );
1033  Cmd_CommandAdd( pAbc, "ABC9", "&cone", Abc_CommandAbc9Cone, 0 );
1034  Cmd_CommandAdd( pAbc, "ABC9", "&slice", Abc_CommandAbc9Slice, 0 );
1035  Cmd_CommandAdd( pAbc, "ABC9", "&popart", Abc_CommandAbc9PoPart, 0 );
1036  Cmd_CommandAdd( pAbc, "ABC9", "&gprove", Abc_CommandAbc9GroupProve, 0 );
1037  Cmd_CommandAdd( pAbc, "ABC9", "&mprove", Abc_CommandAbc9MultiProve, 0 );
1038  Cmd_CommandAdd( pAbc, "ABC9", "&splitprove", Abc_CommandAbc9SplitProve, 0 );
1039  Cmd_CommandAdd( pAbc, "ABC9", "&bmc", Abc_CommandAbc9Bmc, 0 );
1040  Cmd_CommandAdd( pAbc, "ABC9", "&chainbmc", Abc_CommandAbc9ChainBmc, 0 );
1041  Cmd_CommandAdd( pAbc, "ABC9", "&bcore", Abc_CommandAbc9BCore, 0 );
1042  Cmd_CommandAdd( pAbc, "ABC9", "&icheck", Abc_CommandAbc9ICheck, 0 );
1043  Cmd_CommandAdd( pAbc, "ABC9", "&sattest", Abc_CommandAbc9SatTest, 0 );
1044  Cmd_CommandAdd( pAbc, "ABC9", "&fftest", Abc_CommandAbc9FFTest, 0 );
1045  Cmd_CommandAdd( pAbc, "ABC9", "&qbf", Abc_CommandAbc9Qbf, 0 );
1046  Cmd_CommandAdd( pAbc, "ABC9", "&inse", Abc_CommandAbc9Inse, 0 );
1047  Cmd_CommandAdd( pAbc, "ABC9", "&maxi", Abc_CommandAbc9Maxi, 0 );
1048  Cmd_CommandAdd( pAbc, "ABC9", "&bmci", Abc_CommandAbc9Bmci, 0 );
1049  Cmd_CommandAdd( pAbc, "ABC9", "&poxsim", Abc_CommandAbc9PoXsim, 0 );
1050  Cmd_CommandAdd( pAbc, "ABC9", "&demiter", Abc_CommandAbc9Demiter, 0 );
1051  Cmd_CommandAdd( pAbc, "ABC9", "&fadds", Abc_CommandAbc9Fadds, 0 );
1052  Cmd_CommandAdd( pAbc, "ABC9", "&mfs", Abc_CommandAbc9Mfs, 0 );
1053 // Cmd_CommandAdd( pAbc, "ABC9", "&popart2", Abc_CommandAbc9PoPart2, 0 );
1054 // Cmd_CommandAdd( pAbc, "ABC9", "&cexcut", Abc_CommandAbc9CexCut, 0 );
1055 // Cmd_CommandAdd( pAbc, "ABC9", "&cexmerge", Abc_CommandAbc9CexMerge, 0 );
1056 // Cmd_CommandAdd( pAbc, "ABC9", "&cexmin", Abc_CommandAbc9CexMin, 0 );
1057 
1058  Cmd_CommandAdd( pAbc, "Abstraction", "&abs_derive", Abc_CommandAbc9AbsDerive, 0 );
1059  Cmd_CommandAdd( pAbc, "Abstraction", "&abs_refine", Abc_CommandAbc9AbsRefine, 0 );
1060  Cmd_CommandAdd( pAbc, "Abstraction", "&gla_derive", Abc_CommandAbc9GlaDerive, 0 );
1061  Cmd_CommandAdd( pAbc, "Abstraction", "&gla_refine", Abc_CommandAbc9GlaRefine, 0 );
1062  Cmd_CommandAdd( pAbc, "Abstraction", "&gla_shrink", Abc_CommandAbc9GlaShrink, 0 );
1063  Cmd_CommandAdd( pAbc, "Abstraction", "&gla", Abc_CommandAbc9Gla, 0 );
1064  Cmd_CommandAdd( pAbc, "Abstraction", "&vta", Abc_CommandAbc9Vta, 0 );
1065  Cmd_CommandAdd( pAbc, "Abstraction", "&vta_gla", Abc_CommandAbc9Vta2Gla, 0 );
1066  Cmd_CommandAdd( pAbc, "Abstraction", "&gla_vta", Abc_CommandAbc9Gla2Vta, 0 );
1067  Cmd_CommandAdd( pAbc, "Abstraction", "&fla_gla", Abc_CommandAbc9Fla2Gla, 0 );
1068  Cmd_CommandAdd( pAbc, "Abstraction", "&gla_fla", Abc_CommandAbc9Gla2Fla, 0 );
1069 
1070  Cmd_CommandAdd( pAbc, "Liveness", "l2s", Abc_CommandAbcLivenessToSafety, 0 );
1071  Cmd_CommandAdd( pAbc, "Liveness", "l2ssim", Abc_CommandAbcLivenessToSafetySim, 0 );
1072  Cmd_CommandAdd( pAbc, "Liveness", "l3s", Abc_CommandAbcLivenessToSafetyWithLTL, 0 );
1073  Cmd_CommandAdd( pAbc, "Liveness", "kcs", Abc_CommandCS_kLiveness, 0 );
1074  Cmd_CommandAdd( pAbc, "Liveness", "nck", Abc_CommandNChooseK, 0 );
1075 
1076  Cmd_CommandAdd( pAbc, "ABC9", "&test", Abc_CommandAbc9Test, 0 );
1077  {
1078 // extern Mf_ManTruthCount();
1079 // Mf_ManTruthCount();
1080  }
1081 
1082  {
1083  extern void Dar_LibStart();
1084  Dar_LibStart();
1085  }
1086  {
1087 // extern void Dau_DsdTest();
1088 // Dau_DsdTest();
1089 // extern void If_ManSatTest();
1090 // If_ManSatTest();
1091  }
1092 
1093 // if ( Sdm_ManCanRead() )
1094 // Sdm_ManRead();
1095 }
static int Abc_CommandPrintMffc(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1536
static int Abc_CommandPrintIo(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1353
static int Abc_CommandAbc9Append(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29511
static int Abc_CommandOutdec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10475
static int Abc_CommandDsdSave(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:15936
static int Abc_CommandComb(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6639
static int Abc_CommandAbc9Lf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:32787
static int Abc_CommandSuperChoiceLut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14892
static int Abc_CommandOrder(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8164
static int Abc_CommandNpnSave(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13055
static int Abc_CommandShowCut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2866
static int Abc_CommandAbc9Cone(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34961
static int Abc_CommandDsdPs(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16142
static int Abc_CommandAbc9Equiv2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27669
static int Abc_CommandShow(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2709
static int Abc_CommandFlowRetime(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:17400
static int Abc_CommandSendAig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13096
static int Abc_CommandEliminate(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3908
static int Abc_CommandBalance(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3145
static int Abc_CommandSat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21284
static int Abc_CommandAbc9MultiProve(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35420
static int Abc_CommandLogic(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6579
static int Abc_CommandInduction(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23280
static int Abc_CommandReconcile(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24478
static int Abc_CommandSop(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7871
static int Abc_CommandAbc9Unmap(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33408
static int Abc_CommandAbc9Trim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26957
static int Abc_CommandRecDump3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14150
static int Abc_CommandAbc9FFTest(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36146
static int Abc_CommandPrintSupport(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1749
static int Abc_CommandAbc9Miter2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29432
static int Abc_CommandTestCex(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24180
static int Abc_CommandAbc9Posplit(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34028
static int Abc_CommandAbc9Era(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33667
static int Abc_CommandTempor(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23139
static int Abc_CommandAbc9Test(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:38463
static int Abc_CommandAbc9GlaRefine(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:37589
static int Abc_CommandAbc9Sweep(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31040
static int Abc_CommandAddPi(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7448
static int Abc_CommandAbc9Load(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26067
static int Abc_CommandSeqSweep2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:18068
static int Abc_CommandDSat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21411
static int Abc_CommandDSec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20544
static int Abc_CommandCSweep(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12498
static int Abc_CommandAbc9Jf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:32461
static int Abc_CommandAbc9CFraig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30272
static int Abc_CommandCubeEnum(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20161
static int Abc_CommandNodeDup(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10551
static int Abc_CommandDouble(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10342
static int Abc_CommandReorder(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8048
static int Abc_CommandBm(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23837
static int Abc_CommandShortNames(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9103
static int Abc_CommandShowBdd(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2785
static int Abc_CommandIProve(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12600
static int Abc_CommandDRewrite(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11444
static int Abc_CommandSynch(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:19537
static int Abc_CommandInit(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16517
static int Abc_CommandSaucy(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24027
static int Abc_CommandAbc9Miter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29307
static int Abc_CommandTopAnd(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8955
static int Abc_CommandDFraig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12401
static int Abc_CommandAbc9BCore(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35874
static int Abc_CommandAbc9BackReach(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33936
static int Abc_CommandTestColor(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10627
static int Abc_CommandFrames(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7674
static int Abc_CommandAbc9Nf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33220
static int Abc_CommandGen(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9843
static int Abc_CommandSenseInput(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11162
static int Abc_CommandTrace(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:4991
static int Abc_CommandCut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9500
static int Abc_CommandNode(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8794
static int Abc_CommandAbc9Sopb(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31301
static int Abc_CommandDProve(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20680
static int Abc_CommandAbc9WriteVer(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26184
static int Abc_CommandRecStop3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14013
static int Abc_CommandVarMin(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6494
static int Abc_CommandBdd(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7929
static int Abc_CommandPrintGates(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2146
static int Abc_CommandAbc9SatTest(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36097
static int Abc_CommandFraig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13332
static int Abc_CommandQuaReach(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11064
static int Abc_CommandRecMerge3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14234
static int Abc_CommandAig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7991
static int Abc_CommandDsdMatch(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16234
static int Abc_CommandAbc9Read(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25392
static int Abc_CommandReach(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8513
static int Abc_CommandAbc9Equiv(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27551
static int Abc_CommandFraigStore(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13572
static int Abc_CommandIFraig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12281
static int Abc_CommandAbc9Times(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28121
static int Abc_CommandAbc9Vta(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:38038
static int Abc_CommandAbc9ReadVer(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25700
static int Abc_CommandUnfold(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23607
static int Abc_CommandExtWin(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:19810
static int Abc_CommandAbc9SpecI(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27467
static int Abc_CommandBmc2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:22163
static int Abc_CommandEnlarge(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23056
static int Abc_CommandDsdFilter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16416
static int Abc_CommandDropSat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7373
static int Abc_CommandPrintCone(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2430
static int Abc_CommandCover(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10148
static int Abc_CommandAbc9Syn3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29127
static int Abc_CommandAbc9ReachM(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34096
static int Abc_CommandAbc9ReadStg(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25627
static int Abc_CommandRetime(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:17104
static int Abc_CommandCubes(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8308
static int Abc_CommandCexMerge(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24800
static int Abc_CommandOrPos(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6964
static int Abc_CommandAbc9Synch2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29012
static int Abc_CommandIRewrite(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11371
static int Abc_CommandAbc9Ps(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26265
static int Abc_CommandAbc9Syn2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28919
static int Abc_CommandExdcSet(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9332
static int Abc_CommandExtSeqDcs(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8447
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
Definition: cmdApi.c:63
static int Abc_CommandRecPs3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14054
static int Abc_CommandPermute(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20023
static int Abc_CommandRenode(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3432
static int Abc_CommandAbc9ReadBlif(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25477
static int Abc_CommandMap(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14315
static int Abc_CommandAbc9EquivMark(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30700
static int Abc_CommandAbc9Retime(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28288
static int Abc_CommandMfs2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:4758
static int Abc_CommandQuaVar(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10882
static int Abc_CommandConstr(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23421
static int Abc_CommandDChoice(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11757
static int Abc_CommandPrintUnate(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1914
static int Abc_CommandAbc9Fla2Gla(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:38360
static int Abc_CommandAbc9Iso(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34758
static int Abc_CommandAbc9Dsdb(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31402
static int Abc_CommandAbc9Save(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26018
static int Abc_CommandAbc9GlaDerive(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:37528
static int Abc_CommandIResyn(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12130
static int Abc_CommandMulti(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3318
static int Abc_CommandPrintFactor(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1583
static int Abc_CommandAbc9Syn4(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29178
int Abc_CommandAbcLivenessToSafetySim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: liveness_sim.c:754
static int Abc_CommandIf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:15283
static int Abc_CommandPrintFanio(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1476
static int Abc_CommandAbc9Reduce(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30637
static int Abc_CommandAbc9PFan(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26365
static int Abc_CommandUnpermute(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20112
static int Abc_CommandAbc9ReachP(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34275
static int Abc_CommandAbc9Choice(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29889
static int Abc_CommandPdr(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24283
static int Abc_CommandAndPos(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7058
static int Abc_CommandAbc9Srm(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30352
static int Abc_CommandDc2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11673
int Abc_CommandAbcLivenessToSafetyWithLTL(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: liveness.c:2268
static int Abc_CommandResubstitute(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6085
static int Abc_CommandAbc9Fadds(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36887
static int Abc_CommandAbc9AbsRefine(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:37446
static int Abc_CommandAbc9Inse(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36488
int Abc_CommandCS_kLiveness(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: kliveness.c:525
static int Abc_CommandAbc9Resim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27402
static int Abc_CommandAbc9Maxi(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36583
static int Abc_CommandRecAdd3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14098
static int Abc_CommandFraigClean(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13688
static int Abc_CommandAbc9Undo(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34710
static int Abc_CommandTestRPO(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5689
static int Abc_CommandMuxes(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8247
static int Abc_CommandMatch(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21171
static int Abc_CommandRemovePo(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7292
static int Abc_CommandUnfold2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abciUnfold2.c:13
static int Abc_CommandQuaRel(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10969
static int Abc_CommandPrintDelay(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2625
static int Abc_CommandAbc9Gla2Fla(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:38411
static int Abc_CommandAbc9Status(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26468
static int Abc_CommandFraigRestore(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13628
static int Abc_CommandInsWin(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:19909
static int Abc_CommandFastExtract(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3753
static int Abc_CommandNpnLoad(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13015
static int Abc_CommandPrintLevel(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1660
static int Abc_CommandSimSec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21046
static int Abc_CommandDch(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11862
static int Abc_CommandSim3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:19171
static int Abc_CommandMuxStruct(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3250
static int Abc_CommandMoveNames(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9146
static int Abc_CommandAbc9Show(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26549
static int Abc_CommandDsdMerge(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16345
static int Abc_CommandGenFsm(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10014
static int Abc_CommandDebug(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21940
static int Abc_CommandAbc9Sat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29951
static int Abc_CommandAbc9Speedup(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33571
static int Abc_CommandAbc9Force(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31137
static int Abc_CommandCone(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8641
static int Abc_CommandAbc9GroupProve(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35345
static int Abc_CommandAbc9Sim3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27248
static int Abc_CommandDsdLoad(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16005
static int Abc_CommandBmc(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21991
static int Abc_CommandClockGate(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:19649
static int Abc_CommandAbc9Dc2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28408
static int Abc_CommandAbc9PoPart(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35172
static int Abc_CommandAbc9Qbf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36349
static int Abc_CommandPrintMiter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2485
static int Abc_CommandInter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10245
static int Abc_CommandSweep(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3689
static int Abc_CommandAppend(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7500
static int Abc_CommandSparsify(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:4161
static int Abc_CommandDisjoint(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:4041
static int Abc_CommandAbc9Trace(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33512
static int Abc_CommandFold2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abciUnfold2.c:124
static int Abc_CommandTestSeqSweep(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:18340
static int Abc_CommandExtract(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6413
static int Abc_CommandZero(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16682
static int Abc_CommandAbc9Enable(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28353
static int Abc_CommandAbc9Cof(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26871
static int Abc_CommandBm2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23917
static int Abc_CommandPrintXCut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2256
static int Abc_CommandPrintExdc(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1266
static int Abc_CommandAttach(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14773
static int Abc_CommandRecStart3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13897
static int Abc_CommandAbc9Put(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25874
static int Abc_CommandAbc9Dfs(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27038
static int Abc_CommandSeqCleanup(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:18742
static int Abc_CommandAbc9Fraig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30133
static int Abc_CommandMinisimp(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13309
static int Abc_CommandPowerdown(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5162
static int Abc_CommandStrash(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3064
static int Abc_CommandAbc9Vta2Gla(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:38240
static int Abc_CommandAbc9Srm2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30458
static int Abc_CommandCleanup(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:3601
static int Abc_CommandXsim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:18953
static int Abc_CommandUnmap(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14719
static int Abc_CommandAbc9SatEnum(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30066
static int Abc_CommandAbc9EquivFilter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30765
static int Abc_CommandAbc9Lcorr(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29660
static int Abc_CommandSpeedup(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5055
static int Abc_CommandLutpack(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:4241
static int Abc_CommandAbc9Slice(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35114
static ABC_NAMESPACE_IMPL_START int Abc_CommandPrintStats(Abc_Frame_t *pAbc, int argc, char **argv)
DECLARATIONS ///.
Definition: abc.c:1155
static int Abc_CommandPrintKMap(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2058
static int Abc_CommandBb2Wb(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10420
static int Abc_CommandAmap(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14539
static int Abc_CommandSplitSop(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8370
static int Abc_CommandAddBuffs(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5270
static int Abc_CommandDsdFree(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16086
static int Abc_CommandDrwsat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11989
static int Abc_CommandDFrames(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7761
int Abc_CommandNChooseK(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: kliveness.c:718
static int Abc_CommandMfs(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:4590
static int Abc_CommandAbc9If(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31693
static int Abc_CommandAbc9GlaShrink(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:37676
static int Abc_CommandAbc9ReachN(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34425
static int Abc_CommandAbc9Demiter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36833
static int Abc_CommandAbc9AbsDerive(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:37390
static int Abc_CommandAbc9Gla2Vta(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:38291
static int Abc_CommandExdcGet(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9279
static int Abc_CommandAbc9Kf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:32621
static int Abc_CommandAbc9Gla(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:37767
static int Abc_CommandAbc9Shrink(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28567
static int Abc_CommandAbc9SetRegNum(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26597
static int Abc_CommandISat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12198
static int Abc_CommandRestore(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13255
static int Abc_CommandSeqSweep(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:17874
static int Abc_CommandTopmost(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8870
static int Abc_CommandZeroPo(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7131
static int Abc_CommandBidec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:8106
static int Abc_CommandIndcut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:22865
static int Abc_CommandPrintSymms(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1834
static int Abc_CommandCexCut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24676
static int Abc_CommandCexLoad(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24631
static int Abc_CommandAbc9Cec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30811
static int Abc_CommandSwapPos(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7217
int Abc_CommandAbcLivenessToSafety(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: liveness.c:1254
static int Abc_CommandAbc9Cycle(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34897
static int Abc_CommandDarPhase(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:19388
static int Abc_CommandFraigDress(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13813
static int Abc_CommandAbc9Balance(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28736
static int Abc_CommandDemiter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6866
static int Abc_CommandAbc9Bmci(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36675
static int Abc_CommandTrim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9036
static int Abc_CommandAbc9Struct(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33454
static int Abc_CommandIfif(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:15811
static int Abc_CommandCRetime(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:17558
static int Abc_CommandLcorr(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:18614
static int Abc_CommandSendStatus(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13175
static int Abc_CommandDCec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20387
static int Abc_CommandUndc(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16747
static int Abc_CommandAbc9MuxProfile(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26508
static int Abc_CommandAbc9If2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:32280
static int Abc_CommandAbc9False(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29229
static int Abc_CommandFraigTrust(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13512
static int Abc_CommandAbc9ChainBmc(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35790
static int Abc_CommandOneHot(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:16837
static int Abc_CommandICut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11308
static int Abc_CommandAbc9Equiv3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27812
static int Abc_CommandCascade(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6315
static int Abc_CommandAbc9Fx(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28644
static int Abc_CommandSim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:19040
static int Abc_CommandAbc9ReachY(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34555
static int Abc_CommandAbc9PoXsim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36770
static int Abc_CommandAbc9Bidec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28511
static int Abc_CommandAbc9Verify(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30965
static int Abc_CommandLutmin(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:4389
static int Abc_CommandAbc9ReadCBlif(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25547
static int Abc_CommandAbc9Write(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26109
static int Abc_CommandDRefactor(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11552
static int Abc_CommandAbc9Topand(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26774
static int Abc_CommandSuperChoice(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:14829
static int Abc_CommandBlockPo(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25121
static int Abc_CommandAbc9Sim(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27112
static int Abc_CommandCollapse(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2964
static int Abc_CommandTestScorr(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:18504
static int Abc_CommandDRetime(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:17261
static int Abc_CommandAbc9Mfs(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:37025
static int Abc_CommandAbc9Get(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25776
static int Abc_CommandAbc9Scl(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29589
static int Abc_CommandAbc9SplitProve(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35552
static int Abc_CommandAbc9Flow(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31526
static int Abc_CommandAbc9Add1Hot(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26825
static int Abc_CommandAbc9Dsd(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28459
static int Abc_CommandAbc9Rpm(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33864
static int Abc_CommandPutOnTop(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:7583
static int Abc_CommandAbc9Flow2(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31607
static int Abc_CommandAbc9Semi(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:27982
static int Abc_CommandCycle(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:18861
static int Abc_CommandIRewriteSeq(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12057
static int Abc_CommandCareSet(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9416
static int Abc_CommandRewrite(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5765
static int Abc_CommandPrintSharing(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2204
static int Abc_CommandPSat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21605
static int Abc_CommandMiter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:6723
static int Abc_CommandAbc9BalanceLut(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28818
static int Abc_CommandAbc9Mf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33019
static int Abc_CommandPrintLatch(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1422
static int Abc_CommandAbc9ICheck(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:36003
void Dar_LibStart()
MACRO DEFINITIONS ///.
Definition: darLib.c:593
static int Abc_CommandBackup(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13222
static int Abc_CommandAbc9PSig(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26418
static int Abc_CommandTestDec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5497
static int Abc_CommandIStrash(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:11249
static int Abc_CommandTestNpn(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5587
static int Abc_CommandProve(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:21764
static int Abc_CommandFraigSweep(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13731
static int Abc_CommandBmc3(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:22353
static int Abc_CommandPrintDsd(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2308
static int Abc_CommandAbc9CexInfo(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:34844
static int Abc_CommandTest(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:10645
static int Abc_CommandAbSec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20939
static int Abc_CommandRefactor(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:5868
static int Abc_CommandExdcFree(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9223
static int Abc_CommandAbc9Frames(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:28179
static int Abc_CommandEspresso(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:9779
static int Abc_CommandAbc9Scorr(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:29767
static int Abc_CommandMinisat(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:13299
static int Abc_CommandAbc9Embed(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:31201
static int Abc_CommandAbc9Strash(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:26659
static int Abc_CommandAbc9Dch(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:33757
static int Abc_CommandBmcInter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:22634
static int Abc_CommandPrintStatus(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:2540
static int Abc_CommandPrintAuto(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:1981
static int Abc_CommandIso(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25205
static int Abc_CommandDualRail(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:25004
static int Abc_CommandFold(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:23762
static int Abc_CommandAbc9Iff(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:32225
static int Abc_CommandQbf(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:12909
static int Abc_CommandCexSave(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:24590
static int Abc_CommandAbc9Filter(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:30555
static int Abc_CommandAbc9Bmc(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:35658
static int Abc_CommandCec(Abc_Frame_t *pAbc, int argc, char **argv)
Definition: abc.c:20213
Abc_Ntk_t* Abc_NtkFromAigPhase ( Aig_Man_t pMan)

Function*************************************************************

Synopsis [Converts the network from the AIG manager into ABC.]

Description [This procedure should be called after seq sweeping, which changes the number of registers.]

SideEffects []

SeeAlso []

Definition at line 590 of file abcDar.c.

591 {
592  Vec_Ptr_t * vNodes;
593  Abc_Ntk_t * pNtkNew;
594  Abc_Obj_t * pObjNew;
595  Aig_Obj_t * pObj, * pObjLo, * pObjLi;
596  int i;
597  assert( pMan->nAsserts == 0 );
598  // perform strashing
599  pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
600  pNtkNew->nConstrs = pMan->nConstrs;
601  pNtkNew->nBarBufs = pMan->nBarBufs;
602  // duplicate the name and the spec
603 // pNtkNew->pName = Extra_UtilStrsav(pMan->pName);
604 // pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec);
605  Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew);
606  // create PIs
607  Aig_ManForEachPiSeq( pMan, pObj, i )
608  {
609  pObjNew = Abc_NtkCreatePi( pNtkNew );
610 // Abc_ObjAssignName( pObjNew, Abc_ObjName(pObjNew), NULL );
611  pObj->pData = pObjNew;
612  }
613  // create POs
614  Aig_ManForEachPoSeq( pMan, pObj, i )
615  {
616  pObjNew = Abc_NtkCreatePo( pNtkNew );
617 // Abc_ObjAssignName( pObjNew, Abc_ObjName(pObjNew), NULL );
618  pObj->pData = pObjNew;
619  }
620  assert( Abc_NtkCiNum(pNtkNew) == Aig_ManCiNum(pMan) - Aig_ManRegNum(pMan) );
621  assert( Abc_NtkCoNum(pNtkNew) == Aig_ManCoNum(pMan) - Aig_ManRegNum(pMan) );
622  // create as many latches as there are registers in the manager
623  Aig_ManForEachLiLoSeq( pMan, pObjLi, pObjLo, i )
624  {
625  pObjNew = Abc_NtkCreateLatch( pNtkNew );
626  pObjLi->pData = Abc_NtkCreateBi( pNtkNew );
627  pObjLo->pData = Abc_NtkCreateBo( pNtkNew );
628  Abc_ObjAddFanin( pObjNew, (Abc_Obj_t *)pObjLi->pData );
629  Abc_ObjAddFanin( (Abc_Obj_t *)pObjLo->pData, pObjNew );
630  Abc_LatchSetInit0( pObjNew );
631 // Abc_ObjAssignName( (Abc_Obj_t *)pObjLi->pData, Abc_ObjName((Abc_Obj_t *)pObjLi->pData), NULL );
632 // Abc_ObjAssignName( (Abc_Obj_t *)pObjLo->pData, Abc_ObjName((Abc_Obj_t *)pObjLo->pData), NULL );
633  }
634  // rebuild the AIG
635  vNodes = Aig_ManDfs( pMan, 1 );
636  Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
637  if ( Aig_ObjIsBuf(pObj) )
638  pObj->pData = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
639  else
640  pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkNew->pManFunc, (Abc_Obj_t *)Aig_ObjChild0Copy(pObj), (Abc_Obj_t *)Aig_ObjChild1Copy(pObj) );
641  Vec_PtrFree( vNodes );
642  // connect the PO nodes
643  Aig_ManForEachCo( pMan, pObj, i )
644  {
645  pObjNew = (Abc_Obj_t *)Aig_ObjChild0Copy(pObj);
646  Abc_ObjAddFanin( Abc_NtkCo(pNtkNew, i), pObjNew );
647  }
648 
649  Abc_NtkAddDummyPiNames( pNtkNew );
650  Abc_NtkAddDummyPoNames( pNtkNew );
651  Abc_NtkAddDummyBoxNames( pNtkNew );
652 
653  // check the resulting AIG
654  if ( !Abc_NtkCheck( pNtkNew ) )
655  Abc_Print( 1, "Abc_NtkFromAigPhase(): Network check has failed.\n" );
656  return pNtkNew;
657 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
void * pData
Definition: aig.h:87
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
DECLARATIONS ///.
Definition: abcAig.c:52
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:318
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition: abcNtk.c:50
static Abc_Obj_t * Abc_NtkCreateBo(Abc_Ntk_t *pNtk)
Definition: abc.h:306
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
static int Aig_ObjIsBuf(Aig_Obj_t *pObj)
Definition: aig.h:277
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:398
#define Aig_ManForEachLiLoSeq(p, pObjLi, pObjLo, k)
Definition: aig.h:450
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
static Aig_Obj_t * Aig_ObjChild1Copy(Aig_Obj_t *pObj)
Definition: aig.h:313
ABC_DLL void Abc_NtkAddDummyBoxNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:418
static Abc_Obj_t * Abc_NtkCreateLatch(Abc_Ntk_t *pNtk)
Definition: abc.h:309
Vec_Ptr_t * Aig_ManDfs(Aig_Man_t *p, int fNodesOnly)
Definition: aigDfs.c:145
Definition: aig.h:69
static Aig_Obj_t * Aig_ObjChild0Copy(Aig_Obj_t *pObj)
Definition: aig.h:312
static Abc_Obj_t * Abc_NtkCreatePi(Abc_Ntk_t *pNtk)
Definition: abc.h:303
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
int nBarBufs
Definition: abc.h:174
#define assert(ex)
Definition: util_old.h:213
static Abc_Obj_t * Abc_NtkCreateBi(Abc_Ntk_t *pNtk)
Definition: abc.h:305
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
#define Aig_ManForEachPoSeq(p, pObj, i)
Definition: aig.h:444
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:378
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
Definition: abc.h:418
static Abc_Obj_t * Abc_NtkCreatePo(Abc_Ntk_t *pNtk)
Definition: abc.h:304
#define Aig_ManForEachPiSeq(p, pObj, i)
SEQUENTIAL ITERATORS ///.
Definition: aig.h:438
int nConstrs
Definition: abc.h:173
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Aig_Man_t* Abc_NtkToDar ( Abc_Ntk_t pNtk,
int  fExors,
int  fRegisters 
)

Function*************************************************************

Synopsis [Converts the network from the AIG manager into ABC.]

Description [Assumes that registers are ordered after PIs/POs.]

SideEffects []

SeeAlso []

Definition at line 233 of file abcDar.c.

234 {
235  Vec_Ptr_t * vNodes;
236  Aig_Man_t * pMan;
237  Aig_Obj_t * pObjNew;
238  Abc_Obj_t * pObj;
239  int i, nNodes, nDontCares;
240  // make sure the latches follow PIs/POs
241  if ( fRegisters )
242  {
243  assert( Abc_NtkBoxNum(pNtk) == Abc_NtkLatchNum(pNtk) );
244  Abc_NtkForEachCi( pNtk, pObj, i )
245  if ( i < Abc_NtkPiNum(pNtk) )
246  {
247  assert( Abc_ObjIsPi(pObj) );
248  if ( !Abc_ObjIsPi(pObj) )
249  Abc_Print( 1, "Abc_NtkToDar(): Temporary bug: The PI ordering is wrong!\n" );
250  }
251  else
252  assert( Abc_ObjIsBo(pObj) );
253  Abc_NtkForEachCo( pNtk, pObj, i )
254  if ( i < Abc_NtkPoNum(pNtk) )
255  {
256  assert( Abc_ObjIsPo(pObj) );
257  if ( !Abc_ObjIsPo(pObj) )
258  Abc_Print( 1, "Abc_NtkToDar(): Temporary bug: The PO ordering is wrong!\n" );
259  }
260  else
261  assert( Abc_ObjIsBi(pObj) );
262  // print warning about initial values
263  nDontCares = 0;
264  Abc_NtkForEachLatch( pNtk, pObj, i )
265  if ( Abc_LatchIsInitDc(pObj) )
266  {
267  Abc_LatchSetInit0(pObj);
268  nDontCares++;
269  }
270  if ( nDontCares )
271  {
272  Abc_Print( 1, "Warning: %d registers in this network have don't-care init values.\n", nDontCares );
273  Abc_Print( 1, "The don't-care are assumed to be 0. The result may not verify.\n" );
274  Abc_Print( 1, "Use command \"print_latch\" to see the init values of registers.\n" );
275  Abc_Print( 1, "Use command \"zero\" to convert or \"init\" to change the values.\n" );
276  }
277  }
278  // create the manager
279  pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
280  pMan->fCatchExor = fExors;
281  pMan->nConstrs = pNtk->nConstrs;
282  pMan->nBarBufs = pNtk->nBarBufs;
283  pMan->pName = Extra_UtilStrsav( pNtk->pName );
284  pMan->pSpec = Extra_UtilStrsav( pNtk->pSpec );
285  // transfer the pointers to the basic nodes
286  Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)Aig_ManConst1(pMan);
287  Abc_NtkForEachCi( pNtk, pObj, i )
288  {
289  pObj->pCopy = (Abc_Obj_t *)Aig_ObjCreateCi(pMan);
290  // initialize logic level of the CIs
291  ((Aig_Obj_t *)pObj->pCopy)->Level = pObj->Level;
292  }
293  // complement the 1-values registers
294  if ( fRegisters ) {
295  Abc_NtkForEachLatch( pNtk, pObj, i )
296  if ( Abc_LatchIsInit1(pObj) )
297  Abc_ObjFanout0(pObj)->pCopy = Abc_ObjNot(Abc_ObjFanout0(pObj)->pCopy);
298  }
299  // perform the conversion of the internal nodes (assumes DFS ordering)
300 // pMan->fAddStrash = 1;
301  vNodes = Abc_NtkDfs( pNtk, 0 );
302  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
303 // Abc_NtkForEachNode( pNtk, pObj, i )
304  {
305  pObj->pCopy = (Abc_Obj_t *)Aig_And( pMan, (Aig_Obj_t *)Abc_ObjChild0Copy(pObj), (Aig_Obj_t *)Abc_ObjChild1Copy(pObj) );
306 // Abc_Print( 1, "%d->%d ", pObj->Id, ((Aig_Obj_t *)pObj->pCopy)->Id );
307  }
308  Vec_PtrFree( vNodes );
309  pMan->fAddStrash = 0;
310  // create the POs
311  Abc_NtkForEachCo( pNtk, pObj, i )
312  Aig_ObjCreateCo( pMan, (Aig_Obj_t *)Abc_ObjChild0Copy(pObj) );
313  // complement the 1-valued registers
314  Aig_ManSetRegNum( pMan, Abc_NtkLatchNum(pNtk) );
315  if ( fRegisters )
316  Aig_ManForEachLiSeq( pMan, pObjNew, i )
318  pObjNew->pFanin0 = Aig_Not(pObjNew->pFanin0);
319  // remove dangling nodes
320  nNodes = (Abc_NtkGetChoiceNum(pNtk) == 0)? Aig_ManCleanup( pMan ) : 0;
321  if ( !fExors && nNodes )
322  Abc_Print( 1, "Abc_NtkToDar(): Unexpected %d dangling nodes when converting to AIG!\n", nNodes );
323 //Aig_ManDumpVerilog( pMan, "test.v" );
324  // save the number of registers
325  if ( fRegisters )
326  {
327  Aig_ManSetRegNum( pMan, Abc_NtkLatchNum(pNtk) );
328  pMan->vFlopNums = Vec_IntStartNatural( pMan->nRegs );
329 // pMan->vFlopNums = NULL;
330 // pMan->vOnehots = Abc_NtkConverLatchNamesIntoNumbers( pNtk );
331  if ( pNtk->vOnehots )
332  pMan->vOnehots = (Vec_Ptr_t *)Vec_VecDupInt( (Vec_Vec_t *)pNtk->vOnehots );
333  }
334  if ( !Aig_ManCheck( pMan ) )
335  {
336  Abc_Print( 1, "Abc_NtkToDar: AIG check has failed.\n" );
337  Aig_ManStop( pMan );
338  return NULL;
339  }
340  return pMan;
341 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition: aigCheck.c:45
unsigned Level
Definition: aig.h:82
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
static int Abc_ObjIsBo(Abc_Obj_t *pObj)
Definition: abc.h:350
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
Definition: abc.h:289
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static int Abc_ObjIsPi(Abc_Obj_t *pObj)
Definition: abc.h:347
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
static Vec_Int_t * Vec_IntStartNatural(int nSize)
Definition: bblif.c:192
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
unsigned Level
Definition: abc.h:142
char * Extra_UtilStrsav(const char *s)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:318
static Vec_Vec_t * Vec_VecDupInt(Vec_Vec_t *p)
Definition: vecVec.h:395
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
Abc_Obj_t * pCopy
Definition: abc.h:148
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
Definition: aigMan.c:438
static int Abc_LatchIsInitDc(Abc_Obj_t *pLatch)
Definition: abc.h:424
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
static int Abc_LatchIsInit1(Abc_Obj_t *pLatch)
Definition: abc.h:423
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static int Abc_ObjIsBi(Abc_Obj_t *pObj)
Definition: abc.h:349
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
static int Abc_ObjIsPo(Abc_Obj_t *pObj)
Definition: abc.h:348
#define assert(ex)
Definition: util_old.h:213
#define Aig_ManForEachLiSeq(p, pObj, i)
Definition: aig.h:447
static Abc_Obj_t * Abc_ObjNot(Abc_Obj_t *p)
Definition: abc.h:324
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
Definition: abc.h:418
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
static int Gia_ManCompareWithBest ( Gia_Man_t pBest,
Gia_Man_t p,
int *  pnBestLuts,
int *  pnBestEdges,
int *  pnBestLevels 
)
inlinestatic

Function*************************************************************

Synopsis [Compares to versions of the design and finds the best.]

Description []

SideEffects []

SeeAlso []

Definition at line 25987 of file abc.c.

25988 {
25989  int nCurLuts, nCurEdges, nCurLevels;
25990  Gia_ManLutParams( p, &nCurLuts, &nCurEdges, &nCurLevels );
25991  if ( pBest == NULL ||
25992  Gia_ManPiNum(pBest) != Gia_ManPiNum(p) ||
25993  Gia_ManPoNum(pBest) != Gia_ManPoNum(p) ||
25994  Gia_ManRegNum(pBest) != Gia_ManRegNum(p) ||
25995  strcmp(Gia_ManName(pBest), Gia_ManName(p)) ||
25996  (*pnBestLevels > nCurLevels) ||
25997  (*pnBestLevels == nCurLevels && 2*(*pnBestLuts) + *pnBestEdges > 2*nCurLuts + nCurEdges) )
25998  {
25999  *pnBestLuts = nCurLuts;
26000  *pnBestEdges = nCurEdges;
26001  *pnBestLevels = nCurLevels;
26002  return 1;
26003  }
26004  return 0;
26005 }
static int Gia_ManPoNum(Gia_Man_t *p)
Definition: gia.h:386
static char * Gia_ManName(Gia_Man_t *p)
Definition: gia.h:382
void Gia_ManLutParams(Gia_Man_t *p, int *pnCurLuts, int *pnCurEdges, int *pnCurLevels)
Definition: giaIf.c:195
int strcmp()
static int Gia_ManPiNum(Gia_Man_t *p)
Definition: gia.h:385
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387