Skip to content

Commit 27a587e

Browse files
wkkunakgugala
authored andcommitted
ver: tools: Restore i3c_config tests
* update missing entries to the test config * extend allowed options patterns of the 'DisableInputFF' option exception * add new tests on AXI filtering ID option & related Signed-off-by: Wiktoria Kuna <[email protected]>
1 parent 10b4e88 commit 27a587e

File tree

6 files changed

+122
-15
lines changed

6 files changed

+122
-15
lines changed

tools/i3c_config/i3c_core_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
import os
88

99
import yaml
10+
from common import ConfigException, I3CCoreConfig, I3CGenericConfig, RegGenConfig
1011
from jsonschema import ValidationError, validate
1112
from py2svh import cfg2svh
1213

13-
from common import ConfigException, I3CCoreConfig, I3CGenericConfig, RegGenConfig
14-
1514
_DEFAULT_CONFIG_FILE = "i3c_core_configs.yaml"
1615
_DEFAULT_OUT_DEFINES_FILE = "i3c_defines.svh"
1716
_DEFAULT_I3C_CONFIG_NAME = "default"

tools/i3c_config/py2svh.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import os
44

5-
from jinja2 import Environment, FileSystemLoader
6-
75
from common import I3CCoreConfig, I3CGenericConfig
6+
from jinja2 import Environment, FileSystemLoader
87

98

109
# Traverse I3CCoreConfig and pass it to the SVH configuration template

verification/tools/i3c_config/defs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Opts:
2929
# Shared patterns
3030
snake_case = r"[a-z]+[a-z0-9]*(_[a-z0-9]+)*"
3131
UPPER_SNAKE_CASE = r"[A-Z]+[A-Z0-9]*(_[A-Z0-9]+)*"
32-
PascalCase = r"[A-Z][a-z]+(?:[A-Z][a-z]+)*"
32+
PascalCase = r"(DisableInputFF|[A-Z][a-z]+(?:[A-Z][a-z]+)*)"
3333

3434
def __pvalue(name):
3535
return "".join([re.escape("-pvalue+"), name, r"=[0-9]+"])

verification/tools/i3c_config/test_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from io import StringIO
66

77
import pytest
8-
from i3c_core_config import main, _DEFAULT_OUT_DEFINES_FILE, ConfigException
98
from defs import _TEST_CONFIG_FILE_PATH, Configs, Opts
9+
from i3c_core_config import _DEFAULT_OUT_DEFINES_FILE, ConfigException, main
1010

1111

1212
def run_and_capture_output(config_name, config_filename, tool_type):

verification/tools/i3c_config/test_configs.yaml

Lines changed: 116 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ ahb:
1111
RespFifoDepth: 64
1212
IbiFifoDepth: 64
1313
IbiFifoExtSize: False
14-
DctDepth: 12
14+
DatDepth: 128
15+
DctDepth: 128
1516
FrontendBusInterface: "AHB"
16-
FrontendBusAddrWidth: 32
17+
FrontendBusAddrWidth: 18
1718
FrontendBusDataWidth: 64
19+
DisableInputFF: True
1820

1921
axi:
2022
CmdFifoDepth: 64
@@ -23,13 +25,50 @@ axi:
2325
RespFifoDepth: 64
2426
IbiFifoDepth: 64
2527
IbiFifoExtSize: False
26-
DatDepth: 16
27-
DctDepth: 8
28+
DatDepth: 128
29+
DctDepth: 128
2830
FrontendBusInterface: "AXI"
29-
FrontendBusAddrWidth: 32
30-
FrontendBusDataWidth: 64
31+
FrontendBusAddrWidth: 12
32+
FrontendBusDataWidth: 32
3133
FrontendBusUserWidth: 32
32-
FrontendBusIdWidth: 2
34+
FrontendBusIdWidth: 8
35+
FrontendBusIdFiltering: False
36+
DisableInputFF: True
37+
38+
axi_id_filtering:
39+
CmdFifoDepth: 64
40+
RxFifoDepth: 64
41+
TxFifoDepth: 64
42+
RespFifoDepth: 64
43+
IbiFifoDepth: 64
44+
IbiFifoExtSize: False
45+
DatDepth: 128
46+
DctDepth: 128
47+
FrontendBusInterface: "AXI"
48+
FrontendBusAddrWidth: 12
49+
FrontendBusDataWidth: 32
50+
FrontendBusUserWidth: 32
51+
FrontendBusIdWidth: 8
52+
FrontendBusIdFiltering: True
53+
NumPrivIds: 4
54+
DisableInputFF: True
55+
56+
axi_ff:
57+
CmdFifoDepth: 64
58+
RxFifoDepth: 64
59+
TxFifoDepth: 64
60+
RespFifoDepth: 64
61+
IbiFifoDepth: 64
62+
IbiFifoExtSize: False
63+
DatDepth: 128
64+
DctDepth: 128
65+
FrontendBusInterface: "AXI"
66+
FrontendBusAddrWidth: 12
67+
FrontendBusDataWidth: 32
68+
FrontendBusUserWidth: 32
69+
FrontendBusIdWidth: 8
70+
FrontendBusIdFiltering: False
71+
DisableInputFF: False
3372

