Skip to content

Commit 2a265d6

Browse files
authored
Issue 1475: Add support for VHDL 2019 views (#1477)
* Add alias example of a view's 'converse * Add 2019 views Resolves #1475 * Applied review suggestions
1 parent 207af67 commit 2a265d6

File tree

51 files changed

+1240
-264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1240
-264
lines changed

docs/port_rules.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ This rule checks for missing modes in port declarations.
566566
WR_EN : std_logic;
567567
RD_EN : std_logic;
568568
OVERFLOW : std_logic;
569+
V_TEST : some_view;
569570
DATA : inout std_logic
570571
);
571572
@@ -577,6 +578,7 @@ This rule checks for missing modes in port declarations.
577578
WR_EN : in std_logic;
578579
RD_EN : in std_logic;
579580
OVERFLOW : out std_logic;
581+
V_TEST : view some_view;
580582
DATA : inout std_logic
581583
);
582584

tests/port/rule_023_test_input.vhd

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
entity FIFO is
33
port (
4-
I_WR_EN : in std_logic;
5-
I_DATA : out std_logic_vector(31 downto 0);
6-
I_RD_EN : in std_logic;
7-
O_DATA : out std_logic_vector(31 downto 0)
4+
I_WR_EN : in std_logic;
5+
I_DATA : out std_logic_vector(31 downto 0);
6+
I_RD_EN : in std_logic;
7+
O_DATA : out std_logic_vector(31 downto 0);
8+
V_DATA : view some_view
89
);
910
end entity FIFO;
1011

@@ -14,6 +15,7 @@ entity FIFO is
1415
I_WR_EN : std_logic;
1516
I_DATA : std_logic_vector(31 downto 0);
1617
I_RD_EN : std_logic;
17-
O_DATA : std_logic_vector(31 downto 0)
18+
O_DATA : std_logic_vector(31 downto 0);
19+
V_DATA : some_view
1820
);
1921
end entity FIFO;

tests/port/test_rule_023.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_rule_023(self):
2424
self.assertEqual(oRule.identifier, "023")
2525
self.assertEqual(oRule.groups, ["structure"])
2626

27-
lExpected = [14, 15, 16, 17]
27+
lExpected = [15, 16, 17, 18, 19]
2828

2929
oRule.analyze(self.oFile)
3030
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))

tests/vhdlFile/alias_declaration/classification_results.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,25 @@
195195
22 |
196196
<class 'vsg.parser.blank_line'>
197197
--------------------------------------------------------------------------------
198-
23 | begin
199-
<class 'vsg.token.architecture_body.begin_keyword'>
198+
23 | alias opposite_view is some_view'converse;
199+
<class 'vsg.token.alias_declaration.alias_keyword'>
200+
<class 'vsg.token.alias_declaration.alias_designator'>
201+
<class 'vsg.token.alias_declaration.is_keyword'>
202+
<class 'vsg.parser.todo'>
203+
<class 'vsg.parser.tic'>
204+
<class 'vsg.parser.todo'>
205+
<class 'vsg.token.alias_declaration.semicolon'>
200206
--------------------------------------------------------------------------------
201207
24 |
202208
<class 'vsg.parser.blank_line'>
203209
--------------------------------------------------------------------------------
204-
25 | end architecture RTL;
210+
25 | begin
211+
<class 'vsg.token.architecture_body.begin_keyword'>
212+
--------------------------------------------------------------------------------
213+
26 |
214+
<class 'vsg.parser.blank_line'>
215+
--------------------------------------------------------------------------------
216+
27 | end architecture RTL;
205217
<class 'vsg.token.architecture_body.end_keyword'>
206218
<class 'vsg.token.architecture_body.end_architecture_keyword'>
207219
<class 'vsg.token.architecture_body.architecture_simple_name'>

tests/vhdlFile/alias_declaration/classification_test_input.vhd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ architecture RTL of FIFO is
2020

2121
alias s_event_count : natural range 0 to 2**16 - 1 is << signal some.reference.some_signal : natural range 0 to 2**16 - 1 >>;
2222

23+
alias opposite_view is some_view'converse;
24+
2325
begin
2426

2527
end architecture RTL;

