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
b09fdaf7
Commit
b09fdaf7
authored
Aug 08, 2023
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify shadowing notes non-trivial localparams too
parent
5b035613
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
CHANGELOG.md
+1
-0
src/Convert/Simplify.hs
+5
-6
test/basic/simplify_localparam_shadow.sv
+10
-0
No files found.
CHANGELOG.md
View file @
b09fdaf7
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
### Bug Fixes
### Bug Fixes
*
Fixed an issue that prevented parsing tasks and functions with
`inout`
ports
*
Fixed an issue that prevented parsing tasks and functions with
`inout`
ports
*
Fixed errant constant folding of shadowed non-trivial localparams
*
Fixed certain non-ANSI style port declarations being incorrectly reported as
*
Fixed certain non-ANSI style port declarations being incorrectly reported as
incompatible
incompatible
...
...
src/Convert/Simplify.hs
View file @
b09fdaf7
...
@@ -17,8 +17,6 @@
...
@@ -17,8 +17,6 @@
module
Convert.Simplify
(
convert
)
where
module
Convert.Simplify
(
convert
)
where
import
Control.Monad
(
when
)
import
Convert.ExprUtils
import
Convert.ExprUtils
import
Convert.Scoper
import
Convert.Scoper
import
Convert.Traverse
import
Convert.Traverse
...
@@ -53,13 +51,14 @@ pattern SimpleVector sg l r <- IntegerVector _ sg [(RawNum l, RawNum r)]
...
@@ -53,13 +51,14 @@ pattern SimpleVector sg l r <- IntegerVector _ sg [(RawNum l, RawNum r)]
insertExpr
::
Identifier
->
Expr
->
Scoper
Expr
()
insertExpr
::
Identifier
->
Expr
->
Scoper
Expr
()
insertExpr
ident
expr
=
do
insertExpr
ident
expr
=
do
expr'
<-
substituteExprM
expr
expr'
<-
substituteExprM
expr
case
expr'
of
insertElem
ident
$
case
expr'
of
Cast
(
Left
(
SimpleVector
sg
l
r
))
(
Number
n
)
->
Cast
(
Left
(
SimpleVector
sg
l
r
))
(
Number
n
)
->
insertElem
ident
$
Number
$
numberCast
signed
size
n
Number
$
numberCast
signed
size
n
where
where
signed
=
sg
==
Signed
signed
=
sg
==
Signed
size
=
fromIntegral
$
abs
$
l
-
r
+
1
size
=
fromIntegral
$
abs
$
l
-
r
+
1
_
->
when
(
isSimpleExpr
expr'
)
$
insertElem
ident
expr'
_
|
isSimpleExpr
expr'
->
expr'
_
->
Nil
isSimpleExpr
::
Expr
->
Bool
isSimpleExpr
::
Expr
->
Bool
isSimpleExpr
Number
{}
=
True
isSimpleExpr
Number
{}
=
True
...
@@ -84,7 +83,7 @@ traverseGenItemM :: GenItem -> Scoper Expr GenItem
...
@@ -84,7 +83,7 @@ traverseGenItemM :: GenItem -> Scoper Expr GenItem
traverseGenItemM
=
traverseGenItemExprsM
traverseExprM
traverseGenItemM
=
traverseGenItemExprsM
traverseExprM
traverseStmtM
::
Stmt
->
Scoper
Expr
Stmt
traverseStmtM
::
Stmt
->
Scoper
Expr
Stmt
traverseStmtM
stmt
=
traverseStmtExprsM
traverseExprM
stmt
traverseStmtM
=
traverseStmtExprsM
traverseExprM
traverseExprM
::
Expr
->
Scoper
Expr
Expr
traverseExprM
::
Expr
->
Scoper
Expr
Expr
traverseExprM
=
embedScopes
convertExpr
traverseExprM
=
embedScopes
convertExpr
...
...
test/basic/simplify_localparam_shadow.sv
0 → 100644
View file @
b09fdaf7
module
top
;
localparam
i
=
1234
;
if
(
1
)
begin
genvar
j
;
for
(
j
=
0
;
j
<
10
;
j
=
j
+
1
)
begin
localparam
i
=
j
;
initial
$
display
(
i
>
5
?
i
+
100
:
i
-
100
)
;
end
end
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