Skip to content

Commit 3d199b1

Browse files
authored
Merge branch 'jeremiah-c-leary:master' into issue-1488
2 parents fe7987e + 207af67 commit 3d199b1

23 files changed

+266
-92
lines changed

docs/architecture_rules.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ architecture_025
516516
This rule checks for valid names for the architecture.
517517
Typical architecture names are: RTL, EMPTY, and BEHAVE.
518518
This rule allows the user to restrict what can be used for an architecture name.
519+
Note that regular expressions are accepted in the **names** field.
519520

520521
.. NOTE:: This rule is disabled by default.
521522
You can enable and configure the names using the following configuration.
@@ -531,6 +532,7 @@ This rule allows the user to restrict what can be used for an architecture name.
531532
- rtl
532533
- empty
533534
- behave
535+
- my_pattern.*
534536
535537
**Violation**
536538

docs/configuring_type_of_instantiations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This is an example of how to configure these options.
4141
.. code-block:: yaml
4242
4343
rule :
44-
instantiation_010:
44+
instantiation_034:
4545
method: 'component'
4646
4747
Example: |method| set to |component_option|

docs/configuring_vhdl_reserved_words.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ These rules provide the following options:
2828
.. |standard__2008| replace::
2929
:code:`2008` = Use reserved keywords from 2008 standard
3030

31+
.. |standard__2019| replace::
32+
:code:`2019` = Use reserved keywords from 2019 standard
33+
3134
.. |standard__all| replace::
3235
:code:`all` = Use reserved keywords from all standards
3336

3437
.. |values| replace::
35-
:code:`1987`, :code:`1993`, :code:`2000`, :code:`2002`, :code:`2008`
38+
:code:`1987`, :code:`1993`, :code:`2000`, :code:`2002`, :code:`2008`, :code:`2019`
3639

3740
.. |default_value| replace::
3841
:code:`all`
@@ -45,6 +48,7 @@ These rules provide the following options:
4548
| | | | * |standard__2000| |
4649
| | | | * |standard__2002| |
4750
| | | | * |standard__2008| |
51+
| | | | * |standard__2019| |
4852
| | | | * |standard__all| |
4953
+----------------------+----------+-----------------+----------------------------+
5054

@@ -96,6 +100,19 @@ The :code:`context` keyword is a reserved word in the 2008 standard.
96100
end entity;
97101
98102
103+
Example: |standard_option| set to :code:`2019`
104+
##############################################
105+
106+
The :code:`private` keyword is a reserved word in the 2019 standard.
107+
108+
**Violation**
109+
110+
.. code-block:: yaml
111+
112+
entity private is
113+
end entity;
114+
115+
99116
Rules Enforcing Optional Items
100117
##############################
101118

docs/whitespace_rules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ whitespace_011
198198

199199
|phase_2| |error| |whitespace|
200200

201-
This rule checks for at least a single space before and after math operators +, -, /, * and \*\*.
201+
This rule checks for at least a single space before and after math operators +, -, /, * and **.
202202
203203
**Violation**
204204

tests/architecture/test_rule_025.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,54 +28,68 @@ def test_rule_025(self):
2828
lExpected = [3, 10, 17, 24]
2929
oRule.analyze(self.oFile)
3030
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
31-
self.assertEqual("Architecture identifier must be from this list: ", oRule._get_solution(None))
31+
self.assertEqual("Architecture identifier must match a name from this list: ", oRule._get_solution(None))
3232

3333
oRule.violations = []
3434
oRule.names = []
3535
oRule.names.append("rtl")
3636
lExpected = [10, 17, 24]
3737
oRule.analyze(self.oFile)
3838
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
39-
self.assertEqual("Architecture identifier must be from this list: rtl", oRule._get_solution(None))
39+
self.assertEqual("Architecture identifier must match a name from this list: rtl", oRule._get_solution(None))
4040

4141
oRule.violations = []
4242
oRule.names = ["ENTITY1"]
4343
lExpected = [3, 17, 24]
4444
oRule.analyze(self.oFile)
4545
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
46-
self.assertEqual("Architecture identifier must be from this list: ENTITY1", oRule._get_solution(None))
46+
self.assertEqual("Architecture identifier must match a name from this list: ENTITY1", oRule._get_solution(None))
4747

4848
oRule.violations = []
4949
oRule.names = ["BLUE"]
5050
lExpected = [3, 10, 24]
5151
oRule.analyze(self.oFile)
5252
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
53-
self.assertEqual("Architecture identifier must be from this list: BLUE", oRule._get_solution(None))
53+
self.assertEqual("Architecture identifier must match a name from this list: BLUE", oRule._get_solution(None))
5454

