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
81282155
Commit
81282155
authored
Apr 14, 2019
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding miter construction with one bit-level output for each pair of word-level outputs.
parent
bfefe96c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
13 deletions
+59
-13
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaHash.c
+7
-0
src/base/wlc/wlc.h
+2
-0
src/base/wlc/wlcBlast.c
+43
-11
src/base/wlc/wlcCom.c
+6
-2
No files found.
src/aig/gia/gia.h
View file @
81282155
...
...
@@ -1426,6 +1426,7 @@ extern int Gia_ManHashLookupInt( Gia_Man_t * p, int iLit0, int i
extern
int
Gia_ManHashLookup
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
p0
,
Gia_Obj_t
*
p1
);
extern
int
Gia_ManHashAndMulti
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vLits
);
extern
int
Gia_ManHashAndMulti2
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vLits
);
extern
int
Gia_ManHashDualMiter
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vOuts
);
/*=== giaIf.c ===========================================================*/
extern
void
Gia_ManPrintMappingStats
(
Gia_Man_t
*
p
,
char
*
pDumpFile
);
extern
void
Gia_ManPrintPackingStats
(
Gia_Man_t
*
p
);
...
...
src/aig/gia/giaHash.c
View file @
81282155
...
...
@@ -806,6 +806,13 @@ int Gia_ManHashAndMulti2( Gia_Man_t * p, Vec_Int_t * vLits )
iRes
=
Gia_ManHashAnd
(
p
,
iRes
,
iLit
);
return
iRes
;
}
int
Gia_ManHashDualMiter
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vOuts
)
{
int
i
,
iLit0
,
iLit1
,
iRes
=
1
;
Vec_IntForEachEntryDouble
(
vOuts
,
iLit0
,
iLit1
,
i
)
iRes
=
Gia_ManHashOr
(
p
,
iRes
,
Gia_ManHashXor
(
p
,
iLit0
,
iLit1
)
);
return
iRes
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
...
...
src/base/wlc/wlc.h
View file @
81282155
...
...
@@ -217,6 +217,7 @@ struct Wlc_BstPar_t_
int
fCla
;
int
fNoCleanup
;
int
fCreateMiter
;
int
fCreateWordMiter
;
int
fDecMuxes
;
int
fSaveFfNames
;
int
fVerbose
;
...
...
@@ -236,6 +237,7 @@ static inline void Wlc_BstParDefault( Wlc_BstPar_t * pPar )
pPar
->
fBooth
=
0
;
pPar
->
fCla
=
0
;
pPar
->
fCreateMiter
=
0
;
pPar
->
fCreateWordMiter
=
0
;
pPar
->
fDecMuxes
=
0
;
pPar
->
fVerbose
=
0
;
}
...
...
src/base/wlc/wlcBlast.c
View file @
81282155
...
...
@@ -1936,9 +1936,10 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
}
Vec_IntFree
(
vFf2Ci
);
// create COs
if
(
pPar
->
fCreateMiter
)
if
(
pPar
->
fCreateMiter
||
pPar
->
fCreateWordMiter
)
{
int
nPairs
=
0
,
nBits
=
0
;
Vec_Int_t
*
vOuts
=
Vec_IntAlloc
(
100
);
assert
(
Wlc_NtkPoNum
(
p
)
%
2
==
0
);
Wlc_NtkForEachCo
(
p
,
pObj
,
i
)
{
...
...
@@ -1965,26 +1966,48 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
assert
(
nRange1
==
nRange2
);
pFans1
=
Vec_IntEntryP
(
vBits
,
Wlc_ObjCopy
(
p
,
Wlc_ObjId
(
p
,
pObj
))
);
pFans2
=
Vec_IntEntryP
(
vBits
,
Wlc_ObjCopy
(
p
,
Wlc_ObjId
(
p
,
pObj2
))
);
if
(
Wlc_ObjRangeIsReversed
(
pObj
)
)
if
(
pPar
->
fCreateWordMiter
)
{
for
(
k
=
0
;
k
<
nRange1
;
k
++
)
Vec_IntClear
(
vOuts
);
if
(
Wlc_ObjRangeIsReversed
(
pObj
)
)
{
for
(
k
=
0
;
k
<
nRange1
;
k
++
)
Vec_IntPushTwo
(
vOuts
,
pFans1
[
nRange1
-
1
-
k
],
pFans2
[
nRange2
-
1
-
k
]
);
}
else
{
Gia_ManAppendCo
(
pNew
,
pFans1
[
nRange1
-
1
-
k
]
);
Gia_ManAppendCo
(
pNew
,
pFans2
[
nRange2
-
1
-
k
]
);
for
(
k
=
0
;
k
<
nRange1
;
k
++
)
Vec_IntPushTwo
(
vOuts
,
pFans1
[
k
],
pFans2
[
k
]
);
}
Gia_ManAppendCo
(
pNew
,
Gia_ManHashDualMiter
(
pNew
,
vOuts
)
);
}
else
{
for
(
k
=
0
;
k
<
nRange1
;
k
++
)
if
(
Wlc_ObjRangeIsReversed
(
pObj
)
)
{
for
(
k
=
0
;
k
<
nRange1
;
k
++
)
{
Gia_ManAppendCo
(
pNew
,
pFans1
[
nRange1
-
1
-
k
]
);
Gia_ManAppendCo
(
pNew
,
pFans2
[
nRange2
-
1
-
k
]
);
}
}
else
{
Gia_ManAppendCo
(
pNew
,
pFans1
[
k
]
);
Gia_ManAppendCo
(
pNew
,
pFans2
[
k
]
);
for
(
k
=
0
;
k
<
nRange1
;
k
++
)
{
Gia_ManAppendCo
(
pNew
,
pFans1
[
k
]
);
Gia_ManAppendCo
(
pNew
,
pFans2
[
k
]
);
}
}
}
nPairs
++
;
nBits
+=
nRange1
;
}
printf
(
"Derived a dual-output miter with %d pairs of bits belonging to %d pairs of word-level outputs.
\n
"
,
nBits
,
nPairs
);
Vec_IntFree
(
vOuts
);
if
(
pPar
->
fCreateWordMiter
)
printf
(
"Derived an ordinary miter with %d bit-level outputs, one for each pair of word-level outputs.
\n
"
,
nPairs
);
else
printf
(
"Derived a dual-output miter with %d pairs of bits belonging to %d pairs of word-level outputs.
\n
"
,
nBits
,
nPairs
);
}
else
{
...
...
@@ -2280,7 +2303,16 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
{
char
*
pName
=
Wlc_ObjName
(
p
,
Wlc_ObjId
(
p
,
pObj
));
nRange
=
Wlc_ObjRange
(
pObj
);
if
(
pPar
->
fCreateMiter
&&
nRange
>
1
)
if
(
pPar
->
fCreateWordMiter
)
{
Wlc_Obj_t
*
pObj2
=
Wlc_NtkCo
(
p
,
++
i
);
char
*
pName2
=
Wlc_ObjName
(
p
,
Wlc_ObjId
(
p
,
pObj2
));
char
Buffer
[
1000
];
sprintf
(
Buffer
,
"%s_xor_%s"
,
pName
,
pName2
);
Vec_PtrPush
(
pNew
->
vNamesOut
,
Abc_UtilStrsav
(
Buffer
)
);
//printf( "Adding output %s\n", Buffer );
}
else
if
(
pPar
->
fCreateMiter
&&
nRange
>
1
)
{
Wlc_Obj_t
*
pObj2
=
Wlc_NtkCo
(
p
,
++
i
);
char
*
pName2
=
Wlc_ObjName
(
p
,
Wlc_ObjId
(
p
,
pObj2
));
...
...
@@ -2295,7 +2327,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
Vec_PtrPush
(
pNew
->
vNamesOut
,
Abc_UtilStrsav
(
Buffer
)
);
}
}
else
else
{
if
(
fSkipBitRange
&&
nRange
==
1
)
Vec_PtrPush
(
pNew
->
vNamesOut
,
Abc_UtilStrsav
(
pName
)
);
...
...
src/base/wlc/wlcCom.c
View file @
81282155
...
...
@@ -1037,7 +1037,7 @@ int Abc_CommandBlast( Abc_Frame_t * pAbc, int argc, char ** argv )
Wlc_BstParDefault
(
pPar
);
pPar
->
nOutputRange
=
2
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"ORAMcombadstnizvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"ORAMcombad
e
stnizvh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -1103,6 +1103,9 @@ int Abc_CommandBlast( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'd'
:
pPar
->
fCreateMiter
^=
1
;
break
;
case
'e'
:
pPar
->
fCreateWordMiter
^=
1
;
break
;
case
's'
:
pPar
->
fDecMuxes
^=
1
;
break
;
...
...
@@ -1192,7 +1195,7 @@ int Abc_CommandBlast( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_FrameUpdateGia
(
pAbc
,
pNew
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: %%blast [-ORAM num] [-combadstnizvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: %%blast [-ORAM num] [-combad
e
stnizvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs bit-blasting of the word-level design
\n
"
);
Abc_Print
(
-
2
,
"
\t
-O num : zero-based index of the first word-level PO to bit-blast [default = %d]
\n
"
,
pPar
->
iOutput
);
Abc_Print
(
-
2
,
"
\t
-R num : the total number of word-level POs to bit-blast [default = %d]
\n
"
,
pPar
->
nOutputRange
);
...
...
@@ -1204,6 +1207,7 @@ usage:
Abc_Print
(
-
2
,
"
\t
-b : toggle generating radix-4 Booth multipliers [default = %s]
\n
"
,
pPar
->
fBooth
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle generating carry-look-ahead adder [default = %s]
\n
"
,
pPar
->
fCla
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-d : toggle creating dual-output multi-output miter [default = %s]
\n
"
,
pPar
->
fCreateMiter
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-e : toggle creating miter with output word bits combined [default = %s]
\n
"
,
pPar
->
fCreateWordMiter
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : toggle creating decoded MUXes [default = %s]
\n
"
,
pPar
->
fDecMuxes
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-t : toggle creating regular multi-output miter [default = %s]
\n
"
,
fMiter
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-n : toggle dumping signal names into a text file [default = %s]
\n
"
,
fDumpNames
?
"yes"
:
"no"
);
...
...
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