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
aa294eaa
Commit
aa294eaa
authored
Sep 21, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
genvars declared in for loops retain scoping (resolves #46)
parent
142df3b5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
src/Convert/ForDecl.hs
+3
-3
test/basic/for_decl.sv
+9
-0
test/basic/for_decl.v
+14
-0
test/lib/functions.sh
+1
-0
No files found.
src/Convert/ForDecl.hs
View file @
aa294eaa
...
...
@@ -24,10 +24,10 @@ convert =
)
convertGenItem
::
GenItem
->
GenItem
convertGenItem
(
GenFor
(
True
,
x
,
e
)
a
b
c
d
)
=
GenBlock
Nothing
convertGenItem
(
GenFor
(
True
,
x
,
e
)
a
b
mx
c
)
=
GenBlock
(
fmap
(
++
"_for_decl"
)
mx
)
[
GenModuleItem
$
Genvar
x
,
GenFor
(
False
,
x
,
e
)
a
b
c
d
,
GenFor
(
False
,
x
,
e
)
a
b
mx
c
]
convertGenItem
other
=
other
...
...
test/basic/for_decl.sv
View file @
aa294eaa
...
...
@@ -5,6 +5,11 @@ module top;
assign
a
[
n
]
=
n
&
1
;
end
wire
[
0
:
31
]
b
;
for
(
genvar
n
=
0
;
n
<
32
;
n
++
)
begin
:
gen_filter_other
assign
b
[
n
]
=
~
a
[
n
]
;
end
initial
for
(
integer
i
=
0
;
i
<
32
;
i
++
)
$
display
(
"1: "
,
a
[
i
])
;
...
...
@@ -49,4 +54,8 @@ module top;
end
end
initial
for
(
integer
i
=
0
;
i
<
32
;
i
++
)
$
display
(
"8: "
,
a
[
i
]
,
b
[
i
])
;
endmodule
test/basic/for_decl.v
View file @
aa294eaa
...
...
@@ -8,6 +8,14 @@ module top;
end
endgenerate
wire
[
0
:
31
]
b
;
generate
genvar
other_n
;
for
(
other_n
=
0
;
other_n
<
32
;
other_n
=
other_n
+
1
)
begin
:
gen_filter_other
assign
b
[
other_n
]
=
~
a
[
other_n
]
;
end
endgenerate
integer
i
;
initial
begin
:
foo_1
for
(
i
=
0
;
i
<
32
;
i
=
i
+
1
)
...
...
@@ -55,4 +63,10 @@ module top;
$
display
(
"7: "
,
~
a
[
j
*
8
+
k
]
+
11
)
;
end
initial
begin
:
foo_8
integer
i
;
for
(
i
=
0
;
i
<
32
;
i
=
i
+
1
)
$
display
(
"8: "
,
a
[
i
]
,
b
[
i
])
;
end
endmodule
test/lib/functions.sh
View file @
aa294eaa
...
...
@@ -20,6 +20,7 @@ simulate() {
iv_output
=
`
iverilog
\
-Wall
\
-Wno-select-range
\
-Wno-anachronisms
\
-o
"
$sim_prog
"
\
-g2005
\
-DTEST_VCD
=
"
\"
$sim_vcd
\"
"
\
...
...
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