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
fcfafb06
Commit
fcfafb06
authored
Aug 12, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabling additional matching feature in the LUT mapper.
parent
ae27704c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
245 additions
and
8 deletions
+245
-8
abclib.dsp
+4
-0
src/aig/gia/giaIf.c
+29
-0
src/base/abci/abc.c
+31
-7
src/map/if/if.h
+5
-0
src/map/if/ifCut.c
+1
-1
src/map/if/ifDec07.c
+2
-0
src/map/if/ifDec16.c
+127
-0
src/map/if/ifDec75.c
+0
-0
src/map/if/module.make
+1
-0
src/misc/util/utilTruth.h
+44
-0
src/opt/dau/dau.h
+1
-0
No files found.
abclib.dsp
View file @
fcfafb06
...
@@ -2299,6 +2299,10 @@ SOURCE=.\src\map\if\ifDec16.c
...
@@ -2299,6 +2299,10 @@ SOURCE=.\src\map\if\ifDec16.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
SOURCE=.\src\map\if\ifDec75.c
# End Source File
# Begin Source File
SOURCE=.\src\map\if\ifLibBox.c
SOURCE=.\src\map\if\ifLibBox.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
...
...
src/aig/gia/giaIf.c
View file @
fcfafb06
...
@@ -235,6 +235,34 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p )
...
@@ -235,6 +235,34 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p )
Abc_Print
(
1
,
"lev =%5d "
,
LevelMax
);
Abc_Print
(
1
,
"lev =%5d "
,
LevelMax
);
Abc_Print
(
1
,
"mem =%5.2f MB"
,
4
.
0
*
(
Gia_ManObjNum
(
p
)
+
2
*
nLuts
+
nFanins
)
/
(
1
<<
20
)
);
Abc_Print
(
1
,
"mem =%5.2f MB"
,
4
.
0
*
(
Gia_ManObjNum
(
p
)
+
2
*
nLuts
+
nFanins
)
/
(
1
<<
20
)
);
Abc_Print
(
1
,
"
\n
"
);
Abc_Print
(
1
,
"
\n
"
);
{
char
*
pFileName
=
"stats_map.txt"
;
static
char
FileNameOld
[
1000
]
=
{
0
};
static
int
nNodesOld
,
nAreaOld
,
nDelayOld
;
static
abctime
clk
=
0
;
FILE
*
pTable
=
fopen
(
pFileName
,
"a+"
);
if
(
strcmp
(
FileNameOld
,
p
->
pName
)
)
{
sprintf
(
FileNameOld
,
"%s"
,
p
->
pName
);
fprintf
(
pTable
,
"
\n
"
);
fprintf
(
pTable
,
"%s "
,
p
->
pName
);
fprintf
(
pTable
,
"%d "
,
Gia_ManCiNum
(
p
)
);
fprintf
(
pTable
,
"%d "
,
Gia_ManCoNum
(
p
)
);
fprintf
(
pTable
,
"%d "
,
Gia_ManAndNum
(
p
)
);
fprintf
(
pTable
,
"%d "
,
nLuts
);
fprintf
(
pTable
,
"%d "
,
LevelMax
);
clk
=
Abc_Clock
();
}
else
{
fprintf
(
pTable
,
" "
);
fprintf
(
pTable
,
"%d "
,
nLuts
);
fprintf
(
pTable
,
"%d "
,
LevelMax
);
// fprintf( pTable, "%.2f", 1.0*(Abc_Clock() - clk)/CLOCKS_PER_SEC );
}
fclose
(
pTable
);
}
}
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -344,6 +372,7 @@ void Gia_ManChoiceLevel_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
...
@@ -344,6 +372,7 @@ void Gia_ManChoiceLevel_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
if
(
LevelMax
<
Gia_ObjLevel
(
p
,
pNext
)
)
if
(
LevelMax
<
Gia_ObjLevel
(
p
,
pNext
)
)
LevelMax
=
Gia_ObjLevel
(
p
,
pNext
);
LevelMax
=
Gia_ObjLevel
(
p
,
pNext
);
LevelMax
++
;
LevelMax
++
;
assert
(
LevelMax
>
0
);
// get the level of the nodes in the choice node
// get the level of the nodes in the choice node
if
(
(
pNext
=
Gia_ObjSiblObj
(
p
,
Gia_ObjId
(
p
,
pObj
)))
)
if
(
(
pNext
=
Gia_ObjSiblObj
(
p
,
Gia_ObjId
(
p
,
pObj
)))
)
...
...
src/base/abci/abc.c
View file @
fcfafb06
...
@@ -29192,7 +29192,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -29192,7 +29192,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
pPars
->
pLutLib
=
(
If_LibLut_t
*
)
pAbc
->
pLibLut
;
pPars
->
pLutLib
=
(
If_LibLut_t
*
)
pAbc
->
pLibLut
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCFAGDEWSqa
flepmrsdbgyojik
czvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCFAGDEWSqa
lepmrsdbgyojikfu
czvh"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -29309,9 +29309,6 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -29309,9 +29309,6 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'r'
:
case
'r'
:
pPars
->
fExpRed
^=
1
;
pPars
->
fExpRed
^=
1
;
break
;
break
;
case
'f'
:
pPars
->
fFancy
^=
1
;
break
;
case
'l'
:
case
'l'
:
pPars
->
fLatchPaths
^=
1
;
pPars
->
fLatchPaths
^=
1
;
break
;
break
;
...
@@ -29351,6 +29348,12 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -29351,6 +29348,12 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'k'
:
case
'k'
:
pPars
->
fEnableCheck10
^=
1
;
pPars
->
fEnableCheck10
^=
1
;
break
;
break
;
case
'f'
:
pPars
->
fEnableCheck75
^=
1
;
break
;
case
'u'
:
pPars
->
fEnableCheck75u
^=
1
;
break
;
case
'c'
:
case
'c'
:
pPars
->
fEnableRealPos
^=
1
;
pPars
->
fEnableRealPos
^=
1
;
break
;
break
;
...
@@ -29416,7 +29419,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -29416,7 +29419,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars
->
fCutMin
=
1
;
pPars
->
fCutMin
=
1
;
}
}
if
(
pPars
->
fEnableCheck07
+
pPars
->
fEnableCheck08
+
pPars
->
fEnableCheck10
+
(
pPars
->
pLutStruct
!=
NULL
)
>
1
)
if
(
pPars
->
fEnableCheck07
+
pPars
->
fEnableCheck08
+
pPars
->
fEnableCheck10
+
pPars
->
fEnableCheck75
+
pPars
->
fEnableCheck75u
+
(
pPars
->
pLutStruct
!=
NULL
)
>
1
)
{
{
Abc_Print
(
-
1
,
"Only one additional check can be performed at the same time.
\n
"
);
Abc_Print
(
-
1
,
"Only one additional check can be performed at the same time.
\n
"
);
return
1
;
return
1
;
...
@@ -29451,6 +29454,26 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -29451,6 +29454,26 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars
->
pFuncCell
=
If_CutPerformCheck10
;
pPars
->
pFuncCell
=
If_CutPerformCheck10
;
pPars
->
fCutMin
=
1
;
pPars
->
fCutMin
=
1
;
}
}
if
(
pPars
->
fEnableCheck75
)
{
if
(
pPars
->
nLutSize
<
6
||
pPars
->
nLutSize
>
8
)
{
Abc_Print
(
-
1
,
"This feature only works for {6,7,8}-LUTs.
\n
"
);
return
1
;
}
pPars
->
pFuncCell
=
If_CutPerformCheck75
;
pPars
->
fCutMin
=
1
;
}
if
(
pPars
->
fEnableCheck75u
)
{
if
(
pPars
->
nLutSize
<
6
||
pPars
->
nLutSize
>
8
)
{
Abc_Print
(
-
1
,
"This feature only works for {6,7,8}-LUTs.
\n
"
);
return
1
;
}
pPars
->
pFuncCell
=
If_CutPerformCheck75
;
pPars
->
fCutMin
=
1
;
}
if
(
pPars
->
pLutStruct
)
if
(
pPars
->
pLutStruct
)
{
{
if
(
pPars
->
nLutSize
<
6
||
pPars
->
nLutSize
>
16
)
if
(
pPars
->
nLutSize
<
6
||
pPars
->
nLutSize
>
16
)
...
@@ -29536,7 +29559,7 @@ usage:
...
@@ -29536,7 +29559,7 @@ usage:
sprintf
(
LutSize
,
"library"
);
sprintf
(
LutSize
,
"library"
);
else
else
sprintf
(
LutSize
,
"%d"
,
pPars
->
nLutSize
);
sprintf
(
LutSize
,
"%d"
,
pPars
->
nLutSize
);
Abc_Print
(
-
2
,
"usage: &if [-KCFAG num] [-DEW float] [-S str] [-qarlepmsdbgyojikczvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &if [-KCFAG num] [-DEW float] [-S str] [-qarlepmsdbgyojik
fu
czvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs FPGA technology mapping of the network
\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
-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
);
Abc_Print
(
-
2
,
"
\t
-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]
\n
"
,
pPars
->
nCutsMax
);
...
@@ -29549,7 +29572,6 @@ usage:
...
@@ -29549,7 +29572,6 @@ usage:
Abc_Print
(
-
2
,
"
\t
-S str : string representing the LUT structure [default = %s]
\n
"
,
pPars
->
pLutStruct
?
pPars
->
pLutStruct
:
"not used"
);
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
-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
-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" );
Abc_Print
(
-
2
,
"
\t
-r : enables expansion/reduction of the best cuts [default = %s]
\n
"
,
pPars
->
fExpRed
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-r : enables expansion/reduction of the best cuts [default = %s]
\n
"
,
pPars
->
fExpRed
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-l : optimizes latch paths for delay, other paths for area [default = %s]
\n
"
,
pPars
->
fLatchPaths
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-l : optimizes latch paths for delay, other paths for area [default = %s]
\n
"
,
pPars
->
fLatchPaths
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-e : uses edge-based cut selection heuristics [default = %s]
\n
"
,
pPars
->
fEdge
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-e : uses edge-based cut selection heuristics [default = %s]
\n
"
,
pPars
->
fEdge
?
"yes"
:
"no"
);
...
@@ -29564,6 +29586,8 @@ usage:
...
@@ -29564,6 +29586,8 @@ usage:
Abc_Print
(
-
2
,
"
\t
-j : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck07
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-j : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck07
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-i : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck08
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-i : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck08
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-k : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck10
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-k : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck10
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-f : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck75
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-u : toggles enabling additional check [default = %s]
\n
"
,
pPars
->
fEnableCheck75u
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-c : toggles enabling additional feature [default = %s]
\n
"
,
pPars
->
fEnableRealPos
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-c : toggles enabling additional feature [default = %s]
\n
"
,
pPars
->
fEnableRealPos
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-z : toggles deriving LUTs when mapping into LUT structures [default = %s]
\n
"
,
pPars
->
fDeriveLuts
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-z : toggles deriving LUTs when mapping into LUT structures [default = %s]
\n
"
,
pPars
->
fDeriveLuts
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggles verbose output [default = %s]
\n
"
,
pPars
->
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggles verbose output [default = %s]
\n
"
,
pPars
->
fVerbose
?
"yes"
:
"no"
);
src/map/if/if.h
View file @
fcfafb06
...
@@ -117,6 +117,8 @@ struct If_Par_t_
...
@@ -117,6 +117,8 @@ struct If_Par_t_
int
fEnableCheck07
;
// enable additional checking
int
fEnableCheck07
;
// enable additional checking
int
fEnableCheck08
;
// enable additional checking
int
fEnableCheck08
;
// enable additional checking
int
fEnableCheck10
;
// enable additional checking
int
fEnableCheck10
;
// enable additional checking
int
fEnableCheck75
;
// enable additional checking
int
fEnableCheck75u
;
// enable additional checking
int
fEnableRealPos
;
// enable additional feature
int
fEnableRealPos
;
// enable additional feature
int
fUseDsd
;
// compute DSD of the cut functions
int
fUseDsd
;
// compute DSD of the cut functions
int
fDeriveLuts
;
// enables deriving LUT structures
int
fDeriveLuts
;
// enables deriving LUT structures
...
@@ -492,6 +494,9 @@ extern int If_CutPerformCheck07( If_Man_t * p, unsigned * pTruth, in
...
@@ -492,6 +494,9 @@ extern int If_CutPerformCheck07( If_Man_t * p, unsigned * pTruth, in
extern
int
If_CutPerformCheck08
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck08
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck10
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck10
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck16
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck16
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck45
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck54
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
int
If_CutPerformCheck75
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
);
extern
float
If_CutDelayLutStruct
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
char
*
pStr
,
float
WireDelay
);
extern
float
If_CutDelayLutStruct
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
char
*
pStr
,
float
WireDelay
);
extern
int
If_CluCheckExt
(
void
*
p
,
word
*
pTruth
,
int
nVars
,
int
nLutLeaf
,
int
nLutRoot
,
extern
int
If_CluCheckExt
(
void
*
p
,
word
*
pTruth
,
int
nVars
,
int
nLutLeaf
,
int
nLutRoot
,
char
*
pLut0
,
char
*
pLut1
,
word
*
pFunc0
,
word
*
pFunc1
);
char
*
pLut0
,
char
*
pLut1
,
word
*
pFunc0
,
word
*
pFunc1
);
...
...
src/map/if/ifCut.c
View file @
fcfafb06
...
@@ -856,7 +856,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut )
...
@@ -856,7 +856,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut )
return
;
return
;
}
}
if
(
(
p
->
pPars
->
fUseDsd
||
p
->
pPars
->
fUseBat
||
p
->
pPars
->
fEnableCheck07
||
p
->
pPars
->
fEnableCheck08
||
p
->
pPars
->
fEnableCheck10
||
p
->
pPars
->
pLutStruct
||
p
->
pPars
->
fUserRecLib
)
&&
!
pCut
->
fUseless
)
if
(
(
p
->
pPars
->
fUseDsd
||
p
->
pPars
->
fUseBat
||
p
->
pPars
->
fEnableCheck07
||
p
->
pPars
->
fEnableCheck08
||
p
->
pPars
->
fEnableCheck10
||
p
->
pPars
->
fEnableCheck75
||
p
->
pPars
->
fEnableCheck75u
||
p
->
pPars
->
pLutStruct
||
p
->
pPars
->
fUserRecLib
)
&&
!
pCut
->
fUseless
)
{
{
If_Cut_t
*
pFirst
=
pCutSet
->
ppCuts
[
0
];
If_Cut_t
*
pFirst
=
pCutSet
->
ppCuts
[
0
];
if
(
pFirst
->
fUseless
||
If_ManSortCompare
(
p
,
pFirst
,
pCut
)
==
1
)
if
(
pFirst
->
fUseless
||
If_ManSortCompare
(
p
,
pFirst
,
pCut
)
==
1
)
...
...
src/map/if/ifDec07.c
View file @
fcfafb06
...
@@ -455,10 +455,12 @@ word If_Dec7Perform( word t0[2], int fDerive )
...
@@ -455,10 +455,12 @@ word If_Dec7Perform( word t0[2], int fDerive )
// start arrays
// start arrays
for
(
i
=
0
;
i
<
7
;
i
++
)
for
(
i
=
0
;
i
<
7
;
i
++
)
{
{
/*
if ( i < 6 )
if ( i < 6 )
assert( If_Dec6HasVar( t[0], i ) || If_Dec6HasVar( t[1], i ) );
assert( If_Dec6HasVar( t[0], i ) || If_Dec6HasVar( t[1], i ) );
else
else
assert( t[0] != t[1] );
assert( t[0] != t[1] );
*/
Pla2Var
[
i
]
=
Var2Pla
[
i
]
=
i
;
Pla2Var
[
i
]
=
Var2Pla
[
i
]
=
i
;
}
}
// generate permutations
// generate permutations
...
...
src/map/if/ifDec16.c
View file @
fcfafb06
...
@@ -1749,6 +1749,133 @@ If_Grp_t If_CluCheck( If_Man_t * p, word * pTruth0, int nVars, int iVarStart, in
...
@@ -1749,6 +1749,133 @@ If_Grp_t If_CluCheck( If_Man_t * p, word * pTruth0, int nVars, int iVarStart, in
return
G1
;
return
G1
;
}
}
static
inline
word
Abc_Tt6Cofactor0
(
word
t
,
int
iVar
)
{
assert
(
iVar
>=
0
&&
iVar
<
6
);
return
(
t
&~
Truth6
[
iVar
])
|
((
t
&~
Truth6
[
iVar
])
<<
(
1
<<
iVar
));
}
static
inline
word
Abc_Tt6Cofactor1
(
word
t
,
int
iVar
)
{
assert
(
iVar
>=
0
&&
iVar
<
6
);
return
(
t
&
Truth6
[
iVar
])
|
((
t
&
Truth6
[
iVar
])
>>
(
1
<<
iVar
));
}
int
If_CluCheckDecIn
(
word
t
,
int
nVars
)
{
int
v
,
u
,
Cof2
[
2
],
Cof4
[
4
];
// for ( v = 0; v < nVars; v++ )
for
(
v
=
0
;
v
<
1
;
v
++
)
// restrict to the first (decomposed) input
{
Cof2
[
0
]
=
Abc_Tt6Cofactor0
(
t
,
v
);
Cof2
[
1
]
=
Abc_Tt6Cofactor1
(
t
,
v
);
for
(
u
=
v
+
1
;
u
<
nVars
;
u
++
)
{
Cof4
[
0
]
=
Abc_Tt6Cofactor0
(
Cof2
[
0
],
u
);
Cof4
[
1
]
=
Abc_Tt6Cofactor1
(
Cof2
[
0
],
u
);
Cof4
[
2
]
=
Abc_Tt6Cofactor0
(
Cof2
[
1
],
u
);
Cof4
[
3
]
=
Abc_Tt6Cofactor1
(
Cof2
[
1
],
u
);
if
(
Cof4
[
0
]
==
Cof4
[
1
]
&&
Cof4
[
0
]
==
Cof4
[
2
]
)
return
1
;
if
(
Cof4
[
0
]
==
Cof4
[
2
]
&&
Cof4
[
0
]
==
Cof4
[
3
]
)
return
1
;
if
(
Cof4
[
0
]
==
Cof4
[
1
]
&&
Cof4
[
0
]
==
Cof4
[
3
]
)
return
1
;
if
(
Cof4
[
1
]
==
Cof4
[
2
]
&&
Cof4
[
1
]
==
Cof4
[
3
]
)
return
1
;
}
}
return
0
;
}
int
If_CluCheckDecInU
(
word
t
,
int
nVars
)
{
int
v
,
u
,
Cof2
[
2
],
Cof4
[
4
];
// for ( v = 0; v < nVars; v++ )
for
(
v
=
0
;
v
<
1
;
v
++
)
// restrict to the first (decomposed) input
{
Cof2
[
0
]
=
Abc_Tt6Cofactor0
(
t
,
v
);
Cof2
[
1
]
=
Abc_Tt6Cofactor1
(
t
,
v
);
for
(
u
=
v
+
1
;
u
<
nVars
;
u
++
)
{
Cof4
[
0
]
=
Abc_Tt6Cofactor0
(
Cof2
[
0
],
u
);
Cof4
[
1
]
=
Abc_Tt6Cofactor1
(
Cof2
[
0
],
u
);
Cof4
[
2
]
=
Abc_Tt6Cofactor0
(
Cof2
[
1
],
u
);
Cof4
[
3
]
=
Abc_Tt6Cofactor1
(
Cof2
[
1
],
u
);
if
(
Cof4
[
0
]
==
Cof4
[
1
]
&&
Cof4
[
0
]
==
Cof4
[
2
]
)
return
1
;
if
(
Cof4
[
0
]
==
Cof4
[
2
]
&&
Cof4
[
0
]
==
Cof4
[
3
]
)
return
1
;
}
}
return
0
;
}
int
If_CluCheckDecOut
(
word
t
,
int
nVars
)
{
int
v
;
for
(
v
=
0
;
v
<
nVars
;
v
++
)
if
(
(
t
&
Truth6
[
v
])
==
0
||
// F * !a
(
~
t
&
Truth6
[
v
])
==
0
||
// !F * !a
(
t
&
~
Truth6
[
v
])
==
0
||
// F * a
(
~
t
&
~
Truth6
[
v
])
==
0
// !F * a
)
return
1
;
return
0
;
}
int
If_CluCheckDecOutU
(
word
t
,
int
nVars
)
{
int
v
;
for
(
v
=
0
;
v
<
nVars
;
v
++
)
if
(
(
t
&
~
Truth6
[
v
])
==
0
||
// F * a
(
~
t
&
~
Truth6
[
v
])
==
0
// !F * a
)
return
1
;
return
0
;
}
int
If_CutPerformCheck45
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
)
{
// 5LUT -> 4LUT
If_Grp_t
G
,
R
;
word
Func0
,
Func1
;
G
=
If_CluCheck
(
p
,
(
word
*
)
pTruth
,
nLeaves
,
0
,
5
,
4
,
&
R
,
&
Func0
,
&
Func1
,
NULL
,
0
);
if
(
G
.
nVars
==
0
)
return
0
;
Func0
=
If_CluAdjust
(
Func0
,
R
.
nVars
);
Func1
=
If_CluAdjust
(
Func1
,
G
.
nVars
);
#if 0
Kit_DsdPrintFromTruth( pTruth, nVars ); printf( "\n" );
Kit_DsdPrintFromTruth( (unsigned*)&Func0, R.nVars ); printf( "\n" );
Kit_DsdPrintFromTruth( (unsigned*)&Func1, G.nVars ); printf( "\n" );
If_CluPrintGroup( &R );
If_CluPrintGroup( &G );
#endif
if
(
G
.
nVars
<
5
||
(
p
->
pPars
->
fEnableCheck75
&&
If_CluCheckDecOut
(
Func1
,
5
))
||
(
p
->
pPars
->
fEnableCheck75u
&&
If_CluCheckDecOutU
(
Func1
,
5
))
)
return
1
;
return
0
;
}
int
If_CutPerformCheck54
(
If_Man_t
*
p
,
unsigned
*
pTruth
,
int
nVars
,
int
nLeaves
,
char
*
pStr
)
{
// 4LUT -> 5LUT
If_Grp_t
G
,
R
;
word
Func0
,
Func1
;
G
=
If_CluCheck
(
p
,
(
word
*
)
pTruth
,
nLeaves
,
0
,
4
,
5
,
&
R
,
&
Func0
,
&
Func1
,
NULL
,
0
);
if
(
G
.
nVars
==
0
)
return
0
;
Func0
=
If_CluAdjust
(
Func0
,
R
.
nVars
);
Func1
=
If_CluAdjust
(
Func1
,
G
.
nVars
);
#if 0
Kit_DsdPrintFromTruth( pTruth, nVars ); printf( "\n" );
Kit_DsdPrintFromTruth( (unsigned*)&Func0, R.nVars ); printf( "\n" );
Kit_DsdPrintFromTruth( (unsigned*)&Func1, G.nVars ); printf( "\n" );
If_CluPrintGroup( &R );
If_CluPrintGroup( &G );
#endif
if
(
R
.
nVars
<
5
||
(
p
->
pPars
->
fEnableCheck75
&&
If_CluCheckDecIn
(
Func0
,
5
))
||
(
p
->
pPars
->
fEnableCheck75u
&&
If_CluCheckDecInU
(
Func0
,
5
))
)
return
1
;
return
0
;
}
// returns the best group found
// returns the best group found
If_Grp_t
If_CluCheck3
(
If_Man_t
*
p
,
word
*
pTruth0
,
int
nVars
,
int
nLutLeaf
,
int
nLutLeaf2
,
int
nLutRoot
,
If_Grp_t
If_CluCheck3
(
If_Man_t
*
p
,
word
*
pTruth0
,
int
nVars
,
int
nLutLeaf
,
int
nLutLeaf2
,
int
nLutRoot
,
If_Grp_t
*
pR
,
If_Grp_t
*
pG2
,
word
*
pFunc0
,
word
*
pFunc1
,
word
*
pFunc2
)
If_Grp_t
*
pR
,
If_Grp_t
*
pG2
,
word
*
pFunc0
,
word
*
pFunc1
,
word
*
pFunc2
)
...
...
src/map/if/ifDec75.c
0 → 100644
View file @
fcfafb06
This diff is collapsed.
Click to expand it.
src/map/if/module.make
View file @
fcfafb06
...
@@ -5,6 +5,7 @@ SRC += src/map/if/ifCom.c \
...
@@ -5,6 +5,7 @@ SRC += src/map/if/ifCom.c \
src/map/if/ifDec08.c
\
src/map/if/ifDec08.c
\
src/map/if/ifDec10.c
\
src/map/if/ifDec10.c
\
src/map/if/ifDec16.c
\
src/map/if/ifDec16.c
\
src/map/if/ifDec75.c
\
src/map/if/ifLibBox.c
\
src/map/if/ifLibBox.c
\
src/map/if/ifLibLut.c
\
src/map/if/ifLibLut.c
\
src/map/if/ifMan.c
\
src/map/if/ifMan.c
\
...
...
src/misc/util/utilTruth.h
View file @
fcfafb06
...
@@ -1067,6 +1067,50 @@ static inline void Abc_TtSwapVars( word * pTruth, int nVars, int iVar, int jVar
...
@@ -1067,6 +1067,50 @@ static inline void Abc_TtSwapVars( word * pTruth, int nVars, int iVar, int jVar
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Support minimization.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
void
Abc_TtShrink
(
word
*
pF
,
int
nVars
,
int
nVarsAll
,
unsigned
Phase
)
{
int
i
,
k
,
Var
=
0
;
assert
(
nVarsAll
<=
16
);
for
(
i
=
0
;
i
<
nVarsAll
;
i
++
)
if
(
Phase
&
(
1
<<
i
)
)
{
for
(
k
=
i
-
1
;
k
>=
Var
;
k
--
)
Abc_TtSwapAdjacent
(
pF
,
Abc_TtWordNum
(
nVarsAll
),
k
);
Var
++
;
}
assert
(
Var
==
nVars
);
}
static
inline
int
Abc_TtMinimumBase
(
word
*
t
,
int
*
pSupp
,
int
nVarsAll
,
int
*
pnVars
)
{
int
v
,
iVar
=
0
,
uSupp
=
0
;
assert
(
nVarsAll
<=
16
);
for
(
v
=
0
;
v
<
nVarsAll
;
v
++
)
if
(
Abc_TtHasVar
(
t
,
nVarsAll
,
v
)
)
{
uSupp
|=
(
1
<<
v
);
if
(
pSupp
)
pSupp
[
iVar
]
=
pSupp
[
v
];
iVar
++
;
}
if
(
pnVars
)
*
pnVars
=
iVar
;
if
(
uSupp
==
0
||
Abc_TtSuppIsMinBase
(
uSupp
)
)
return
0
;
Abc_TtShrink
(
t
,
iVar
,
nVarsAll
,
uSupp
);
return
1
;
}
/**Function*************************************************************
Synopsis [Implemeting given NPN config.]
Synopsis [Implemeting given NPN config.]
Description []
Description []
...
...
src/opt/dau/dau.h
View file @
fcfafb06
...
@@ -77,6 +77,7 @@ static inline int Dau_DsdReadVar( char * p ) { if ( *p == '!' ) p++; return *p
...
@@ -77,6 +77,7 @@ static inline int Dau_DsdReadVar( char * p ) { if ( *p == '!' ) p++; return *p
/*=== dauCanon.c ==========================================================*/
/*=== dauCanon.c ==========================================================*/
extern
unsigned
Abc_TtCanonicize
(
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
);
extern
unsigned
Abc_TtCanonicize
(
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
);
/*=== dauDsd.c ==========================================================*/
/*=== dauDsd.c ==========================================================*/
extern
int
*
Dau_DsdComputeMatches
(
char
*
p
);
extern
int
Dau_DsdDecompose
(
word
*
pTruth
,
int
nVarsInit
,
int
fSplitPrime
,
int
fWriteTruth
,
char
*
pRes
);
extern
int
Dau_DsdDecompose
(
word
*
pTruth
,
int
nVarsInit
,
int
fSplitPrime
,
int
fWriteTruth
,
char
*
pRes
);
extern
void
Dau_DsdPrintFromTruth
(
FILE
*
pFile
,
word
*
pTruth
,
int
nVarsInit
);
extern
void
Dau_DsdPrintFromTruth
(
FILE
*
pFile
,
word
*
pTruth
,
int
nVarsInit
);
extern
word
*
Dau_DsdToTruth
(
char
*
p
,
int
nVars
);
extern
word
*
Dau_DsdToTruth
(
char
*
p
,
int
nVars
);
...
...
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