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
490e84c4
Commit
490e84c4
authored
Apr 28, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding on-the-fly truth-table minimization.
parent
334911a1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletions
+22
-1
src/map/if/if.h
+2
-0
src/map/if/ifDec16.c
+17
-0
src/map/if/ifMan.c
+3
-0
src/map/if/ifTruth.c
+0
-1
No files found.
src/map/if/if.h
View file @
490e84c4
...
@@ -177,6 +177,7 @@ struct If_Man_t_
...
@@ -177,6 +177,7 @@ struct If_Man_t_
int
nCutsUsed
;
// the number of cuts currently used
int
nCutsUsed
;
// the number of cuts currently used
int
nCutsMerged
;
// the total number of cuts merged
int
nCutsMerged
;
// the total number of cuts merged
unsigned
*
puTemp
[
4
];
// used for the truth table computation
unsigned
*
puTemp
[
4
];
// used for the truth table computation
If_Cut_t
*
pCutTemp
;
// temporary cut
int
SortMode
;
// one of the three sorting modes
int
SortMode
;
// one of the three sorting modes
int
fNextRound
;
// set to 1 after the first round
int
fNextRound
;
// set to 1 after the first round
int
nChoices
;
// the number of choice nodes
int
nChoices
;
// the number of choice nodes
...
@@ -495,6 +496,7 @@ extern float If_CutDelay( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pC
...
@@ -495,6 +496,7 @@ extern float If_CutDelay( If_Man_t * p, If_Obj_t * pObj, If_Cut_t * pC
extern
void
If_CutPropagateRequired
(
If_Man_t
*
p
,
If_Obj_t
*
pObj
,
If_Cut_t
*
pCut
,
float
Required
);
extern
void
If_CutPropagateRequired
(
If_Man_t
*
p
,
If_Obj_t
*
pObj
,
If_Cut_t
*
pCut
,
float
Required
);
extern
void
If_CutRotatePins
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
);
extern
void
If_CutRotatePins
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
);
/*=== ifTruth.c ===========================================================*/
/*=== ifTruth.c ===========================================================*/
extern
int
If_CutTruthMinimize
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
);
extern
int
If_CutComputeTruth
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Cut_t
*
pCut0
,
If_Cut_t
*
pCut1
,
int
fCompl0
,
int
fCompl1
);
extern
int
If_CutComputeTruth
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Cut_t
*
pCut0
,
If_Cut_t
*
pCut1
,
int
fCompl0
,
int
fCompl1
);
extern
void
If_CutTruthPermute
(
unsigned
*
pOut
,
unsigned
*
pIn
,
int
nVars
,
float
*
pDelays
,
int
*
pVars
);
extern
void
If_CutTruthPermute
(
unsigned
*
pOut
,
unsigned
*
pIn
,
int
nVars
,
float
*
pDelays
,
int
*
pVars
);
/*=== ifUtil.c ============================================================*/
/*=== ifUtil.c ============================================================*/
...
...
src/map/if/ifDec16.c
View file @
490e84c4
...
@@ -2040,6 +2040,23 @@ int If_CutPerformCheck16( If_Man_t * p, unsigned * pTruth, int nVars, int nLeave
...
@@ -2040,6 +2040,23 @@ int If_CutPerformCheck16( If_Man_t * p, unsigned * pTruth, int nVars, int nLeave
{
{
If_Grp_t
G1
=
{
0
};
//, G3 = {0};
If_Grp_t
G1
=
{
0
};
//, G3 = {0};
int
i
,
nLutLeaf
,
nLutLeaf2
,
nLutRoot
,
Length
;
int
i
,
nLutLeaf
,
nLutLeaf2
,
nLutRoot
,
Length
;
// if cutmin is disabled, minimize the cut
if
(
!
p
->
pPars
->
fCutMin
&&
If_CluSupportSize
((
word
*
)
pTruth
,
nVars
)
<
nLeaves
)
{
If_Cut_t
*
pCut
=
p
->
pCutTemp
;
pCut
->
nLimit
=
nVars
;
pCut
->
nLeaves
=
nLeaves
;
pCut
->
pLeaves
=
(
int
*
)(
pCut
+
1
);
for
(
i
=
0
;
i
<
nLeaves
;
i
++
)
pCut
->
pLeaves
[
i
]
=
i
;
pCut
->
pTruth
=
(
unsigned
*
)
pCut
->
pLeaves
+
pCut
->
nLimit
+
p
->
nPermWords
;
If_CluCopy
(
(
word
*
)
If_CutTruth
(
pCut
),
(
word
*
)
pTruth
,
nVars
);
if
(
If_CutTruthMinimize
(
p
,
pCut
)
>=
2
)
return
0
;
nLeaves
=
pCut
->
nLeaves
;
If_CluCopy
(
(
word
*
)
pTruth
,
(
word
*
)
If_CutTruth
(
pCut
),
nVars
);
}
// quit if parameters are wrong
// quit if parameters are wrong
Length
=
strlen
(
pStr
);
Length
=
strlen
(
pStr
);
if
(
Length
!=
2
&&
Length
!=
3
)
if
(
Length
!=
2
&&
Length
!=
3
)
...
...
src/map/if/ifMan.c
View file @
490e84c4
...
@@ -78,6 +78,8 @@ If_Man_t * If_ManStart( If_Par_t * pPars )
...
@@ -78,6 +78,8 @@ If_Man_t * If_ManStart( If_Par_t * pPars )
p
->
puTemp
[
1
]
=
p
->
puTemp
[
0
]
+
p
->
nTruthWords
;
p
->
puTemp
[
1
]
=
p
->
puTemp
[
0
]
+
p
->
nTruthWords
;
p
->
puTemp
[
2
]
=
p
->
puTemp
[
1
]
+
p
->
nTruthWords
;
p
->
puTemp
[
2
]
=
p
->
puTemp
[
1
]
+
p
->
nTruthWords
;
p
->
puTemp
[
3
]
=
p
->
puTemp
[
2
]
+
p
->
nTruthWords
;
p
->
puTemp
[
3
]
=
p
->
puTemp
[
2
]
+
p
->
nTruthWords
;
p
->
pCutTemp
=
(
If_Cut_t
*
)
ABC_ALLOC
(
char
,
p
->
nCutBytes
);
// create the constant node
// create the constant node
p
->
pConst1
=
If_ManSetupObj
(
p
);
p
->
pConst1
=
If_ManSetupObj
(
p
);
p
->
pConst1
->
Type
=
IF_CONST1
;
p
->
pConst1
->
Type
=
IF_CONST1
;
...
@@ -160,6 +162,7 @@ void If_ManStop( If_Man_t * p )
...
@@ -160,6 +162,7 @@ void If_ManStop( If_Man_t * p )
ABC_FREE
(
p
->
pMemCi
);
ABC_FREE
(
p
->
pMemCi
);
ABC_FREE
(
p
->
pMemAnd
);
ABC_FREE
(
p
->
pMemAnd
);
ABC_FREE
(
p
->
puTemp
[
0
]
);
ABC_FREE
(
p
->
puTemp
[
0
]
);
ABC_FREE
(
p
->
pCutTemp
);
// free pars memory
// free pars memory
if
(
p
->
pPars
->
pTimesArr
)
if
(
p
->
pPars
->
pTimesArr
)
ABC_FREE
(
p
->
pPars
->
pTimesArr
);
ABC_FREE
(
p
->
pPars
->
pTimesArr
);
...
...
src/map/if/ifTruth.c
View file @
490e84c4
...
@@ -27,7 +27,6 @@ ABC_NAMESPACE_IMPL_START
...
@@ -27,7 +27,6 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
static
int
If_CutTruthMinimize
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
);
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
...
...
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