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
c2e467d5
Commit
c2e467d5
authored
Nov 15, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added switch 'cexcut -n' to generate only one bad state.
parent
2eb2402b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
88 deletions
+22
-88
src/aig/gia/gia.h
+2
-0
src/base/abci/abc.c
+18
-86
src/sat/bmc/bmc.h
+2
-2
src/sat/bmc/bmcCexCut.c
+0
-0
No files found.
src/aig/gia/gia.h
View file @
c2e467d5
...
...
@@ -677,6 +677,8 @@ static inline int Gia_ObjLutFanin( Gia_Man_t * p, int Id, int i ) { re
#define Gia_ManForEachObjVecLit( vVec, p, pObj, fCompl, i ) \
for ( i = 0; (i < Vec_IntSize(vVec)) && ((pObj) = Gia_ManObj(p, Abc_Lit2Var(Vec_IntEntry(vVec,i)))) && (((fCompl) = Abc_LitIsCompl(Vec_IntEntry(vVec,i))),1); i++ )
#define Gia_ManForEachObjReverse( p, pObj, i ) \
for ( i = p->nObjs - 1; (i >= 0) && ((pObj) = Gia_ManObj(p, i)); i-- )
#define Gia_ManForEachObjReverse1( p, pObj, i ) \
for ( i = p->nObjs - 1; (i > 0) && ((pObj) = Gia_ManObj(p, i)); i-- )
#define Gia_ManForEachAnd( p, pObj, i ) \
for ( i = 0; (i < p->nObjs) && ((pObj) = Gia_ManObj(p, i)); i++ ) if ( !Gia_ObjIsAnd(pObj) ) {} else
...
...
src/base/abci/abc.c
View file @
c2e467d5
...
...
@@ -22593,9 +22593,10 @@ int Abc_CommandCexCut( Abc_Frame_t * pAbc, int argc, char ** argv )
int
iFrStart
=
0
;
int
iFrStop
=
ABC_INFINITY
;
int
fCombOnly
=
0
;
int
fUseOne
=
0
;
int
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FGcvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FGc
n
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -22624,6 +22625,9 @@ int Abc_CommandCexCut( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'c'
:
fCombOnly
^=
1
;
break
;
case
'n'
:
fUseOne
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -22658,7 +22662,7 @@ int Abc_CommandCexCut( Abc_Frame_t * pAbc, int argc, char ** argv )
extern
Abc_Ntk_t
*
Abc_NtkFromAigPhase
(
Aig_Man_t
*
pMan
);
Abc_Ntk_t
*
pNtkNew
;
Aig_Man_t
*
pAig
=
Abc_NtkToDar
(
pAbc
->
pNtkCur
,
0
,
1
);
Aig_Man_t
*
pAigNew
=
Bmc_AigTargetStates
(
pAig
,
pAbc
->
pCex
,
iFrStart
,
iFrStop
,
fCombOnly
,
fVerbose
);
Aig_Man_t
*
pAigNew
=
Bmc_AigTargetStates
(
pAig
,
pAbc
->
pCex
,
iFrStart
,
iFrStop
,
fCombOnly
,
f
UseOne
,
f
Verbose
);
Aig_ManStop
(
pAig
);
if
(
pAigNew
==
NULL
)
{
...
...
@@ -22671,6 +22675,15 @@ int Abc_CommandCexCut( Abc_Frame_t * pAbc, int argc, char ** argv )
// update the network
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkNew
);
}
/*
pGiaNew = Bmc_GiaTargetStates( pAbc->pGia, pAbc->pCex, iFrStart, iFrStop, fCombOnly, fUseOne, fVerbose );
if ( pGiaNew == NULL )
{
Abc_Print( 1, "Command has failed.\n");
return 0;
}
Abc_CommandUpdate9( pAbc, pGiaNew );
*/
return
0
;
usage:
...
...
@@ -22678,7 +22691,8 @@ usage:
Abc_Print
(
-
2
,
"
\t
creates logic for bad states using the current CEX
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : 0-based number of the starting frame [default = %d]
\n
"
,
iFrStart
);
Abc_Print
(
-
2
,
"
\t
-G num : 0-based number of the ending frame [default = %d]
\n
"
,
iFrStop
);
Abc_Print
(
-
2
,
"
\t
-c : toggle outputting combinational unate circuit [default = %s]
\n
"
,
fCombOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-c : toggle outputting unate combinational circuit [default = %s]
\n
"
,
fCombOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-n : toggle generating only one bad state [default = %s]
\n
"
,
fUseOne
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
...
...
@@ -28813,89 +28827,7 @@ usage:
***********************************************************************/
int
Abc_CommandAbc9CexCut
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Gia_Man_t
*
pGiaNew
;
int
c
;
int
iFrStart
=
0
;
int
iFrStop
=
ABC_INFINITY
;
int
fCombOnly
=
0
;
int
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"FGcvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'F'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-F
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
iFrStart
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
iFrStart
<
0
)
goto
usage
;
break
;
case
'G'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-G
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
iFrStop
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
iFrStop
<
0
)
goto
usage
;
break
;
case
'c'
:
fCombOnly
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
Abc_Print
(
-
2
,
"Unknown switch.
\n
"
);
goto
usage
;
}
}
if
(
pAbc
->
pCex
==
NULL
)
{
Abc_Print
(
1
,
"There is no current cex.
\n
"
);
return
0
;
}
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
1
,
"There is no AIG in the &-space.
\n
"
);
return
0
;
}
if
(
!
Gia_ManVerifyCex
(
pAbc
->
pGia
,
pAbc
->
pCex
,
0
)
)
{
Abc_Print
(
1
,
"Current CEX does not fail AIG
\"
%s
\"
in the &-space.
\n
"
,
Gia_ManName
(
pAbc
->
pGia
)
);
return
0
;
}
if
(
iFrStop
==
ABC_INFINITY
)
iFrStop
=
pAbc
->
pCex
->
iFrame
;
pGiaNew
=
Bmc_GiaTargetStates
(
pAbc
->
pGia
,
pAbc
->
pCex
,
iFrStart
,
iFrStop
,
fCombOnly
,
fVerbose
);
if
(
pGiaNew
==
NULL
)
{
Abc_Print
(
1
,
"Command has failed.
\n
"
);
return
0
;
}
Abc_CommandUpdate9
(
pAbc
,
pGiaNew
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &cexcut [-FG num] [-cvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
creates logic for bad states using the current CEX
\n
"
);
Abc_Print
(
-
2
,
"
\t
-F num : 0-based number of the starting frame [default = %d]
\n
"
,
iFrStart
);
Abc_Print
(
-
2
,
"
\t
-G num : 0-based number of the ending frame [default = %d]
\n
"
,
iFrStop
);
Abc_Print
(
-
2
,
"
\t
-c : toggle producing combinational unate circuit [default = %s]
\n
"
,
fCombOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
return
-
1
;
}
/**Function*************************************************************
...
...
src/sat/bmc/bmc.h
View file @
c2e467d5
...
...
@@ -75,8 +75,8 @@ extern int Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFra
extern
void
Saig_ParBmcSetDefaultParams
(
Saig_ParBmc_t
*
p
);
extern
int
Saig_ManBmcScalable
(
Aig_Man_t
*
pAig
,
Saig_ParBmc_t
*
pPars
);
/*=== bmcCexCut.c ==========================================================*/
extern
Gia_Man_t
*
Bmc_GiaTargetStates
(
Gia_Man_t
*
p
,
Abc_Cex_t
*
pCex
,
int
iFrBeg
,
int
iFrEnd
,
int
fCombOnly
,
int
fVerbose
);
extern
Aig_Man_t
*
Bmc_AigTargetStates
(
Aig_Man_t
*
p
,
Abc_Cex_t
*
pCex
,
int
iFrBeg
,
int
iFrEnd
,
int
fCombOnly
,
int
fVerbose
);
extern
Gia_Man_t
*
Bmc_GiaTargetStates
(
Gia_Man_t
*
p
,
Abc_Cex_t
*
pCex
,
int
iFrBeg
,
int
iFrEnd
,
int
fCombOnly
,
int
f
GenAll
,
int
f
Verbose
);
extern
Aig_Man_t
*
Bmc_AigTargetStates
(
Aig_Man_t
*
p
,
Abc_Cex_t
*
pCex
,
int
iFrBeg
,
int
iFrEnd
,
int
fCombOnly
,
int
f
GenAll
,
int
f
Verbose
);
/*=== bmcCexMin.c ==========================================================*/
extern
Abc_Cex_t
*
Saig_ManCexMinPerform
(
Aig_Man_t
*
pAig
,
Abc_Cex_t
*
pCex
);
...
...
src/sat/bmc/bmcCexCut.c
View file @
c2e467d5
This diff is collapsed.
Click to expand it.
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