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
b5df218d
Commit
b5df218d
authored
Mar 22, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with mapping.
parent
ace34099
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaKf.c
+15
-9
src/base/abci/abc.c
+6
-2
No files found.
src/aig/gia/gia.h
View file @
b5df218d
...
...
@@ -258,6 +258,7 @@ struct Jf_Par_t_
int
fCnfObjIds
;
int
fAddOrCla
;
int
fPureAig
;
int
fCutHashing
;
int
fVerbose
;
int
fVeryVerbose
;
int
nLutSizeMax
;
...
...
src/aig/gia/giaKf.c
View file @
b5df218d
...
...
@@ -144,8 +144,8 @@ static inline void Kf_SetPrepare( Kf_Set_t * p, int * pCuts0, int * pCuts1 )
{
int
i
;
// prepare hash table
for
(
i
=
0
;
i
<=
p
->
TableMask
;
i
++
)
assert
(
p
->
pTable
[
i
]
==
0
);
//
for ( i = 0; i <= p->TableMask; i++ )
//
assert( p->pTable[i] == 0 );
// prepare cut storage
for
(
i
=
0
;
i
<=
p
->
nLutSize
;
i
++
)
p
->
pList
[
i
]
=
-
1
;
...
...
@@ -333,7 +333,7 @@ static inline void Kf_HashCleanup( Kf_Set_t * p, int iStart )
{
int
i
;
for
(
i
=
iStart
;
i
<
p
->
nTEntries
;
i
++
)
p
->
p
Place
[
i
]
=
0
;
p
->
p
Table
[
p
->
pPlace
[
i
]
]
=
0
;
p
->
nTEntries
=
iStart
;
}
...
...
@@ -398,6 +398,7 @@ static inline void Kf_SetMergePairs( Kf_Set_t * p, Kf_Cut_t * pCut0, Kf_Cut_t *
break
;
if
(
i
<
pCut1
->
nLeaves
)
continue
;
p
->
CutCount
[
1
]
++
;
if
(
Kf_SetRemoveDuplicates
(
p
,
p
->
nTEntries
,
pCut0
->
Sign
|
pCut1
->
Sign
)
)
continue
;
// create new cut
...
...
@@ -417,6 +418,7 @@ static inline Kf_Cut_t * Kf_SetMerge( Kf_Set_t * p, int * pCuts0, int * pCuts1,
{
int
c0
,
c1
;
Kf_SetPrepare
(
p
,
pCuts0
,
pCuts1
);
p
->
CutCount
[
0
]
+=
p
->
nCuts0
*
p
->
nCuts1
;
for
(
c0
=
c1
=
0
;
c0
<
p
->
nCuts0
&&
c1
<
p
->
nCuts1
;
)
{
if
(
p
->
pCuts0
[
c0
].
nLeaves
>=
p
->
pCuts1
[
c1
].
nLeaves
)
...
...
@@ -424,8 +426,9 @@ static inline Kf_Cut_t * Kf_SetMerge( Kf_Set_t * p, int * pCuts0, int * pCuts1,
else
Kf_SetMergePairs
(
p
,
p
->
pCuts1
+
c1
++
,
p
->
pCuts0
+
c0
,
p
->
nCuts0
-
c0
,
fArea
);
}
p
->
CutCount
[
2
]
+=
p
->
nCuts
;
Kf_SetFilter
(
p
);
p
->
CutCount
[
3
]
+=
Abc_MinInt
(
p
->
nCuts
,
p
->
nCutNum
);
p
->
CutCount
[
3
]
+=
Abc_MinInt
(
p
->
nCuts
,
p
->
nCutNum
-
1
);
return
Kf_SetSelectBest
(
p
,
fArea
,
1
);
}
...
...
@@ -619,7 +622,7 @@ static inline Kf_Cut_t * Kf_SetMerge2( Kf_Set_t * p, int * pCuts0, int * pCuts1,
}
Kf_SetFilter2
(
p
);
p
->
CutCount
[
3
]
+=
Abc_MinInt
(
p
->
nCuts
,
p
->
nCutNum
-
1
);
return
Kf_SetSelectBest
(
p
,
fArea
,
0
);
return
Kf_SetSelectBest
(
p
,
fArea
,
1
);
}
...
...
@@ -766,7 +769,7 @@ void Kf_ManComputeMapping( Kf_Man_t * p )
if
(
p
->
pPars
->
fVerbose
)
{
printf
(
"Aig: CI = %d CO = %d AND = %d "
,
Gia_ManCiNum
(
p
->
pGia
),
Gia_ManCoNum
(
p
->
pGia
),
Gia_ManAndNum
(
p
->
pGia
)
);
printf
(
"LutSize = %d CutMax = %d
Rounds = %d
\n
"
,
p
->
pPars
->
nLutSize
,
p
->
pPars
->
nCutNum
,
p
->
pPars
->
nRounds
);
printf
(
"LutSize = %d CutMax = %d
Hash = %d
\n
"
,
p
->
pPars
->
nLutSize
,
p
->
pPars
->
nCutNum
,
p
->
pPars
->
fCutHashing
);
printf
(
"Computing cuts...
\r
"
);
fflush
(
stdout
);
}
...
...
@@ -781,8 +784,10 @@ void Kf_ManComputeMapping( Kf_Man_t * p )
}
else
if
(
Gia_ObjIsAnd
(
pObj
)
)
{
pCutBest
=
Kf_SetMerge2
(
p
->
pSett
,
Kf_ObjCuts0
(
p
,
i
),
Kf_ObjCuts1
(
p
,
i
),
p
->
pPars
->
fAreaOnly
,
p
->
pPars
->
fCutMin
);
// pCutBest = Kf_SetMerge( p->pSett, Kf_ObjCuts0(p, i), Kf_ObjCuts1(p, i), p->pPars->fAreaOnly, p->pPars->fCutMin );
if
(
p
->
pPars
->
fCutHashing
)
pCutBest
=
Kf_SetMerge
(
p
->
pSett
,
Kf_ObjCuts0
(
p
,
i
),
Kf_ObjCuts1
(
p
,
i
),
p
->
pPars
->
fAreaOnly
,
p
->
pPars
->
fCutMin
);
else
pCutBest
=
Kf_SetMerge2
(
p
->
pSett
,
Kf_ObjCuts0
(
p
,
i
),
Kf_ObjCuts1
(
p
,
i
),
p
->
pPars
->
fAreaOnly
,
p
->
pPars
->
fCutMin
);
Kf_ManSaveResults
(
p
->
pSett
->
ppCuts
,
p
->
pSett
->
nCuts
,
pCutBest
,
p
->
vTemp
);
Vec_IntWriteEntry
(
&
p
->
vTime
,
i
,
pCutBest
->
Delay
+
1
);
Vec_FltWriteEntry
(
&
p
->
vArea
,
i
,
(
pCutBest
->
Area
+
1
)
/
Kf_ObjRefs
(
p
,
i
)
);
...
...
@@ -926,13 +931,14 @@ void Kf_ManSetDefaultPars( Jf_Par_t * pPars )
pPars
->
nRounds
=
1
;
pPars
->
nVerbLimit
=
5
;
pPars
->
DelayTarget
=
-
1
;
pPars
->
fAreaOnly
=
1
;
pPars
->
fAreaOnly
=
0
;
pPars
->
fOptEdge
=
1
;
pPars
->
fCoarsen
=
0
;
pPars
->
fCutMin
=
0
;
pPars
->
fFuncDsd
=
0
;
pPars
->
fGenCnf
=
0
;
pPars
->
fPureAig
=
0
;
pPars
->
fCutHashing
=
0
;
pPars
->
fVerbose
=
0
;
pPars
->
fVeryVerbose
=
0
;
pPars
->
nLutSizeMax
=
KF_LEAF_MAX
;
...
...
src/base/abci/abc.c
View file @
b5df218d
...
...
@@ -30369,7 +30369,7 @@ int Abc_CommandAbc9Kf( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_Man_t
*
pNew
;
int
c
;
Kf_ManSetDefaultPars
(
pPars
);
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCRDWPaekmdcgvwh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCRDWPaekmdcg
t
vwh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -30466,6 +30466,9 @@ int Abc_CommandAbc9Kf( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'g'
:
pPars
->
fPureAig
^=
1
;
break
;
case
't'
:
pPars
->
fCutHashing
^=
1
;
break
;
case
'v'
:
pPars
->
fVerbose
^=
1
;
break
;
...
...
@@ -30498,7 +30501,7 @@ usage:
sprintf
(
Buffer
,
"best possible"
);
else
sprintf
(
Buffer
,
"%d"
,
pPars
->
DelayTarget
);
Abc_Print
(
-
2
,
"usage: &kf [-KCRDWP num] [-akmdcgvwh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &kf [-KCRDWP num] [-akmdcg
t
vwh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs technology mapping of the network
\n
"
);
Abc_Print
(
-
2
,
"
\t
-K num : LUT size for the mapping (2 <= K <= %d) [default = %d]
\n
"
,
pPars
->
nLutSizeMax
,
pPars
->
nLutSize
);
Abc_Print
(
-
2
,
"
\t
-C num : the max number of priority cuts (1 <= C <= %d) [default = %d]
\n
"
,
pPars
->
nCutNumMax
,
pPars
->
nCutNum
);
...
...
@@ -30513,6 +30516,7 @@ usage:
Abc_Print
(
-
2
,
"
\t
-d : toggles using DSD to represent cut functions [default = %s]
\n
"
,
pPars
->
fFuncDsd
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-c : toggles mapping for CNF generation [default = %s]
\n
"
,
pPars
->
fGenCnf
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-g : toggles generating AIG without mapping [default = %s]
\n
"
,
pPars
->
fPureAig
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-t : toggles cut computation using hash table [default = %s]
\n
"
,
pPars
->
fCutHashing
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggles verbose output [default = %s]
\n
"
,
pPars
->
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-w : toggles very verbose output [default = %s]
\n
"
,
pPars
->
fVeryVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : prints the command usage
\n
"
);
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