tests/vhdlFile/component_declaration/classification_results.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@
7878
<class 'vsg.token.interface_unknown_declaration.identifier'>
7979
<class 'vsg.token.interface_unknown_declaration.colon'>
8080
<class 'vsg.token.type_mark.name'>
81-
<class 'vsg.token.interface_unknown_declaration.assignment'>
81+
<class 'vsg.token.simple_mode_indication.assignment'>
8282
<class 'vsg.parser.todo'>
8383
<class 'vsg.token.interface_list.semicolon'>
8484
--------------------------------------------------------------------------------
8585
20 | G_GEN2 : integer := 0
8686
<class 'vsg.token.interface_unknown_declaration.identifier'>
8787
<class 'vsg.token.interface_unknown_declaration.colon'>
8888
<class 'vsg.token.type_mark.name'>
89-
<class 'vsg.token.interface_unknown_declaration.assignment'>
89+
<class 'vsg.token.simple_mode_indication.assignment'>
9090
<class 'vsg.parser.todo'>
9191
--------------------------------------------------------------------------------
9292
21 | );
@@ -119,7 +119,7 @@
119119
<class 'vsg.token.interface_unknown_declaration.colon'>
120120
<class 'vsg.token.mode.in_keyword'>
121121
<class 'vsg.token.type_mark.name'>
122-
<class 'vsg.token.interface_unknown_declaration.assignment'>
122+
<class 'vsg.token.simple_mode_indication.assignment'>
123123
<class 'vsg.parser.todo'>
124124
<class 'vsg.token.interface_list.semicolon'>
125125
--------------------------------------------------------------------------------
@@ -128,7 +128,7 @@
128128
<class 'vsg.token.interface_unknown_declaration.colon'>
129129
<class 'vsg.token.mode.out_keyword'>
130130
<class 'vsg.token.type_mark.name'>
131-
<class 'vsg.token.interface_unknown_declaration.assignment'>
131+
<class 'vsg.token.simple_mode_indication.assignment'>
132132
<class 'vsg.parser.todo'>
133133
--------------------------------------------------------------------------------
134134
29 | );
@@ -160,15 +160,15 @@
160160
<class 'vsg.token.interface_unknown_declaration.identifier'>
161161
<class 'vsg.token.interface_unknown_declaration.colon'>
162162
<class 'vsg.token.type_mark.name'>
163-
<class 'vsg.token.interface_unknown_declaration.assignment'>
163+
<class 'vsg.token.simple_mode_indication.assignment'>
164164
<class 'vsg.parser.todo'>
165165
<class 'vsg.token.interface_list.semicolon'>
166166
--------------------------------------------------------------------------------
167167
36 | G_GEN2 : integer := 0
168168
<class 'vsg.token.interface_unknown_declaration.identifier'>
169169
<class 'vsg.token.interface_unknown_declaration.colon'>
170170
<class 'vsg.token.type_mark.name'>
171-
<class 'vsg.token.interface_unknown_declaration.assignment'>
171+
<class 'vsg.token.simple_mode_indication.assignment'>
172172
<class 'vsg.parser.todo'>
173173
--------------------------------------------------------------------------------
174174
37 | );
@@ -184,7 +184,7 @@
184184
<class 'vsg.token.interface_unknown_declaration.colon'>
185185
<class 'vsg.token.mode.in_keyword'>
186186
<class 'vsg.token.type_mark.name'>
187-
<class 'vsg.token.interface_unknown_declaration.assignment'>
187+
<class 'vsg.token.simple_mode_indication.assignment'>
188188
<class 'vsg.parser.todo'>
189189
<class 'vsg.token.interface_list.semicolon'>
190190
--------------------------------------------------------------------------------
@@ -193,7 +193,7 @@
193193
<class 'vsg.token.interface_unknown_declaration.colon'>
194194
<class 'vsg.token.mode.out_keyword'>
195195
<class 'vsg.token.type_mark.name'>
196-
<class 'vsg.token.interface_unknown_declaration.assignment'>
196+
<class 'vsg.token.simple_mode_indication.assignment'>
197197
<class 'vsg.parser.todo'>
198198
--------------------------------------------------------------------------------
199199
41 | );
@@ -225,7 +225,7 @@
225225
<class 'vsg.token.interface_unknown_declaration.identifier'>
226226
<class 'vsg.token.interface_unknown_declaration.colon'>
227227
<class 'vsg.token.type_mark.name'>
228-
<class 'vsg.token.interface_unknown_declaration.assignment'>
228+
<class 'vsg.token.simple_mode_indication.assignment'>
229229
<class 'vsg.parser.todo'>
230230
<class 'vsg.token.interface_list.semicolon'>
231231
--------------------------------------------------------------------------------
@@ -251,7 +251,7 @@
251251
<class 'vsg.token.interface_unknown_declaration.colon'>
252252
<class 'vsg.token.mode.in_keyword'>
253253
<class 'vsg.token.type_mark.name'>
254-
<class 'vsg.token.interface_unknown_declaration.assignment'>
254+
<class 'vsg.token.simple_mode_indication.assignment'>
255255
<class 'vsg.parser.todo'>
256256
<class 'vsg.token.interface_list.semicolon'>
257257
--------------------------------------------------------------------------------
@@ -260,7 +260,7 @@
260260
<class 'vsg.token.interface_unknown_declaration.colon'>
261261
<class 'vsg.token.mode.out_keyword'>
262262
<class 'vsg.token.type_mark.name'>
263-
<class 'vsg.token.interface_unknown_declaration.assignment'>
263+
<class 'vsg.token.simple_mode_indication.assignment'>
264264
<class 'vsg.parser.todo'>
265265
--------------------------------------------------------------------------------
266266
53 | );

