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
698e3b0b
Commit
698e3b0b
authored
Jul 27, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix unbased unsized binding conversion for instances with type parameters
parent
50d6faa9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
src/Convert/UnbasedUnsized.hs
+7
-1
test/basic/unbased_unsized.sv
+5
-4
No files found.
src/Convert/UnbasedUnsized.hs
View file @
698e3b0b
...
...
@@ -47,13 +47,19 @@ collectPartsM _ = return ()
convertModuleItem
::
Parts
->
ModuleItem
->
ModuleItem
convertModuleItem
parts
(
Instance
moduleName
params
instanceName
[]
bindings
)
=
convertModuleItem'
$
Instance
moduleName
params
instanceName
[]
bindings'
if
Map
.
member
moduleName
parts
&&
not
(
any
isTypeParam
moduleItems
)
then
convertModuleItem'
$
Instance
moduleName
params
instanceName
[]
bindings'
else
Instance
moduleName
params
instanceName
[]
bindings
where
bindings'
=
zipWith
convertBinding
bindings
[
0
..
]
(
portNames
,
moduleItems
)
=
case
Map
.
lookup
moduleName
parts
of
Nothing
->
error
$
"could not find module: "
++
moduleName
Just
partInfo
->
partInfo
isTypeParam
::
ModuleItem
->
Bool
isTypeParam
(
MIPackageItem
(
Decl
ParamType
{}))
=
True
isTypeParam
_
=
False
tag
=
Ident
"~~uub~~"
convertBinding
::
PortBinding
->
Int
->
PortBinding
convertBinding
(
portName
,
expr
)
idx
=
...
...
test/basic/unbased_unsized.sv
View file @
698e3b0b
...
...
@@ -130,9 +130,10 @@ endmodule
module
M
(
a
,
b
,
c
,
d
)
;
parameter
W
=
1
;
input
logic
[
W
+
0
:
1
]
a
;
input
logic
[
W
+
1
:
1
]
b
;
input
logic
[
W
+
2
:
1
]
c
;
input
logic
[
W
+
3
:
1
]
d
;
parameter
type
T
=
logic
;
input
T
[
W
+
0
:
1
]
a
;
input
T
[
W
+
1
:
1
]
b
;
input
T
[
W
+
2
:
1
]
c
;
input
T
[
W
+
3
:
1
]
d
;
initial
$
display
(
"M W=%0d %b %b %b %b"
,
W
,
a
,
b
,
c
,
d
)
;
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