Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
75d6d6ab
Commit
75d6d6ab
authored
Sep 12, 2008
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version abc80912
parent
4db86550
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
294 additions
and
22 deletions
+294
-22
abc.dsp
+4
-0
abc.rc
+2
-2
src/aig/fra/fraSec.c
+12
-3
src/aig/saig/saig.h
+1
-0
src/aig/saig/saigMiter.c
+35
-0
src/aig/saig/saigSynch.c
+0
-0
src/aig/ssw/sswCore.c
+3
-2
src/aig/ssw/sswMan.c
+5
-5
src/aig/ssw/sswSimSat.c
+17
-4
src/aig/ssw/sswSweep.c
+7
-1
src/base/abci/abc.c
+121
-2
src/base/abci/abcDar.c
+65
-0
src/base/io/ioReadBlifMv.c
+2
-2
src/bdd/parse/parseCore.c
+20
-1
No files found.
abc.dsp
View file @
75d6d6ab
...
...
@@ -3306,6 +3306,10 @@ SOURCE=.\src\aig\saig\saigScl.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\saig\saigSynch.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\saig\saigTrans.c
# End Source File
# End Group
...
...
abc.rc
View file @
75d6d6ab
# global parameters
#set check # checks intermediate networks
#set checkfio # prints warnings when fanins/fanouts are duplicated
#
set checkread # checks new networks after reading from file
#
set backup # saves backup networks retrived by "undo" and "recall"
set checkread # checks new networks after reading from file
set backup # saves backup networks retrived by "undo" and "recall"
set savesteps 1 # sets the maximum number of backup networks to save
set progressbar # display the progress bar
...
...
src/aig/fra/fraSec.c
View file @
75d6d6ab
...
...
@@ -21,6 +21,7 @@
#include "fra.h"
#include "ioa.h"
#include "int.h"
#include "ssw.h"
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
...
...
@@ -75,6 +76,7 @@ void Fra_SecSetDefaultParams( Fra_Sec_t * p )
***********************************************************************/
int
Fra_FraigSec
(
Aig_Man_t
*
p
,
Fra_Sec_t
*
pParSec
)
{
Ssw_Pars_t
Pars2
,
*
pPars2
=
&
Pars2
;
Fra_Ssw_t
Pars
,
*
pPars
=
&
Pars
;
Fra_Sml_t
*
pSml
;
Aig_Man_t
*
pNew
,
*
pTemp
;
...
...
@@ -90,6 +92,8 @@ int Fra_FraigSec( Aig_Man_t * p, Fra_Sec_t * pParSec )
goto
finish
;
// prepare parameters
Ssw_ManSetDefaultParams
(
pPars2
);
// prepare parameters
memset
(
pPars
,
0
,
sizeof
(
Fra_Ssw_t
)
);
pPars
->
fLatchCorr
=
fLatchCorr
;
pPars
->
fVerbose
=
pParSec
->
fVeryVerbose
;
...
...
@@ -288,12 +292,17 @@ PRT( "Time", clock() - clk );
goto
finish
;
}
}
clk
=
clock
();
pPars
->
nFramesK
=
nFrames
;
pPars
->
TimeLimit
=
TimeLeft
;
pPars
->
fSilent
=
pParSec
->
fSilent
;
pNew
=
Fra_FraigInduction
(
pTemp
=
pNew
,
pPars
);
// pNew = Fra_FraigInduction( pTemp = pNew, pPars );
pPars2
->
nFramesK
=
nFrames
;
pPars2
->
nBTLimit
=
1000
*
nFrames
;
Aig_ManSetRegNum
(
pNew
,
pNew
->
nRegs
);
pNew
=
Ssw_SignalCorrespondence
(
pTemp
=
pNew
,
pPars2
);
if
(
pNew
==
NULL
)
{
pNew
=
pTemp
;
...
...
@@ -306,7 +315,7 @@ clk = clock();
if
(
pParSec
->
fVerbose
)
{
printf
(
"K-step (K=%2d,I=%3d): Latches = %5d. Nodes = %6d. "
,
nFrames
,
pPars
->
nIters
,
Aig_ManRegNum
(
pNew
),
Aig_ManNodeNum
(
pNew
)
);
nFrames
,
pPars
2
->
nIters
,
Aig_ManRegNum
(
pNew
),
Aig_ManNodeNum
(
pNew
)
);
PRT
(
"Time"
,
clock
()
-
clk
);
}
if
(
RetValue
!=
-
1
)
...
...
src/aig/saig/saig.h
View file @
75d6d6ab
...
...
@@ -89,6 +89,7 @@ extern Aig_Man_t * Saig_ManReadBlif( char * pFileName );
extern
int
Saig_Interpolate
(
Aig_Man_t
*
pAig
,
Inter_ManParams_t
*
pPars
,
int
*
pDepth
);
/*=== saigMiter.c ==========================================================*/
extern
Aig_Man_t
*
Saig_ManCreateMiter
(
Aig_Man_t
*
p1
,
Aig_Man_t
*
p2
,
int
Oper
);
extern
Aig_Man_t
*
Saig_ManDupInitZero
(
Aig_Man_t
*
p
);
/*=== saigPhase.c ==========================================================*/
extern
Aig_Man_t
*
Saig_ManPhaseAbstract
(
Aig_Man_t
*
p
,
Vec_Int_t
*
vInits
,
int
nFrames
,
int
fIgnore
,
int
fPrint
,
int
fVerbose
);
/*=== saigRetFwd.c ==========================================================*/
...
...
src/aig/saig/saigMiter.c
View file @
75d6d6ab
...
...
@@ -48,6 +48,7 @@ Aig_Man_t * Saig_ManCreateMiter( Aig_Man_t * p1, Aig_Man_t * p2, int Oper )
assert
(
Saig_ManPiNum
(
p1
)
==
Saig_ManPiNum
(
p2
)
);
assert
(
Saig_ManPoNum
(
p1
)
==
Saig_ManPoNum
(
p2
)
);
pNew
=
Aig_ManStart
(
Aig_ManObjNumMax
(
p1
)
+
Aig_ManObjNumMax
(
p2
)
);
pNew
->
pName
=
Aig_UtilStrsav
(
"miter"
);
// map constant nodes
Aig_ManConst1
(
p1
)
->
pData
=
Aig_ManConst1
(
pNew
);
Aig_ManConst1
(
p2
)
->
pData
=
Aig_ManConst1
(
pNew
);
...
...
@@ -88,6 +89,40 @@ Aig_Man_t * Saig_ManCreateMiter( Aig_Man_t * p1, Aig_Man_t * p2, int Oper )
return
pNew
;
}
/**Function*************************************************************
Synopsis [Duplicates the AIG to have constant-0 initial state.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Aig_Man_t
*
Saig_ManDupInitZero
(
Aig_Man_t
*
p
)
{
Aig_Man_t
*
pNew
;
Aig_Obj_t
*
pObj
;
int
i
;
pNew
=
Aig_ManStart
(
Aig_ManObjNumMax
(
p
)
);
pNew
->
pName
=
Aig_UtilStrsav
(
p
->
pName
);
Aig_ManConst1
(
p
)
->
pData
=
Aig_ManConst1
(
pNew
);
Saig_ManForEachPi
(
p
,
pObj
,
i
)
pObj
->
pData
=
Aig_ObjCreatePi
(
pNew
);
Saig_ManForEachLo
(
p
,
pObj
,
i
)
pObj
->
pData
=
Aig_NotCond
(
Aig_ObjCreatePi
(
pNew
),
pObj
->
fMarkA
);
Aig_ManForEachNode
(
p
,
pObj
,
i
)
pObj
->
pData
=
Aig_And
(
pNew
,
Aig_ObjChild0Copy
(
pObj
),
Aig_ObjChild1Copy
(
pObj
)
);
Saig_ManForEachPo
(
p
,
pObj
,
i
)
pObj
->
pData
=
Aig_ObjCreatePo
(
pNew
,
Aig_ObjChild0Copy
(
pObj
)
);
Saig_ManForEachLi
(
p
,
pObj
,
i
)
pObj
->
pData
=
Aig_ObjCreatePo
(
pNew
,
Aig_NotCond
(
Aig_ObjChild0Copy
(
pObj
),
pObj
->
fMarkA
)
);
Aig_ManSetRegNum
(
pNew
,
Saig_ManRegNum
(
p
)
);
assert
(
Aig_ManNodeNum
(
pNew
)
==
Aig_ManNodeNum
(
p
)
);
return
pNew
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
...
...
src/aig/saig/saigSynch.c
0 → 100644
View file @
75d6d6ab
This diff is collapsed.
Click to expand it.
src/aig/ssw/sswCore.c
View file @
75d6d6ab
...
...
@@ -139,8 +139,9 @@ clk = clock();
printf
(
"%3d : Const = %6d. Cl = %6d. LR = %6d. NR = %6d. F = %5d. "
,
nIter
,
Ssw_ClassesCand1Num
(
p
->
ppClasses
),
Ssw_ClassesClassNum
(
p
->
ppClasses
),
p
->
nConstrReduced
,
Aig_ManNodeNum
(
p
->
pFrames
),
p
->
nSatFailsReal
);
printf
(
"Use = %5d. Skip = %5d. "
,
p
->
nRefUse
,
p
->
nRefSkip
);
if
(
p
->
pPars
->
fSkipCheck
)
printf
(
"Use = %5d. Skip = %5d. "
,
p
->
nRefUse
,
p
->
nRefSkip
);
PRT
(
"T"
,
clock
()
-
clk
);
}
Ssw_ManCleanup
(
p
);
...
...
src/aig/ssw/sswMan.c
View file @
75d6d6ab
...
...
@@ -47,14 +47,14 @@ Ssw_Man_t * Ssw_ManCreate( Aig_Man_t * pAig, Ssw_Pars_t * pPars )
Aig_ManFanoutStart
(
pAig
);
Aig_ManSetPioNumbers
(
pAig
);
// create interpolation manager
p
=
ALLOC
(
Ssw_Man_t
,
1
);
p
=
ALLOC
(
Ssw_Man_t
,
1
);
memset
(
p
,
0
,
sizeof
(
Ssw_Man_t
)
);
p
->
pPars
=
pPars
;
p
->
pAig
=
pAig
;
p
->
nFrames
=
pPars
->
nFramesK
+
1
;
p
->
pNodeToFraig
=
CALLOC
(
Aig_Obj_t
*
,
Aig_ManObjNumMax
(
p
->
pAig
)
*
p
->
nFrames
);
// SAT solving
p
->
pSatVars
=
CALLOC
(
int
,
Aig_ManObjNumMax
(
p
->
pAig
)
*
p
->
nFrames
);
p
->
pSatVars
=
CALLOC
(
int
,
Aig_ManObjNumMax
(
p
->
pAig
)
*
(
p
->
nFrames
+
1
)
);
p
->
vFanins
=
Vec_PtrAlloc
(
100
);
p
->
vSimRoots
=
Vec_PtrAlloc
(
1000
);
p
->
vSimClasses
=
Vec_PtrAlloc
(
1000
);
...
...
@@ -99,8 +99,8 @@ void Ssw_ManPrintStats( Ssw_Man_t * p )
{
double
nMemory
=
1
.
0
*
Aig_ManObjNumMax
(
p
->
pAig
)
*
p
->
nFrames
*
(
2
*
sizeof
(
int
)
+
2
*
sizeof
(
void
*
))
/
(
1
<<
20
);
printf
(
"Parameters: F
r = %d. C-limit
= %d. Constr = %d. SkipCheck = %d. MaxLev = %d. Mem = %0.2f Mb.
\n
"
,
p
->
pPars
->
nFramesK
,
p
->
pPars
->
nBTLimit
,
p
->
pPars
->
nConstrs
,
p
->
pPars
->
fSkipCheck
,
p
->
pPars
->
nMaxLevs
,
nMemory
);
printf
(
"Parameters: F
= %d. AddF = %d. C-lim
= %d. Constr = %d. SkipCheck = %d. MaxLev = %d. Mem = %0.2f Mb.
\n
"
,
p
->
pPars
->
nFramesK
,
p
->
pPars
->
n
FramesAddSim
,
p
->
pPars
->
n
BTLimit
,
p
->
pPars
->
nConstrs
,
p
->
pPars
->
fSkipCheck
,
p
->
pPars
->
nMaxLevs
,
nMemory
);
printf
(
"AIG : PI = %d. PO = %d. Latch = %d. Node = %d. Ave SAT vars = %d.
\n
"
,
Saig_ManPiNum
(
p
->
pAig
),
Saig_ManPoNum
(
p
->
pAig
),
Saig_ManRegNum
(
p
->
pAig
),
Aig_ManNodeNum
(
p
->
pAig
),
p
->
nSatVarsTotal
/
p
->
pPars
->
nIters
);
...
...
@@ -149,7 +149,7 @@ void Ssw_ManCleanup( Ssw_Man_t * p )
p
->
nSatVarsTotal
+=
p
->
pSat
->
size
;
sat_solver_delete
(
p
->
pSat
);
p
->
pSat
=
NULL
;
memset
(
p
->
pSatVars
,
0
,
sizeof
(
int
)
*
Aig_ManObjNumMax
(
p
->
pAig
)
*
p
->
nFrames
);
memset
(
p
->
pSatVars
,
0
,
sizeof
(
int
)
*
Aig_ManObjNumMax
(
p
->
pAig
)
*
(
p
->
nFrames
+
1
)
);
}
p
->
nConstrTotal
=
0
;
p
->
nConstrReduced
=
0
;
...
...
src/aig/ssw/sswSimSat.c
View file @
75d6d6ab
...
...
@@ -234,7 +234,6 @@ void Ssw_ManResimulateCexTotal( Ssw_Man_t * p, Aig_Obj_t * pCand, Aig_Obj_t * pR
// set the PI simulation information
Aig_ManConst1
(
p
->
pAig
)
->
fMarkB
=
1
;
Aig_ManForEachPi
(
p
->
pAig
,
pObj
,
i
)
// pObj->fMarkB = Ssw_ManOriginalPiValue( p, pObj, f );
pObj
->
fMarkB
=
Aig_InfoHasBit
(
p
->
pPatWords
,
i
);
// simulate internal nodes
Aig_ManForEachNode
(
p
->
pAig
,
pObj
,
i
)
...
...
@@ -244,10 +243,18 @@ void Ssw_ManResimulateCexTotal( Ssw_Man_t * p, Aig_Obj_t * pCand, Aig_Obj_t * pR
RetValue1
=
Ssw_ClassesRefineConst1
(
p
->
ppClasses
,
0
);
RetValue2
=
Ssw_ClassesRefine
(
p
->
ppClasses
,
0
);
// make sure refinement happened
if
(
Aig_ObjIsConst1
(
pRepr
)
)
if
(
Aig_ObjIsConst1
(
pRepr
)
)
{
assert
(
RetValue1
);
if
(
RetValue1
==
0
)
printf
(
"
\n
Ssw_ManResimulateCexTotal() Error: RetValue1 does not hold.
\n
"
);
}
else
{
assert
(
RetValue2
);
if
(
RetValue2
==
0
)
printf
(
"
\n
Ssw_ManResimulateCexTotal() Error: RetValue2 does not hold.
\n
"
);
}
p
->
timeSimSat
+=
clock
()
-
clk
;
}
...
...
@@ -266,8 +273,6 @@ p->timeSimSat += clock() - clk;
void
Ssw_ManResimulateCexTotalSim
(
Ssw_Man_t
*
p
,
Aig_Obj_t
*
pCand
,
Aig_Obj_t
*
pRepr
,
int
f
)
{
int
RetValue1
,
RetValue2
,
clk
=
clock
();
// save the counter-example
// Ssw_SmlSavePatternAig( p, f );
// set the PI simulation information
Ssw_SmlAssignDist1Plus
(
p
->
pSml
,
p
->
pPatWords
);
// simulate internal nodes
...
...
@@ -277,9 +282,17 @@ void Ssw_ManResimulateCexTotalSim( Ssw_Man_t * p, Aig_Obj_t * pCand, Aig_Obj_t *
RetValue2
=
Ssw_ClassesRefine
(
p
->
ppClasses
,
1
);
// make sure refinement happened
if
(
Aig_ObjIsConst1
(
pRepr
)
)
{
assert
(
RetValue1
);
if
(
RetValue1
==
0
)
printf
(
"
\n
Ssw_ManResimulateCexTotalSim() Error: RetValue1 does not hold.
\n
"
);
}
else
{
assert
(
RetValue2
);
if
(
RetValue2
==
0
)
printf
(
"
\n
Ssw_ManResimulateCexTotalSim() Error: RetValue2 does not hold.
\n
"
);
}
p
->
timeSimSat
+=
clock
()
-
clk
;
}
...
...
src/aig/ssw/sswSweep.c
View file @
75d6d6ab
...
...
@@ -222,6 +222,7 @@ clk = clock();
p
->
fRefined
=
0
;
if
(
p
->
pPars
->
fVerbose
)
pProgress
=
Bar_ProgressStart
(
stdout
,
Aig_ManObjNumMax
(
p
->
pAig
)
*
p
->
pPars
->
nFramesK
);
Ssw_ManStartSolver
(
p
);
for
(
f
=
0
;
f
<
p
->
pPars
->
nFramesK
;
f
++
)
{
// map constants and PIs
...
...
@@ -241,8 +242,13 @@ clk = clock();
if
(
f
==
p
->
pPars
->
nFramesK
-
1
)
break
;
// transfer latch input to the latch outputs
// build logic cones for register outputs
Saig_ManForEachLiLo
(
p
->
pAig
,
pObjLi
,
pObjLo
,
i
)
Ssw_ObjSetFraig
(
p
,
pObjLo
,
f
+
1
,
Ssw_ObjChild0Fra
(
p
,
pObjLi
,
f
)
);
{
pObjNew
=
Ssw_ObjChild0Fra
(
p
,
pObjLi
,
f
);
Ssw_ObjSetFraig
(
p
,
pObjLo
,
f
+
1
,
pObjNew
);
Ssw_CnfNodeAddToSolver
(
p
,
Aig_Regular
(
pObjNew
)
);
}
}
if
(
p
->
pPars
->
fVerbose
)
Bar_ProgressStop
(
pProgress
);
...
...
src/base/abci/abc.c
View file @
75d6d6ab
...
...
@@ -199,6 +199,7 @@ static int Abc_CommandCycle ( Abc_Frame_t * pAbc, int argc, char ** arg
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_CommandDarPhase
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSynch
(
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
);
...
...
@@ -463,6 +464,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Sequential"
,
"xsim"
,
Abc_CommandXsim
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Sequential"
,
"sim"
,
Abc_CommandSim
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Sequential"
,
"phase"
,
Abc_CommandDarPhase
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Sequential"
,
"synch"
,
Abc_CommandSynch
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"cec"
,
Abc_CommandCec
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"dcec"
,
Abc_CommandDCec
,
0
);
...
...
@@ -4862,7 +4864,6 @@ int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew
=
argc
-
globalUtilOptind
;
if
(
!
Abc_NtkPrepareTwoNtks
(
pErr
,
pNtk
,
pArgvNew
,
nArgcNew
,
&
pNtk1
,
&
pNtk2
,
&
fDelete1
,
&
fDelete2
)
)
return
1
;
// compute the miter
pNtkRes
=
Abc_NtkMiter
(
pNtk1
,
pNtk2
,
fComb
,
nPartSize
,
fImplic
,
fMulti
);
if
(
fDelete1
)
Abc_NtkDelete
(
pNtk1
);
...
...
@@ -14424,6 +14425,121 @@ usage:
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandSynch
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
FILE
*
pOut
,
*
pErr
;
Abc_Ntk_t
*
pNtkRes
,
*
pNtk1
,
*
pNtk2
,
*
pNtk
;
char
**
pArgvNew
;
int
nArgcNew
;
int
fDelete1
,
fDelete2
;
int
c
;
int
nWords
;
int
fVerbose
;
extern
Abc_Ntk_t
*
Abc_NtkDarSynch
(
Abc_Ntk_t
*
pNtk1
,
Abc_Ntk_t
*
pNtk2
,
int
nWords
,
int
fVerbose
);
extern
Abc_Ntk_t
*
Abc_NtkDarSynchOne
(
Abc_Ntk_t
*
pNtk
,
int
nWords
,
int
fVerbose
);
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
pOut
=
Abc_FrameReadOut
(
pAbc
);
pErr
=
Abc_FrameReadErr
(
pAbc
);
// set defaults
nWords
=
32
;
fVerbose
=
1
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Wvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'W'
:
if
(
globalUtilOptind
>=
argc
)
{
fprintf
(
pErr
,
"Command line switch
\"
-W
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nWords
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nWords
<=
0
)
goto
usage
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
pArgvNew
=
argv
+
globalUtilOptind
;
nArgcNew
=
argc
-
globalUtilOptind
;
if
(
nArgcNew
==
0
)
{
if
(
pNtk
==
NULL
)
{
fprintf
(
pErr
,
"Empty network.
\n
"
);
return
1
;
}
pNtkRes
=
Abc_NtkDarSynchOne
(
pNtk
,
nWords
,
fVerbose
);
}
else
{
if
(
!
Abc_NtkPrepareTwoNtks
(
pErr
,
pNtk
,
pArgvNew
,
nArgcNew
,
&
pNtk1
,
&
pNtk2
,
&
fDelete1
,
&
fDelete2
)
)
return
1
;
if
(
Abc_NtkLatchNum
(
pNtk1
)
==
0
||
Abc_NtkLatchNum
(
pNtk2
)
==
0
)
{
if
(
fDelete1
)
Abc_NtkDelete
(
pNtk1
);
if
(
fDelete2
)
Abc_NtkDelete
(
pNtk2
);
printf
(
"The network has no latches..
\n
"
);
return
0
;
}
// modify the current network
pNtkRes
=
Abc_NtkDarSynch
(
pNtk1
,
pNtk2
,
nWords
,
fVerbose
);
if
(
fDelete1
)
Abc_NtkDelete
(
pNtk1
);
if
(
fDelete2
)
Abc_NtkDelete
(
pNtk2
);
}
if
(
pNtkRes
==
NULL
)
{
fprintf
(
pErr
,
"Synchronization has failed.
\n
"
);
return
0
;
}
// replace the current network
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
return
0
;
usage:
fprintf
(
pErr
,
"usage: synch [-W <num>] [-vh] <file1> <file2>
\n
"
);
fprintf
(
pErr
,
"
\t
derives and applies synchronization sequence
\n
"
);
fprintf
(
pErr
,
"
\t
-W num : the number of simulation words [default = %d]
\n
"
,
nWords
);
fprintf
(
pErr
,
"
\t
-v : toggle verbose output [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
fprintf
(
pErr
,
"
\t
-h : print the command usage
\n
"
);
fprintf
(
pErr
,
"
\t
file1 : (optional) the file with the first design
\n
"
);
fprintf
(
pErr
,
"
\t
file2 : (optional) the file with the second design
\n\n
"
);
fprintf
(
pErr
,
"
\t
If no designs are given on the command line,
\n
"
);
fprintf
(
pErr
,
"
\t
assumes the current network has no initial state,
\n
"
);
fprintf
(
pErr
,
"
\t
derives synchronization sequence and applies it.
\n\n
"
);
fprintf
(
pErr
,
"
\t
If two designs are given on the command line
\n
"
);
fprintf
(
pErr
,
"
\t
assumes both of them have no initial state,
\n
"
);
fprintf
(
pErr
,
"
\t
derives sequences for both designs, synchorinizes
\n
"
);
fprintf
(
pErr
,
"
\t
them, and creates SEC miter comparing two designs.
\n\n
"
);
fprintf
(
pErr
,
"
\t
If only one design is given on the command line,
\n
"
);
fprintf
(
pErr
,
"
\t
considers the second design to be the current network,
\n
"
);
fprintf
(
pErr
,
"
\t
and derives SEC miter for them, as described above.
\n
"
);
return
1
;
}
/**Function*************************************************************
...
...
@@ -14842,6 +14958,8 @@ int Abc_CommandSec( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
Abc_NtkLatchNum
(
pNtk1
)
==
0
||
Abc_NtkLatchNum
(
pNtk2
)
==
0
)
{
if
(
fDelete1
)
Abc_NtkDelete
(
pNtk1
);
if
(
fDelete2
)
Abc_NtkDelete
(
pNtk2
);
printf
(
"The network has no latches. Used combinational command
\"
cec
\"
.
\n
"
);
return
0
;
}
...
...
@@ -14960,9 +15078,10 @@ int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
nArgcNew
=
argc
-
globalUtilOptind
;
if
(
!
Abc_NtkPrepareTwoNtks
(
pErr
,
pNtk
,
pArgvNew
,
nArgcNew
,
&
pNtk1
,
&
pNtk2
,
&
fDelete1
,
&
fDelete2
)
)
return
1
;
if
(
Abc_NtkLatchNum
(
pNtk1
)
==
0
||
Abc_NtkLatchNum
(
pNtk2
)
==
0
)
{
if
(
fDelete1
)
Abc_NtkDelete
(
pNtk1
);
if
(
fDelete2
)
Abc_NtkDelete
(
pNtk2
);
printf
(
"The network has no latches. Used combinational command
\"
cec
\"
.
\n
"
);
return
0
;
}
...
...
src/base/abci/abcDar.c
View file @
75d6d6ab
...
...
@@ -2195,6 +2195,71 @@ Abc_Ntk_t * Abc_NtkPhaseAbstract( Abc_Ntk_t * pNtk, int nFrames, int fIgnore, in
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkDarSynchOne
(
Abc_Ntk_t
*
pNtk
,
int
nWords
,
int
fVerbose
)
{
extern
Aig_Man_t
*
Saig_SynchSequenceApply
(
Aig_Man_t
*
pAig
,
int
nWords
,
int
fVerbose
);
Abc_Ntk_t
*
pNtkAig
;
Aig_Man_t
*
pMan
,
*
pTemp
;
pMan
=
Abc_NtkToDar
(
pNtk
,
0
,
1
);
if
(
pMan
==
NULL
)
return
NULL
;
pMan
=
Saig_SynchSequenceApply
(
pTemp
=
pMan
,
nWords
,
fVerbose
);
Aig_ManStop
(
pTemp
);
if
(
pMan
==
NULL
)
return
NULL
;
pNtkAig
=
Abc_NtkFromDar
(
pNtk
,
pMan
);
Aig_ManStop
(
pMan
);
return
pNtkAig
;
}
/**Function*************************************************************
Synopsis [Performs phase abstraction.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkDarSynch
(
Abc_Ntk_t
*
pNtk1
,
Abc_Ntk_t
*
pNtk2
,
int
nWords
,
int
fVerbose
)
{
extern
Aig_Man_t
*
Saig_Synchronize
(
Aig_Man_t
*
pAig1
,
Aig_Man_t
*
pAig2
,
int
nWords
,
int
fVerbose
);
Abc_Ntk_t
*
pNtkAig
;
Aig_Man_t
*
pMan1
,
*
pMan2
,
*
pMan
;
pMan1
=
Abc_NtkToDar
(
pNtk1
,
0
,
1
);
if
(
pMan1
==
NULL
)
return
NULL
;
pMan2
=
Abc_NtkToDar
(
pNtk2
,
0
,
1
);
if
(
pMan2
==
NULL
)
{
Aig_ManStop
(
pMan1
);
return
NULL
;
}
pMan
=
Saig_Synchronize
(
pMan1
,
pMan2
,
nWords
,
fVerbose
);
Aig_ManStop
(
pMan1
);
Aig_ManStop
(
pMan2
);
if
(
pMan
==
NULL
)
return
NULL
;
pNtkAig
=
Abc_NtkFromAigPhase
(
pMan
);
pNtkAig
->
pName
=
Extra_UtilStrsav
(
"miter"
);
pNtkAig
->
pSpec
=
NULL
;
Aig_ManStop
(
pMan
);
return
pNtkAig
;
}
/**Function*************************************************************
Synopsis [Performs phase abstraction.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t
*
Abc_NtkDarFrames
(
Abc_Ntk_t
*
pNtk
,
int
nPrefix
,
int
nFrames
,
int
fInit
,
int
fVerbose
)
{
Abc_Ntk_t
*
pNtkAig
;
...
...
src/base/io/ioReadBlifMv.c
View file @
75d6d6ab
...
...
@@ -146,7 +146,7 @@ Abc_Ntk_t * Io_ReadBlifMv( char * pFileName, int fBlifMv, int fCheck )
// start the file reader
p
=
Io_MvAlloc
();
p
->
fBlifMv
=
fBlifMv
;
p
->
fUseReset
=
0
;
p
->
fUseReset
=
1
;
p
->
pFileName
=
pFileName
;
p
->
pBuffer
=
Io_MvLoadFile
(
pFileName
);
if
(
p
->
pBuffer
==
NULL
)
...
...
@@ -704,7 +704,7 @@ static Abc_Lib_t * Io_MvParse( Io_MvMan_t * p )
int
i
,
k
;
// iterate through the models
Vec_PtrForEachEntry
(
p
->
vModels
,
pMod
,
i
)
{
{
// check if there any MV lines
if
(
Vec_PtrSize
(
pMod
->
vMvs
)
>
0
)
Abc_NtkStartMvVars
(
pMod
->
pNtk
);
...
...
src/bdd/parse/parseCore.c
View file @
75d6d6ab
...
...
@@ -362,6 +362,7 @@ DdNode * Parse_FormulaParser( FILE * pOutput, char * pFormulaInit, int nVars, in
default:
// scan the next name
/*
fFound = 0;
for ( i = 0; pTemp[i] && pTemp[i] != ' ' && pTemp[i] != '\t' && pTemp[i] != '\r' && pTemp[i] != '\n'; i++ )
{
...
...
@@ -375,13 +376,31 @@ DdNode * Parse_FormulaParser( FILE * pOutput, char * pFormulaInit, int nVars, in
if ( fFound )
break;
}
*/
// bug fix by SV (9/11/08)
fFound
=
0
;
for
(
i
=
0
;
pTemp
[
i
]
&&
pTemp
[
i
]
!=
' '
&&
pTemp
[
i
]
!=
'\t'
&&
pTemp
[
i
]
!=
'\r'
&&
pTemp
[
i
]
!=
'\n'
&&
pTemp
[
i
]
!=
PARSE_SYM_AND1
&&
pTemp
[
i
]
!=
PARSE_SYM_AND2
&&
pTemp
[
i
]
!=
PARSE_SYM_XOR1
&&
pTemp
[
i
]
!=
PARSE_SYM_XOR2
&&
pTemp
[
i
]
!=
PARSE_SYM_XOR3
&&
pTemp
[
i
]
!=
PARSE_SYM_XOR
&&
pTemp
[
i
]
!=
PARSE_SYM_OR1
&&
pTemp
[
i
]
!=
PARSE_SYM_OR2
&&
pTemp
[
i
]
!=
PARSE_SYM_CLOSE
;
i
++
)
{}
for
(
v
=
0
;
v
<
nVars
;
v
++
)
{
if
(
strncmp
(
pTemp
,
ppVarNames
[
v
],
i
)
==
0
&&
strlen
(
ppVarNames
[
v
])
==
(
unsigned
)(
i
)
)
{
pTemp
+=
i
-
1
;
fFound
=
1
;
break
;
}
}
if
(
!
fFound
)
{
fprintf
(
pOutput
,
"Parse_FormulaParser(): The parser cannot find var
\"
%s
\"
in the input var list.
\n
"
,
pTemp
);
Flag
=
PARSE_FLAG_ERROR
;
break
;
}
// assume operation AND, if vars follow one another
if
(
Flag
==
PARSE_FLAG_VAR
)
Parse_StackOpPush
(
pStackOp
,
PARSE_OPER_AND
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment