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
c8e77626
Commit
c8e77626
authored
Mar 30, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ports bound to decls inlined from an interface expansion
parent
a059b6e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/Convert/Interface.hs
+6
-4
No files found.
src/Convert/Interface.hs
View file @
c8e77626
...
@@ -53,7 +53,7 @@ convertDescription interfaces (Part extern Module lifetime name ports items) =
...
@@ -53,7 +53,7 @@ convertDescription interfaces (Part extern Module lifetime name ports items) =
case
t
of
case
t
of
InterfaceT
interfaceName
(
Just
modportName
)
[]
->
InterfaceT
interfaceName
(
Just
modportName
)
[]
->
tell
(
Map
.
empty
,
Map
.
singleton
ident
modportDecls
)
tell
(
Map
.
empty
,
Map
.
singleton
ident
modportDecls
)
where
modportDecls
=
lookupModport
Nothing
interfaceName
modportName
where
Just
modportDecls
=
lookupModport
Nothing
interfaceName
modportName
_
->
return
()
_
->
return
()
collectInterface
(
Instance
part
_
ident
Nothing
_
)
=
collectInterface
(
Instance
part
_
ident
Nothing
_
)
=
if
Map
.
member
part
interfaces
if
Map
.
member
part
interfaces
...
@@ -88,14 +88,16 @@ convertDescription interfaces (Part extern Module lifetime name ports items) =
...
@@ -88,14 +88,16 @@ convertDescription interfaces (Part extern Module lifetime name ports items) =
case
Map
.
lookup
instanceName
instances
of
case
Map
.
lookup
instanceName
instances
of
Nothing
->
[
origBinding
]
Nothing
->
[
origBinding
]
Just
interfaceName
->
Just
interfaceName
->
map
mapper
modportDecls
case
modportDecls
of
Nothing
->
[(
portName
,
Just
$
Ident
$
instanceName
++
"_"
++
modportName
)]
Just
decls
->
map
mapper
decls
where
where
modportDecls
=
lookupModport
(
Just
instanceName
)
interfaceName
modportName
modportDecls
=
lookupModport
(
Just
instanceName
)
interfaceName
modportName
mapper
(
_
,
x
,
me
)
=
(
portName
++
"_"
++
x
,
me
)
mapper
(
_
,
x
,
me
)
=
(
portName
++
"_"
++
x
,
me
)
expandPortBinding
other
=
[
other
]
expandPortBinding
other
=
[
other
]
lookupModport
::
Maybe
Identifier
->
Identifier
->
Identifier
->
[
ModportDecl
]
lookupModport
::
Maybe
Identifier
->
Identifier
->
Identifier
->
Maybe
[
ModportDecl
]
lookupModport
instanceName
interfaceName
=
(
Map
.!
)
modportMap
lookupModport
instanceName
interfaceName
=
(
Map
.!
?
)
modportMap
where
where
prefix
=
maybe
""
(
++
"_"
)
instanceName
prefix
=
maybe
""
(
++
"_"
)
instanceName
interfaceItems
=
interfaceItems
=
...
...
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