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
34c5ac88
Commit
34c5ac88
authored
May 20, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving SMT-LIB parser.
parent
7b570b62
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
5 deletions
+23
-5
src/base/wlc/wlc.h
+2
-0
src/base/wlc/wlcBlast.c
+4
-4
src/base/wlc/wlcNtk.c
+6
-0
src/base/wlc/wlcReadSmt.c
+0
-0
src/base/wlc/wlcReadVer.c
+3
-0
src/base/wlc/wlcWriteVer.c
+8
-1
No files found.
src/base/wlc/wlc.h
View file @
34c5ac88
...
...
@@ -61,6 +61,8 @@ typedef enum {
WLC_OBJ_BIT_AND
,
// 16: bitwise AND
WLC_OBJ_BIT_OR
,
// 17: bitwise OR
WLC_OBJ_BIT_XOR
,
// 18: bitwise XOR
WLC_OBJ_BIT_NAND
,
// 16: bitwise AND
WLC_OBJ_BIT_NOR
,
// 17: bitwise OR
WLC_OBJ_BIT_NXOR
,
// 19: bitwise NXOR
WLC_OBJ_BIT_SELECT
,
// 20: bit selection
WLC_OBJ_BIT_CONCAT
,
// 21: bit concatenation
...
...
src/base/wlc/wlcBlast.c
View file @
34c5ac88
...
...
@@ -946,21 +946,21 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds, int fGiaSimple
for
(
k
=
0
;
k
<
nRange
;
k
++
)
Vec_IntPush
(
vRes
,
Abc_LitNot
(
pArg0
[
k
])
);
}
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_AND
)
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_AND
||
pObj
->
Type
==
WLC_OBJ_BIT_NAND
)
{
int
nRangeMax
=
Abc_MaxInt
(
nRange
,
Abc_MaxInt
(
nRange0
,
nRange1
)
);
int
*
pArg0
=
Wlc_VecLoadFanins
(
vTemp0
,
pFans0
,
nRange0
,
nRangeMax
,
Wlc_ObjIsSignedFanin01
(
p
,
pObj
)
);
int
*
pArg1
=
Wlc_VecLoadFanins
(
vTemp1
,
pFans1
,
nRange1
,
nRangeMax
,
Wlc_ObjIsSignedFanin01
(
p
,
pObj
)
);
for
(
k
=
0
;
k
<
nRange
;
k
++
)
Vec_IntPush
(
vRes
,
Gia_ManHashAnd
(
pNew
,
pArg0
[
k
],
pArg1
[
k
]
)
);
Vec_IntPush
(
vRes
,
Abc_LitNotCond
(
Gia_ManHashAnd
(
pNew
,
pArg0
[
k
],
pArg1
[
k
]),
pObj
->
Type
==
WLC_OBJ_BIT_NAND
)
);
}
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_OR
)
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_OR
||
pObj
->
Type
==
WLC_OBJ_BIT_NOR
)
{
int
nRangeMax
=
Abc_MaxInt
(
nRange
,
Abc_MaxInt
(
nRange0
,
nRange1
)
);
int
*
pArg0
=
Wlc_VecLoadFanins
(
vTemp0
,
pFans0
,
nRange0
,
nRangeMax
,
Wlc_ObjIsSignedFanin01
(
p
,
pObj
)
);
int
*
pArg1
=
Wlc_VecLoadFanins
(
vTemp1
,
pFans1
,
nRange1
,
nRangeMax
,
Wlc_ObjIsSignedFanin01
(
p
,
pObj
)
);
for
(
k
=
0
;
k
<
nRange
;
k
++
)
Vec_IntPush
(
vRes
,
Gia_ManHashOr
(
pNew
,
pArg0
[
k
],
pArg1
[
k
]
)
);
Vec_IntPush
(
vRes
,
Abc_LitNotCond
(
Gia_ManHashOr
(
pNew
,
pArg0
[
k
],
pArg1
[
k
]),
pObj
->
Type
==
WLC_OBJ_BIT_NOR
)
);
}
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_XOR
||
pObj
->
Type
==
WLC_OBJ_BIT_NXOR
)
{
...
...
src/base/wlc/wlcNtk.c
View file @
34c5ac88
...
...
@@ -50,6 +50,8 @@ static char * Wlc_Names[WLC_OBJ_NUMBER+1] = {
"&"
,
// 16: bitwise AND
"|"
,
// 17: bitwise OR
"^"
,
// 18: bitwise XOR
"~&"
,
// 16: bitwise NAND
"~|"
,
// 17: bitwise NOR
"~^"
,
// 19: bitwise NXOR
"[:]"
,
// 20: bit selection
"{,}"
,
// 21: bit concatenation
...
...
@@ -362,6 +364,10 @@ void Wlc_NtkPrintDistrib( Wlc_Ntk_t * p, int fVerbose )
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_BIT_OR
,
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_XOR
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_BIT_XOR
,
3
*
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_NAND
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_BIT_NAND
,
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_NOR
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_BIT_NOR
,
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_NXOR
)
Vec_IntAddToEntry
(
vAnds
,
WLC_OBJ_BIT_NXOR
,
3
*
Wlc_ObjRange
(
Wlc_ObjFanin0
(
p
,
pObj
))
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_SELECT
)
...
...
src/base/wlc/wlcReadSmt.c
View file @
34c5ac88
This diff is collapsed.
Click to expand it.
src/base/wlc/wlcReadVer.c
View file @
34c5ac88
...
...
@@ -778,9 +778,12 @@ static inline int Wlc_PrsFindDefinition( Wlc_Prs_t * p, char * pStr, Vec_Int_t *
else
if
(
pStr
[
0
]
==
'&'
&&
pStr
[
1
]
!=
'&'
)
pStr
+=
1
,
Type
=
WLC_OBJ_BIT_AND
;
else
if
(
pStr
[
0
]
==
'|'
&&
pStr
[
1
]
!=
'|'
)
pStr
+=
1
,
Type
=
WLC_OBJ_BIT_OR
;
else
if
(
pStr
[
0
]
==
'^'
&&
pStr
[
1
]
!=
'^'
)
pStr
+=
1
,
Type
=
WLC_OBJ_BIT_XOR
;
else
if
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'&'
)
pStr
+=
2
,
Type
=
WLC_OBJ_BIT_NAND
;
else
if
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'|'
)
pStr
+=
2
,
Type
=
WLC_OBJ_BIT_NOR
;
else
if
(
pStr
[
0
]
==
'~'
&&
pStr
[
1
]
==
'^'
)
pStr
+=
2
,
Type
=
WLC_OBJ_BIT_NXOR
;
else
if
(
pStr
[
0
]
==
'&'
&&
pStr
[
1
]
==
'&'
)
pStr
+=
2
,
Type
=
WLC_OBJ_LOGIC_AND
;
else
if
(
pStr
[
0
]
==
'|'
&&
pStr
[
1
]
==
'|'
)
pStr
+=
2
,
Type
=
WLC_OBJ_LOGIC_OR
;
else
if
(
pStr
[
0
]
==
'^'
&&
pStr
[
1
]
==
'^'
)
pStr
+=
2
,
Type
=
WLC_OBJ_LOGIC_XOR
;
else
if
(
pStr
[
0
]
==
'='
&&
pStr
[
1
]
==
'='
)
pStr
+=
2
,
Type
=
WLC_OBJ_COMP_EQU
;
else
if
(
pStr
[
0
]
==
'!'
&&
pStr
[
1
]
==
'='
)
pStr
+=
2
,
Type
=
WLC_OBJ_COMP_NOTEQU
;
else
if
(
pStr
[
0
]
==
'<'
&&
pStr
[
1
]
!=
'='
)
pStr
+=
1
,
Type
=
WLC_OBJ_COMP_LESS
;
...
...
src/base/wlc/wlcWriteVer.c
View file @
34c5ac88
...
...
@@ -308,12 +308,18 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
fprintf
(
pFile
,
"|"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_XOR
)
fprintf
(
pFile
,
"^"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_NAND
)
fprintf
(
pFile
,
"~&"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_NOR
)
fprintf
(
pFile
,
"~|"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_BIT_NXOR
)
fprintf
(
pFile
,
"~^"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_LOGIC_AND
)
fprintf
(
pFile
,
"&&"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_LOGIC_OR
)
fprintf
(
pFile
,
"||"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_LOGIC_XOR
)
fprintf
(
pFile
,
"^^"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_COMP_EQU
)
fprintf
(
pFile
,
"=="
);
else
if
(
pObj
->
Type
==
WLC_OBJ_COMP_NOTEQU
)
...
...
@@ -333,7 +339,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_MULTI
)
fprintf
(
pFile
,
"*"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_DIVIDE
)
fprintf
(
pFile
,
"/
/
"
);
fprintf
(
pFile
,
"/"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_MODULUS
)
fprintf
(
pFile
,
"%%"
);
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_POWER
)
...
...
@@ -343,6 +349,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_SQUARE
)
fprintf
(
pFile
,
"#"
);
else
assert
(
0
);
//fprintf( pFile, "???" );
fprintf
(
pFile
,
" %s"
,
Wlc_ObjName
(
p
,
Wlc_ObjFaninId
(
pObj
,
1
))
);
}
}
...
...
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