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
c0b8ba17
Commit
c0b8ba17
authored
Apr 13, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify interface port type representation
parent
7f79147c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
src/Convert/Interface.hs
+2
-2
src/Convert/Traverse.hs
+1
-1
src/Language/SystemVerilog/AST/Type.hs
+4
-4
src/Language/SystemVerilog/Parser/Parse.y
+1
-1
src/Language/SystemVerilog/Parser/ParseDecl.hs
+1
-1
No files found.
src/Convert/Interface.hs
View file @
c0b8ba17
...
...
@@ -260,8 +260,8 @@ convertDescription parts (Part attrs extern Module lifetime name ports items) =
collectDecl
_
=
return
()
extractModportInfo
::
Type
->
Maybe
Identifier
extractModportInfo
(
InterfaceT
""
Nothing
[]
)
=
Just
""
extractModportInfo
(
InterfaceT
interfaceName
(
Just
modportName
)
[]
)
=
extractModportInfo
(
InterfaceT
""
""
[]
)
=
Just
""
extractModportInfo
(
InterfaceT
interfaceName
modportName
[]
)
=
if
isInterface
interfaceName
then
Just
modportName
else
Nothing
...
...
src/Convert/Traverse.hs
View file @
c0b8ba17
...
...
@@ -798,7 +798,7 @@ traverseSinglyNestedTypesM mapper = tm
tm
(
IntegerAtom
kw
sg
)
=
return
$
IntegerAtom
kw
sg
tm
(
NonInteger
kw
)
=
return
$
NonInteger
kw
tm
(
TypeOf
expr
)
=
return
$
TypeOf
expr
tm
(
InterfaceT
x
my
r
)
=
return
$
InterfaceT
x
m
y
r
tm
(
InterfaceT
x
y
r
)
=
return
$
InterfaceT
x
y
r
tm
(
Enum
t
vals
r
)
=
do
t'
<-
mapper
t
return
$
Enum
t'
vals
r
...
...
src/Language/SystemVerilog/AST/Type.hs
View file @
c0b8ba17
...
...
@@ -49,7 +49,7 @@ data Type
|
Enum
Type
[
Item
]
[
Range
]
|
Struct
Packing
[
Field
]
[
Range
]
|
Union
Packing
[
Field
]
[
Range
]
|
InterfaceT
Identifier
(
Maybe
Identifier
)
[
Range
]
|
InterfaceT
Identifier
Identifier
[
Range
]
|
TypeOf
Expr
|
UnpackedType
Type
[
Range
]
-- used internally
deriving
(
Eq
,
Ord
)
...
...
@@ -63,8 +63,8 @@ instance Show Type where
show
(
IntegerVector
kw
sg
rs
)
=
printf
"%s%s%s"
(
show
kw
)
(
showPadBefore
sg
)
(
showRanges
rs
)
show
(
IntegerAtom
kw
sg
)
=
printf
"%s%s"
(
show
kw
)
(
showPadBefore
sg
)
show
(
NonInteger
kw
)
=
printf
"%s"
(
show
kw
)
show
(
InterfaceT
x
m
y
r
)
=
x
++
yStr
++
(
showRanges
r
)
where
yStr
=
maybe
""
(
"."
++
)
m
y
show
(
InterfaceT
x
y
r
)
=
x
++
yStr
++
(
showRanges
r
)
where
yStr
=
if
null
y
then
""
else
'.'
:
y
show
(
Enum
t
vals
r
)
=
printf
"enum %s{%s}%s"
tStr
(
commas
$
map
showVal
vals
)
(
showRanges
r
)
where
tStr
=
showPad
t
...
...
@@ -104,7 +104,7 @@ typeRanges typ =
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
m
y
,
rs
)
InterfaceT
x
y
rs
->
(
InterfaceT
x
y
,
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
)
...
...
src/Language/SystemVerilog/Parser/Parse.y
View file @
c0b8ba17
...
...
@@ -661,7 +661,7 @@ PortDeclTokens(delim) :: { [DeclToken] }
|
GenericInterfaceDecl
delim
{
$
1
}
|
AttributeInstance
PortDeclTokens
(
delim
)
{
%
posInject
\
p
->
DTAttr
p
$
1
:
$
2
}
GenericInterfaceDecl
::
{
[
DeclToken
]
}
:
"interface"
Identifier
{
%
posInject
\
p
->
[
DTType
p
(
\
Unspecified
->
InterfaceT
""
Nothing
),
DTIdent
p
$
2
]
}
:
"interface"
Identifier
{
%
posInject
\
p
->
[
DTType
p
(
\
Unspecified
->
InterfaceT
""
""
),
DTIdent
p
$
2
]
}
VariablePortIdentifiers
::
{
[(
Identifier
,
Expr
)]
}
:
VariablePortIdentifier
{
[
$
1
]
}
...
...
src/Language/SystemVerilog/Parser/ParseDecl.hs
View file @
c0b8ba17
...
...
@@ -434,7 +434,7 @@ takeLifetime (DTLifetime _ l : rest) = (Just l, rest)
takeLifetime
rest
=
(
Nothing
,
rest
)
takeType
::
[
DeclToken
]
->
([
Range
]
->
Type
,
[
DeclToken
])
takeType
(
DTIdent
_
a
:
DTDot
_
b
:
rest
)
=
(
InterfaceT
a
(
Just
b
)
,
rest
)
takeType
(
DTIdent
_
a
:
DTDot
_
b
:
rest
)
=
(
InterfaceT
a
b
,
rest
)
takeType
(
DTType
_
tf
:
DTSigning
_
sg
:
rest
)
=
(
tf
sg
,
rest
)
takeType
(
DTType
_
tf
:
rest
)
=
(
tf
Unspecified
,
rest
)
takeType
(
DTSigning
_
sg
:
rest
)
=
(
Implicit
sg
,
rest
)
...
...
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