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
0e05d148
Commit
0e05d148
authored
Jan 20, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with MUX restructuring.
parent
632c7a7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
src/aig/gia/giaUtil.c
+34
-7
No files found.
src/aig/gia/giaUtil.c
View file @
0e05d148
...
...
@@ -2396,29 +2396,56 @@ void Gia_ManDumpFiles( Gia_Man_t * p, int nCexesT, int nCexesV )
Gia_Man_t
*
Gia_ManDupWithMuxPos
(
Gia_Man_t
*
p
)
{
Vec_Int_t
*
vPoints
=
Vec_IntAlloc
(
1000
);
Vec_Int_t
*
vQuads
=
Vec_IntAlloc
(
1000
);
Vec_Bit_t
*
vHeads
=
Vec_BitStart
(
Gia_ManObjNum
(
p
)
);
Vec_Bit_t
*
vDatas
=
Vec_BitStart
(
Gia_ManObjNum
(
p
)
);
Gia_Obj_t
*
pObj
,
*
pCtrl
,
*
pData0
,
*
pData1
;
Gia_Man_t
*
pNew
=
Gia_ManDup
(
p
);
int
i
,
iObj
;
assert
(
Gia_ManRegNum
(
pNew
)
==
0
);
Gia_ManForEachCo
(
pNew
,
pObj
,
i
)
Gia_ObjFanin0
(
pObj
)
->
fMark0
=
1
;
Gia_ManForEachAnd
(
pNew
,
pObj
,
i
)
{
if
(
!
Gia_ObjIsMuxType
(
pObj
)
)
continue
;
pCtrl
=
Gia_ObjRecognizeMux
(
pObj
,
&
pData1
,
&
pData0
);
pCtrl
=
Gia_Regular
(
pCtrl
);
pData1
=
Gia_Regular
(
pData1
);
pData0
=
Gia_Regular
(
pData0
);
if
(
Gia_ObjIsAnd
(
pObj
)
&&
!
pObj
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pObj
)
);
if
(
Gia_ObjIsAnd
(
pCtrl
)
&&
!
pCtrl
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pCtrl
)
);
if
(
Gia_ObjIsAnd
(
pData1
)
&&
!
pData1
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pData1
)
);
if
(
Gia_ObjIsAnd
(
pData0
)
&&
!
pData0
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pData0
)
);
pData1
=
Gia_Regular
(
pData1
);
Vec_IntPushTwo
(
vQuads
,
Gia_ObjId
(
pNew
,
pObj
),
Gia_ObjId
(
pNew
,
pCtrl
)
);
Vec_IntPushTwo
(
vQuads
,
Gia_ObjId
(
pNew
,
pData0
),
Gia_ObjId
(
pNew
,
pData1
)
);
Vec_BitWriteEntry
(
vHeads
,
Gia_ObjId
(
pNew
,
pObj
),
1
);
Vec_BitWriteEntry
(
vDatas
,
Gia_ObjId
(
pNew
,
pData0
),
1
);
Vec_BitWriteEntry
(
vDatas
,
Gia_ObjId
(
pNew
,
pData1
),
1
);
}
Gia_ManForEachCo
(
pNew
,
pObj
,
i
)
Gia_ObjFanin0
(
pObj
)
->
fMark0
=
1
;
for
(
i
=
0
;
i
<
Vec_IntSize
(
vQuads
)
/
4
;
i
++
)
{
int
iObj
=
Vec_IntEntry
(
vQuads
,
4
*
i
+
0
);
int
iCtrl
=
Vec_IntEntry
(
vQuads
,
4
*
i
+
1
);
int
iData0
=
Vec_IntEntry
(
vQuads
,
4
*
i
+
2
);
int
iData1
=
Vec_IntEntry
(
vQuads
,
4
*
i
+
3
);
if
(
(
Vec_BitEntry
(
vHeads
,
iObj
)
&&
Vec_BitEntry
(
vDatas
,
iObj
))
||
(
Vec_BitEntry
(
vHeads
,
iData0
)
&&
Vec_BitEntry
(
vDatas
,
iData0
))
||
(
Vec_BitEntry
(
vHeads
,
iData1
)
&&
Vec_BitEntry
(
vDatas
,
iData1
))
)
{
Gia_Obj_t
*
pObj
=
Gia_ManObj
(
p
,
iObj
);
Gia_Obj_t
*
pCtrl
=
Gia_ManObj
(
p
,
iCtrl
);
Gia_Obj_t
*
pData0
=
Gia_ManObj
(
p
,
iData0
);
Gia_Obj_t
*
pData1
=
Gia_ManObj
(
p
,
iData1
);
if
(
Gia_ObjIsAnd
(
pObj
)
&&
!
pObj
->
fMark0
)
Vec_IntPush
(
vPoints
,
iObj
);
if
(
Gia_ObjIsAnd
(
pCtrl
)
&&
!
pCtrl
->
fMark0
)
Vec_IntPush
(
vPoints
,
iCtrl
);
if
(
Gia_ObjIsAnd
(
pData0
)
&&
!
pData0
->
fMark0
)
Vec_IntPush
(
vPoints
,
iData0
);
if
(
Gia_ObjIsAnd
(
pData1
)
&&
!
pData1
->
fMark0
)
Vec_IntPush
(
vPoints
,
iData1
);
}
}
Gia_ManCleanMark0
(
pNew
);
Vec_IntUniqify
(
vPoints
);
Vec_IntForEachEntry
(
vPoints
,
iObj
,
i
)
Gia_ManAppendCo
(
pNew
,
Abc_Var2Lit
(
iObj
,
0
)
);
Vec_IntFree
(
vPoints
);
Vec_IntFree
(
vQuads
);
Vec_BitFree
(
vHeads
);
Vec_BitFree
(
vDatas
);
return
pNew
;
}
...
...
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