dvsim 1.7.2__py3-none-any.whl → 1.7.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dvsim/cli/admin.py CHANGED
@@ -4,12 +4,14 @@
4
4
 
5
5
  """DVSim CLI main entry point."""
6
6
 
7
+ from importlib.metadata import version
7
8
  from pathlib import Path
8
9
 
9
10
  import click
10
11
 
11
12
 
12
13
  @click.group()
14
+ @click.version_option(version("dvsim"))
13
15
  def cli() -> None:
14
16
  """DVSim Administration tool.
15
17
 
dvsim/cli/run.py CHANGED
@@ -28,6 +28,7 @@ import shlex
28
28
  import subprocess
29
29
  import sys
30
30
  import textwrap
31
+ from importlib.metadata import version
31
32
  from pathlib import Path
32
33
 
33
34
  from dvsim.flow.factory import make_cfg
@@ -43,9 +44,6 @@ from dvsim.launcher.slurm import SlurmLauncher
43
44
  from dvsim.logging import configure_logging, log
44
45
  from dvsim.utils import TS_FORMAT, TS_FORMAT_LONG, Timer, rm_path, run_cmd_with_timeout
45
46
 
46
- # TODO: add dvsim_cfg.hjson to retrieve this info
47
- version = 0.1
48
-
49
47
  # The different categories that can be passed to the --list argument.
50
48
  _LIST_CATEGORIES = ["build_modes", "run_modes", "tests", "regressions"]
51
49
 
@@ -298,7 +296,7 @@ def parse_args():
298
296
 
299
297
  parser.add_argument("cfg", metavar=cfg_metavar, help="""Configuration hjson file.""")
300
298
 
301
- parser.add_argument("--version", action="store_true", help="Print version and exit")
299
+ parser.add_argument("--version", action="version", version=version("dvsim"))
302
300
 
303
301
  parser.add_argument(
304
302
  "--tool",
@@ -794,9 +792,6 @@ def parse_args():
794
792
 
795
793
  args = parser.parse_args()
796
794
 
797
- if args.version:
798
- sys.exit()
799
-
800
795
  # Check conflicts
801
796
  # interactive and remote, r
802
797
  if args.interactive and args.remote:
dvsim/flow/formal.py CHANGED
@@ -2,12 +2,14 @@
2
2
  # Licensed under the Apache License, Version 2.0, see LICENSE for details.
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ from collections.abc import Sequence
5
6
  from pathlib import Path
6
7
 
7
8
  import hjson
8
9
  from tabulate import tabulate
9
10
 
10
11
  from dvsim.flow.one_shot import OneShotCfg
12
+ from dvsim.job.data import CompletedJobStatus
11
13
  from dvsim.logging import log
12
14
  from dvsim.utils import subst_wildcards
13
15
 
@@ -176,41 +178,47 @@ class FormalCfg(OneShotCfg):
176
178
 
177
179
  return self.results_summary_md
178
180
 
179
- def _gen_results(self, results):
180
- # This function is called after the regression and looks for
181
- # results.hjson file with aggregated results from the formal logfile.
182
- # The hjson file is required to follow this format:
183
- # {
184
- # "messages": {
185
- # "errors" : []
186
- # "warnings" : []
187
- # "cex" : ["property1", "property2"...],
188
- # "undetermined": [],
189
- # "unreachable" : [],
190
- # },
191
- #
192
- # "summary": {
193
- # "errors" : 0
194
- # "warnings" : 2
195
- # "proven" : 20,
196
- # "cex" : 5,
197
- # "covered" : 18,
198
- # "undetermined": 7,
199
- # "unreachable" : 2,
200
- # "pass_rate" : "90 %",
201
- # "cover_rate" : "90 %"
202
- # },
203
- # }
204
- # The categories for property results are: proven, cex, undetermined,
205
- # covered, and unreachable.
206
- #
207
- # If coverage was enabled then results.hjson will also have an item that
208
- # shows formal coverage. It will have the following format:
209
- # "coverage": {
210
- # formal: "90 %",
211
- # stimuli: "90 %",
212
- # checker: "80 %"
213
- # }
181
+ def _gen_results(self, results: Sequence[CompletedJobStatus]) -> None:
182
+ """Generate results.
183
+
184
+ This function is called after the regression and looks for
185
+ results.hjson file with aggregated results from the formal logfile.
186
+ The hjson file is required to follow this format:
187
+ {
188
+ "messages": {
189
+ "errors" : []
190
+ "warnings" : []
191
+ "cex" : ["property1", "property2"...],
192
+ "undetermined": [],
193
+ "unreachable" : [],
194
+ },
195
+
196
+ "summary": {
197
+ "errors" : 0
198
+ "warnings" : 2
199
+ "proven" : 20,
200
+ "cex" : 5,
201
+ "covered" : 18,
202
+ "undetermined": 7,
203
+ "unreachable" : 2,
204
+ "pass_rate" : "90 %",
205
+ "cover_rate" : "90 %"
206
+ },
207
+ }
208
+ The categories for property results are: proven, cex, undetermined,
209
+ covered, and unreachable.
210
+
211
+ If coverage was enabled then results.hjson will also have an item that
212
+ shows formal coverage. It will have the following format:
213
+ "coverage": {
214
+ formal: "90 %",
215
+ stimuli: "90 %",
216
+ checker: "80 %"
217
+ }
218
+ """
219
+ # There should be just one job that has run for this config.
220
+ complete_job = results[0]
221
+
214
222
  results_str = "## " + self.results_title + "\n\n"
215
223
  results_str += "### " + self.timestamp_long + "\n"
216
224
  if self.revision:
@@ -222,7 +230,7 @@ class FormalCfg(OneShotCfg):
222
230
  assert len(self.deploy) == 1
223
231
  mode = self.deploy[0]
224
232
 
225
- if results[mode] == "P":
233
+ if complete_job.status == "P":
226
234
  result_data = Path(
227
235
  subst_wildcards(self.build_dir, {"build_mode": mode.name}),
228
236
  "results.hjson",
@@ -254,8 +262,8 @@ class FormalCfg(OneShotCfg):
254
262
  else:
255
263
  summary += ["N/A", "N/A", "N/A"]
256
264
 
257
- if results[mode] != "P":
258
- results_str += "\n## List of Failures\n" + "".join(mode.launcher.fail_msg.message)
265
+ if complete_job.status != "P":
266
+ results_str += "\n## List of Failures\n" + "".join(complete_job.fail_msg.message)
259
267
 
260
268
  messages = self.result.get("messages")
261
269
  if messages is not None:
dvsim/flow/lint.py CHANGED
@@ -4,11 +4,13 @@
4
4
 
5
5
  """Class describing lint configuration object."""
6
6
 
7
+ from collections.abc import Sequence
7
8
  from pathlib import Path
8
9
 
9
10
  from tabulate import tabulate
10
11
 
11
12
  from dvsim.flow.one_shot import OneShotCfg
13
+ from dvsim.job.data import CompletedJobStatus
12
14
  from dvsim.logging import log
13
15
  from dvsim.msg_buckets import MsgBuckets
14
16
  from dvsim.utils import check_bool, subst_wildcards
@@ -99,26 +101,26 @@ class LintCfg(OneShotCfg):
99
101
 
100
102
  # TODO(#9079): This way of parsing out messages into an intermediate
101
103
  # results.hjson file will be replaced by a native parser mechanism.
102
- def _gen_results(self, results):
103
- # '''
104
- # The function is called after the regression has completed. It looks
105
- # for a results.hjson file with aggregated results from the lint run.
106
- # The hjson needs to have the following format:
107
- #
108
- # {
109
- # bucket_key: [str],
110
- # // other buckets according to message_buckets configuration
111
- # }
112
- #
113
- # Each bucket key points to a list of signatures (strings).
114
- # The bucket categories and severities are defined in the
115
- # message_buckets class variable, and can be set via Hjson Dvsim
116
- # config files.
117
- #
118
- # Note that if this is a primary config, the results will
119
- # be generated using the _gen_results_summary function
120
- # '''
121
-
104
+ def _gen_results(self, results: Sequence[CompletedJobStatus]) -> None:
105
+ """Generate results.
106
+
107
+ The function is called after the regression has completed. It looks
108
+ for a results.hjson file with aggregated results from the lint run.
109
+ The hjson needs to have the following format:
110
+
111
+ {
112
+ bucket_key: [str],
113
+ // other buckets according to message_buckets configuration
114
+ }
115
+
116
+ Each bucket key points to a list of signatures (strings).
117
+ The bucket categories and severities are defined in the
118
+ message_buckets class variable, and can be set via Hjson Dvsim
119
+ config files.
120
+
121
+ Note that if this is a primary config, the results will
122
+ be generated using the _gen_results_summary function
123
+ """
122
124
  # Generate results table for runs.
123
125
  results_str = f"## {self.results_title}\n\n"
124
126
  results_str += f"### {self.timestamp_long}\n"
dvsim/flow/one_shot.py CHANGED
@@ -154,7 +154,7 @@ class OneShotCfg(FlowCfg):
154
154
  self._create_dirs()
155
155
 
156
156
  @abstractmethod
157
- def _gen_results(self):
157
+ def _gen_results(self, results: Sequence[CompletedJobStatus]) -> None:
158
158
  """Generate results for this config."""
159
159
 
160
160
  @abstractmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dvsim
3
- Version: 1.7.2
3
+ Version: 1.7.4
4
4
  Summary: DV system
5
5
  Author: lowRISC contributors (OpenTitan project)
6
6
  License-File: LICENSE
@@ -10,8 +10,8 @@ dvsim/test.py,sha256=lMTieXHFIGEYQRJGJFsh_cP4bZ1_EadUolRWzIVmBvs,5610
10
10
  dvsim/testplan.py,sha256=Qhne2FqlU8R9UGB5o3QOufMVh1xdbKFMhtLvjvyGyts,28389
11
11
  dvsim/testplanner.py,sha256=kvgb6iAbmfaKmOLem1crKm49eygvOQX1q79Jv5UAHe0,1326
12
12
  dvsim/cli/__init__.py,sha256=vggha7pCXj7dUK4VZChIR37MhKONBcJqt3j8l9xKM_U,238
13
- dvsim/cli/admin.py,sha256=bBnz0ZX1gd8RBTLd4CB3ZFvm08ayIjUUszI-rauxIK4,1182
14
- dvsim/cli/run.py,sha256=_S6ejDxGRyxMYKgNreCH6CC7vLFoJFRPmnCTPqQ6PBc,27968
13
+ dvsim/cli/admin.py,sha256=wyN1WAmsJUTAZwCL-aGC_1ILrCyRdYZGeXCWmxy0An0,1261
14
+ dvsim/cli/run.py,sha256=sgf0Qa8UJLU7kPUAUbOi6-t3sHTGAmPmWBmf607rjnI,27893
15
15
  dvsim/examples/testplanner/common_testplan.hjson,sha256=IDkf3AYleDdbuEarj8FItBhg5lMgoVrfgnAMzTU9_IM,806
16
16
  dvsim/examples/testplanner/foo_dv_doc.md,sha256=AZkreUFyAehr2-6xh6Z7eRo4Eok9HFUH4TrDnByDor0,331
17
17
  dvsim/examples/testplanner/foo_sim_results.hjson,sha256=WAx9FIwS11oybfw1BU7AmY_14tRDXWtoLBxAL0ZDh8I,1642
@@ -20,10 +20,10 @@ dvsim/flow/__init__.py,sha256=K6yruWpqvtuLCORlnTspPxwBjsIpQhMaCfQSqqtyvTQ,185
20
20
  dvsim/flow/base.py,sha256=2Ac15oc3rDpnAFlaKabLOMSOGwyi9ReVTd9zdeoLcgs,16602
21
21
  dvsim/flow/cdc.py,sha256=87aDKAsHNDnFs4dRkclQSJ5-Pm_djY8BlSR-nzcPAMY,558
22
22
  dvsim/flow/factory.py,sha256=Wtp3o87vqbGzZwku4I2zxAizEMzNyZRgDwgj7aWjw4U,3862
23
- dvsim/flow/formal.py,sha256=DVu-MkKJP-bJrfskXBIfqnL_sQTbqbDRuNiLv9_QQ2E,9935
23
+ dvsim/flow/formal.py,sha256=_sJIVSPNQv9-ezDcNr35r-xJKi1HKAWlCvwI4iqb3l0,10131
24
24
  dvsim/flow/hjson.py,sha256=iKR8gAHZl1XsYNkTPaePwKSkAcPgqO8BlKNBs4ER3XY,6483
25
- dvsim/flow/lint.py,sha256=YeLR8eegChWWkJj-jMtzqZp6VWN8grbuxz4kclaN9us,7063
26
- dvsim/flow/one_shot.py,sha256=qtbqQvql_VMoO33lfEz9qM7aGpr_CKSG4nXA1gbooBQ,6772
25
+ dvsim/flow/lint.py,sha256=mOfNHmbFMLl9sbulbygMK1ekfxdMWZwb8RQTKXUBadM,7144
26
+ dvsim/flow/one_shot.py,sha256=tRW8uXMz2OEYh1IIjpGuKh3Te5DId8Kp084CLSd9NEs,6819
27
27
  dvsim/flow/rdc.py,sha256=pu7GKw-eNd3RXdhq6oFKidBOflMtr1joAokS3SosTi4,562
28
28
  dvsim/flow/syn.py,sha256=LnwDM6dUhxNXRoTcUCbESZ2VCpBYEFdfuur3jsojejQ,15996
29
29
  dvsim/job/__init__.py,sha256=EtF6aoKkGy3sxCsfQMm2MAHgjYknmI1No90xvyjXRpY,186
@@ -80,8 +80,8 @@ dvsim/utils/status_printer.py,sha256=azwNWS83rI-h7OfOYPIj-Sy46aIz35L3y_Yiwkx60ZE
80
80
  dvsim/utils/subprocess.py,sha256=8jje9hmwZ_JH0zQ8JNwhsNldntgI3_SF6L5SUHQ9luo,1829
81
81
  dvsim/utils/timer.py,sha256=jD4R3wB_rBxaefiMr-k34aH325xdcoqtHHRCtSczSC8,1604
82
82
  dvsim/utils/wildcards.py,sha256=5WkByZLHyPlo5lD4rIXPuDjjrhrWqNpcTYxmQ5k294o,11701
83
- dvsim-1.7.2.dist-info/METADATA,sha256=Mpw4nSelVLJwKDLZjhN6NW26vtic8yVcbH1mNyxARFM,5882
84
- dvsim-1.7.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
85
- dvsim-1.7.2.dist-info/entry_points.txt,sha256=6A-YOJ6XYbedSfSJ5dP56lRkoHYrLanJt0AYNH9w3r0,75
86
- dvsim-1.7.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
87
- dvsim-1.7.2.dist-info/RECORD,,
83
+ dvsim-1.7.4.dist-info/METADATA,sha256=54RR4UKrC5rDrQjZdddXYgCnT10beId7HvPt8_uYhzM,5882
84
+ dvsim-1.7.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
85
+ dvsim-1.7.4.dist-info/entry_points.txt,sha256=6A-YOJ6XYbedSfSJ5dP56lRkoHYrLanJt0AYNH9w3r0,75
86
+ dvsim-1.7.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
87
+ dvsim-1.7.4.dist-info/RECORD,,
File without changes