3473
invalid_missing_cmd_fifo_depth:
3574
RxFifoDepth: 64
@@ -44,6 +83,8 @@ invalid_missing_cmd_fifo_depth:
4483
FrontendBusDataWidth: 64
4584
FrontendBusUserWidth: 32
4685
FrontendBusIdWidth: 2
86+
FrontendBusIdFiltering: False
87+
DisableInputFF: False
4788

4889
invalid_too_many_args:
4990
CmdFifoDepth: 64
@@ -57,6 +98,8 @@ invalid_too_many_args:
5798
FrontendBusDataWidth: 64
5899
FrontendBusUserWidth: 32
59100
FrontendBusIdWidth: 2
101+
DisableInputFF: False
102+
FrontendBusIdFiltering: False
60103
AdditionalArg: "arg"
61104

62105
invalid_wrong_type:
@@ -71,6 +114,8 @@ invalid_wrong_type:
71114
FrontendBusDataWidth: 64
72115
FrontendBusUserWidth: 32
73116
FrontendBusIdWidth: 2
117+
FrontendBusIdFiltering: False
118+
DisableInputFF: False
74119

75120
invalid_out_of_range:
76121
CmdFifoDepth: 64
@@ -84,6 +129,8 @@ invalid_out_of_range:
84129
FrontendBusDataWidth: 64
85130
FrontendBusUserWidth: 32
86131
FrontendBusIdWidth: 2
132+
FrontendBusIdFiltering: False
133+
DisableInputFF: False
87134

88135
invalid_axi_missing_usr_width:
89136
CmdFifoDepth: 64
@@ -96,6 +143,8 @@ invalid_axi_missing_usr_width:
96143
FrontendBusAddrWidth: 32
97144
FrontendBusDataWidth: 64
98145
FrontendBusIdWidth: 2
146+
FrontendBusIdFiltering: False
147+
DisableInputFF: False
99148

100149
invalid_axi_missing_id_width:
101150
CmdFifoDepth: 64
@@ -108,6 +157,44 @@ invalid_axi_missing_id_width:
108157
FrontendBusAddrWidth: 32
109158
FrontendBusDataWidth: 64
110159
FrontendBusUserWidth: 32
160+
FrontendBusIdFiltering: False
161+
DisableInputFF: False
162+
163+
invalid_axi_id_filtering_missing_num_priv_ids:
164+
CmdFifoDepth: 64
165+
RxFifoDepth: 64
166+
TxFifoDepth: 64
167+
RespFifoDepth: 64
168+
IbiFifoDepth: 64
169+
IbiFifoExtSize: False
170+
DatDepth: 128
171+
DctDepth: 128
172+
FrontendBusInterface: "AXI"
173+
FrontendBusAddrWidth: 12
174+
FrontendBusDataWidth: 32
175+
FrontendBusUserWidth: 32
176+
FrontendBusIdWidth: 8
177+
FrontendBusIdFiltering: True
178+
DisableInputFF: True
179+
180+
invalid_axi_id_filtering_off_num_priv_ids_defined:
181+
CmdFifoDepth: 64
182+
RxFifoDepth: 64
183+
TxFifoDepth: 64
184+
RespFifoDepth: 64
185+
IbiFifoDepth: 64
186+
IbiFifoExtSize: False
187+
DatDepth: 128
188+
DctDepth: 128
189+
FrontendBusInterface: "AXI"
190+
FrontendBusAddrWidth: 12
191+
FrontendBusDataWidth: 32
192+
FrontendBusUserWidth: 32
193+
FrontendBusIdWidth: 8
194+
FrontendBusIdFiltering: False
195+
NumPrivIds: 4
196+
DisableInputFF: True
197+
111198

