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
7f701cd1
Commit
7f701cd1
authored
Sep 15, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed dimension shorthand diretion and relevant tests
parent
2ca8a022
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
24 deletions
+46
-24
src/Language/SystemVerilog/Parser/Parse.y
+1
-1
src/Language/SystemVerilog/Parser/ParseDecl.hs
+1
-1
test/basic/multipack_port.sv
+17
-0
test/basic/multipack_port.v
+26
-5
test/basic/multipack_port_tb.v
+0
-16
test/basic/unpacked_localparam.v
+1
-1
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
7f701cd1
...
@@ -802,7 +802,7 @@ DimensionsNonEmpty :: { [Range] }
...
@@ -802,7 +802,7 @@ DimensionsNonEmpty :: { [Range] }
| DimensionsNonEmpty Dimension { $1 ++ [$2] }
| DimensionsNonEmpty Dimension { $1 ++ [$2] }
Dimension :: { Range }
Dimension :: { Range }
: Range { $1 }
: Range { $1 }
| "[" Expr "]" { (
simplify $ BinOp Sub $2 (Number "1"), Number "0"
) }
| "[" Expr "]" { (
Number "0", BinOp Sub $2 (Number "1")
) }
DeclAsgns :: { [(Identifier, Expr, [Range])] }
DeclAsgns :: { [(Identifier, Expr, [Range])] }
: DeclAsgn { [$1] }
: DeclAsgn { [$1] }
...
...
src/Language/SystemVerilog/Parser/ParseDecl.hs
View file @
7f701cd1
...
@@ -357,7 +357,7 @@ takeRanges (token : tokens) =
...
@@ -357,7 +357,7 @@ takeRanges (token : tokens) =
_
->
(
[]
,
token
:
tokens
)
_
->
(
[]
,
token
:
tokens
)
where
where
(
rs
,
rest
)
=
takeRanges
tokens
(
rs
,
rest
)
=
takeRanges
tokens
asRange
s
=
(
simplify
$
BinOp
Sub
s
(
Number
"1"
),
Number
"0"
)
asRange
s
=
(
Number
"0"
,
BinOp
Sub
s
(
Number
"1"
)
)
-- Matching DTAsgnNBlk here allows tripLookahead to work both for standard
-- Matching DTAsgnNBlk here allows tripLookahead to work both for standard
-- declarations and in `parseDTsAsDeclOrAsgn`, where we're checking for an
-- declarations and in `parseDTsAsDeclOrAsgn`, where we're checking for an
...
...
test/basic/multipack_port.sv
View file @
7f701cd1
...
@@ -14,3 +14,20 @@ module foo(clock, data);
...
@@ -14,3 +14,20 @@ module foo(clock, data);
data
[
0
][
0
]
=
~
data
[
0
][
0
]
;
data
[
0
][
0
]
=
~
data
[
0
][
0
]
;
end
end
endmodule
endmodule
module
top
;
logic
[
10
:
0
]
data
[
5
]
;
reg
clock
;
foo
f
(
clock
,
data
)
;
initial
begin
clock
=
1
;
forever
#
1
clock
=
~
clock
;
end
initial
begin
:
foo
$
monitor
(
"%d %b%b%b%b%b"
,
$
time
,
data
[
0
]
,
data
[
1
]
,
data
[
2
]
,
data
[
3
]
,
data
[
4
])
;
#
100
;
$
finish
()
;
end
endmodule
test/basic/multipack_port.v
View file @
7f701cd1
module
foo
(
clock
,
data
)
;
module
foo
(
clock
,
data
)
;
input
clock
;
input
clock
;
output
reg
[
54
:
0
]
data
;
output
reg
[
54
:
0
]
data
;
initial
data
[
0
]
=
0
;
initial
data
[
11
*
4
]
=
0
;
always
@
(
clock
)
begin
:
block_name
always
@
(
clock
)
begin
:
block_name
integer
i
;
integer
i
,
j
;
for
(
i
=
53
;
i
>=
0
;
i
=
i
-
1
)
begin
for
(
i
=
4
;
i
>=
0
;
i
--
)
begin
data
[
i
+
1
]
=
data
[
i
]
;
for
(
j
=
9
;
j
>=
0
;
j
--
)
begin
data
[
11
*
(
4
-
i
)
+
j
+
1
]
=
data
[
11
*
(
4
-
i
)
+
j
]
;
end
if
(
i
!=
0
)
data
[
11
*
(
4
-
i
)
+
0
]
=
data
[
11
*
(
4
-
(
i
-
1
))
+
10
]
;
end
end
data
[
0
]
=
~
data
[
0
]
;
data
[
11
*
4
]
=
~
data
[
11
*
4
]
;
end
endmodule
module
top
;
wire
[
54
:
0
]
data
;
reg
clock
;
foo
f
(
clock
,
data
)
;
initial
begin
clock
=
1
;
forever
#
1
clock
=
~
clock
;
end
initial
begin
:
foo
$
monitor
(
"%d %b"
,
$
time
,
data
)
;
#
100
;
$
finish
()
;
end
end
endmodule
endmodule
test/basic/multipack_port_tb.v
deleted
100644 → 0
View file @
2ca8a022
module
top
;
wire
[
0
:
54
]
data
;
reg
clock
;
foo
f
(
clock
,
data
)
;
initial
begin
clock
=
1
;
forever
#
1
clock
=
~
clock
;
end
initial
begin
:
foo
$
monitor
(
"%d %b"
,
$
time
,
data
)
;
#
100
;
$
finish
()
;
end
endmodule
test/basic/unpacked_localparam.v
View file @
7f701cd1
...
@@ -2,7 +2,7 @@ module top;
...
@@ -2,7 +2,7 @@ module top;
localparam
[
31
:
0
]
init_val
=
{
8'd0
,
8'd8
,
8'd10
,
8'd200
};
localparam
[
31
:
0
]
init_val
=
{
8'd0
,
8'd8
,
8'd10
,
8'd200
};
initial
begin
:
foo
initial
begin
:
foo
integer
i
,
j
;
integer
i
,
j
;
for
(
i
=
0
;
i
<
4
;
i
+
=
1
)
begin
for
(
i
=
3
;
i
>=
0
;
i
-
=
1
)
begin
$
display
(
init_val
[
8
*
i
+:
8
])
;
$
display
(
init_val
[
8
*
i
+:
8
])
;
for
(
j
=
0
;
j
<
8
;
j
+=
1
)
begin
for
(
j
=
0
;
j
<
8
;
j
+=
1
)
begin
$
display
(
init_val
[
8
*
i
+
j
])
;
$
display
(
init_val
[
8
*
i
+
j
])
;
...
...
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