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
53217cdc
Commit
53217cdc
authored
Feb 07, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Yet another update to the runtime control in BDD operations.
parent
21bb515b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
214 additions
and
8 deletions
+214
-8
src/aig/llb/llb3Nonlin.c
+21
-4
src/misc/extra/extra.h
+1
-0
src/misc/extra/extraBddTime.c
+192
-4
No files found.
src/aig/llb/llb3Nonlin.c
View file @
53217cdc
...
@@ -427,7 +427,7 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
...
@@ -427,7 +427,7 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
if
(
p
->
pPars
->
TimeLimit
&&
clock
()
>=
p
->
pPars
->
TimeTarget
)
if
(
p
->
pPars
->
TimeLimit
&&
clock
()
>=
p
->
pPars
->
TimeTarget
)
{
{
if
(
!
p
->
pPars
->
fSilent
)
if
(
!
p
->
pPars
->
fSilent
)
printf
(
"Reached timeout
during image computation (%d seconds)
.
\n
"
,
p
->
pPars
->
TimeLimit
);
printf
(
"Reached timeout
(%d seconds) during image computation
.
\n
"
,
p
->
pPars
->
TimeLimit
);
p
->
pPars
->
iFrame
=
nIters
-
1
;
p
->
pPars
->
iFrame
=
nIters
-
1
;
Cudd_RecursiveDeref
(
p
->
dd
,
bCurrent
);
bCurrent
=
NULL
;
Cudd_RecursiveDeref
(
p
->
dd
,
bCurrent
);
bCurrent
=
NULL
;
return
-
1
;
return
-
1
;
...
@@ -484,7 +484,7 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
...
@@ -484,7 +484,7 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
if
(
bNext
==
NULL
)
if
(
bNext
==
NULL
)
{
{
if
(
!
p
->
pPars
->
fSilent
)
if
(
!
p
->
pPars
->
fSilent
)
printf
(
"Reached timeout
during image computation (%d seconds)
.
\n
"
,
p
->
pPars
->
TimeLimit
);
printf
(
"Reached timeout
(%d seconds) during image computation in quantification
.
\n
"
,
p
->
pPars
->
TimeLimit
);
p
->
pPars
->
iFrame
=
nIters
-
1
;
p
->
pPars
->
iFrame
=
nIters
-
1
;
Cudd_RecursiveDeref
(
p
->
dd
,
bCurrent
);
bCurrent
=
NULL
;
Cudd_RecursiveDeref
(
p
->
dd
,
bCurrent
);
bCurrent
=
NULL
;
return
-
1
;
return
-
1
;
...
@@ -530,7 +530,16 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
...
@@ -530,7 +530,16 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
// transfer to the state manager
// transfer to the state manager
clk3
=
clock
();
clk3
=
clock
();
Cudd_RecursiveDeref
(
p
->
ddG
,
p
->
ddG
->
bFunc2
);
Cudd_RecursiveDeref
(
p
->
ddG
,
p
->
ddG
->
bFunc2
);
p
->
ddG
->
bFunc2
=
Extra_TransferPermute
(
p
->
dd
,
p
->
ddG
,
bNext
,
Vec_IntArray
(
p
->
vNs2Glo
)
);
Cudd_Ref
(
p
->
ddG
->
bFunc2
);
p
->
ddG
->
bFunc2
=
Extra_TransferPermuteTime
(
p
->
dd
,
p
->
ddG
,
bNext
,
Vec_IntArray
(
p
->
vNs2Glo
),
p
->
pPars
->
TimeTarget
);
if
(
p
->
ddG
->
bFunc2
==
NULL
)
{
if
(
!
p
->
pPars
->
fSilent
)
printf
(
"Reached timeout (%d seconds) during image computation in transfer 1.
\n
"
,
p
->
pPars
->
TimeLimit
);
p
->
pPars
->
iFrame
=
nIters
-
1
;
Cudd_RecursiveDeref
(
p
->
dd
,
bNext
);
return
-
1
;
}
Cudd_Ref
(
p
->
ddG
->
bFunc2
);
Cudd_RecursiveDeref
(
p
->
dd
,
bNext
);
Cudd_RecursiveDeref
(
p
->
dd
,
bNext
);
p
->
timeTran1
+=
clock
()
-
clk3
;
p
->
timeTran1
+=
clock
()
-
clk3
;
...
@@ -552,7 +561,15 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
...
@@ -552,7 +561,15 @@ int Llb_NonlinReachability( Llb_Mnn_t * p )
// move new states to the working manager
// move new states to the working manager
clk3
=
clock
();
clk3
=
clock
();
bCurrent
=
Extra_TransferPermute
(
p
->
ddG
,
p
->
dd
,
p
->
ddG
->
bFunc2
,
Vec_IntArray
(
p
->
vGlo2Cs
)
);
Cudd_Ref
(
bCurrent
);
bCurrent
=
Extra_TransferPermuteTime
(
p
->
ddG
,
p
->
dd
,
p
->
ddG
->
bFunc2
,
Vec_IntArray
(
p
->
vGlo2Cs
),
p
->
pPars
->
TimeTarget
);
if
(
bCurrent
==
NULL
)
{
if
(
!
p
->
pPars
->
fSilent
)
printf
(
"Reached timeout (%d seconds) during image computation in transfer 2.
\n
"
,
p
->
pPars
->
TimeLimit
);
p
->
pPars
->
iFrame
=
nIters
-
1
;
return
-
1
;
}
Cudd_Ref
(
bCurrent
);
p
->
timeTran2
+=
clock
()
-
clk3
;
p
->
timeTran2
+=
clock
()
-
clk3
;
// report the results
// report the results
...
...
src/misc/extra/extra.h
View file @
53217cdc
...
@@ -265,6 +265,7 @@ extern DdNode * extraZddSelectOneSubset( DdManager * dd, DdNode * zS );
...
@@ -265,6 +265,7 @@ extern DdNode * extraZddSelectOneSubset( DdManager * dd, DdNode * zS );
extern
DdNode
*
Extra_bddAndTime
(
DdManager
*
dd
,
DdNode
*
f
,
DdNode
*
g
,
int
TimeOut
);
extern
DdNode
*
Extra_bddAndTime
(
DdManager
*
dd
,
DdNode
*
f
,
DdNode
*
g
,
int
TimeOut
);
extern
DdNode
*
Extra_bddAndAbstractTime
(
DdManager
*
manager
,
DdNode
*
f
,
DdNode
*
g
,
DdNode
*
cube
,
int
TimeOut
);
extern
DdNode
*
Extra_bddAndAbstractTime
(
DdManager
*
manager
,
DdNode
*
f
,
DdNode
*
g
,
DdNode
*
cube
,
int
TimeOut
);
extern
DdNode
*
Extra_TransferPermuteTime
(
DdManager
*
ddSource
,
DdManager
*
ddDestination
,
DdNode
*
f
,
int
*
Permute
,
int
TimeOut
);
/*=== extraBddUnate.c =================================================================*/
/*=== extraBddUnate.c =================================================================*/
...
...
src/misc/extra/extraBddTime.c
View file @
53217cdc
...
@@ -25,6 +25,8 @@ ABC_NAMESPACE_IMPL_START
...
@@ -25,6 +25,8 @@ ABC_NAMESPACE_IMPL_START
/* Constant declarations */
/* Constant declarations */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
#define CHECK_FACTOR 10
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* Stucture declarations */
/* Stucture declarations */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
...
@@ -53,6 +55,8 @@ ABC_NAMESPACE_IMPL_START
...
@@ -53,6 +55,8 @@ ABC_NAMESPACE_IMPL_START
static
DdNode
*
cuddBddAndRecurTime
(
DdManager
*
manager
,
DdNode
*
f
,
DdNode
*
g
,
int
*
pRecCalls
,
int
TimeOut
);
static
DdNode
*
cuddBddAndRecurTime
(
DdManager
*
manager
,
DdNode
*
f
,
DdNode
*
g
,
int
*
pRecCalls
,
int
TimeOut
);
static
DdNode
*
cuddBddAndAbstractRecurTime
(
DdManager
*
manager
,
DdNode
*
f
,
DdNode
*
g
,
DdNode
*
cube
,
int
*
pRecCalls
,
int
TimeOut
);
static
DdNode
*
cuddBddAndAbstractRecurTime
(
DdManager
*
manager
,
DdNode
*
f
,
DdNode
*
g
,
DdNode
*
cube
,
int
*
pRecCalls
,
int
TimeOut
);
static
DdNode
*
extraTransferPermuteTime
(
DdManager
*
ddS
,
DdManager
*
ddD
,
DdNode
*
f
,
int
*
Permute
,
int
TimeOut
);
static
DdNode
*
extraTransferPermuteRecurTime
(
DdManager
*
ddS
,
DdManager
*
ddD
,
DdNode
*
f
,
st_table
*
table
,
int
*
Permute
,
int
TimeOut
);
/**AutomaticEnd***************************************************************/
/**AutomaticEnd***************************************************************/
...
@@ -91,7 +95,7 @@ Extra_bddAndTime(
...
@@ -91,7 +95,7 @@ Extra_bddAndTime(
}
while
(
dd
->
reordered
==
1
);
}
while
(
dd
->
reordered
==
1
);
return
(
res
);
return
(
res
);
}
/* end of
Cudd_bddAnd
*/
}
/* end of
Extra_bddAndTime
*/
/**Function********************************************************************
/**Function********************************************************************
...
@@ -126,8 +130,35 @@ Extra_bddAndAbstractTime(
...
@@ -126,8 +130,35 @@ Extra_bddAndAbstractTime(
}
while
(
manager
->
reordered
==
1
);
}
while
(
manager
->
reordered
==
1
);
return
(
res
);
return
(
res
);
}
/* end of Cudd_bddAndAbstract */
}
/* end of Extra_bddAndAbstractTime */
/**Function********************************************************************
Synopsis [Convert a {A,B}DD from a manager to another with variable remapping.]
Description [Convert a {A,B}DD from a manager to another one. The orders of the
variables in the two managers may be different. Returns a
pointer to the {A,B}DD in the destination manager if successful; NULL
otherwise. The i-th entry in the array Permute tells what is the index
of the i-th variable from the old manager in the new manager.]
SideEffects [None]
SeeAlso []
******************************************************************************/
DdNode
*
Extra_TransferPermuteTime
(
DdManager
*
ddSource
,
DdManager
*
ddDestination
,
DdNode
*
f
,
int
*
Permute
,
int
TimeOut
)
{
DdNode
*
bRes
;
do
{
ddDestination
->
reordered
=
0
;
bRes
=
extraTransferPermuteTime
(
ddSource
,
ddDestination
,
f
,
Permute
,
TimeOut
);
}
while
(
ddDestination
->
reordered
==
1
);
return
(
bRes
);
}
/* end of Extra_TransferPermuteTime */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
...
@@ -193,7 +224,8 @@ cuddBddAndRecurTime(
...
@@ -193,7 +224,8 @@ cuddBddAndRecurTime(
if
(
r
!=
NULL
)
return
(
r
);
if
(
r
!=
NULL
)
return
(
r
);
}
}
if
(
TimeOut
&&
((
*
pRecCalls
)
++
%
10
)
==
0
&&
TimeOut
<
clock
()
)
// if ( TimeOut && ((*pRecCalls)++ % CHECK_FACTOR) == 0 && TimeOut < clock() )
if
(
TimeOut
&&
TimeOut
<
clock
()
)
return
NULL
;
return
NULL
;
/* Here we can skip the use of cuddI, because the operands are known
/* Here we can skip the use of cuddI, because the operands are known
...
@@ -346,7 +378,8 @@ cuddBddAndAbstractRecurTime(
...
@@ -346,7 +378,8 @@ cuddBddAndAbstractRecurTime(
}
}
}
}
if
(
TimeOut
&&
((
*
pRecCalls
)
++
%
10
)
==
0
&&
TimeOut
<
clock
()
)
// if ( TimeOut && ((*pRecCalls)++ % CHECK_FACTOR) == 0 && TimeOut < clock() )
if
(
TimeOut
&&
TimeOut
<
clock
()
)
return
NULL
;
return
NULL
;
if
(
topf
==
top
)
{
if
(
topf
==
top
)
{
...
@@ -464,6 +497,161 @@ cuddBddAndAbstractRecurTime(
...
@@ -464,6 +497,161 @@ cuddBddAndAbstractRecurTime(
/* Definition of static functions */
/* Definition of static functions */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/**Function********************************************************************
Synopsis [Convert a BDD from a manager to another one.]
Description [Convert a BDD from a manager to another one. Returns a
pointer to the BDD in the destination manager if successful; NULL
otherwise.]
SideEffects [None]
SeeAlso [Extra_TransferPermute]
******************************************************************************/
DdNode
*
extraTransferPermuteTime
(
DdManager
*
ddS
,
DdManager
*
ddD
,
DdNode
*
f
,
int
*
Permute
,
int
TimeOut
)
{
DdNode
*
res
;
st_table
*
table
=
NULL
;
st_generator
*
gen
=
NULL
;
DdNode
*
key
,
*
value
;
table
=
st_init_table
(
st_ptrcmp
,
st_ptrhash
);
if
(
table
==
NULL
)
goto
failure
;
res
=
extraTransferPermuteRecurTime
(
ddS
,
ddD
,
f
,
table
,
Permute
,
TimeOut
);
if
(
res
!=
NULL
)
cuddRef
(
res
);
/* Dereference all elements in the table and dispose of the table.
** This must be done also if res is NULL to avoid leaks in case of
** reordering. */
gen
=
st_init_gen
(
table
);
if
(
gen
==
NULL
)
goto
failure
;
while
(
st_gen
(
gen
,
(
const
char
**
)
&
key
,
(
char
**
)
&
value
)
)
{
Cudd_RecursiveDeref
(
ddD
,
value
);
}
st_free_gen
(
gen
);
gen
=
NULL
;
st_free_table
(
table
);
table
=
NULL
;
if
(
res
!=
NULL
)
cuddDeref
(
res
);
return
(
res
);
failure:
if
(
table
!=
NULL
)
st_free_table
(
table
);
if
(
gen
!=
NULL
)
st_free_gen
(
gen
);
return
(
NULL
);
}
/* end of extraTransferPermuteTime */
/**Function********************************************************************
Synopsis [Performs the recursive step of Extra_TransferPermute.]
Description [Performs the recursive step of Extra_TransferPermute.
Returns a pointer to the result if successful; NULL otherwise.]
SideEffects [None]
SeeAlso [extraTransferPermuteTime]
******************************************************************************/
static
DdNode
*
extraTransferPermuteRecurTime
(
DdManager
*
ddS
,
DdManager
*
ddD
,
DdNode
*
f
,
st_table
*
table
,
int
*
Permute
,
int
TimeOut
)
{
DdNode
*
ft
,
*
fe
,
*
t
,
*
e
,
*
var
,
*
res
;
DdNode
*
one
,
*
zero
;
int
index
;
int
comple
=
0
;
statLine
(
ddD
);
one
=
DD_ONE
(
ddD
);
comple
=
Cudd_IsComplement
(
f
);
/* Trivial cases. */
if
(
Cudd_IsConstant
(
f
)
)
return
(
Cudd_NotCond
(
one
,
comple
)
);
/* Make canonical to increase the utilization of the cache. */
f
=
Cudd_NotCond
(
f
,
comple
);
/* Now f is a regular pointer to a non-constant node. */
/* Check the cache. */
if
(
st_lookup
(
table
,
(
char
*
)
f
,
(
char
**
)
&
res
)
)
return
(
Cudd_NotCond
(
res
,
comple
)
);
if
(
TimeOut
&&
TimeOut
<
clock
()
)
return
NULL
;
/* Recursive step. */
if
(
Permute
)
index
=
Permute
[
f
->
index
];
else
index
=
f
->
index
;
ft
=
cuddT
(
f
);
fe
=
cuddE
(
f
);
t
=
extraTransferPermuteRecurTime
(
ddS
,
ddD
,
ft
,
table
,
Permute
,
TimeOut
);
if
(
t
==
NULL
)
{
return
(
NULL
);
}
cuddRef
(
t
);
e
=
extraTransferPermuteRecurTime
(
ddS
,
ddD
,
fe
,
table
,
Permute
,
TimeOut
);
if
(
e
==
NULL
)
{
Cudd_RecursiveDeref
(
ddD
,
t
);
return
(
NULL
);
}
cuddRef
(
e
);
zero
=
Cudd_Not
(
ddD
->
one
);
var
=
cuddUniqueInter
(
ddD
,
index
,
one
,
zero
);
if
(
var
==
NULL
)
{
Cudd_RecursiveDeref
(
ddD
,
t
);
Cudd_RecursiveDeref
(
ddD
,
e
);
return
(
NULL
);
}
res
=
cuddBddIteRecur
(
ddD
,
var
,
t
,
e
);
if
(
res
==
NULL
)
{
Cudd_RecursiveDeref
(
ddD
,
t
);
Cudd_RecursiveDeref
(
ddD
,
e
);
return
(
NULL
);
}
cuddRef
(
res
);
Cudd_RecursiveDeref
(
ddD
,
t
);
Cudd_RecursiveDeref
(
ddD
,
e
);
if
(
st_add_direct
(
table
,
(
char
*
)
f
,
(
char
*
)
res
)
==
ST_OUT_OF_MEM
)
{
Cudd_RecursiveDeref
(
ddD
,
res
);
return
(
NULL
);
}
return
(
Cudd_NotCond
(
res
,
comple
)
);
}
/* end of extraTransferPermuteRecurTime */
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
...
...
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