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
e9d62e01
Commit
e9d62e01
authored
Feb 19, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unify type range splitting
parent
aea2975d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
30 deletions
+19
-30
src/Convert/Struct.hs
+1
-0
src/Convert/Typedef.hs
+2
-15
src/Language/SystemVerilog/AST/Type.hs
+16
-15
No files found.
src/Convert/Struct.hs
View file @
e9d62e01
...
...
@@ -125,6 +125,7 @@ traverseDeclM decl = do
isRangeable
::
Type
->
Bool
isRangeable
IntegerAtom
{}
=
False
isRangeable
NonInteger
{}
=
False
isRangeable
TypeOf
{}
=
False
isRangeable
_
=
True
traverseGenItemM
::
GenItem
->
Scoper
Type
GenItem
...
...
src/Convert/Typedef.hs
View file @
e9d62e01
...
...
@@ -86,19 +86,6 @@ traverseTypeM (Alias st rs1) = do
details
<-
lookupElemM
st
return
$
case
details
of
Nothing
->
Alias
st
rs1
Just
(
_
,
_
,
typ
)
->
case
typ
of
Net
kw
sg
rs2
->
Net
kw
sg
$
rs1
++
rs2
Implicit
sg
rs2
->
Implicit
sg
$
rs1
++
rs2
IntegerVector
kw
sg
rs2
->
IntegerVector
kw
sg
$
rs1
++
rs2
Enum
t
v
rs2
->
Enum
t
v
$
rs1
++
rs2
Struct
p
l
rs2
->
Struct
p
l
$
rs1
++
rs2
Union
p
l
rs2
->
Union
p
l
$
rs1
++
rs2
InterfaceT
x
my
rs2
->
InterfaceT
x
my
$
rs1
++
rs2
Alias
xx
rs2
->
Alias
xx
$
rs1
++
rs2
PSAlias
ps
xx
rs2
->
PSAlias
ps
xx
$
rs1
++
rs2
CSAlias
ps
pm
xx
rs2
->
CSAlias
ps
pm
xx
$
rs1
++
rs2
UnpackedType
t
rs2
->
UnpackedType
t
$
rs1
++
rs2
IntegerAtom
kw
sg
->
nullRange
(
IntegerAtom
kw
sg
)
rs1
NonInteger
kw
->
nullRange
(
NonInteger
kw
)
rs1
TypeOf
expr
->
nullRange
(
TypeOf
expr
)
rs1
Just
(
_
,
_
,
typ
)
->
tf
$
rs1
++
rs2
where
(
tf
,
rs2
)
=
typeRanges
typ
traverseTypeM
other
=
return
other
src/Language/SystemVerilog/AST/Type.hs
View file @
e9d62e01
...
...
@@ -24,7 +24,6 @@ module Language.SystemVerilog.AST.Type
,
ChargeStrength
(
..
)
,
pattern
UnknownType
,
typeRanges
,
nullRange
,
elaborateIntegerAtom
)
where
...
...
@@ -101,20 +100,22 @@ instance Ord (Signing -> [Range] -> Type) where
compare
tf1
tf2
=
compare
(
tf1
Unspecified
)
(
tf2
Unspecified
)
typeRanges
::
Type
->
([
Range
]
->
Type
,
[
Range
])
typeRanges
(
Alias
xx
rs
)
=
(
Alias
xx
,
rs
)
typeRanges
(
PSAlias
ps
xx
rs
)
=
(
PSAlias
ps
xx
,
rs
)
typeRanges
(
CSAlias
ps
pm
xx
rs
)
=
(
CSAlias
ps
pm
xx
,
rs
)
typeRanges
(
Net
kw
sg
rs
)
=
(
Net
kw
sg
,
rs
)
typeRanges
(
Implicit
sg
rs
)
=
(
Implicit
sg
,
rs
)
typeRanges
(
IntegerVector
kw
sg
rs
)
=
(
IntegerVector
kw
sg
,
rs
)
typeRanges
(
IntegerAtom
kw
sg
)
=
(
nullRange
$
IntegerAtom
kw
sg
,
[]
)
typeRanges
(
NonInteger
kw
)
=
(
nullRange
$
NonInteger
kw
,
[]
)
typeRanges
(
Enum
t
v
r
)
=
(
Enum
t
v
,
r
)
typeRanges
(
Struct
p
l
r
)
=
(
Struct
p
l
,
r
)
typeRanges
(
Union
p
l
r
)
=
(
Union
p
l
,
r
)
typeRanges
(
InterfaceT
x
my
r
)
=
(
InterfaceT
x
my
,
r
)
typeRanges
(
TypeOf
expr
)
=
(
UnpackedType
$
TypeOf
expr
,
[]
)
typeRanges
(
UnpackedType
t
rs
)
=
(
UnpackedType
t
,
rs
)
typeRanges
typ
=
case
typ
of
Net
kw
sg
rs
->
(
Net
kw
sg
,
rs
)
Implicit
sg
rs
->
(
Implicit
sg
,
rs
)
IntegerVector
kw
sg
rs
->
(
IntegerVector
kw
sg
,
rs
)
Enum
t
v
rs
->
(
Enum
t
v
,
rs
)
Struct
p
l
rs
->
(
Struct
p
l
,
rs
)
Union
p
l
rs
->
(
Union
p
l
,
rs
)
InterfaceT
x
my
rs
->
(
InterfaceT
x
my
,
rs
)
Alias
xx
rs
->
(
Alias
xx
,
rs
)
PSAlias
ps
xx
rs
->
(
PSAlias
ps
xx
,
rs
)
CSAlias
ps
pm
xx
rs
->
(
CSAlias
ps
pm
xx
,
rs
)
UnpackedType
t
rs
->
(
UnpackedType
t
,
rs
)
IntegerAtom
kw
sg
->
(
nullRange
$
IntegerAtom
kw
sg
,
[]
)
NonInteger
kw
->
(
nullRange
$
NonInteger
kw
,
[]
)
TypeOf
expr
->
(
nullRange
$
TypeOf
expr
,
[]
)
nullRange
::
Type
->
([
Range
]
->
Type
)
nullRange
t
[]
=
t
...
...
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