Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
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
sv2v
Commits
9825bb9b
Commit
9825bb9b
authored
Jan 04, 2024
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak codegen for bitwise binary followed by reduction unary
parent
f9917d94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
4 deletions
+20
-4
CHANGELOG.md
+1
-0
src/Language/SystemVerilog/AST/Expr.hs
+10
-4
test/basic/red_wrap.sv
+5
-0
test/basic/red_wrap.sv.pat
+4
-0
No files found.
CHANGELOG.md
View file @
9825bb9b
...
...
@@ -35,6 +35,7 @@
*
Added error checking for unresolved typenames
*
Added constant folding for
`||`
and
`&&`
*
`input reg`
module ports are now converted to
`input wire`
*
`x | |y`
and
`x & &y`
are now output as
`x | (|y)`
and
`x & (&y)`
## v0.0.11
...
...
src/Language/SystemVerilog/AST/Expr.hs
View file @
9825bb9b
...
...
@@ -121,7 +121,10 @@ instance Show Expr where
shows
o
.
showChar
' '
.
showsAttrs
a
.
showBinOpPrec
r
case
(
o
,
r
)
of
(
BitAnd
,
UniOp
RedAnd
_
)
->
showExprWrapped
r
(
BitOr
,
UniOp
RedOr
_
)
->
showExprWrapped
r
_
->
showBinOpPrec
r
showsPrec
_
(
Dot
e
n
)
=
shows
e
.
showChar
'.'
.
...
...
@@ -202,14 +205,17 @@ showRange :: Range -> String
showRange
(
h
,
l
)
=
'['
:
show
h
++
':'
:
show
l
++
"]"
showUniOpPrec
::
Expr
->
ShowS
showUniOpPrec
e
@
UniOp
{}
=
(
showParen
True
.
shows
)
e
showUniOpPrec
e
@
BinOp
{}
=
(
showParen
True
.
shows
)
e
showUniOpPrec
e
@
UniOp
{}
=
showExprWrapped
e
showUniOpPrec
e
@
BinOp
{}
=
showExprWrapped
e
showUniOpPrec
e
=
shows
e
showBinOpPrec
::
Expr
->
ShowS
showBinOpPrec
e
@
BinOp
{}
=
(
showParen
True
.
shows
)
e
showBinOpPrec
e
@
BinOp
{}
=
showExprWrapped
e
showBinOpPrec
e
=
shows
e
showExprWrapped
::
Expr
->
ShowS
showExprWrapped
=
showParen
True
.
shows
type
ParamBinding
=
(
Identifier
,
TypeOrExpr
)
showParams
::
[
ParamBinding
]
->
String
...
...
test/basic/red_wrap.sv
0 → 100644
View file @
9825bb9b
module
top
;
wire
a
,
b
,
x
,
y
;
assign
x
=
a
|
|
b
;
assign
y
=
a
&
&
b
;
endmodule
test/basic/red_wrap.sv.pat
0 → 100644
View file @
9825bb9b
affirm | (|
affirm & (&
reject | |
reject & &
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