Skip to content

Commit 3d58538

Browse files
Issue#1411: Adding parsing for PSL. (#1412)
* Issue#1411: Adding parsing for PSL. * Fixing cover_assertion classification.
1 parent c5184bf commit 3d58538

32 files changed

+1455
-1
lines changed

docs/overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ Known Limitations
6464
VSG is a continual work in progress.
6565
As such, this version has the following known limitations:
6666

67-
* Parser will not process embedded PSL
67+
* Minumal support for embedded PSL
6868
* Parser will not process VHDL 2019

tests/vhdlFile/psl/classification_results.txt

Lines changed: 559 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2+
-- verification_unit
3+
vunit identifier ( something ) {
4+
something
5+
something
6+
}
7+
8+
vpkg identifier ( something ) {
9+
something
10+
something
11+
}
12+
13+
vprop identifier ( something ) {
14+
something
15+
something
16+
}
17+
18+
vmode identifier ( something ) {
19+
something
20+
something
21+
}
22+
23+
entity fifo is
24+
25+
default clock is rising_edge(i_clk);
26+
27+
sequence identifier something something;
28+
29+
property identifier something something;
30+
31+
begin
32+
33+
-- Unlabeled
34+
assert something something [report something];
35+
36+
assume something something;
37+
38+
restrict something something;
39+
40+
restrict! something something;
41+
42+
cover something something report something;
43+
44+
fairness something something;
45+
46+
strong fairness something something;
47+
48+
-- labeled
49+
label1: assert something something [report something];
50+
51+
label1: assume something something;
52+
53+
label1: restrict something something;
54+
55+
label1: restrict! something something;
56+
57+
label1: cover something something report something;
58+
59+
label1: fairness something something;
60+
61+
label1: strong fairness something something;
62+
63+
end entity fifo;
64+
65+
66+
architecture rtl of fifo is
67+
68+
default clock is rising_edge(i_clk);
69+
70+
sequence identifier something something;
71+
72+
property identifier something something;
73+
74+
begin
75+
76+
-- Unlabeled
77+
assert something something [report something];
78+
79+
assume something something;
80+
81+
restrict something something;
82+
83+
restrict! something something;
84+
85+
cover something something report something;
86+
87+
fairness something something;
88+
89+
strong fairness something something;
90+
91+
-- labeled
92+
label1: assert something something [report something];
93+
94+
label1: assume something something;
95+
96+
label1: restrict something something;
97+
98+
label1: restrict! something something;
99+
100+
label1: cover something something report something;
101+
102+
label1: fairness something something;
103+
104+
label1: strong fairness something something;
105+
106+
end architecture rtl;
107+
108+
package my_pkg is
109+
110+
sequence identifier something something;
111+
112+
property identifier something something;
113+
114+
end package my_pkg;

vsg/parser.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,24 @@ def __init__(self):
452452
super().__init__(")")
453453

454454

