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
5405003a
Commit
5405003a
authored
Apr 02, 2022
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suggested changes to properly initialize the variable array for Cudd_bddVectorCompose().
parent
480aaa64
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
src/base/abc/abcMinBase.c
+15
-4
No files found.
src/base/abc/abcMinBase.c
View file @
5405003a
...
@@ -113,7 +113,7 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
...
@@ -113,7 +113,7 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
DdNode
*
bTemp
,
**
pbVars
;
DdNode
*
bTemp
,
**
pbVars
;
Vec_Str_t
*
vSupport
;
Vec_Str_t
*
vSupport
;
int
i
,
nVars
,
j
,
iFanin
,
iFanin2
,
k
=
0
;
int
i
,
nVars
,
j
,
iFanin
,
iFanin2
,
k
=
0
;
int
fDupFanins
=
0
;
int
ddSize
,
fDupFanins
=
0
;
assert
(
Abc_NtkIsBddLogic
(
pNode
->
pNtk
)
);
assert
(
Abc_NtkIsBddLogic
(
pNode
->
pNtk
)
);
assert
(
Abc_ObjIsNode
(
pNode
)
);
assert
(
Abc_ObjIsNode
(
pNode
)
);
...
@@ -127,8 +127,14 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
...
@@ -127,8 +127,14 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
return
0
;
return
0
;
}
}
// remove unused fanins
// remove unused fanins.
pbVars
=
ABC_CALLOC
(
DdNode
*
,
Abc_ObjFaninNum
(
pNode
)
);
// By default, every BDD variable stays equivalent to itself.
ddSize
=
Cudd_ReadSize
(
dd
);
pbVars
=
ABC_CALLOC
(
DdNode
*
,
ddSize
);
for
(
i
=
0
;
i
<
ddSize
;
i
+=
1
)
{
pbVars
[
i
]
=
Cudd_bddIthVar
(
dd
,
i
);
}
Vec_IntForEachEntry
(
&
pNode
->
vFanins
,
iFanin
,
i
)
Vec_IntForEachEntry
(
&
pNode
->
vFanins
,
iFanin
,
i
)
{
{
Abc_Obj_t
*
pFanin
=
Abc_NtkObj
(
pNode
->
pNtk
,
iFanin
);
Abc_Obj_t
*
pFanin
=
Abc_NtkObj
(
pNode
->
pNtk
,
iFanin
);
...
@@ -146,13 +152,18 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
...
@@ -146,13 +152,18 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
Vec_IntWriteEntry
(
&
pNode
->
vFanins
,
k
++
,
iFanin
);
Vec_IntWriteEntry
(
&
pNode
->
vFanins
,
k
++
,
iFanin
);
else
if
(
!
Vec_IntRemove
(
&
pFanin
->
vFanouts
,
pNode
->
Id
)
)
else
if
(
!
Vec_IntRemove
(
&
pFanin
->
vFanouts
,
pNode
->
Id
)
)
printf
(
"The obj %d is not found among the fanouts of obj %d ...
\n
"
,
pNode
->
Id
,
iFanin
);
printf
(
"The obj %d is not found among the fanouts of obj %d ...
\n
"
,
pNode
->
Id
,
iFanin
);
// i-th variable becomes equivalent to j-th variable (can be itself)
pbVars
[
i
]
=
Cudd_bddIthVar
(
dd
,
j
);
pbVars
[
i
]
=
Cudd_bddIthVar
(
dd
,
j
);
}
}
Vec_IntShrink
(
&
pNode
->
vFanins
,
k
);
Vec_IntShrink
(
&
pNode
->
vFanins
,
k
);
// update the function of the node
// update the function of the node
pNode
->
pData
=
Cudd_bddVectorCompose
(
dd
,
bTemp
=
(
DdNode
*
)
pNode
->
pData
,
pbVars
);
Cudd_Ref
(
(
DdNode
*
)
pNode
->
pData
);
if
(
!
Cudd_IsConstant
((
DdNode
*
)
pNode
->
pData
)
)
{
pNode
->
pData
=
Cudd_bddVectorCompose
(
dd
,
bTemp
=
(
DdNode
*
)
pNode
->
pData
,
pbVars
);
Cudd_Ref
(
(
DdNode
*
)
pNode
->
pData
);
Cudd_RecursiveDeref
(
dd
,
bTemp
);
Cudd_RecursiveDeref
(
dd
,
bTemp
);
}
Vec_StrFree
(
vSupport
);
Vec_StrFree
(
vSupport
);
ABC_FREE
(
pbVars
);
ABC_FREE
(
pbVars
);
...
...
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