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
1e6fa7b8
Commit
1e6fa7b8
authored
Jul 22, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix looping simplification on unfolded based literals
parent
b2b6f8f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
src/Convert/ExprUtils.hs
+4
-0
test/basic/simplify_binop.sv
+3
-0
No files found.
src/Convert/ExprUtils.hs
View file @
1e6fa7b8
...
@@ -66,6 +66,10 @@ simplifyStep (Call (Ident "$clog2") (Args [Dec k] [])) =
...
@@ -66,6 +66,10 @@ simplifyStep (Call (Ident "$clog2") (Args [Dec k] [])) =
clog2
::
Integer
->
Integer
clog2
::
Integer
->
Integer
clog2
n
=
if
n
<
2
then
0
else
clog2Help
1
n
clog2
n
=
if
n
<
2
then
0
else
clog2Help
1
n
-- TODO: add full constant evaluation for all number literals to avoid the
-- anti-loop hack below
simplifyStep
e
@
(
BinOp
_
(
BinOp
_
Number
{}
Number
{})
Number
{})
=
e
simplifyStep
(
BinOp
op
e1
e2
)
=
simplifyBinOp
op
e1
e2
simplifyStep
(
BinOp
op
e1
e2
)
=
simplifyBinOp
op
e1
e2
simplifyStep
other
=
other
simplifyStep
other
=
other
...
...
test/basic/simplify_binop.sv
0 → 100644
View file @
1e6fa7b8
module
top
;
initial
$
display
(
"%b"
,
(
12'hb03
-
12'hb07
)
+
12'hb10
)
;
endmodule
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