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
83f2dbde
Commit
83f2dbde
authored
May 08, 2023
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up interface check decl type
parent
11a5d047
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
src/Convert/Interface.hs
+12
-14
No files found.
src/Convert/Interface.hs
View file @
83f2dbde
...
@@ -71,25 +71,23 @@ convertDescription parts (Part attrs extern Module lifetime name ports items) =
...
@@ -71,25 +71,23 @@ convertDescription parts (Part attrs extern Module lifetime name ports items) =
traverseDeclM
::
Decl
->
Scoper
[
ModportDecl
]
Decl
traverseDeclM
::
Decl
->
Scoper
[
ModportDecl
]
Decl
traverseDeclM
decl
=
do
traverseDeclM
decl
=
do
case
decl
of
case
decl
of
Variable
_
t
x
_
_
->
checkDeclType
t
x
$
insertElem
x
DeclVal
Variable
_
t
x
_
_
->
checkDeclType
t
x
>>
insertElem
x
DeclVal
Net
_
_
_
t
x
_
_
->
checkDeclType
t
x
$
insertElem
x
DeclVal
Net
_
_
_
t
x
_
_
->
checkDeclType
t
x
>>
insertElem
x
DeclVal
Param
_
t
x
_
->
checkDeclType
t
x
$
insertElem
x
DeclVal
Param
_
t
x
_
->
checkDeclType
t
x
>>
insertElem
x
DeclVal
ParamType
_
x
_
->
insertElem
x
DeclVal
ParamType
_
x
_
->
insertElem
x
DeclVal
CommentDecl
{}
->
return
()
CommentDecl
{}
->
return
()
return
decl
return
decl
-- check for module or interface names used as type names
-- check for module or interface names used as type names
checkDeclType
::
Type
->
Identifier
->
Scoper
a
b
->
Scoper
a
b
checkDeclType
::
Type
->
Identifier
->
Scoper
a
()
checkDeclType
(
Alias
typeName
_
)
declName
continue
checkDeclType
(
Alias
typeName
_
)
declName
|
isNothing
(
readMaybe
declName
::
Maybe
Int
)
=
do
|
isNothing
(
readMaybe
declName
::
Maybe
Int
)
maybeType
<-
lookupElemM
typeName
,
Just
part
<-
Map
.
lookup
typeName
parts
=
do
case
(
maybePart
,
maybeType
)
of
maybeType
<-
lookupElemM
typeName
(
Just
part
,
Nothing
{})
->
scopedErrorM
$
"declaration "
++
when
(
isNothing
maybeType
)
$
scopedErrorM
$
declName
++
" uses "
++
show
(
pKind
part
)
++
" name "
++
"declaration "
++
declName
++
" uses "
++
show
(
pKind
part
)
typeName
++
" where a type name is expected"
++
" name "
++
typeName
++
" where a type name is expected"
_
->
continue
checkDeclType
_
_
=
return
()
where
maybePart
=
Map
.
lookup
typeName
parts
checkDeclType
_
_
other
=
other
lookupIntfElem
::
Scopes
[
ModportDecl
]
->
Expr
->
LookupResult
[
ModportDecl
]
lookupIntfElem
::
Scopes
[
ModportDecl
]
->
Expr
->
LookupResult
[
ModportDecl
]
lookupIntfElem
modports
expr
=
lookupIntfElem
modports
expr
=
...
...
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