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
cb7bf6ae
Commit
cb7bf6ae
authored
Oct 26, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to the truth table computation in 'if' package.
parent
f416e849
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
src/map/if/if.h
+4
-2
src/map/if/ifMan.c
+1
-2
src/map/if/ifMap.c
+3
-1
src/map/if/ifTruth.c
+0
-0
No files found.
src/map/if/if.h
View file @
cb7bf6ae
...
...
@@ -353,8 +353,9 @@ static inline void If_CutSetDataInt( If_Cut_t * pCut, int Data ) { *
static
inline
int
If_CutLeaveNum
(
If_Cut_t
*
pCut
)
{
return
pCut
->
nLeaves
;
}
static
inline
int
*
If_CutLeaves
(
If_Cut_t
*
pCut
)
{
return
pCut
->
pLeaves
;
}
static
inline
unsigned
*
If_CutTruth
(
If_Cut_t
*
pCut
)
{
return
pCut
->
pTruth
;
}
static
inline
word
*
If_CutTruthW
(
If_Cut_t
*
pCut
)
{
return
(
word
*
)
pCut
->
pTruth
;
}
static
inline
unsigned
If_CutSuppMask
(
If_Cut_t
*
pCut
)
{
return
(
~
(
unsigned
)
0
)
>>
(
32
-
pCut
->
nLeaves
);
}
static
inline
int
If_CutTruthWords
(
int
nVarsMax
)
{
return
nVarsMax
<=
5
?
1
:
(
1
<<
(
nVarsMax
-
5
));
}
static
inline
int
If_CutTruthWords
(
int
nVarsMax
)
{
return
nVarsMax
<=
5
?
2
:
(
1
<<
(
nVarsMax
-
5
));
}
static
inline
int
If_CutPermWords
(
int
nVarsMax
)
{
return
nVarsMax
/
sizeof
(
int
)
+
((
nVarsMax
%
sizeof
(
int
))
>
0
);
}
static
inline
float
If_CutLutArea
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
)
{
return
pCut
->
fUser
?
(
float
)
pCut
->
Cost
:
(
p
->
pPars
->
pLutLib
?
p
->
pPars
->
pLutLib
->
pLutAreas
[
pCut
->
nLeaves
]
:
(
float
)
1
.
0
);
}
...
...
@@ -505,8 +506,9 @@ extern void If_CutPropagateRequired( If_Man_t * p, If_Obj_t * pObj, I
extern
void
If_CutRotatePins
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
);
/*=== 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
void
If_CutTruthPermute
(
unsigned
*
pOut
,
unsigned
*
pIn
,
int
nVars
,
float
*
pDelays
,
int
*
pVars
);
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_CutComputeTruth2
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Cut_t
*
pCut0
,
If_Cut_t
*
pCut1
,
int
fCompl0
,
int
fCompl1
);
/*=== ifUtil.c ============================================================*/
extern
void
If_ManCleanNodeCopy
(
If_Man_t
*
p
);
extern
void
If_ManCleanCutData
(
If_Man_t
*
p
);
...
...
src/map/if/ifMan.c
View file @
cb7bf6ae
...
...
@@ -411,8 +411,7 @@ void If_ManSetupCutTriv( If_Man_t * p, If_Cut_t * pCut, int ObjId )
// set up elementary truth table of the unit cut
if
(
p
->
pPars
->
fTruth
)
{
int
i
,
nTruthWords
;
nTruthWords
=
pCut
->
nLimit
<=
5
?
1
:
(
1
<<
(
pCut
->
nLimit
-
5
));
int
i
,
nTruthWords
=
If_CutTruthWords
(
pCut
->
nLimit
);
for
(
i
=
0
;
i
<
nTruthWords
;
i
++
)
If_CutTruth
(
pCut
)[
i
]
=
0xAAAAAAAA
;
}
...
...
src/map/if/ifMap.c
View file @
cb7bf6ae
...
...
@@ -212,8 +212,10 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if
(
p
->
pPars
->
fTruth
)
{
// clock_t clk = clock();
int
RetValue
=
If_CutComputeTruth
(
p
,
pCut
,
pCut0
,
pCut1
,
pObj
->
fCompl0
,
pObj
->
fCompl1
);
// int RetValue = If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 );
int
RetValue
=
If_CutComputeTruth2
(
p
,
pCut
,
pCut0
,
pCut1
,
pObj
->
fCompl0
,
pObj
->
fCompl1
);
// p->timeTruth += clock() - clk;
pCut
->
fUseless
=
0
;
if
(
p
->
pPars
->
pFuncCell
&&
RetValue
<
2
)
{
...
...
src/map/if/ifTruth.c
View file @
cb7bf6ae
This diff is collapsed.
Click to expand it.
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