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
a38137b6
Commit
a38137b6
authored
Jul 15, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix conversion of casts in gen item exprs
parent
c28bb71a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
src/Convert/Scoper.hs
+11
-1
src/Convert/SizeCast.hs
+1
-1
test/basic/local_cast.sv
+6
-0
test/basic/local_cast.v
+6
-0
No files found.
src/Convert/Scoper.hs
View file @
a38137b6
...
...
@@ -349,7 +349,17 @@ evalScoperT declMapper moduleItemMapper genItemMapper stmtMapper topName items =
-- TODO: This doesn't yet support implicit naming of generate blocks as
-- blocks as described in Section 27.6.
fullGenItemMapper
::
GenItem
->
ScoperT
a
m
GenItem
fullGenItemMapper
=
genItemMapper
>=>
scopeGenItemMapper
fullGenItemMapper
genItem
=
do
genItem'
<-
genItemMapper
genItem
injected
<-
gets
sInjected
if
null
injected
then
scopeGenItemMapper
genItem'
else
do
modify'
$
\
s
->
s
{
sInjected
=
[]
}
injected'
<-
mapM
fullModuleItemMapper
injected
genItem''
<-
scopeGenItemMapper
genItem'
let
genItems
=
map
GenModuleItem
injected'
++
[
genItem''
]
return
$
GenBlock
""
genItems
scopeGenItemMapper
::
GenItem
->
ScoperT
a
m
GenItem
scopeGenItemMapper
(
GenFor
(
index
,
a
)
b
c
(
GenBlock
name
genItems
))
=
do
enterScope
name
index
...
...
src/Convert/SizeCast.hs
View file @
a38137b6
...
...
@@ -37,7 +37,7 @@ traverseModuleItemM item =
traverseExprsM
traverseExprM
item
traverseGenItemM
::
GenItem
->
Scoper
Type
GenItem
traverseGenItemM
=
return
traverseGenItemM
=
traverseGenItemExprsM
traverseExprM
traverseStmtM
::
Stmt
->
Scoper
Type
Stmt
traverseStmtM
=
traverseStmtExprsM
traverseExprM
...
...
test/basic/local_cast.sv
View file @
a38137b6
...
...
@@ -15,5 +15,11 @@ module top;
end
end
end
// TODO: This is not yet supported by iverilog
// localparam P = 2;
// for (genvar i = 0; i < int'(P); i = i + 1) begin : g
// wire a = i;
// end
// initial $display("%b %b", g[0].a, g[1].a);
endgenerate
endmodule
test/basic/local_cast.v
View file @
a38137b6
...
...
@@ -20,5 +20,11 @@ module top;
cast_i
=
inp
;
endfunction
end
// TODO: This is not yet supported by iverilog
// localparam P = 2;
// for (i = 0; i < P; i = i + 1) begin : g
// wire a = i;
// end
// initial $display("%b %b", g[0].a, g[1].a);
endgenerate
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