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
2dcd35ad
Commit
2dcd35ad
authored
Feb 02, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support typedefs with unpacked dimensions
parent
a402a734
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
src/Language/SystemVerilog/Parser/Parse.y
+1
-0
test/basic/dimensions.sv
+4
-0
test/basic/dimensions.v
+21
-0
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
2dcd35ad
...
@@ -776,6 +776,7 @@ PackageItem :: { [PackageItem] }
...
@@ -776,6 +776,7 @@ PackageItem :: { [PackageItem] }
| NonDeclPackageItem { $1 }
| NonDeclPackageItem { $1 }
NonDeclPackageItem :: { [PackageItem] }
NonDeclPackageItem :: { [PackageItem] }
: "typedef" Type Identifier ";" { [Typedef $2 $3] }
: "typedef" Type Identifier ";" { [Typedef $2 $3] }
| "typedef" Type Identifier DimensionsNonEmpty ";" { [Typedef (UnpackedType $2 $4) $3] }
| "function" Lifetime FuncRetAndName TFItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) (map defaultFuncInput $ (map makeInput $4) ++ fst $5) (snd $5)] }
| "function" Lifetime FuncRetAndName TFItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) (map defaultFuncInput $ (map makeInput $4) ++ fst $5) (snd $5)] }
| "function" Lifetime "void" Identifier TFItems DeclsAndStmts "endfunction" opt(Tag) { [Task $2 $4 (map defaultFuncInput $ $5 ++ fst $6) (snd $6)] }
| "function" Lifetime "void" Identifier TFItems DeclsAndStmts "endfunction" opt(Tag) { [Task $2 $4 (map defaultFuncInput $ $5 ++ fst $6) (snd $6)] }
| "task" Lifetime Identifier TFItems DeclsAndStmts "endtask" opt(Tag) { [Task $2 $3 (map defaultFuncInput $ $4 ++ fst $5) (snd $5)] }
| "task" Lifetime Identifier TFItems DeclsAndStmts "endtask" opt(Tag) { [Task $2 $3 (map defaultFuncInput $ $4 ++ fst $5) (snd $5)] }
...
...
test/basic/dimensions.sv
View file @
2dcd35ad
...
@@ -16,6 +16,8 @@ module top;
...
@@ -16,6 +16,8 @@ module top;
integer
ints
[
3
:
0
]
;
integer
ints
[
3
:
0
]
;
typedef
struct
packed
{
logic
x
,
y
,
z
;
}
T
;
typedef
struct
packed
{
logic
x
,
y
,
z
;
}
T
;
logic
[$
size
(
T
)
-
1
:
0
]
foo
;
logic
[$
size
(
T
)
-
1
:
0
]
foo
;
typedef
byte
unpacked_t
[
3
]
;
unpacked_t
unpacked
;
initial
begin
initial
begin
$
display
($
size
(
Word
))
;
$
display
($
size
(
Word
))
;
$
display
($
size
(
Ram
,
2
))
;
$
display
($
size
(
Ram
,
2
))
;
...
@@ -33,5 +35,7 @@ module top;
...
@@ -33,5 +35,7 @@ module top;
`EXHAUST
(
bit
)
;
`EXHAUST
(
bit
)
;
`EXHAUST
(
byte
)
;
`EXHAUST
(
byte
)
;
`EXHAUST
(
ints
)
;
`EXHAUST
(
ints
)
;
`EXHAUST
(
unpacked_t
)
;
`EXHAUST
(
unpacked
)
;
end
end
endmodule
endmodule
test/basic/dimensions.v
View file @
2dcd35ad
...
@@ -114,5 +114,26 @@ module top;
...
@@ -114,5 +114,26 @@ module top;
$
display
(
2
)
;
$
display
(
2
)
;
$
display
(
1
)
;
$
display
(
1
)
;
$
display
(
128
)
;
$
display
(
128
)
;
$
display
(
3
,
3
,
8
)
;
$
display
(
0
,
0
,
7
)
;
$
display
(
2
,
2
,
0
)
;
$
display
(
2
,
2
,
7
)
;
$
display
(
0
,
0
,
0
)
;
$
display
(
-
1
,
-
1
,
1
)
;
$
display
(
2
)
;
$
display
(
1
)
;
$
display
(
24
)
;
$
display
(
3
,
3
,
8
)
;
$
display
(
0
,
0
,
7
)
;
$
display
(
2
,
2
,
0
)
;
$
display
(
2
,
2
,
7
)
;
$
display
(
0
,
0
,
0
)
;
$
display
(
-
1
,
-
1
,
1
)
;
$
display
(
2
)
;
$
display
(
1
)
;
$
display
(
24
)
;
end
end
endmodule
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