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
7f2fe54b
Commit
7f2fe54b
authored
Dec 09, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix jump statement conversion
parent
fb5fd393
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
13 deletions
+71
-13
src/Convert/Jump.hs
+0
-0
test/basic/inside_expr.sv
+7
-1
test/basic/inside_expr.v
+9
-1
test/basic/jump.sv
+39
-11
test/basic/jump.v
+16
-0
No files found.
src/Convert/Jump.hs
View file @
7f2fe54b
This diff is collapsed.
Click to expand it.
test/basic/inside_expr.sv
View file @
7f2fe54b
...
@@ -31,9 +31,15 @@ module top;
...
@@ -31,9 +31,15 @@ module top;
$
display
(
"test1: %b %b"
,
3'b0z1
,
test1
(
3'b0z1
))
;
$
display
(
"test1: %b %b"
,
3'b0z1
,
test1
(
3'b0z1
))
;
end
end
integer
arr
[]
=
{
32'd60
,
32'd61
,
32'd63
};
function
test2
;
function
test2
;
input
integer
inp
;
input
integer
inp
;
return
inp
inside
{
[
16
:
23
]
,
[
32
:
47
]
};
// TODO: Add support for array value ranges.
test2
=
0
;
for
(
integer
i
=
0
;
i
<
3
;
++
i
)
if
(
inp
==
arr
[
i
])
return
1'b1
;
return
test2
||
inp
inside
{
[
16
:
23
]
,
[
32
:
47
]
};
endfunction
endfunction
initial
begin
initial
begin
for
(
integer
i
=
0
;
i
<
64
;
++
i
)
for
(
integer
i
=
0
;
i
<
64
;
++
i
)
...
...
test/basic/inside_expr.v
View file @
7f2fe54b
...
@@ -33,9 +33,17 @@ module top;
...
@@ -33,9 +33,17 @@ module top;
$
display
(
"test1: %b %b"
,
3'b0z1
,
test1
(
3'b0z1
))
;
$
display
(
"test1: %b %b"
,
3'b0z1
,
test1
(
3'b0z1
))
;
end
end
wire
[
0
:
2
][
31
:
0
]
arr
;
assign
arr
=
{
32'd60
,
32'd61
,
32'd63
};
function
test2
;
function
test2
;
input
integer
inp
;
input
integer
inp
;
test2
=
(
16
<=
inp
&&
inp
<=
23
)
||
(
32
<=
inp
&&
inp
<=
47
)
;
integer
i
;
begin
test2
=
0
;
for
(
i
=
0
;
i
<
3
;
++
i
)
test2
=
test2
||
(
inp
==
arr
[
i
])
;
test2
=
test2
||
(
16
<=
inp
&&
inp
<=
23
)
||
(
32
<=
inp
&&
inp
<=
47
)
;
end
endfunction
endfunction
initial
begin
:
foobar
initial
begin
:
foobar
integer
i
;
integer
i
;
...
...
test/basic/jump.sv
View file @
7f2fe54b
...
@@ -3,25 +3,25 @@ module top;
...
@@ -3,25 +3,25 @@ module top;
task
skip1
;
task
skip1
;
$
display
(
"HELLO skip1"
)
;
$
display
(
"HELLO skip1"
)
;
return
;
return
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
endtask
endtask
function
void
skip2
;
function
void
skip2
;
$
display
(
"HELLO skip2"
)
;
$
display
(
"HELLO skip2"
)
;
return
;
return
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
endfunction
endfunction
function
int
skip3
;
function
int
skip3
;
$
display
(
"HELLO skip3"
)
;
$
display
(
"HELLO skip3"
)
;
return
1
;
return
1
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
endfunction
endfunction
task
skip4
;
task
skip4
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
$
display
(
"HELLO skip4"
)
;
$
display
(
"HELLO skip4"
)
;
return
;
return
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
end
end
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
endtask
endtask
task
skip5
;
task
skip5
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
...
@@ -29,11 +29,36 @@ module top;
...
@@ -29,11 +29,36 @@ module top;
for
(
int
j
=
0
;
j
<
10
;
++
j
)
begin
for
(
int
j
=
0
;
j
<
10
;
++
j
)
begin
$
display
(
"HELLO skip5-2"
)
;
$
display
(
"HELLO skip5-2"
)
;
return
;
return
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
end
end
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
end
end
$
display
(
"UNREACHABLE"
)
;
$
display
(
"UNREACHABLE "
,
`__LINE__
)
;
endtask
task
skip6
;
for
(
int
i
=
0
;
i
<
0
;
++
i
)
begin
$
display
(
"UNREACHABLE "
,
`__LINE__
)
;
return
;
end
$
display
(
"HELLO skip6"
)
;
endtask
task
skip7
;
begin
parameter
x
=
1
;
$
display
(
"HELLO skip7"
)
;
if
(
x
==
1
)
return
;
$
display
(
"UNREACHABLE "
,
`__LINE__
)
;
end
$
display
(
"UNREACHABLE "
,
`__LINE__
)
;
endtask
task
skip8
;
begin
parameter
x
=
1
;
$
display
(
"HELLO skip8-1"
)
;
if
(
x
==
2
)
return
;
$
display
(
"HELLO skip8-2"
)
;
end
$
display
(
"HELLO skip8-3"
)
;
endtask
endtask
initial
begin
initial
begin
skip1
;
skip1
;
...
@@ -41,20 +66,23 @@ module top;
...
@@ -41,20 +66,23 @@ module top;
$
display
(
skip3
())
;
$
display
(
skip3
())
;
skip4
;
skip4
;
skip5
;
skip5
;
skip6
;
skip7
;
skip8
;
end
end
initial
initial
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
$
display
(
"Loop Y:"
,
i
)
;
$
display
(
"Loop Y:"
,
i
)
;
continue
;
continue
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
end
end
initial
initial
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
for
(
int
i
=
0
;
i
<
10
;
++
i
)
begin
$
display
(
"Loop Z:"
,
i
)
;
$
display
(
"Loop Z:"
,
i
)
;
break
;
break
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
end
end
initial
initial
...
@@ -73,7 +101,7 @@ module top;
...
@@ -73,7 +101,7 @@ module top;
else
begin
else
begin
$
display
(
"Loop B-3:"
,
i
)
;
$
display
(
"Loop B-3:"
,
i
)
;
continue
;
continue
;
$
display
(
"UNREACHABLE
"
)
;
$
display
(
"UNREACHABLE
"
,
`__LINE__
)
;
end
end
$
display
(
"Loop B:"
,
i
)
;
$
display
(
"Loop B:"
,
i
)
;
end
end
...
...
test/basic/jump.v
View file @
7f2fe54b
...
@@ -22,12 +22,28 @@ module top;
...
@@ -22,12 +22,28 @@ module top;
$
display
(
"HELLO skip5-2"
)
;
$
display
(
"HELLO skip5-2"
)
;
end
end
endtask
endtask
task
skip6
;
$
display
(
"HELLO skip6"
)
;
endtask
task
skip7
;
$
display
(
"HELLO skip7"
)
;
endtask
task
skip8
;
begin
$
display
(
"HELLO skip8-1"
)
;
$
display
(
"HELLO skip8-2"
)
;
$
display
(
"HELLO skip8-3"
)
;
end
endtask
initial
begin
initial
begin
skip1
;
skip1
;
skip2
;
skip2
;
$
display
(
skip3
(
0
))
;
$
display
(
skip3
(
0
))
;
skip4
;
skip4
;
skip5
;
skip5
;
skip6
;
skip7
;
skip8
;
end
end
initial
begin
:
loop_y
initial
begin
:
loop_y
...
...
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