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
58e5bfa6
Commit
58e5bfa6
authored
Jan 23, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typeof incorrectly propagating implicit types
parent
8eb3a251
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
src/Convert/TypeOf.hs
+4
-3
test/basic/case_inside_cast.sv
+17
-0
test/basic/case_inside_cast.v
+6
-0
No files found.
src/Convert/TypeOf.hs
View file @
58e5bfa6
...
...
@@ -41,9 +41,10 @@ traverseDeclM decl = do
item
<-
traverseModuleItemM
(
MIPackageItem
$
Decl
decl
)
let
MIPackageItem
(
Decl
decl'
)
=
item
case
decl'
of
Variable
Local
UnknownType
ident
[]
Nil
->
do
-- functions with no return type implicitly return a single bit
insertElem
ident
UnitType
Variable
Local
(
Implicit
sg
rs
)
ident
[]
Nil
->
do
-- implicit types, which are commonly found in function return
-- types, are recast as logics to avoid outputting bare ranges
insertElem
ident
$
IntegerVector
TLogic
sg
rs
return
decl'
Variable
d
t
ident
a
e
->
do
let
t'
=
injectRanges
t
a
...
...
test/basic/case_inside_cast.sv
0 → 100644
View file @
58e5bfa6
module
top
;
typedef
logic
[
1
:
0
]
T
;
function
automatic
[
1
:
0
]
flip
;
input
[
1
:
0
]
inp
;
flip
=
~
inp
;
endfunction
initial
begin
case
(
flip
(
2'b00
))
inside
2'b11
:
$
display
(
"good"
)
;
default:
$
display
(
"default"
)
;
endcase
case
(
T
'
(
flip
(
2'b00
)))
inside
2'b11
:
$
display
(
"good"
)
;
default:
$
display
(
"default"
)
;
endcase
end
endmodule
test/basic/case_inside_cast.v
0 → 100644
View file @
58e5bfa6
module
top
;
initial
begin
$
display
(
"good"
)
;
$
display
(
"good"
)
;
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