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
da076196
Commit
da076196
authored
Feb 23, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support const declarations of alias types
parent
5080265e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
src/Language/SystemVerilog/Parser/Parse.y
+5
-0
test/basic/const.sv
+10
-0
test/basic/const.v
+5
-0
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
da076196
...
...
@@ -454,6 +454,10 @@ TypeAlias :: { Type }
:
Identifier
Dimensions
{
Alias
$
1
$
2
}
|
Identifier
"::"
Identifier
Dimensions
{
PSAlias
$
1
$
3
$
4
}
|
Identifier
ParamBindings
"::"
Identifier
Dimensions
{
CSAlias
$
1
$
2
$
4
$
5
}
PartialTypeAlias
::
{
Signing
->
[
Range
]
->
Type
}
:
Identifier
{
\
Unspecified
->
Alias
$
1
}
|
Identifier
"::"
Identifier
{
\
Unspecified
->
PSAlias
$
1
$
3
}
|
Identifier
ParamBindings
"::"
Identifier
{
\
Unspecified
->
CSAlias
$
1
$
2
$
4
}
TypeNonIdent
::
{
Type
}
:
PartialType
OptSigning
Dimensions
{
$
1
$
2
$
3
}
|
"type"
"("
Expr
")"
{
TypeOf
$
3
}
...
...
@@ -636,6 +640,7 @@ DeclToken :: { DeclToken }
|
Signing
{
%
posInject
\
p
->
DTSigning
p
$
1
}
|
ExplicitLifetime
{
%
posInject
\
p
->
DTLifetime
p
$
1
}
|
"const"
PartialType
{
%
posInject
\
p
->
DTType
p
$
2
}
|
"const"
PartialTypeAlias
{
%
posInject
\
p
->
DTType
p
$
2
}
|
"{"
StreamOp
StreamSize
Concat
"}"
{
%
posInject
\
p
->
DTStream
p
$
2
$
3
(
map
toLHS
$
4
)
}
|
"{"
StreamOp
Concat
"}"
{
%
posInject
\
p
->
DTStream
p
$
2
(
RawNum
1
)
(
map
toLHS
$
3
)
}
|
opt
(
"var"
)
"type"
"("
Expr
")"
{
%
posInject
\
p
->
DTType
p
(
\
Unspecified
->
\
[]
->
TypeOf
$
4
)
}
...
...
test/basic/const.sv
0 → 100644
View file @
da076196
module
top
;
typedef
struct
packed
{
integer
y
,
z
;
}
T
;
// TODO iverilog doesn't allow references to variables in initializers
// if (1) begin : blk
// integer a = 11;
// integer b = 12;
const
integer
w
=
11
;
const
T
x
=
'
{
y
:
11
,
z
:
12
};
initial
$
display
(
"%b %b %b %b"
,
w
,
x
,
x
.
y
,
x
.
z
)
;
endmodule
test/basic/const.v
0 → 100644
View file @
da076196
module
top
;
integer
w
=
11
;
wire
[
63
:
0
]
x
=
{
32'd11
,
32'd12
};
initial
$
display
(
"%b %b %b %b"
,
w
,
x
,
x
[
32
+:
32
]
,
x
[
0
+:
32
])
;
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