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
fabdc084
Commit
fabdc084
authored
Aug 27, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix package resolution of nested typedefs (resolves #11)
parent
737791ae
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
1 deletions
+32
-1
src/Convert/Package.hs
+4
-1
test/basic/package_typedef.sv
+0
-0
test/basic/package_typedef.v
+0
-0
test/basic/package_typedef_nested.sv
+24
-0
test/basic/package_typedef_nested.v
+4
-0
No files found.
src/Convert/Package.hs
View file @
fabdc084
...
...
@@ -83,11 +83,14 @@ prefixPackageItem packageName idents item =
Decl
(
Parameter
a
x
b
)
->
Decl
(
Parameter
a
(
prefix
x
)
b
)
Decl
(
Localparam
a
x
b
)
->
Decl
(
Localparam
a
(
prefix
x
)
b
)
other
->
other
convertType
(
Alias
Nothing
x
rs
)
=
Alias
Nothing
(
prefix
x
)
rs
convertType
other
=
other
convertExpr
(
Ident
x
)
=
Ident
$
prefix
x
convertExpr
other
=
other
convertLHS
(
LHSIdent
x
)
=
LHSIdent
$
prefix
x
convertLHS
other
=
other
converter
=
(
traverseTypes
$
traverseNestedTypes
convertType
)
.
(
traverseExprs
$
traverseNestedExprs
convertExpr
)
.
(
traverseLHSs
$
traverseNestedLHSs
convertLHS
)
MIPackageItem
item''
=
converter
$
MIPackageItem
item'
...
...
@@ -137,7 +140,7 @@ traverseModuleItem existingItemNames packages (MIPackageItem (Import x y)) =
traverseModuleItem
_
_
item
=
(
traverseExprs
$
traverseNestedExprs
traverseExpr
)
$
(
traverseStmts
traverseStmt
)
$
(
traverseTypes
traverseType
)
$
(
traverseTypes
$
traverseNestedTypes
traverseType
)
$
item
where
...
...
test/basic/pac
ak
ge_typedef.sv
→
test/basic/pac
ka
ge_typedef.sv
View file @
fabdc084
File moved
test/basic/pac
ak
ge_typedef.v
→
test/basic/pac
ka
ge_typedef.v
View file @
fabdc084
File moved
test/basic/package_typedef_nested.sv
0 → 100644
View file @
fabdc084
package
foo_pkg
;
typedef
struct
packed
{
logic
[
7
:
0
]
rsvd
;
logic
[
7
:
0
]
parity
;
}
user_t
;
typedef
struct
packed
{
logic
valid
;
user_t
user
;
}
inp_t
;
typedef
struct
packed
{
logic
valid
;
logic
opcode
;
}
out_t
;
endpackage
module
top
(
input
foo_pkg
::
inp_t
dat_i
,
output
foo_pkg
::
out_t
dat_o
)
;
endmodule
test/basic/package_typedef_nested.v
0 → 100644
View file @
fabdc084
module
top
(
dat_i
,
dat_o
)
;
input
wire
[
16
:
0
]
dat_i
;
output
wire
[
1
:
0
]
dat_o
;
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