455+
class open_curly(item):
456+
"""
457+
unique_id = parser : open_curly
458+
"""
459+
460+
def __init__(self):
461+
super().__init__("{")
462+
463+
464+
class close_curly(item):
465+
"""
466+
unique_id = parser : close_curly
467+
"""
468+
469+
def __init__(self):
470+
super().__init__("}")
471+
472+
455473
class equal_sign(item):
456474
"""
457475
unique_id = parser : equal_sign

vsg/token/psl/assert_directive.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from vsg import parser
4+
5+
6+
class assert_keyword(parser.keyword):
7+
"""
8+
unique_id = psl_assert_directive : assert_keyword
9+
"""
10+
11+
def __init__(self, sString):
12+
super().__init__(sString)
13+
14+
15+
class todo(parser.todo):
16+
"""
17+
unique_id = psl_assert_directive : todo
18+
"""
19+
20+
def __init__(self, sString):
21+
super().__init__(sString)
22+
23+
24+
class semicolon(parser.semicolon):
25+
"""
26+
unique_id = psl_assert_directive : semicolon
27+
"""
28+
29+
def __init__(self, sString):
30+
super().__init__()

vsg/token/psl/assume_directive.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from vsg import parser
4+
5+
6+
class assume_keyword(parser.keyword):
7+
"""
8+
unique_id = psl_assume_directive : assume_keyword
9+
"""
10+
11+
def __init__(self, sString):
12+
super().__init__(sString)
13+
14+
15+
class todo(parser.todo):
16+
"""
17+
unique_id = psl_assume_directive : todo
18+
"""
19+
20+
def __init__(self, sString):
21+
super().__init__(sString)
22+
23+
24+
class semicolon(parser.semicolon):
25+
"""
26+
unique_id = psl_assume_directive : semicolon
27+
"""
28+
29+
def __init__(self, sString):
30+
super().__init__()

vsg/token/psl/clock_declaration.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from vsg import parser
4+
5+
6+
class default_keyword(parser.keyword):
7+
"""
8+
unique_id = psl_clock_declaration : default_keyword
9+
"""
10+
11+
def __init__(self, sString):
12+
super().__init__(sString)
13+
14+
15+
class clock_keyword(parser.keyword):
16+
"""
17+
unique_id = psl_clock_declaration : clock_keyword
18+
"""
19+
20+
def __init__(self, sString):
21+
super().__init__(sString)
22+
23+
24+
class todo(parser.todo):
25+
"""
26+
unique_id = psl_clock_declaration : todo
27+
"""
28+
29+
def __init__(self, sString):
30+
super().__init__(sString)
31+
32+
33+
class semicolon(parser.semicolon):
34+
"""
35+
unique_id = psl_clock_declaration : semicolon
36+
"""
37+
38+
def __init__(self, sString):
39+
super().__init__()

vsg/token/psl/cover_directive.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from vsg import parser
4+
5+
6+
class cover_keyword(parser.keyword):
7+
"""
8+
unique_id = psl_cover_directive : cover_keyword
9+
"""
10+
11+
def __init__(self, sString):
12+
super().__init__(sString)
13+
14+
15+
class todo(parser.todo):
16+
"""
17+
unique_id = psl_cover_directive : todo
18+
"""
19+
20+
def __init__(self, sString):
21+
super().__init__(sString)
22+
23+
24+
class semicolon(parser.semicolon):
25+
"""
26+
unique_id = psl_cover_directive : semicolon
27+
"""
28+
29+
def __init__(self, sString):
30+
super().__init__()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from vsg import parser
4+
5+
6+
class strong_keyword(parser.keyword):
7+
"""
8+
unique_id = psl_fairness_directive : strong_keyword
9+
"""
10+
11+
def __init__(self, sString):
12+
super().__init__(sString)
13+
14+
15+
class fairness_keyword(parser.keyword):
16+
"""
17+
unique_id = psl_fairness_directive : fairness_keyword
18+
"""
19+
20+
def __init__(self, sString):
21+
super().__init__(sString)
22+
23+
24+
class todo(parser.todo):
25+
"""
26+
unique_id = psl_fairness_directive : todo
27+
"""
28+
29+
def __init__(self, sString):
30+
super().__init__(sString)
31+
32+
33+
class semicolon(parser.semicolon):
34+
"""
35+
unique_id = psl_fairness_directive : semicolon
36+
"""
37+
38+
def __init__(self, sString):
39+
super().__init__()
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from vsg import parser
4+
5+
6+
class property_keyword(parser.keyword):
7+
"""
8+
unique_id = psl_property_declaration : property_keyword
9+
"""
10+
11+
def __init__(self, sString):
12+
super().__init__(sString)
13+
14+
15+
class todo(parser.todo):
16+
"""
17+
unique_id = psl_property_declaration : todo
18+
"""
19+
20+
def __init__(self, sString):
21+
super().__init__(sString)
22+
23+
24+
class semicolon(parser.semicolon):
25+
"""
26+
unique_id = psl_property_declaration : semicolon
27+
"""
28+
29+
def __init__(self, sString):
30+
super().__init__()

0 commit comments

Comments
 (0)