112199
invalid_unsupported_bus:
113200
CmdFifoDepth: 64
@@ -119,6 +206,7 @@ invalid_unsupported_bus:
119206
FrontendBusInterface: "TileLink"
120207
FrontendBusAddrWidth: 32
121208
FrontendBusDataWidth: 64
209+
DisableInputFF: False
122210

123211
invalid_ahb_with_id_width:
124212
CmdFifoDepth: 64
@@ -131,6 +219,22 @@ invalid_ahb_with_id_width:
131219
FrontendBusAddrWidth: 32
132220
FrontendBusDataWidth: 64
133221
FrontendBusIdWidth: 2
222+
DisableInputFF: False
223+
224+
invalid_ahb_id_filtering_on:
225+
CmdFifoDepth: 64
226+
RxFifoDepth: 64
227+
TxFifoDepth: 64
228+
RespFifoDepth: 64
229+
IbiFifoDepth: 64
230+
IbiFifoExtSize: False
231+
FrontendBusInterface: "AHB"
232+
FrontendBusAddrWidth: 32
233+
FrontendBusDataWidth: 64
234+
FrontendBusIdWidth: 2
235+
FrontendBusIdFiltering: True
236+
NumPrivIds: 4
237+
DisableInputFF: False
134238

135239
invalid_ahb_with_usr_width:
136240
CmdFifoDepth: 64
@@ -143,6 +247,7 @@ invalid_ahb_with_usr_width:
143247
FrontendBusAddrWidth: 32
144248
FrontendBusDataWidth: 64
145249
FrontendBusUserWidth: 32
250+
DisableInputFF: False
146251

147252
invalid_ahb_with_axi_props:
148253
CmdFifoDepth: 64
@@ -156,6 +261,7 @@ invalid_ahb_with_axi_props:
156261
FrontendBusDataWidth: 64
157262
FrontendBusUserWidth: 32
158263
FrontendBusIdWidth: 2
264+
DisableInputFF: False
159265

160266
invalid_empty_arg:
161267
CmdFifoDepth:
@@ -167,6 +273,7 @@ invalid_empty_arg:
167273
FrontendBusInterface: "AHB"
168274
FrontendBusAddrWidth: 32
169275
FrontendBusDataWidth: 64
276+
DisableInputFF: False
170277

171278
edge_min_val:
172279
CmdFifoDepth: 64
@@ -178,6 +285,7 @@ edge_min_val:
178285
FrontendBusInterface: "AHB"
179286
FrontendBusAddrWidth: 32
180287
FrontendBusDataWidth: 64
288+
DisableInputFF: False
181289

182290
edge_one_less_than_max_val:
183291
CmdFifoDepth: 64
@@ -189,3 +297,4 @@ edge_one_less_than_max_val:
189297
FrontendBusInterface: "AHB"
190298
FrontendBusAddrWidth: 32
191299
FrontendBusDataWidth: 127
300+
DisableInputFF: False

verification/tools/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def lint(session: nox.Session) -> None:
5252
session.run("isort", ".", "../../tools")
5353
# Specify config for black explicitly since it gets "lost" when calling black with multiple
5454
# paths
55-
session.run("black", "--config=../block/pyproject.toml", ".", "../../tools")
55+
session.run("black", "--config=../cocotb/pyproject.toml", ".", "../../tools")
5656
session.run("flake8", ".", "../../tools")
5757

5858

@@ -64,5 +64,5 @@ def test_lint(session: nox.Session) -> None:
6464
session.run("isort", "--check", ".", "../../tools")
6565
# Specify config for black explicitly since it gets "lost" when calling black with multiple
6666
# paths
67-
session.run("black", "--config=../block/pyproject.toml", "--check", ".", "../../tools")
67+
session.run("black", "--config=../cocotb/pyproject.toml", "--check", ".", "../../tools")
6868
session.run("flake8", ".", "../../tools")

0 commit comments

Comments
 (0)