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
de4bf41c
Commit
de4bf41c
authored
Feb 08, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New command &satoko.
parent
80f5070d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
204 additions
and
4 deletions
+204
-4
abclib.dsp
+4
-0
src/aig/gia/giaSatoko.c
+126
-0
src/aig/gia/module.make
+1
-0
src/base/abci/abc.c
+71
-2
src/base/wlc/wlcShow.c
+2
-2
No files found.
abclib.dsp
View file @
de4bf41c
...
...
@@ -4639,6 +4639,10 @@ SOURCE=.\src\aig\gia\giaSatMap.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaSatoko.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaScl.c
# End Source File
# Begin Source File
...
...
src/aig/gia/giaSatoko.c
0 → 100644
View file @
de4bf41c
/**CFile****************************************************************
FileName [giaSatoko.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Scalable AIG package.]
Synopsis [Interface to Satoko solver.]
Author [Alan Mishchenko, Bruno Schmitt]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: giaSatoko.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "gia.h"
#include "sat/cnf/cnf.h"
#include "sat/satoko/satoko.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
extern
Cnf_Dat_t
*
Mf_ManGenerateCnf
(
Gia_Man_t
*
pGia
,
int
nLutSize
,
int
fCnfObjIds
,
int
fAddOrCla
,
int
fVerbose
);
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
satoko_t
*
Gia_ManCreateSatoko
(
Gia_Man_t
*
p
)
{
satoko_t
*
pSat
=
satoko_create
();
Cnf_Dat_t
*
pCnf
=
Mf_ManGenerateCnf
(
p
,
8
,
0
,
1
,
0
);
int
i
,
status
;
//sat_solver_setnvars( pSat, p->nVars );
for
(
i
=
0
;
i
<
pCnf
->
nClauses
;
i
++
)
{
if
(
!
satoko_add_clause
(
pSat
,
pCnf
->
pClauses
[
i
],
pCnf
->
pClauses
[
i
+
1
]
-
pCnf
->
pClauses
[
i
]
)
)
{
Cnf_DataFree
(
pCnf
);
satoko_destroy
(
pSat
);
return
NULL
;
}
}
Cnf_DataFree
(
pCnf
);
status
=
satoko_simplify
(
pSat
);
if
(
status
==
SATOKO_OK
)
return
pSat
;
satoko_destroy
(
pSat
);
return
NULL
;
}
void
Gia_ManCallSatokoOne
(
Gia_Man_t
*
p
,
satoko_opts_t
*
opts
,
int
iOutput
)
{
abctime
clk
=
Abc_Clock
();
satoko_t
*
pSat
;
int
status
;
pSat
=
Gia_ManCreateSatoko
(
p
);
if
(
pSat
)
{
satoko_configure
(
pSat
,
opts
);
status
=
satoko_solve
(
pSat
);
satoko_destroy
(
pSat
);
}
else
status
=
SATOKO_UNSAT
;
if
(
iOutput
>=
0
)
Abc_Print
(
1
,
"Output %6d : "
,
iOutput
);
else
Abc_Print
(
1
,
"Total: "
);
if
(
status
==
SATOKO_UNDEC
)
Abc_Print
(
1
,
"UNDECIDED "
);
else
if
(
status
==
SATOKO_SAT
)
Abc_Print
(
1
,
"SATISFIABLE "
);
else
Abc_Print
(
1
,
"UNSATISFIABLE "
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
}
void
Gia_ManCallSatoko
(
Gia_Man_t
*
p
,
satoko_opts_t
*
opts
,
int
fSplit
)
{
if
(
fSplit
)
{
Gia_Man_t
*
pOne
;
Gia_Obj_t
*
pRoot
;
int
i
;
Gia_ManForEachCo
(
p
,
pRoot
,
i
)
{
pOne
=
Gia_ManDupDfsCone
(
p
,
pRoot
);
Gia_ManCallSatokoOne
(
pOne
,
opts
,
i
);
Gia_ManStop
(
pOne
);
}
return
;
}
Gia_ManCallSatokoOne
(
p
,
opts
,
-
1
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
src/aig/gia/module.make
View file @
de4bf41c
...
...
@@ -59,6 +59,7 @@ SRC += src/aig/gia/giaAig.c \
src/aig/gia/giaSatLE.c
\
src/aig/gia/giaSatLut.c
\
src/aig/gia/giaSatMap.c
\
src/aig/gia/giaSatoko.c
\
src/aig/gia/giaScl.c
\
src/aig/gia/giaScript.c
\
src/aig/gia/giaShow.c
\
...
...
src/base/abci/abc.c
View file @
de4bf41c
...
...
@@ -310,6 +310,7 @@ static int Abc_CommandSat ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandDSat
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandXSat
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSatoko
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Satoko
(
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
);
...
...
@@ -959,6 +960,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"dsat"
,
Abc_CommandDSat
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"xsat"
,
Abc_CommandXSat
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"satoko"
,
Abc_CommandSatoko
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"&satoko"
,
Abc_CommandAbc9Satoko
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"psat"
,
Abc_CommandPSat
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"prove"
,
Abc_CommandProve
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Verification"
,
"iprove"
,
Abc_CommandIProve
,
1
);
...
...
@@ -23356,11 +23358,12 @@ int Abc_CommandSatoko( Abc_Frame_t * pAbc, int argc, char ** argv )
satoko_t
*
p
;
int
status
;
satoko_parse_dimacs
(
pFileName
,
&
p
);
s
tatus
=
s
atoko_parse_dimacs
(
pFileName
,
&
p
);
satoko_configure
(
p
,
&
opts
);
clk
=
Abc_Clock
();
status
=
satoko_solve
(
p
);
if
(
status
==
SATOKO_OK
)
status
=
satoko_solve
(
p
);
if
(
status
==
SATOKO_UNDEC
)
Abc_Print
(
1
,
"UNDECIDED "
);
...
...
@@ -23382,6 +23385,72 @@ usage:
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9Satoko
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Gia_ManCallSatoko
(
Gia_Man_t
*
p
,
satoko_opts_t
*
opts
,
int
fSplit
);
int
c
,
fSplit
=
0
;
satoko_opts_t
opts
;
satoko_default_opts
(
&
opts
);
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Csvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'C'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-C
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
opts
.
conf_limit
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
opts
.
conf_limit
<
0
)
goto
usage
;
break
;
case
's'
:
fSplit
^=
1
;
break
;
case
'v'
:
opts
.
verbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Satoko(): There is no AIG.
\n
"
);
return
1
;
}
Gia_ManCallSatoko
(
pAbc
->
pGia
,
&
opts
,
fSplit
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &satoko [-C num] [-svh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
-C num : limit on the number of conflicts [default = %d]
\n
"
,
opts
.
conf_limit
);
Abc_Print
(
-
2
,
"
\t
-s : split multi-output miter into individual outputs [default = %s]
\n
"
,
fSplit
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : prints verbose information [default = %s]
\n
"
,
opts
.
verbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
src/base/wlc/wlcShow.c
View file @
de4bf41c
...
...
@@ -49,9 +49,9 @@ void Wlc_NtkDumpDot( Wlc_Ntk_t * p, char * pFileName, Vec_Int_t * vBold )
Wlc_Obj_t
*
pNode
;
int
LevelMax
,
Prev
,
Level
,
i
;
if
(
Wlc_NtkObjNum
(
p
)
>
1
000
)
if
(
Wlc_NtkObjNum
(
p
)
>
2
000
)
{
fprintf
(
stdout
,
"Cannot visualize WLC with more than %d nodes.
\n
"
,
1
000
);
fprintf
(
stdout
,
"Cannot visualize WLC with more than %d nodes.
\n
"
,
2
000
);
return
;
}
if
(
(
pFile
=
fopen
(
pFileName
,
"w"
))
==
NULL
)
...
...
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