5555
oRule.violations = []
5656
oRule.names = ["CDC"]
5757
lExpected = [3, 10, 17]
5858
oRule.analyze(self.oFile)
5959
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
60-
self.assertEqual("Architecture identifier must be from this list: CDC", oRule._get_solution(None))
60+
self.assertEqual("Architecture identifier must match a name from this list: CDC", oRule._get_solution(None))
6161

6262
oRule.violations = []
6363
oRule.names = ["rtl", "CDC"]
6464
lExpected = [10, 17]
6565
oRule.analyze(self.oFile)
6666
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
67-
self.assertEqual("Architecture identifier must be from this list: rtl, CDC", oRule._get_solution(None))
67+
self.assertEqual("Architecture identifier must match a name from this list: rtl, CDC", oRule._get_solution(None))
6868

6969
oRule.violations = []
7070
oRule.names = ["rtl", "cdc", "blue"]
7171
lExpected = [10]
7272
oRule.analyze(self.oFile)
7373
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
74-
self.assertEqual("Architecture identifier must be from this list: rtl, cdc, blue", oRule._get_solution(None))
74+
self.assertEqual("Architecture identifier must match a name from this list: rtl, cdc, blue", oRule._get_solution(None))
7575

7676
oRule.violations = []
7777
oRule.names = ["rtl", "cdc", "blue", "entity1"]
7878
lExpected = []
7979
oRule.analyze(self.oFile)
8080
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
81-
self.assertEqual("Architecture identifier must be from this list: rtl, cdc, blue, entity1", oRule._get_solution(None))
81+
self.assertEqual("Architecture identifier must match a name from this list: rtl, cdc, blue, entity1", oRule._get_solution(None))
82+
83+
oRule.violations = []
84+
oRule.names = [".ntit\w\d"]
85+
lExpected = [3, 17, 24]
86+
oRule.analyze(self.oFile)
87+
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
88+
self.assertEqual("Architecture identifier must match a name from this list: .ntit\w\d", oRule._get_solution(None))
89+
90+
oRule.violations = []
91+
oRule.names = ["\w\w\w", "b...", ".ntit\w\d"]
92+
lExpected = []
93+
oRule.analyze(self.oFile)
94+
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
95+
self.assertEqual("Architecture identifier must match a name from this list: \w\w\w, b..., .ntit\w\d", oRule._get_solution(None))