tests/vhdlFile/entity_header/classification_results.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<class 'vsg.token.interface_unknown_declaration.identifier'>
2121
<class 'vsg.token.interface_unknown_declaration.colon'>
2222
<class 'vsg.token.type_mark.name'>
23-
<class 'vsg.token.interface_unknown_declaration.assignment'>
23+
<class 'vsg.token.simple_mode_indication.assignment'>
2424
<class 'vsg.parser.todo'>
2525
<class 'vsg.token.interface_list.semicolon'>
2626
--------------------------------------------------------------------------------
@@ -30,7 +30,7 @@
3030
<class 'vsg.token.interface_unknown_declaration.identifier'>
3131
<class 'vsg.token.interface_unknown_declaration.colon'>
3232
<class 'vsg.token.type_mark.name'>
33-
<class 'vsg.token.interface_unknown_declaration.assignment'>
33+
<class 'vsg.token.simple_mode_indication.assignment'>
3434
<class 'vsg.parser.character_literal'>
3535
<class 'vsg.token.interface_list.semicolon'>
3636
--------------------------------------------------------------------------------
@@ -110,7 +110,7 @@
110110
<class 'vsg.token.interface_unknown_declaration.identifier'>
111111
<class 'vsg.token.interface_unknown_declaration.colon'>
112112
<class 'vsg.token.type_mark.name'>
113-
<class 'vsg.token.interface_unknown_declaration.assignment'>
113+
<class 'vsg.token.simple_mode_indication.assignment'>
114114
<class 'vsg.parser.todo'>
115115
<class 'vsg.token.interface_list.semicolon'>
116116
--------------------------------------------------------------------------------
@@ -120,7 +120,7 @@
120120
<class 'vsg.token.interface_unknown_declaration.identifier'>
121121
<class 'vsg.token.interface_unknown_declaration.colon'>
122122
<class 'vsg.token.type_mark.name'>
123-
<class 'vsg.token.interface_unknown_declaration.assignment'>
123+
<class 'vsg.token.simple_mode_indication.assignment'>
124124
<class 'vsg.parser.character_literal'>
125125
<class 'vsg.token.interface_list.semicolon'>
126126
--------------------------------------------------------------------------------

tests/vhdlFile/function_specification/classification_results.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
<class 'vsg.token.interface_unknown_declaration.identifier'>
224224
<class 'vsg.token.interface_unknown_declaration.colon'>
225225
<class 'vsg.token.type_mark.name'>
226-
<class 'vsg.token.interface_unknown_declaration.assignment'>
226+
<class 'vsg.token.simple_mode_indication.assignment'>
227227
<class 'vsg.parser.todo'>
228228
<class 'vsg.token.interface_list.semicolon'>
229229
<class 'vsg.token.interface_unknown_declaration.identifier'>
@@ -270,7 +270,7 @@
270270
<class 'vsg.token.interface_unknown_declaration.identifier'>
271271
<class 'vsg.token.interface_unknown_declaration.colon'>
272272
<class 'vsg.token.type_mark.name'>
273-
<class 'vsg.token.interface_unknown_declaration.assignment'>
273+
<class 'vsg.token.simple_mode_indication.assignment'>
274274
<class 'vsg.parser.todo'>
275275
<class 'vsg.token.interface_list.semicolon'>
276276
<class 'vsg.token.interface_unknown_declaration.identifier'>

0 commit comments

Comments
 (0)