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
73f8b598
Commit
73f8b598
authored
Oct 29, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rare bug fix in mapping with choices.
parent
b2aa245e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
0 deletions
+75
-0
src/aig/gia/giaAig.c
+36
-0
src/aig/gia/giaIf.c
+38
-0
src/map/if/ifMap.c
+1
-0
No files found.
src/aig/gia/giaAig.c
View file @
73f8b598
...
...
@@ -102,6 +102,41 @@ Gia_Man_t * Gia_ManFromAig( Aig_Man_t * p )
/**Function*************************************************************
Synopsis [Checks integrity of choice nodes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManCheckChoices_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
if
(
!
pObj
||
!
Gia_ObjIsAnd
(
pObj
)
||
pObj
->
fPhase
)
return
;
pObj
->
fPhase
=
1
;
Gia_ManCheckChoices_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
Gia_ManCheckChoices_rec
(
p
,
Gia_ObjFanin1
(
pObj
)
);
Gia_ManCheckChoices_rec
(
p
,
Gia_ObjSiblObj
(
p
,
Gia_ObjId
(
p
,
pObj
))
);
}
void
Gia_ManCheckChoices
(
Gia_Man_t
*
p
)
{
Gia_Obj_t
*
pObj
;
int
i
,
fFound
=
0
;
Gia_ManCleanPhase
(
p
);
Gia_ManForEachCo
(
p
,
pObj
,
i
)
Gia_ManCheckChoices_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
Gia_ManForEachAnd
(
p
,
pObj
,
i
)
if
(
!
pObj
->
fPhase
)
printf
(
"Object %d is dangling.
\n
"
,
i
),
fFound
=
1
;
if
(
!
fFound
)
printf
(
"There are no dangling objects.
\n
"
);
Gia_ManCleanPhase
(
p
);
}
/**Function*************************************************************
Synopsis [Duplicates AIG in the DFS order.]
Description []
...
...
@@ -155,6 +190,7 @@ Gia_Man_t * Gia_ManFromAigChoices( Aig_Man_t * p )
Gia_ManAppendCo
(
pNew
,
Gia_ObjChild0Copy
(
pObj
)
);
Gia_ManSetRegNum
(
pNew
,
Aig_ManRegNum
(
p
)
);
//assert( Gia_ManObjNum(pNew) == Aig_ManObjNum(p) );
//Gia_ManCheckChoices( pNew );
return
pNew
;
}
...
...
src/aig/gia/giaIf.c
View file @
73f8b598
...
...
@@ -756,6 +756,43 @@ int Gia_ManChoiceLevel( Gia_Man_t * p )
}
/**Function*************************************************************
Synopsis [Checks integrity of choice nodes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
If_ManCheckChoices_rec
(
If_Man_t
*
pIfMan
,
If_Obj_t
*
pIfObj
)
{
if
(
!
pIfObj
||
pIfObj
->
Type
!=
IF_AND
||
pIfObj
->
fDriver
)
return
;
pIfObj
->
fDriver
=
1
;
If_ManCheckChoices_rec
(
pIfMan
,
If_ObjFanin0
(
pIfObj
)
);
If_ManCheckChoices_rec
(
pIfMan
,
If_ObjFanin1
(
pIfObj
)
);
If_ManCheckChoices_rec
(
pIfMan
,
pIfObj
->
pEquiv
);
}
void
If_ManCheckChoices
(
If_Man_t
*
pIfMan
)
{
If_Obj_t
*
pIfObj
;
int
i
,
fFound
=
0
;
If_ManForEachObj
(
pIfMan
,
pIfObj
,
i
)
pIfObj
->
fDriver
=
0
;
If_ManForEachCo
(
pIfMan
,
pIfObj
,
i
)
If_ManCheckChoices_rec
(
pIfMan
,
If_ObjFanin0
(
pIfObj
)
);
If_ManForEachNode
(
pIfMan
,
pIfObj
,
i
)
if
(
!
pIfObj
->
fDriver
)
printf
(
"Object %d is dangling.
\n
"
,
i
),
fFound
=
1
;
if
(
!
fFound
)
printf
(
"There are no dangling objects.
\n
"
);
If_ManForEachObj
(
pIfMan
,
pIfObj
,
i
)
pIfObj
->
fDriver
=
0
;
}
/**Function*************************************************************
...
...
@@ -824,6 +861,7 @@ If_Man_t * Gia_ManToIf( Gia_Man_t * p, If_Par_t * pPars )
}
if
(
Gia_ManHasChoices
(
p
)
)
Gia_ManCleanMark0
(
p
);
//If_ManCheckChoices( pIfMan );
return
pIfMan
;
}
...
...
src/map/if/ifMap.c
View file @
73f8b598
...
...
@@ -516,6 +516,7 @@ void If_ObjPerformMappingChoice( If_Man_t * p, If_Obj_t * pObj, int Mode, int fP
// remove elementary cuts
for
(
pTemp
=
pObj
;
pTemp
;
pTemp
=
pTemp
->
pEquiv
)
if
(
pTemp
!=
pObj
||
pTemp
->
pCutSet
->
nCuts
>
1
)
pTemp
->
pCutSet
->
nCuts
--
;
// update the cutset of the node
...
...
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