tests/concurrent/rule_003_test_input.fixed_align_left_no_align_paren_no.vhd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ begin
1212
resize(unsigned(I_FOO) +
1313
unsigned(I_BAR), q_foo'length);
1414

15-
n_bar <= a or b and c
15+
n_bar <= (a or b) and c
1616
xor z and x or
1717
w and z;
1818

1919
n_bar <=
20-
a or b and c
20+
(a or b) and c
2121
xor z and x or
2222
w and z;
2323

@@ -30,12 +30,12 @@ begin
3030
resize(unsigned(I_FOO) +
3131
unsigned(I_BAR), q_foo'length);
3232

33-
n_bar <= a or b and c
33+
n_bar <= (a or b) and c
3434
xor z and x or
3535
w and z;
3636

3737
n_bar <=
38-
a or b and c
38+
(a or b) and c
3939
xor z and x or
4040
w and z;
4141

@@ -48,12 +48,12 @@ begin
4848
resize(unsigned(I_FOO) +
4949
unsigned(I_BAR), q_foo'length);
5050

51-
n_bar <= a or b and c
51+
n_bar <= (a or b) and c
5252
xor z and x or
5353
w and z;
5454

5555
n_bar <=
56-
a or b and c
56+
(a or b) and c
5757
xor z and x or
5858
w and z;
5959

@@ -66,12 +66,12 @@ begin
6666
resize(unsigned(I_FOO) +
6767
unsigned(I_BAR), q_foo'length);
6868

69-
n_bar <= a or b and c
69+
n_bar <= (a or b) and c
7070
xor z and x or
7171
w and z;
7272

7373
n_bar <=
74-
a or b and c
74+
(a or b) and c
7575
xor z and x or
7676
w and z;
7777

tests/concurrent/rule_003_test_input.fixed_align_left_no_align_paren_yes.vhd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ begin
1212
resize(unsigned(I_FOO) +
1313
unsigned(I_BAR), q_foo'length);
1414

15-
n_bar <= a or b and c
15+
n_bar <= (a or b) and c
1616
xor z and x or
1717
w and z;
1818

1919
n_bar <=
20-
a or b and c
20+
(a or b) and c
2121
xor z and x or
2222
w and z;
2323

@@ -30,12 +30,12 @@ begin
3030
resize(unsigned(I_FOO) +
3131
unsigned(I_BAR), q_foo'length);
3232

33-
n_bar <= a or b and c
33+
n_bar <= (a or b) and c
3434
xor z and x or
3535
w and z;
3636

3737
n_bar <=
38-
a or b and c
38+
(a or b) and c
3939
xor z and x or
4040
w and z;
4141

@@ -48,12 +48,12 @@ begin
4848
resize(unsigned(I_FOO) +
4949
unsigned(I_BAR), q_foo'length);
5050

51-
n_bar <= a or b and c
51+
n_bar <= (a or b) and c
5252
xor z and x or
5353
w and z;
5454

5555
n_bar <=
56-
a or b and c
56+
(a or b) and c
5757
xor z and x or
5858
w and z;
5959

@@ -66,12 +66,12 @@ begin
6666
resize(unsigned(I_FOO) +
6767
unsigned(I_BAR), q_foo'length);
6868

69-
n_bar <= a or b and c
69+
n_bar <= (a or b) and c
7070
xor z and x or
7171
w and z;
7272

7373
n_bar <=
74-
a or b and c
74+
(a or b) and c
7575
xor z and x or
7676
w and z;
7777

tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_no.vhd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ begin
1212
resize(unsigned(I_FOO) +
1313
unsigned(I_BAR), q_foo'length);
1414

15-
n_bar <= a or b and c
15+
n_bar <= (a or b) and c
1616
xor z and x or
1717
w and z;
1818

1919
n_bar <=
20-
a or b and c
20+
(a or b) and c
2121
xor z and x or
2222
w and z;
2323

@@ -30,12 +30,12 @@ begin
3030
resize(unsigned(I_FOO) +
3131
unsigned(I_BAR), q_foo'length);
3232

33-
n_bar <= a or b and c
33+
n_bar <= (a or b) and c
3434
xor z and x or
3535
w and z;
3636

3737
n_bar <=
38-
a or b and c
38+
(a or b) and c
3939
xor z and x or
4040
w and z;
4141

@@ -48,12 +48,12 @@ begin
4848
resize(unsigned(I_FOO) +
4949
unsigned(I_BAR), q_foo'length);
5050

51-
n_bar <= a or b and c
51+
n_bar <= (a or b) and c
5252
xor z and x or
5353
w and z;
5454

5555
n_bar <=
56-
a or b and c
56+
(a or b) and c
5757
xor z and x or
5858
w and z;
5959

@@ -66,12 +66,12 @@ begin
6666
resize(unsigned(I_FOO) +
6767
unsigned(I_BAR), q_foo'length);
6868

69-
n_bar <= a or b and c
69+
n_bar <= (a or b) and c
7070
xor z and x or
7171
w and z;
7272

7373
n_bar <=
74-
a or b and c
74+
(a or b) and c
7575
xor z and x or
7676
w and z;
7777

tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_yes.vhd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ begin
1212
resize(unsigned(I_FOO) +
1313
unsigned(I_BAR), q_foo'length);
1414

15-
n_bar <= a or b and c
15+
n_bar <= (a or b) and c
1616
xor z and x or
1717
w and z;
1818

1919
n_bar <=
20-
a or b and c
20+
(a or b) and c
2121
xor z and x or
2222
w and z;
2323

@@ -30,12 +30,12 @@ begin
3030
resize(unsigned(I_FOO) +
3131
unsigned(I_BAR), q_foo'length);
3232

33-
n_bar <= a or b and c
33+
n_bar <= (a or b) and c
3434
xor z and x or
3535
w and z;
3636

3737
n_bar <=
38-
a or b and c
38+
(a or b) and c
3939
xor z and x or
4040
w and z;
4141

@@ -48,12 +48,12 @@ begin
4848
resize(unsigned(I_FOO) +
4949
unsigned(I_BAR), q_foo'length);
5050

51-
n_bar <= a or b and c
51+
n_bar <= (a or b) and c
5252
xor z and x or
5353
w and z;
5454

5555
n_bar <=
56-
a or b and c
56+
(a or b) and c
5757
xor z and x or
5858
w and z;
5959

@@ -66,12 +66,12 @@ begin
6666
resize(unsigned(I_FOO) +
6767
unsigned(I_BAR), q_foo'length);
6868

69-
n_bar <= a or b and c
69+
n_bar <= (a or b) and c
7070
xor z and x or
7171
w and z;
7272

7373
n_bar <=
74-
a or b and c
74+
(a or b) and c
7575
xor z and x or
7676
w and z;
7777

0 commit comments

Comments
 (0)