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
2f1988e8
Commit
2f1988e8
authored
Oct 12, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MUX decomposition during mapping.
parent
3ac8aa9c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
src/aig/gia/giaIf.c
+10
-7
No files found.
src/aig/gia/giaIf.c
View file @
2f1988e8
...
@@ -1602,7 +1602,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
...
@@ -1602,7 +1602,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
int
nWords
=
Abc_Truth6WordNum
(
LutSize
);
int
nWords
=
Abc_Truth6WordNum
(
LutSize
);
int
truthId
=
Abc_Lit2Var
(
pCutBest
->
iCutFunc
);
int
truthId
=
Abc_Lit2Var
(
pCutBest
->
iCutFunc
);
int
nLeaves
=
pCutBest
->
nLeaves
;
int
nLeaves
=
pCutBest
->
nLeaves
;
int
c
,
iVar
=
Vec_StrEntry
(
pIfMan
->
vTtVars
[
nLeaves
],
truthId
),
iTemp
;
int
c
,
iVar
=
Vec_StrEntry
(
pIfMan
->
vTtVars
[
nLeaves
],
truthId
),
iTemp
,
iTopLit
;
assert
(
iVar
>=
0
&&
iVar
<
nLeaves
&&
LutSize
<=
13
);
assert
(
iVar
>=
0
&&
iVar
<
nLeaves
&&
LutSize
<=
13
);
for
(
c
=
0
;
c
<
2
;
c
++
)
for
(
c
=
0
;
c
<
2
;
c
++
)
{
{
...
@@ -1629,7 +1629,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
...
@@ -1629,7 +1629,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
}
}
iLitCofs
[
2
]
=
Vec_IntEntry
(
vLeaves
,
iVar
);
iLitCofs
[
2
]
=
Vec_IntEntry
(
vLeaves
,
iVar
);
// derive MUX
// derive MUX
if
(
iLitCofs
[
0
]
>
1
||
iLitCofs
[
1
]
>
1
)
if
(
iLitCofs
[
0
]
>
1
&&
iLitCofs
[
1
]
>
1
)
{
{
pTruthCof
[
0
]
=
ABC_CONST
(
0xCACACACACACACACA
);
pTruthCof
[
0
]
=
ABC_CONST
(
0xCACACACACACACACA
);
Vec_IntClear
(
vLeaves2
);
Vec_IntClear
(
vLeaves2
);
...
@@ -1637,25 +1637,28 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
...
@@ -1637,25 +1637,28 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
Vec_IntPush
(
vLeaves2
,
iLitCofs
[
1
]
);
Vec_IntPush
(
vLeaves2
,
iLitCofs
[
1
]
);
Vec_IntPush
(
vLeaves2
,
iLitCofs
[
2
]
);
Vec_IntPush
(
vLeaves2
,
iLitCofs
[
2
]
);
pIfObj
->
iCopy
=
Kit_TruthToGia
(
pNew
,
(
unsigned
*
)
pTruthCof
,
Vec_IntSize
(
vLeaves2
),
vCover
,
vLeaves2
,
0
);
pIfObj
->
iCopy
=
Kit_TruthToGia
(
pNew
,
(
unsigned
*
)
pTruthCof
,
Vec_IntSize
(
vLeaves2
),
vCover
,
vLeaves2
,
0
);
iTopLit
=
iLitCofs
[
2
];
}
}
else
else
{
{
iLitCofs
[
0
]
=
Abc_LitNot
(
Gia_ManAppendAnd2
(
pNew
,
iLitCofs
[
0
],
Abc_LitNot
(
iLitCofs
[
2
])
)
);
iLitCofs
[
1
]
=
Abc_LitNot
(
Gia_ManAppendAnd2
(
pNew
,
iLitCofs
[
1
],
iLitCofs
[
2
]
)
);
pIfObj
->
iCopy
=
Abc_LitNot
(
Gia_ManAppendAnd2
(
pNew
,
iLitCofs
[
0
],
iLitCofs
[
1
]
)
);
// collect leaves
// collect leaves
Vec_IntClear
(
vLeaves2
);
Vec_IntClear
(
vLeaves2
);
for
(
k
=
0
;
k
<
3
;
k
++
)
for
(
k
=
0
;
k
<
3
;
k
++
)
if
(
iLitCofs
[
k
]
>
1
)
if
(
iLitCofs
[
k
]
>
1
)
Vec_IntPush
(
vLeaves2
,
iLitCofs
[
k
]
);
Vec_IntPush
(
vLeaves2
,
iLitCofs
[
k
]
);
assert
(
Vec_IntSize
(
vLeaves2
)
>
1
);
assert
(
Vec_IntSize
(
vLeaves2
)
==
2
);
// create "MUX"
iLitCofs
[
0
]
=
Abc_LitNot
(
Gia_ManAppendAnd2
(
pNew
,
iLitCofs
[
0
],
Abc_LitNot
(
iLitCofs
[
2
])
)
);
iLitCofs
[
1
]
=
Abc_LitNot
(
Gia_ManAppendAnd2
(
pNew
,
iLitCofs
[
1
],
iLitCofs
[
2
]
)
);
pIfObj
->
iCopy
=
Abc_LitNot
(
Gia_ManAppendAnd2
(
pNew
,
iLitCofs
[
0
],
iLitCofs
[
1
]
)
);
iTopLit
=
pIfObj
->
iCopy
;
}
}
// create mapping
// create mapping
Vec_IntSetEntry
(
vMapping
,
Abc_Lit2Var
(
pIfObj
->
iCopy
),
Vec_IntSize
(
vMapping2
)
);
Vec_IntSetEntry
(
vMapping
,
Abc_Lit2Var
(
pIfObj
->
iCopy
),
Vec_IntSize
(
vMapping2
)
);
Vec_IntPush
(
vMapping2
,
Vec_IntSize
(
vLeaves2
)
);
Vec_IntPush
(
vMapping2
,
Vec_IntSize
(
vLeaves2
)
);
Vec_IntForEachEntry
(
vLeaves2
,
iTemp
,
k
)
Vec_IntForEachEntry
(
vLeaves2
,
iTemp
,
k
)
Vec_IntPush
(
vMapping2
,
Abc_Lit2Var
(
iTemp
)
);
Vec_IntPush
(
vMapping2
,
Abc_Lit2Var
(
iTemp
)
);
Vec_IntPush
(
vMapping2
,
-
Abc_Lit2Var
(
pIfObj
->
iCopy
)
);
Vec_IntPush
(
vMapping2
,
-
Abc_Lit2Var
(
iTopLit
)
);
pIfObj
->
iCopy
=
Abc_LitNotCond
(
pIfObj
->
iCopy
,
pCutBest
->
fCompl
);
pIfObj
->
iCopy
=
Abc_LitNotCond
(
pIfObj
->
iCopy
,
pCutBest
->
fCompl
);
}
}
else
if
(
(
pIfMan
->
pPars
->
fDeriveLuts
&&
pIfMan
->
pPars
->
fTruth
)
||
pIfMan
->
pPars
->
fUseDsd
||
pIfMan
->
pPars
->
fUseTtPerm
)
else
if
(
(
pIfMan
->
pPars
->
fDeriveLuts
&&
pIfMan
->
pPars
->
fTruth
)
||
pIfMan
->
pPars
->
fUseDsd
||
pIfMan
->
pPars
->
fUseTtPerm
)
...
...
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