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
3f35ac81
Commit
3f35ac81
authored
Dec 05, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New command 'lutexact'.
parent
e5d83352
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
0 deletions
+104
-0
src/base/abci/abc.c
+104
-0
src/sat/bmc/bmcMaj.c
+0
-0
src/sat/bmc/bmcMaj2.c
+0
-0
No files found.
src/base/abci/abc.c
View file @
3f35ac81
...
@@ -151,6 +151,7 @@ static int Abc_CommandBmsStop ( Abc_Frame_t * pAbc, int argc, cha
...
@@ -151,6 +151,7 @@ static int Abc_CommandBmsStop ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandBmsPs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandBmsPs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMajExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMajExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandTwoExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandTwoExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandLutExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandLogic
(
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_CommandComb
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
@@ -819,6 +820,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -819,6 +820,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Exact synthesis"
,
"bms_ps"
,
Abc_CommandBmsPs
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Exact synthesis"
,
"bms_ps"
,
Abc_CommandBmsPs
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Exact synthesis"
,
"majexact"
,
Abc_CommandMajExact
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Exact synthesis"
,
"majexact"
,
Abc_CommandMajExact
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Exact synthesis"
,
"twoexact"
,
Abc_CommandTwoExact
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Exact synthesis"
,
"twoexact"
,
Abc_CommandTwoExact
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Exact synthesis"
,
"lutexact"
,
Abc_CommandLutExact
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"logic"
,
Abc_CommandLogic
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"logic"
,
Abc_CommandLogic
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"comb"
,
Abc_CommandComb
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"comb"
,
Abc_CommandComb
,
1
);
...
@@ -8258,6 +8260,108 @@ usage:
...
@@ -8258,6 +8260,108 @@ usage:
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Abc_CommandLutExact
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Exa3_ManExactSynthesis
(
char
*
pTtStr
,
int
nVars
,
int
nNodes
,
int
nLutSize
,
int
fVerbose
);
extern
void
Exa3_ManExactSynthesis2
(
char
*
pTtStr
,
int
nVars
,
int
nNodes
,
int
nLutSize
,
int
fVerbose
);
int
c
,
nVars
=
5
,
nNodes
=
5
,
nLutSize
=
3
,
fGlucose
=
0
,
fVerbose
=
1
;
char
*
pTtStr
=
NULL
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"INKgvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'I'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-I
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nVars
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nVars
<
0
)
goto
usage
;
break
;
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-N
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nNodes
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nNodes
<
0
)
goto
usage
;
break
;
case
'K'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-K
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nLutSize
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nLutSize
<
0
)
goto
usage
;
break
;
case
'g'
:
fGlucose
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
argc
==
globalUtilOptind
+
1
)
pTtStr
=
argv
[
globalUtilOptind
];
if
(
pTtStr
==
NULL
)
{
Abc_Print
(
-
1
,
"Truth table should be given on the command line.
\n
"
);
return
1
;
}
if
(
nVars
>
10
)
{
Abc_Print
(
-
1
,
"Function should not have more than 10 inputs.
\n
"
);
return
1
;
}
if
(
nLutSize
>
6
)
{
Abc_Print
(
-
1
,
"Node size should not be more than 6 inputs.
\n
"
);
return
1
;
}
if
(
fGlucose
)
Exa3_ManExactSynthesis
(
pTtStr
,
nVars
,
nNodes
,
nLutSize
,
fVerbose
);
else
Exa3_ManExactSynthesis2
(
pTtStr
,
nVars
,
nNodes
,
nLutSize
,
fVerbose
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: lutexact [-INK <num>] [-fcgvh] <hex>
\n
"
);
Abc_Print
(
-
2
,
"
\t
exact synthesis of multi-input function using two-input gates
\n
"
);
Abc_Print
(
-
2
,
"
\t
-I <num> : the number of input variables [default = %d]
\n
"
,
nVars
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the number of K-input nodes [default = %d]
\n
"
,
nNodes
);
Abc_Print
(
-
2
,
"
\t
-K <num> : the number of node fanins [default = %d]
\n
"
,
nLutSize
);
Abc_Print
(
-
2
,
"
\t
-g : toggle using Glucose 3.0 by Gilles Audemard and Laurent Simon [default = %s]
\n
"
,
fGlucose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle verbose printout [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
Abc_Print
(
-
2
,
"
\t
<hex> : truth table in hex notation
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandLogic
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandLogic
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
Abc_Ntk_t
*
pNtk
,
*
pNtkRes
;
Abc_Ntk_t
*
pNtk
,
*
pNtkRes
;
src/sat/bmc/bmcMaj.c
View file @
3f35ac81
This diff is collapsed.
Click to expand it.
src/sat/bmc/bmcMaj2.c
View file @
3f35ac81
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