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
d0a6b0f5
Commit
d0a6b0f5
authored
Jun 07, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 32 bit constant cast
parent
3186afe4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletions
+5
-1
src/Convert/SizeCast.hs
+3
-1
test/basic/cast.sv
+1
-0
test/basic/cast.v
+1
-0
No files found.
src/Convert/SizeCast.hs
View file @
d0a6b0f5
...
@@ -66,7 +66,9 @@ traverseExprM =
...
@@ -66,7 +66,9 @@ traverseExprM =
where
where
str
=
(
show
size
)
++
"'d"
++
(
show
num
)
str
=
(
show
size
)
++
"'d"
++
(
show
num
)
size
=
s'
size
=
s'
num
=
n'
`
mod
`
(
2
^
s'
)
num
=
if
size
==
32
then
n'
else
n'
`
mod
`
(
2
^
s'
)
_
->
convertCastM
(
Number
s
)
(
Number
n
)
_
->
convertCastM
(
Number
s
)
(
Number
n
)
convertExprM
(
orig
@
(
Cast
(
Right
DimsFn
{})
_
))
=
convertExprM
(
orig
@
(
Cast
(
Right
DimsFn
{})
_
))
=
return
orig
return
orig
...
...
test/basic/cast.sv
View file @
d0a6b0f5
...
@@ -22,6 +22,7 @@ module top;
...
@@ -22,6 +22,7 @@ module top;
$
display
(
"%0d %0d"
,
x
,
($
clog2
(
WIDTH
))
'
(
x
))
;
$
display
(
"%0d %0d"
,
x
,
($
clog2
(
WIDTH
))
'
(
x
))
;
$
display
(
"%0d %0d"
,
y
,
($
clog2
(
WIDTH
))
'
(
y
))
;
$
display
(
"%0d %0d"
,
y
,
($
clog2
(
WIDTH
))
'
(
y
))
;
$
display
(
"%0d %0d"
,
z
,
($
clog2
(
WIDTH
))
'
(
z
))
;
$
display
(
"%0d %0d"
,
z
,
($
clog2
(
WIDTH
))
'
(
z
))
;
$
display
(
"%b"
,
32
'
(
4
))
;
end
end
localparam
bit
foo
=
'0
;
localparam
bit
foo
=
'0
;
...
...
test/basic/cast.v
View file @
d0a6b0f5
...
@@ -25,6 +25,7 @@ module top;
...
@@ -25,6 +25,7 @@ module top;
$
display
(
"%0d %0d"
,
x
,
$
signed
(
x
[
4
:
0
]))
;
$
display
(
"%0d %0d"
,
x
,
$
signed
(
x
[
4
:
0
]))
;
$
display
(
"%0d %0d"
,
y
,
$
signed
(
y
[
4
:
0
]))
;
$
display
(
"%0d %0d"
,
y
,
$
signed
(
y
[
4
:
0
]))
;
$
display
(
"%0d %0d"
,
z
,
z
[
4
:
0
])
;
$
display
(
"%0d %0d"
,
z
,
z
[
4
:
0
])
;
$
display
(
"%b"
,
32'd4
)
;
end
end
localparam
[
0
:
0
]
foo
=
0
;
localparam
[
0
:
0
]
foo
=
0
;
...
...
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