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
456e381a
Commit
456e381a
authored
Oct 23, 2021
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix in sweep (which happens to be a rare bug in Abc_NodeMinimumBase).
parent
d4f073ba
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
6 deletions
+55
-6
src/base/abc/abcMinBase.c
+52
-3
src/base/abci/abcReorder.c
+1
-1
src/base/abci/abcSweep.c
+2
-2
No files found.
src/base/abc/abcMinBase.c
View file @
456e381a
...
@@ -72,7 +72,7 @@ int Abc_NtkMinimumBase( Abc_Ntk_t * pNtk )
...
@@ -72,7 +72,7 @@ int Abc_NtkMinimumBase( Abc_Ntk_t * pNtk )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Abc_NodeMinimumBase
(
Abc_Obj_t
*
pNode
)
int
Abc_NodeMinimumBase
_buggy
(
Abc_Obj_t
*
pNode
)
{
{
Vec_Str_t
*
vSupport
;
Vec_Str_t
*
vSupport
;
Vec_Ptr_t
*
vFanins
;
Vec_Ptr_t
*
vFanins
;
...
@@ -107,6 +107,55 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
...
@@ -107,6 +107,55 @@ int Abc_NodeMinimumBase( Abc_Obj_t * pNode )
return
1
;
return
1
;
}
}
int
Abc_NodeMinimumBase
(
Abc_Obj_t
*
pNode
)
{
DdManager
*
dd
=
(
DdManager
*
)
pNode
->
pNtk
->
pManFunc
;
DdNode
*
bTemp
,
**
pbVars
;
Vec_Str_t
*
vSupport
;
int
i
,
nVars
,
j
,
iFanin
,
iFanin2
,
k
=
0
;
assert
(
Abc_NtkIsBddLogic
(
pNode
->
pNtk
)
);
assert
(
Abc_ObjIsNode
(
pNode
)
);
// compute support
vSupport
=
Vec_StrAlloc
(
10
);
nVars
=
Abc_NodeSupport
(
Cudd_Regular
(
pNode
->
pData
),
vSupport
,
Abc_ObjFaninNum
(
pNode
)
);
if
(
nVars
==
Abc_ObjFaninNum
(
pNode
)
)
{
Vec_StrFree
(
vSupport
);
return
0
;
}
// remove unused fanins
pbVars
=
ABC_CALLOC
(
DdNode
*
,
Abc_ObjFaninNum
(
pNode
)
);
Vec_IntForEachEntry
(
&
pNode
->
vFanins
,
iFanin
,
i
)
{
Abc_Obj_t
*
pFanin
=
Abc_NtkObj
(
pNode
->
pNtk
,
iFanin
);
if
(
!
Vec_StrEntry
(
vSupport
,
i
)
)
{
if
(
!
Vec_IntRemove
(
&
pFanin
->
vFanouts
,
pNode
->
Id
)
)
printf
(
"The obj %d is not found among the fanouts of obj %d ...
\n
"
,
pNode
->
Id
,
iFanin
);
continue
;
}
Vec_IntForEachEntryStop
(
&
pNode
->
vFanins
,
iFanin2
,
j
,
k
)
if
(
iFanin
==
iFanin2
)
break
;
if
(
j
==
k
)
Vec_IntWriteEntry
(
&
pNode
->
vFanins
,
k
++
,
iFanin
);
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
);
pbVars
[
i
]
=
Cudd_bddIthVar
(
dd
,
j
);
}
Vec_IntShrink
(
&
pNode
->
vFanins
,
k
);
// update the function of the node
pNode
->
pData
=
Cudd_bddVectorCompose
(
dd
,
bTemp
=
(
DdNode
*
)
pNode
->
pData
,
pbVars
);
Cudd_Ref
(
(
DdNode
*
)
pNode
->
pData
);
Cudd_RecursiveDeref
(
dd
,
bTemp
);
Vec_StrFree
(
vSupport
);
ABC_FREE
(
pbVars
);
return
1
;
}
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Makes nodes of the network fanin-dup-free.]
Synopsis [Makes nodes of the network fanin-dup-free.]
...
@@ -447,7 +496,7 @@ int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose
...
@@ -447,7 +496,7 @@ int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose
return
0
;
return
0
;
}
}
// prepare nodes for sweeping
// prepare nodes for sweeping
Abc_NtkRemoveDupFanins
(
pNtk
);
//
Abc_NtkRemoveDupFanins( pNtk );
Abc_NtkMinimumBase
(
pNtk
);
Abc_NtkMinimumBase
(
pNtk
);
Abc_NtkCleanup
(
pNtk
,
0
);
Abc_NtkCleanup
(
pNtk
,
0
);
// get the nodes in the given order
// get the nodes in the given order
...
@@ -740,7 +789,7 @@ int Abc_NtkEliminateSpecial( Abc_Ntk_t * pNtk, int nMaxSize, int fVerbose )
...
@@ -740,7 +789,7 @@ int Abc_NtkEliminateSpecial( Abc_Ntk_t * pNtk, int nMaxSize, int fVerbose )
}
}
// prepare nodes for sweeping
// prepare nodes for sweeping
Abc_NtkRemoveDupFanins
(
pNtk
);
//
Abc_NtkRemoveDupFanins( pNtk );
Abc_NtkMinimumBase
(
pNtk
);
Abc_NtkMinimumBase
(
pNtk
);
Abc_NtkCleanup
(
pNtk
,
0
);
Abc_NtkCleanup
(
pNtk
,
0
);
...
...
src/base/abci/abcReorder.c
View file @
456e381a
...
@@ -84,7 +84,7 @@ void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -84,7 +84,7 @@ void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose )
reo_man
*
p
;
reo_man
*
p
;
Abc_Obj_t
*
pNode
;
Abc_Obj_t
*
pNode
;
int
i
;
int
i
;
Abc_NtkRemoveDupFanins
(
pNtk
);
//
Abc_NtkRemoveDupFanins( pNtk );
Abc_NtkMinimumBase
(
pNtk
);
Abc_NtkMinimumBase
(
pNtk
);
p
=
Extra_ReorderInit
(
Abc_NtkGetFaninMax
(
pNtk
),
100
);
p
=
Extra_ReorderInit
(
Abc_NtkGetFaninMax
(
pNtk
),
100
);
Abc_NtkForEachNode
(
pNtk
,
pNode
,
i
)
Abc_NtkForEachNode
(
pNtk
,
pNode
,
i
)
...
...
src/base/abci/abcSweep.c
View file @
456e381a
...
@@ -619,7 +619,7 @@ int Abc_NtkSweep( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -619,7 +619,7 @@ int Abc_NtkSweep( Abc_Ntk_t * pNtk, int fVerbose )
nNodesOld
=
Abc_NtkNodeNum
(
pNtk
);
nNodesOld
=
Abc_NtkNodeNum
(
pNtk
);
Abc_NtkCleanup
(
pNtk
,
0
);
Abc_NtkCleanup
(
pNtk
,
0
);
// prepare nodes for sweeping
// prepare nodes for sweeping
Abc_NtkRemoveDupFanins
(
pNtk
);
//
Abc_NtkRemoveDupFanins(pNtk);
Abc_NtkMinimumBase
(
pNtk
);
Abc_NtkMinimumBase
(
pNtk
);
// collect sweepable nodes
// collect sweepable nodes
vNodes
=
Vec_PtrAlloc
(
100
);
vNodes
=
Vec_PtrAlloc
(
100
);
...
@@ -649,7 +649,7 @@ int Abc_NtkSweep( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -649,7 +649,7 @@ int Abc_NtkSweep( Abc_Ntk_t * pNtk, int fVerbose )
Abc_NodeComplementInput
(
pFanout
,
pNode
);
Abc_NodeComplementInput
(
pFanout
,
pNode
);
Abc_ObjPatchFanin
(
pFanout
,
pNode
,
pDriver
);
Abc_ObjPatchFanin
(
pFanout
,
pNode
,
pDriver
);
}
}
Abc_NodeRemoveDupFanins
(
pFanout
);
//
Abc_NodeRemoveDupFanins( pFanout );
Abc_NodeMinimumBase
(
pFanout
);
Abc_NodeMinimumBase
(
pFanout
);
// check if the fanout should be added
// check if the fanout should be added
if
(
Abc_ObjFaninNum
(
pFanout
)
<
2
)
if
(
Abc_ObjFaninNum
(
pFanout
)
<
2
)
...
...
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