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
549cd2c6
Commit
549cd2c6
authored
Dec 04, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making 'fold' and 'unfold' skip constant POs (another fix).
parent
539f05c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
src/aig/saig/saigConstr.c
+17
-5
No files found.
src/aig/saig/saigConstr.c
View file @
549cd2c6
...
@@ -164,6 +164,14 @@ int Saig_ManDetectConstr( Aig_Man_t * p, int iOut, Vec_Ptr_t ** pvOuts, Vec_Ptr_
...
@@ -164,6 +164,14 @@ int Saig_ManDetectConstr( Aig_Man_t * p, int iOut, Vec_Ptr_t ** pvOuts, Vec_Ptr_
*
pvOuts
=
NULL
;
*
pvOuts
=
NULL
;
*
pvCons
=
NULL
;
*
pvCons
=
NULL
;
pObj
=
Aig_ObjChild0
(
Aig_ManCo
(
p
,
iOut
)
);
pObj
=
Aig_ObjChild0
(
Aig_ManCo
(
p
,
iOut
)
);
if
(
pObj
==
Aig_ManConst0
(
p
)
)
{
vUnique
=
Vec_PtrStart
(
1
);
Vec_PtrWriteEntry
(
vUnique
,
0
,
Aig_ManConst1
(
p
)
);
*
pvOuts
=
vUnique
;
*
pvCons
=
Vec_PtrAlloc
(
0
);
return
-
1
;
}
if
(
Aig_IsComplement
(
pObj
)
||
!
Aig_ObjIsNode
(
pObj
)
)
if
(
Aig_IsComplement
(
pObj
)
||
!
Aig_ObjIsNode
(
pObj
)
)
{
{
printf
(
"The output is not an AND.
\n
"
);
printf
(
"The output is not an AND.
\n
"
);
...
@@ -283,8 +291,6 @@ Aig_Man_t * Saig_ManDupUnfoldConstrs( Aig_Man_t * pAig )
...
@@ -283,8 +291,6 @@ Aig_Man_t * Saig_ManDupUnfoldConstrs( Aig_Man_t * pAig )
vConsAll
=
Vec_PtrAlloc
(
Saig_ManPoNum
(
pAig
)
);
vConsAll
=
Vec_PtrAlloc
(
Saig_ManPoNum
(
pAig
)
);
Saig_ManForEachPo
(
pAig
,
pObj
,
i
)
Saig_ManForEachPo
(
pAig
,
pObj
,
i
)
{
{
if
(
Aig_ObjChild0
(
pObj
)
==
Aig_ManConst0
(
pAig
)
)
continue
;
RetValue
=
Saig_ManDetectConstr
(
pAig
,
i
,
&
vOuts
,
&
vCons
);
RetValue
=
Saig_ManDetectConstr
(
pAig
,
i
,
&
vOuts
,
&
vCons
);
if
(
RetValue
==
0
)
if
(
RetValue
==
0
)
{
{
...
@@ -302,8 +308,17 @@ Aig_Man_t * Saig_ManDupUnfoldConstrs( Aig_Man_t * pAig )
...
@@ -302,8 +308,17 @@ Aig_Man_t * Saig_ManDupUnfoldConstrs( Aig_Man_t * pAig )
// check if constraints are compatible
// check if constraints are compatible
vCons0
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vConsAll
,
0
);
vCons0
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vConsAll
,
0
);
Vec_PtrForEachEntry
(
Vec_Ptr_t
*
,
vConsAll
,
vCons
,
i
)
Vec_PtrForEachEntry
(
Vec_Ptr_t
*
,
vConsAll
,
vCons
,
i
)
if
(
Vec_PtrSize
(
vCons
)
)
vCons0
=
vCons
;
Vec_PtrForEachEntry
(
Vec_Ptr_t
*
,
vConsAll
,
vCons
,
i
)
{
// Constant 0 outputs are always compatible (vOuts stores the negation)
vOuts
=
(
Vec_Ptr_t
*
)
Vec_PtrEntry
(
vOutsAll
,
i
);
if
(
Vec_PtrSize
(
vOuts
)
==
1
&&
(
Aig_Obj_t
*
)
Vec_PtrEntry
(
vOuts
,
0
)
==
Aig_ManConst1
(
pAig
)
)
continue
;
if
(
!
Vec_PtrEqual
(
vCons0
,
vCons
)
)
if
(
!
Vec_PtrEqual
(
vCons0
,
vCons
)
)
break
;
break
;
}
if
(
i
<
Vec_PtrSize
(
vConsAll
)
)
if
(
i
<
Vec_PtrSize
(
vConsAll
)
)
{
{
printf
(
"Collected constraints are not compatible.
\n
"
);
printf
(
"Collected constraints are not compatible.
\n
"
);
...
@@ -394,9 +409,6 @@ Aig_Man_t * Saig_ManDupFoldConstrs( Aig_Man_t * pAig, Vec_Int_t * vConstrs )
...
@@ -394,9 +409,6 @@ Aig_Man_t * Saig_ManDupFoldConstrs( Aig_Man_t * pAig, Vec_Int_t * vConstrs )
// create primary output
// create primary output
Saig_ManForEachPo
(
pAig
,
pObj
,
i
)
Saig_ManForEachPo
(
pAig
,
pObj
,
i
)
{
{
if
(
Aig_ObjChild0
(
pObj
)
==
Aig_ManConst0
(
pAig
)
)
// the output is a constant 0
pMiter
=
Aig_ObjChild0Copy
(
pObj
);
else
pMiter
=
Aig_And
(
pAigNew
,
Aig_ObjChild0Copy
(
pObj
),
Aig_Not
(
pFlopIn
)
);
pMiter
=
Aig_And
(
pAigNew
,
Aig_ObjChild0Copy
(
pObj
),
Aig_Not
(
pFlopIn
)
);
Aig_ObjCreateCo
(
pAigNew
,
pMiter
);
Aig_ObjCreateCo
(
pAigNew
,
pMiter
);
}
}
...
...
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