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
74328f52
Commit
74328f52
authored
Mar 10, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Supporting complemented reduction operators.
parent
847d661b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
11 deletions
+40
-11
src/base/wlc/wlc.h
+3
-0
src/base/wlc/wlcBlast.c
+8
-7
src/base/wlc/wlcNtk.c
+9
-0
src/base/wlc/wlcReadVer.c
+14
-4
src/base/wlc/wlcWriteVer.c
+6
-0
No files found.
src/base/wlc/wlc.h
View file @
74328f52
...
...
@@ -78,6 +78,9 @@ typedef enum {
WLC_OBJ_REDUCT_AND
,
// 34: reduction AND
WLC_OBJ_REDUCT_OR
,
// 35: reduction OR
WLC_OBJ_REDUCT_XOR
,
// 36: reduction XOR
WLC_OBJ_REDUCT_NAND
,
// 34: reduction NAND
WLC_OBJ_REDUCT_NOR
,
// 35: reduction NOR
WLC_OBJ_REDUCT_NXOR
,
// 36: reduction NXOR
WLC_OBJ_ARI_ADD
,
// 37: arithmetic addition
WLC_OBJ_ARI_SUB
,
// 38: arithmetic subtraction
WLC_OBJ_ARI_MULTI
,
// 39: arithmetic multiplier
...
...
src/base/wlc/wlcBlast.c
View file @
74328f52
...
...
@@ -170,26 +170,26 @@ void Wlc_BlastRotateLeft( Gia_Man_t * pNew, int * pNum, int nNum, int * pShift,
}
int
Wlc_BlastReduction
(
Gia_Man_t
*
pNew
,
int
*
pFans
,
int
nFans
,
int
Type
)
{
if
(
Type
==
WLC_OBJ_REDUCT_AND
)
if
(
Type
==
WLC_OBJ_REDUCT_AND
||
Type
==
WLC_OBJ_REDUCT_NAND
)
{
int
k
,
iLit
=
1
;
for
(
k
=
0
;
k
<
nFans
;
k
++
)
iLit
=
Gia_ManHashAnd
(
pNew
,
iLit
,
pFans
[
k
]
);
return
iLit
;
return
Abc_LitNotCond
(
iLit
,
Type
==
WLC_OBJ_REDUCT_NAND
)
;
}
if
(
Type
==
WLC_OBJ_REDUCT_OR
)
if
(
Type
==
WLC_OBJ_REDUCT_OR
||
Type
==
WLC_OBJ_REDUCT_NOR
)
{
int
k
,
iLit
=
0
;
for
(
k
=
0
;
k
<
nFans
;
k
++
)
iLit
=
Gia_ManHashOr
(
pNew
,
iLit
,
pFans
[
k
]
);
return
iLit
;
return
Abc_LitNotCond
(
iLit
,
Type
==
WLC_OBJ_REDUCT_NOR
)
;
}
if
(
Type
==
WLC_OBJ_REDUCT_XOR
)
if
(
Type
==
WLC_OBJ_REDUCT_XOR
||
Type
==
WLC_OBJ_REDUCT_NXOR
)
{
int
k
,
iLit
=
0
;
for
(
k
=
0
;
k
<
nFans
;
k
++
)
iLit
=
Gia_ManHashXor
(
pNew
,
iLit
,
pFans
[
k
]
);
return
iLit
;
return
Abc_LitNotCond
(
iLit
,
Type
==
WLC_OBJ_REDUCT_NXOR
)
;
}
assert
(
0
);
return
-
1
;
...
...
@@ -1032,7 +1032,8 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
for
(
k
=
1
;
k
<
nRange
;
k
++
)
Vec_IntPush
(
vRes
,
0
);
}
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_AND
||
pObj
->
Type
==
WLC_OBJ_REDUCT_OR
||
pObj
->
Type
==
WLC_OBJ_REDUCT_XOR
)
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_AND
||
pObj
->
Type
==
WLC_OBJ_REDUCT_OR
||
pObj
->
Type
==
WLC_OBJ_REDUCT_XOR
||
pObj
->
Type
==
WLC_OBJ_REDUCT_NAND
||
pObj
->
Type
==
WLC_OBJ_REDUCT_NOR
||
pObj
->
Type
==
WLC_OBJ_REDUCT_NXOR
)
{
Vec_IntPush
(
vRes
,
Wlc_BlastReduction
(
pNew
,
pFans0
,
nRange0
,
pObj
->
Type
)
);
for
(
k
=
1
;
k
<
nRange
;
k
++
)
...
...
src/base/wlc/wlcNtk.c
View file @
74328f52
...
...
@@ -67,6 +67,9 @@ static char * Wlc_Names[WLC_OBJ_NUMBER+1] = {
"&"
,
// 34: reduction AND
"|"
,
// 35: reduction OR
"^"
,
// 36: reduction XOR
"~&"
,
// 34: reduction NAND
"~|"
,
// 35: reduction NOR
"~^"
,
// 36: reduction NXOR
"+"
,
// 37: arithmetic addition
"-"
,
// 38: arithmetic subtraction
"*"
,
// 39: arithmetic multiplier
...
...
@@ -391,6 +394,12 @@ void Wlc_NtkPrintDistrib( Wlc_Ntk_t * p, int fVerbose )
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_REDUCT_OR
,
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
-
1
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_XOR
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_REDUCT_XOR
,
3
*
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
-
3
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_NAND
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_REDUCT_NAND
,
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
-
1
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_NOR
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_REDUCT_NOR
,
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
-
1
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_NXOR
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_REDUCT_NXOR
,
3
*
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
-
3
);
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_ADD
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_ARI_ADD
,
9
*
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_SUB
)
...
...
src/base/wlc/wlcReadVer.c
View file @
74328f52
...
...
@@ -685,16 +685,26 @@ static inline int Wlc_PrsFindDefinition( Wlc_Prs_t * p, char * pStr, Vec_Int_t *
if
(
!
(
pStr
=
Wlc_PrsReadName
(
p
,
pStr
,
vFanins
))
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStr
,
"Cannot read name after !."
);
}
else
if
(
pStr
[
0
]
==
'&'
||
pStr
[
0
]
==
'|'
||
pStr
[
0
]
==
'^'
||
pStr
[
0
]
==
'-'
)
else
if
(
pStr
[
0
]
==
'-'
||
pStr
[
0
]
==
'&'
||
pStr
[
0
]
==
'|'
||
pStr
[
0
]
==
'^'
||
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'&'
)
||
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'|'
)
||
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'^'
)
)
{
if
(
pStr
[
0
]
==
'&'
)
if
(
pStr
[
0
]
==
'-'
)
Type
=
WLC_OBJ_ARI_MINUS
;
else
if
(
pStr
[
0
]
==
'&'
)
Type
=
WLC_OBJ_REDUCT_AND
;
else
if
(
pStr
[
0
]
==
'|'
)
Type
=
WLC_OBJ_REDUCT_OR
;
else
if
(
pStr
[
0
]
==
'^'
)
Type
=
WLC_OBJ_REDUCT_XOR
;
else
if
(
pStr
[
0
]
==
'-'
)
Type
=
WLC_OBJ_ARI_MINUS
;
else
if
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'&'
)
Type
=
WLC_OBJ_REDUCT_NAND
;
else
if
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'|'
)
Type
=
WLC_OBJ_REDUCT_NOR
;
else
if
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'^'
)
Type
=
WLC_OBJ_REDUCT_NXOR
;
else
assert
(
0
);
if
(
!
(
pStr
=
Wlc_PrsReadName
(
p
,
pStr
+
1
,
vFanins
))
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStr
,
"Cannot read name after a unary operator."
);
...
...
src/base/wlc/wlcWriteVer.c
View file @
74328f52
...
...
@@ -272,6 +272,12 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
fprintf
(
pFile
,
"|%s"
,
Wlc_ObjName
(
p
,
Wlc_ObjFaninId0
(
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_XOR
)
fprintf
(
pFile
,
"^%s"
,
Wlc_ObjName
(
p
,
Wlc_ObjFaninId0
(
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_NAND
)
fprintf
(
pFile
,
"~&%s"
,
Wlc_ObjName
(
p
,
Wlc_ObjFaninId0
(
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_NOR
)
fprintf
(
pFile
,
"~|%s"
,
Wlc_ObjName
(
p
,
Wlc_ObjFaninId0
(
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_REDUCT_NXOR
)
fprintf
(
pFile
,
"~^%s"
,
Wlc_ObjName
(
p
,
Wlc_ObjFaninId0
(
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_SELECT
)
fprintf
(
pFile
,
"%s [%d:%d]"
,
Wlc_ObjName
(
p
,
Wlc_ObjFaninId0
(
pObj
)),
Wlc_ObjRangeEnd
(
pObj
),
Wlc_ObjRangeBeg
(
pObj
)
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_SIGNEXT
)
...
...
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