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
ea81d55c
Commit
ea81d55c
authored
May 31, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix duplicate param type modules
parent
790312d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
src/Convert/ParamType.hs
+7
-2
test/basic/paramtype_recurse.v
+0
-12
No files found.
src/Convert/ParamType.hs
View file @
ea81d55c
...
...
@@ -91,7 +91,7 @@ convert files =
else
if
all
isNothing
maybeTypeMap
then
[]
else
filter
(
not
.
flip
elem
existing
)
$
filter
(
not
.
alreadyExists
)
$
(
:
)
(
removeDefaultTypeParams
part
)
$
if
isNothing
typeMap
then
[]
...
...
@@ -99,6 +99,11 @@ convert files =
where
maybeTypeMap
=
snd
$
info
Map
.!
name
typeMap
=
defaultInstance
maybeTypeMap
existingNames
=
map
maybeModuleName
existing
alreadyExists
=
(
flip
elem
existingNames
)
.
maybeModuleName
maybeModuleName
::
Description
->
Maybe
Identifier
maybeModuleName
(
Part
_
_
_
_
x
_
_
)
=
Just
x
maybeModuleName
_
=
Nothing
replaceDefault
_
other
=
[
other
]
removeDefaultTypeParams
::
Description
->
Description
...
...
@@ -235,7 +240,7 @@ convertModuleItemM info (orig @ (Instance m bindings x r p)) =
else
if
any
(
not
.
isSimpleType
)
resolvedTypes
then
do
let
defaults
=
Map
.
map
Left
resolvedTypes
let
bindingsDefaulted
=
Map
.
toList
$
Map
.
union
bindingsMap
defaults
if
isDefaultName
m
||
bindingsDefaulted
/
=
Map
.
toList
bindingsMap
if
isDefaultName
m
||
bindingsDefaulted
=
=
Map
.
toList
bindingsMap
then
return
$
Instance
m
bindingsNamed
x
r
p
else
return
$
Instance
(
moduleDefaultName
m
)
bindingsDefaulted
x
r
p
else
do
...
...
test/basic/paramtype_recurse.v
View file @
ea81d55c
module
foo_default
#(
parameter
size
=
0
)
;
initial
$
display
(
"foo %d %d"
,
1
,
size
)
;
endmodule
module
bar_default
#(
parameter
size
=
0
)
;
initial
$
display
(
"bar %d %d"
,
1
,
size
)
;
endmodule
module
foo_byte
#(
parameter
size
=
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