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
f7fd3297
Commit
f7fd3297
authored
Oct 25, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to the QBF solver.
parent
a8e1ba40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
9 deletions
+38
-9
src/base/abci/abc.c
+19
-5
src/base/abci/abcGen.c
+2
-2
src/base/abci/abcQbf.c
+17
-2
No files found.
src/base/abci/abc.c
View file @
f7fd3297
...
@@ -11016,14 +11016,16 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -11016,14 +11016,16 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
int
c
;
int
c
;
int
nPars
;
int
nPars
;
int
nIters
;
int
fVerbose
;
int
fVerbose
;
extern
void
Abc_NtkQbf
(
Abc_Ntk_t
*
pNtk
,
int
nPars
,
int
fVerbose
);
extern
void
Abc_NtkQbf
(
Abc_Ntk_t
*
pNtk
,
int
nPars
,
int
nIters
,
int
fVerbose
);
// set defaults
// set defaults
nPars
=
-
1
;
nPars
=
-
1
;
nIters
=
-
1
;
fVerbose
=
1
;
fVerbose
=
1
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Pvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"P
I
vh"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -11038,6 +11040,17 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -11038,6 +11040,17 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
nPars
<
0
)
if
(
nPars
<
0
)
goto
usage
;
goto
usage
;
break
;
break
;
case
'I'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-I
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
nIters
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
nIters
<
0
)
goto
usage
;
break
;
case
'v'
:
case
'v'
:
fVerbose
^=
1
;
fVerbose
^=
1
;
break
;
break
;
...
@@ -11068,19 +11081,20 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -11068,19 +11081,20 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
return
1
;
return
1
;
}
}
if
(
Abc_NtkIsStrash
(
pNtk
)
)
if
(
Abc_NtkIsStrash
(
pNtk
)
)
Abc_NtkQbf
(
pNtk
,
nPars
,
fVerbose
);
Abc_NtkQbf
(
pNtk
,
nPars
,
nIters
,
fVerbose
);
else
else
{
{
pNtk
=
Abc_NtkStrash
(
pNtk
,
0
,
1
,
0
);
pNtk
=
Abc_NtkStrash
(
pNtk
,
0
,
1
,
0
);
Abc_NtkQbf
(
pNtk
,
nPars
,
fVerbose
);
Abc_NtkQbf
(
pNtk
,
nPars
,
nIters
,
fVerbose
);
Abc_NtkDelete
(
pNtk
);
Abc_NtkDelete
(
pNtk
);
}
}
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: qbf [-P num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"usage: qbf [-P
I
num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
solves QBF problem EpVxM(p,x)
\n
"
);
Abc_Print
(
-
2
,
"
\t
solves QBF problem EpVxM(p,x)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-P num : number of parameters p (should be the first PIs) [default = %d]
\n
"
,
nPars
);
Abc_Print
(
-
2
,
"
\t
-P num : number of parameters p (should be the first PIs) [default = %d]
\n
"
,
nPars
);
Abc_Print
(
-
2
,
"
\t
-I num : quit after the given iteration even if unsolved [default = %d]
\n
"
,
nIters
);
Abc_Print
(
-
2
,
"
\t
-v : toggle verbose output [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle verbose output [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
return
1
;
...
...
src/base/abci/abcGen.c
View file @
f7fd3297
...
@@ -442,8 +442,8 @@ void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars )
...
@@ -442,8 +442,8 @@ void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars )
fprintf
(
pFile
,
".inputs"
);
fprintf
(
pFile
,
".inputs"
);
for
(
i
=
0
;
i
<
nParsLut
;
i
++
)
for
(
i
=
0
;
i
<
nParsLut
;
i
++
)
{
{
if
(
i
%
(
1
<<
nLutSize
)
==
0
&&
i
!=
(
nLuts
-
1
)
*
(
1
<<
nLutSize
)
)
//
if ( i % (1 << nLutSize) == 0 && i != (nLuts - 1) * (1 << nLutSize) )
continue
;
//
continue;
fprintf
(
pFile
,
" pl%02d"
,
i
);
fprintf
(
pFile
,
" pl%02d"
,
i
);
}
}
fprintf
(
pFile
,
"
\n
"
);
fprintf
(
pFile
,
"
\n
"
);
...
...
src/base/abci/abcQbf.c
View file @
f7fd3297
...
@@ -41,6 +41,8 @@ static void Abc_NtkVectorClearVars( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues, int
...
@@ -41,6 +41,8 @@ static void Abc_NtkVectorClearVars( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues, int
static
void
Abc_NtkVectorPrintPars
(
Vec_Int_t
*
vPiValues
,
int
nPars
);
static
void
Abc_NtkVectorPrintPars
(
Vec_Int_t
*
vPiValues
,
int
nPars
);
static
void
Abc_NtkVectorPrintVars
(
Abc_Ntk_t
*
pNtk
,
Vec_Int_t
*
vPiValues
,
int
nPars
);
static
void
Abc_NtkVectorPrintVars
(
Abc_Ntk_t
*
pNtk
,
Vec_Int_t
*
vPiValues
,
int
nPars
);
extern
int
Abc_NtkDSat
(
Abc_Ntk_t
*
pNtk
,
ABC_INT64_T
nConfLimit
,
ABC_INT64_T
nInsLimit
,
int
fAlignPol
,
int
fAndOuts
,
int
fVerbose
);
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
@@ -58,7 +60,7 @@ static void Abc_NtkVectorPrintVars( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues, int
...
@@ -58,7 +60,7 @@ static void Abc_NtkVectorPrintVars( Abc_Ntk_t * pNtk, Vec_Int_t * vPiValues, int
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
void
Abc_NtkQbf
(
Abc_Ntk_t
*
pNtk
,
int
nPars
,
int
fVerbose
)
void
Abc_NtkQbf
(
Abc_Ntk_t
*
pNtk
,
int
nPars
,
int
nItersMax
,
int
fVerbose
)
{
{
Abc_Ntk_t
*
pNtkVer
,
*
pNtkSyn
,
*
pNtkSyn2
,
*
pNtkTemp
;
Abc_Ntk_t
*
pNtkVer
,
*
pNtkSyn
,
*
pNtkSyn2
,
*
pNtkTemp
;
Vec_Int_t
*
vPiValues
;
Vec_Int_t
*
vPiValues
;
...
@@ -74,6 +76,15 @@ void Abc_NtkQbf( Abc_Ntk_t * pNtk, int nPars, int fVerbose )
...
@@ -74,6 +76,15 @@ void Abc_NtkQbf( Abc_Ntk_t * pNtk, int nPars, int fVerbose )
// initialize the synthesized network with 0000-combination
// initialize the synthesized network with 0000-combination
vPiValues
=
Vec_IntStart
(
Abc_NtkPiNum
(
pNtk
)
);
vPiValues
=
Vec_IntStart
(
Abc_NtkPiNum
(
pNtk
)
);
// create random init value
{
int
i
;
srand
(
time
(
NULL
)
);
for
(
i
=
nPars
;
i
<
Abc_NtkPiNum
(
pNtk
);
i
++
)
Vec_IntWriteEntry
(
vPiValues
,
i
,
rand
()
&
1
);
}
Abc_NtkVectorClearPars
(
vPiValues
,
nPars
);
Abc_NtkVectorClearPars
(
vPiValues
,
nPars
);
pNtkSyn
=
Abc_NtkMiterCofactor
(
pNtk
,
vPiValues
);
pNtkSyn
=
Abc_NtkMiterCofactor
(
pNtk
,
vPiValues
);
if
(
fVerbose
)
if
(
fVerbose
)
...
@@ -147,6 +158,8 @@ clkV = clock() - clkV;
...
@@ -147,6 +158,8 @@ clkV = clock() - clkV;
ABC_PRT
(
"Syn"
,
clkS
);
ABC_PRT
(
"Syn"
,
clkS
);
// ABC_PRT( "Ver", clkV );
// ABC_PRT( "Ver", clkV );
}
}
if
(
nIters
+
1
==
nItersMax
)
break
;
}
}
Abc_NtkDelete
(
pNtkSyn
);
Abc_NtkDelete
(
pNtkSyn
);
// report the results
// report the results
...
@@ -159,7 +172,9 @@ clkV = clock() - clkV;
...
@@ -159,7 +172,9 @@ clkV = clock() - clkV;
}
}
else
if
(
nIters
==
nIterMax
)
else
if
(
nIters
==
nIterMax
)
printf
(
"Unsolved after %d interations. "
,
nIters
);
printf
(
"Unsolved after %d interations. "
,
nIters
);
else
else
if
(
nIters
==
nItersMax
)
printf
(
"Quit after %d interatios. "
,
nItersMax
);
else
printf
(
"Implementation does not exist. "
);
printf
(
"Implementation does not exist. "
);
ABC_PRT
(
"Total runtime"
,
clock
()
-
clkTotal
);
ABC_PRT
(
"Total runtime"
,
clock
()
-
clkTotal
);
Vec_IntFree
(
vPiValues
);
Vec_IntFree
(
vPiValues
);
...
...
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