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
976f5f5a
Commit
976f5f5a
authored
Sep 24, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to Boolean matching.
parent
d080336b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
5 deletions
+93
-5
src/base/abci/abc.c
+48
-2
src/base/abci/abcIf.c
+1
-1
src/map/if/if.h
+3
-0
src/map/if/ifDec10f.c
+0
-0
src/map/if/ifMap.c
+6
-2
src/misc/extra/extraBddKmap.c
+35
-0
No files found.
src/base/abci/abc.c
View file @
976f5f5a
...
...
@@ -902,6 +902,10 @@ void Abc_Init( Abc_Frame_t * pAbc )
printf( "\n" );
}
*/
{
extern
void
If_CluTest
();
If_CluTest
();
}
}
/**Function*************************************************************
...
...
@@ -12992,6 +12996,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars
->
fSeqMap
=
0
;
pPars
->
fBidec
=
0
;
pPars
->
fVerbose
=
0
;
pPars
->
pLutStruct
=
NULL
;
// internal parameters
pPars
->
fTruth
=
0
;
pPars
->
nLatches
=
pNtk
?
Abc_NtkLatchNum
(
pNtk
)
:
0
;
...
...
@@ -13003,7 +13008,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
fLutMux
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCFADEqaflepmrsdbugojikcvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCFADE
WS
qaflepmrsdbugojikcvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -13075,6 +13080,31 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
pPars
->
Epsilon
<
0
.
0
||
pPars
->
Epsilon
>
1
.
0
)
goto
usage
;
break
;
case
'W'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-W
\"
should be followed by a floating point number.
\n
"
);
goto
usage
;
}
pPars
->
WireDelay
=
(
float
)
atof
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
pPars
->
WireDelay
<
0
.
0
)
goto
usage
;
break
;
case
'S'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-S
\"
should be followed by string.
\n
"
);
goto
usage
;
}
pPars
->
pLutStruct
=
argv
[
globalUtilOptind
];
globalUtilOptind
++
;
if
(
!
strlen
(
pPars
->
pLutStruct
)
==
2
&&
!
strlen
(
pPars
->
pLutStruct
)
==
3
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-S
\"
should be followed by a 2- or 3-char string (e.g.
\"
44
\"
or
\"
555
\"
).
\n
"
);
goto
usage
;
}
break
;
case
'q'
:
pPars
->
fPreprocess
^=
1
;
break
;
...
...
@@ -13261,6 +13291,20 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars
->
pLutLib
=
NULL
;
}
// modify for LUT structures
if
(
pPars
->
pLutStruct
)
{
if
(
pPars
->
nLutSize
==
-
1
)
{
Abc_Print
(
-
1
,
"Please specify the maximum cut size (-K <num>) when LUT structure is used.
\n
"
);
return
1
;
}
pPars
->
fTruth
=
1
;
pPars
->
fExpRed
=
0
;
pPars
->
fUsePerm
=
1
;
pPars
->
pLutLib
=
NULL
;
}
// complain if truth tables are requested but the cut size is too large
if
(
pPars
->
fTruth
&&
pPars
->
nLutSize
>
IF_MAX_FUNC_LUTSIZE
)
{
...
...
@@ -13323,7 +13367,7 @@ usage:
sprintf
(
LutSize
,
"library"
);
else
sprintf
(
LutSize
,
"%d"
,
pPars
->
nLutSize
);
Abc_Print
(
-
2
,
"usage: if [-KCFA num] [-DE
float
] [-qarlepmsdbugojikcvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: if [-KCFA num] [-DE
W float] [-S str
] [-qarlepmsdbugojikcvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs FPGA technology mapping of the network
\n
"
);
Abc_Print
(
-
2
,
"
\t
-K num : the number of LUT inputs (2 < num < %d) [default = %s]
\n
"
,
IF_MAX_LUTSIZE
+
1
,
LutSize
);
Abc_Print
(
-
2
,
"
\t
-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]
\n
"
,
pPars
->
nCutsMax
);
...
...
@@ -13331,6 +13375,8 @@ usage:
Abc_Print
(
-
2
,
"
\t
-A num : the number of exact area recovery iterations (num >= 0) [default = %d]
\n
"
,
pPars
->
nAreaIters
);
Abc_Print
(
-
2
,
"
\t
-D float : sets the delay constraint for the mapping [default = %s]
\n
"
,
Buffer
);
Abc_Print
(
-
2
,
"
\t
-E float : sets epsilon used for tie-breaking [default = %f]
\n
"
,
pPars
->
Epsilon
);
Abc_Print
(
-
2
,
"
\t
-W float : sets wire delay between adjects LUTs [default = %f]
\n
"
,
pPars
->
WireDelay
);
Abc_Print
(
-
2
,
"
\t
-S str : string representing the LUT structure [default = %s]
\n
"
,
pPars
->
pLutStruct
?
pPars
->
pLutStruct
:
"not used"
);
Abc_Print
(
-
2
,
"
\t
-q : toggles preprocessing using several starting points [default = %s]
\n
"
,
pPars
->
fPreprocess
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-a : toggles area-oriented mapping [default = %s]
\n
"
,
pPars
->
fArea
?
"yes"
:
"no"
);
// Abc_Print( -2, "\t-f : toggles one fancy feature [default = %s]\n", pPars->fFancy? "yes": "no" );
...
...
src/base/abci/abcIf.c
View file @
976f5f5a
...
...
@@ -436,7 +436,7 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
pCutBest
=
If_ObjCutBest
(
pIfObj
);
// printf( "%d 0x%02X %d\n", pCutBest->nLeaves, 0xff & *If_CutTruth(pCutBest), pIfMan->pPars->pFuncCost(pCutBest) );
// if ( pIfMan->pPars->pLutLib && pIfMan->pPars->pLutLib->fVarPinDelays )
if
(
!
pIfMan
->
pPars
->
fDelayOpt
)
if
(
!
pIfMan
->
pPars
->
fDelayOpt
&&
!
pIfMan
->
pPars
->
pLutStruct
)
If_CutRotatePins
(
pIfMan
,
pCutBest
);
if
(
pIfMan
->
pPars
->
fUseCnfs
||
pIfMan
->
pPars
->
fUseMv
)
{
...
...
src/map/if/if.h
View file @
976f5f5a
...
...
@@ -101,6 +101,8 @@ struct If_Par_t_
int
fEnableCheck10
;
// enable additional checking
int
fEnableRealPos
;
// enable additional feature
int
fVerbose
;
// the verbosity flag
char
*
pLutStruct
;
// LUT structure
float
WireDelay
;
// wire delay
// internal parameters
int
fDelayOpt
;
// special delay optimization
int
fAreaOnly
;
// area only mode
...
...
@@ -414,6 +416,7 @@ extern float If_CutPowerRefed( If_Man_t * p, If_Cut_t * pCut, If_Obj_t
extern
int
If_CutPerformCheck07
(
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
);
extern
int
If_CutPerformCheck08
(
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
);
extern
int
If_CutPerformCheck10
(
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
);
extern
float
If_CutDelayLutStruct
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
char
*
pStr
,
float
WireDelay
);
/*=== ifLib.c =============================================================*/
extern
If_Lib_t
*
If_LutLibRead
(
char
*
FileName
);
extern
If_Lib_t
*
If_LutLibDup
(
If_Lib_t
*
p
);
...
...
src/map/if/ifDec10f.c
View file @
976f5f5a
This diff is collapsed.
Click to expand it.
src/map/if/ifMap.c
View file @
976f5f5a
...
...
@@ -153,7 +153,9 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if
(
pCut
->
nLeaves
>
0
)
{
// recompute the parameters of the best cut
if
(
p
->
pPars
->
fDelayOpt
)
if
(
p
->
pPars
->
pLutStruct
)
pCut
->
Delay
=
If_CutDelayLutStruct
(
p
,
pCut
,
p
->
pPars
->
pLutStruct
,
p
->
pPars
->
WireDelay
);
else
if
(
p
->
pPars
->
fDelayOpt
)
pCut
->
Delay
=
If_CutDelaySopCost
(
p
,
pCut
);
else
pCut
->
Delay
=
If_CutDelay
(
p
,
pObj
,
pCut
);
...
...
@@ -215,7 +217,9 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if
(
pCut
->
Cost
==
IF_COST_MAX
)
continue
;
// check if the cut satisfies the required times
if
(
p
->
pPars
->
fDelayOpt
)
if
(
p
->
pPars
->
pLutStruct
)
pCut
->
Delay
=
If_CutDelayLutStruct
(
p
,
pCut
,
p
->
pPars
->
pLutStruct
,
p
->
pPars
->
WireDelay
);
else
if
(
p
->
pPars
->
fDelayOpt
)
pCut
->
Delay
=
If_CutDelaySopCost
(
p
,
pCut
);
else
pCut
->
Delay
=
If_CutDelay
(
p
,
pObj
,
pCut
);
...
...
src/misc/extra/extraBddKmap.c
View file @
976f5f5a
...
...
@@ -200,6 +200,7 @@ void Extra_PrintKMap(
int
fSuppType
,
/* the flag which determines how support is computed */
char
**
pVarNames
)
{
int
fPrintTruth
=
1
;
int
d
,
p
,
n
,
s
,
v
,
h
,
w
;
int
nVarsVer
;
int
nVarsHor
;
...
...
@@ -213,6 +214,40 @@ void Extra_PrintKMap(
fprintf
(
Output
,
"PrintKMap(): The on-set and the off-set overlap
\n
"
);
return
;
}
// print truth table for debugging
if
(
fPrintTruth
)
{
DdNode
*
bCube
,
*
bPart
;
printf
(
"Truth table: "
);
if
(
nVars
==
0
)
printf
(
"Constant"
);
else
if
(
nVars
==
1
)
printf
(
"1-var function"
);
else
{
// printf( "0x" );
for
(
d
=
(
1
<<
(
nVars
-
2
))
-
1
;
d
>=
0
;
d
--
)
{
int
Value
=
0
;
for
(
s
=
0
;
s
<
4
;
s
++
)
{
bCube
=
Extra_bddBitsToCube
(
dd
,
4
*
d
+
s
,
nVars
,
dd
->
vars
,
0
);
Cudd_Ref
(
bCube
);
bPart
=
Cudd_Cofactor
(
dd
,
OnSet
,
bCube
);
Cudd_Ref
(
bPart
);
Value
|=
((
int
)(
bPart
==
b1
)
<<
s
);
Cudd_RecursiveDeref
(
dd
,
bPart
);
Cudd_RecursiveDeref
(
dd
,
bCube
);
}
if
(
Value
<
10
)
fprintf
(
stdout
,
"%d"
,
Value
);
else
fprintf
(
stdout
,
"%c"
,
'a'
+
Value
-
10
);
}
}
printf
(
"
\n
"
);
}
/*
if ( OnSet == b1 )
{
...
...
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