dvsim 1.6.2__py3-none-any.whl → 1.7.0__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 +3 -8
- dvsim/flow/base.py +4 -4
- dvsim/report/generate.py +32 -2
- dvsim/sim_results.py +1 -1
- dvsim/templates/render.py +18 -1
- dvsim/templates/reports/block_report.html +38 -46
- dvsim/templates/reports/summary_report.html +10 -54
- dvsim/templates/reports/wrapper.html +35 -0
- dvsim/templates/static/css/bootstrap.min.css +6 -0
- dvsim/templates/static/css/style.css +16 -0
- dvsim/templates/static/js/bootstrap.bundle.min.js +7 -0
- dvsim/templates/static/js/htmx.min.js +1 -0
- {dvsim-1.6.2.dist-info → dvsim-1.7.0.dist-info}/METADATA +1 -1
- {dvsim-1.6.2.dist-info → dvsim-1.7.0.dist-info}/RECORD +17 -12
- {dvsim-1.6.2.dist-info → dvsim-1.7.0.dist-info}/WHEEL +0 -0
- {dvsim-1.6.2.dist-info → dvsim-1.7.0.dist-info}/entry_points.txt +0 -0
- {dvsim-1.6.2.dist-info → dvsim-1.7.0.dist-info}/licenses/LICENSE +0 -0
dvsim/cli/admin.py
CHANGED
|
@@ -8,9 +8,6 @@ from pathlib import Path
|
|
|
8
8
|
|
|
9
9
|
import click
|
|
10
10
|
|
|
11
|
-
from dvsim.report.data import ResultsSummary
|
|
12
|
-
from dvsim.report.generate import gen_block_report
|
|
13
|
-
|
|
14
11
|
|
|
15
12
|
@click.group()
|
|
16
13
|
def cli() -> None:
|
|
@@ -38,11 +35,9 @@ def report() -> None:
|
|
|
38
35
|
)
|
|
39
36
|
def gen(json_path: Path, output_dir: Path) -> None:
|
|
40
37
|
"""Generate a report from a existing results JSON."""
|
|
41
|
-
from dvsim.report.
|
|
38
|
+
from dvsim.report.data import ResultsSummary
|
|
39
|
+
from dvsim.report.generate import gen_reports
|
|
42
40
|
|
|
43
41
|
results: ResultsSummary = ResultsSummary.load(path=json_path)
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
for flow_result in results.flow_results.values():
|
|
48
|
-
gen_block_report(flow_result, path=output_dir)
|
|
43
|
+
gen_reports(summary=results, path=output_dir)
|
dvsim/flow/base.py
CHANGED
|
@@ -21,7 +21,7 @@ from dvsim.job.data import CompletedJobStatus
|
|
|
21
21
|
from dvsim.launcher.factory import get_launcher_cls
|
|
22
22
|
from dvsim.logging import log
|
|
23
23
|
from dvsim.report.data import FlowResults, IPMeta, ResultsSummary
|
|
24
|
-
from dvsim.report.generate import gen_block_report,
|
|
24
|
+
from dvsim.report.generate import gen_block_report, gen_reports
|
|
25
25
|
from dvsim.scheduler import Scheduler
|
|
26
26
|
from dvsim.utils import (
|
|
27
27
|
find_and_substitute_wildcards,
|
|
@@ -480,7 +480,7 @@ class FlowCfg(ABC):
|
|
|
480
480
|
|
|
481
481
|
all_flow_results[block_result_index] = flow_results
|
|
482
482
|
|
|
483
|
-
#
|
|
483
|
+
# Generate the block's JSON/HTML reports to the report area.
|
|
484
484
|
gen_block_report(
|
|
485
485
|
results=flow_results,
|
|
486
486
|
path=reports_dir,
|
|
@@ -511,8 +511,8 @@ class FlowCfg(ABC):
|
|
|
511
511
|
report_path=reports_dir,
|
|
512
512
|
)
|
|
513
513
|
|
|
514
|
-
#
|
|
515
|
-
|
|
514
|
+
# Generate all the JSON/HTML reports to the report area.
|
|
515
|
+
gen_reports(
|
|
516
516
|
summary=results_summary,
|
|
517
517
|
path=reports_dir,
|
|
518
518
|
)
|
dvsim/report/generate.py
CHANGED
|
@@ -8,10 +8,11 @@ from pathlib import Path
|
|
|
8
8
|
|
|
9
9
|
from dvsim.logging import log
|
|
10
10
|
from dvsim.report.data import FlowResults, ResultsSummary
|
|
11
|
-
from dvsim.templates.render import render_template
|
|
11
|
+
from dvsim.templates.render import render_static, render_template
|
|
12
12
|
|
|
13
13
|
__all__ = (
|
|
14
14
|
"gen_block_report",
|
|
15
|
+
"gen_reports",
|
|
15
16
|
"gen_summary_report",
|
|
16
17
|
)
|
|
17
18
|
|
|
@@ -61,8 +62,23 @@ def gen_summary_report(summary: ResultsSummary, path: Path) -> None:
|
|
|
61
62
|
# Save the JSON version
|
|
62
63
|
(path / "index.json").write_text(summary.model_dump_json())
|
|
63
64
|
|
|
65
|
+
# Generate style CSS
|
|
66
|
+
for name in (
|
|
67
|
+
"css/style.css",
|
|
68
|
+
"css/bootstrap.min.css",
|
|
69
|
+
"js/bootstrap.bundle.min.js",
|
|
70
|
+
"js/htmx.min.js",
|
|
71
|
+
):
|
|
72
|
+
output = path / name
|
|
73
|
+
|
|
74
|
+
output.parent.mkdir(parents=True, exist_ok=True)
|
|
75
|
+
output.write_text(render_static(path=name))
|
|
76
|
+
|
|
77
|
+
# HTMX wrapper
|
|
78
|
+
(path / "index.html").write_text(render_template(path="reports/wrapper.html"))
|
|
79
|
+
|
|
64
80
|
# Generate HTML report
|
|
65
|
-
(path / "
|
|
81
|
+
(path / "summary.html").write_text(
|
|
66
82
|
render_template(
|
|
67
83
|
path="reports/summary_report.html",
|
|
68
84
|
data={
|
|
@@ -70,3 +86,17 @@ def gen_summary_report(summary: ResultsSummary, path: Path) -> None:
|
|
|
70
86
|
},
|
|
71
87
|
),
|
|
72
88
|
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def gen_reports(summary: ResultsSummary, path: Path) -> None:
|
|
92
|
+
"""Generate a full set of reports for the given regression run.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
summary: overview of the block results
|
|
96
|
+
path: output directory path
|
|
97
|
+
|
|
98
|
+
"""
|
|
99
|
+
gen_summary_report(summary=summary, path=path)
|
|
100
|
+
|
|
101
|
+
for flow_result in summary.flow_results.values():
|
|
102
|
+
gen_block_report(results=flow_result, path=path)
|
dvsim/sim_results.py
CHANGED
|
@@ -132,7 +132,7 @@ class BucketedFailures(BaseModel):
|
|
|
132
132
|
|
|
133
133
|
buckets[bucket].append(
|
|
134
134
|
JobFailureOverview(
|
|
135
|
-
name=job_status.
|
|
135
|
+
name=job_status.name,
|
|
136
136
|
seed=job_status.seed,
|
|
137
137
|
line=job_status.fail_msg.line_number,
|
|
138
138
|
log_context=job_status.fail_msg.context,
|
dvsim/templates/render.py
CHANGED
|
@@ -9,6 +9,7 @@ DVSim. Templates can be referenced relative to this directory.
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
from collections.abc import Mapping
|
|
12
|
+
from importlib import resources
|
|
12
13
|
|
|
13
14
|
from jinja2 import Environment, PackageLoader, select_autoescape
|
|
14
15
|
|
|
@@ -17,6 +18,22 @@ __all__ = ("render_template",)
|
|
|
17
18
|
_env: Environment | None = None
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
def render_static(path: str) -> str:
|
|
22
|
+
"""Render static files packaged with DVSim.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
path: relative path to the DVSim template directory
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
string containing the static file content
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
return resources.read_text(
|
|
32
|
+
"dvsim",
|
|
33
|
+
f"templates/static/{path}",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
20
37
|
def render_template(path: str, data: Mapping[str, object] | None = None) -> str:
|
|
21
38
|
"""Render a template packaged with DVSim.
|
|
22
39
|
|
|
@@ -38,4 +55,4 @@ def render_template(path: str, data: Mapping[str, object] | None = None) -> str:
|
|
|
38
55
|
|
|
39
56
|
template = _env.get_template(path)
|
|
40
57
|
|
|
41
|
-
return template.render(data)
|
|
58
|
+
return template.render(data or {})
|
|
@@ -4,51 +4,12 @@
|
|
|
4
4
|
# SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
6
|
-->
|
|
7
|
-
|
|
8
7
|
{% set block = results.block %}
|
|
9
8
|
{% set tool = results.tool %}
|
|
10
9
|
{% set timestamp = results.timestamp %}
|
|
11
10
|
{% set stages = results.stages %}
|
|
12
11
|
{% set coverage = results.coverage %}
|
|
13
|
-
|
|
14
|
-
<!doctype html>
|
|
15
|
-
<html lang="en">
|
|
16
|
-
<head>
|
|
17
|
-
<meta charset="utf-8">
|
|
18
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
19
|
-
<title>{{ block.name }} Simulation Results</title>
|
|
20
|
-
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
|
21
|
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
22
|
-
rel="stylesheet"
|
|
23
|
-
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
|
24
|
-
crossorigin="anonymous">
|
|
25
|
-
<style>
|
|
26
|
-
td.c0 { color: #ffffff; background-color: #EF5757; }
|
|
27
|
-
td.c1 { color: #ffffff; background-color: #EF6D57; }
|
|
28
|
-
td.c2 { color: #000000; background-color: #EF8357; }
|
|
29
|
-
td.c3 { color: #000000; background-color: #EF9957; }
|
|
30
|
-
td.c4 { color: #000000; background-color: #EFAF57; }
|
|
31
|
-
td.c5 { color: #000000; background-color: #EFC557; }
|
|
32
|
-
td.c6 { color: #000000; background-color: #EFDB57; }
|
|
33
|
-
td.c7 { color: #000000; background-color: #ECEF57; }
|
|
34
|
-
td.c8 { color: #000000; background-color: #D6EF57; }
|
|
35
|
-
td.c9 { color: #000000; background-color: #C0EF57; }
|
|
36
|
-
td.c10 { color: #000000; background-color: #57EF57; }
|
|
37
|
-
</style>
|
|
38
|
-
</head>
|
|
39
|
-
<body>
|
|
40
|
-
|
|
41
|
-
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
|
42
|
-
<div class="container-fluid">
|
|
43
|
-
<a class="navbar-brand" href="#">Nightly Reports</a>
|
|
44
|
-
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
|
|
45
|
-
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
|
|
46
|
-
aria-expanded="false" aria-label="Toggle navigation">
|
|
47
|
-
<span class="navbar-toggler-icon"></span>
|
|
48
|
-
</button>
|
|
49
|
-
</div>
|
|
50
|
-
</nav>
|
|
51
|
-
|
|
12
|
+
{% set failed_jobs = results.failed_jobs %}
|
|
52
13
|
<div class="container-md">
|
|
53
14
|
<div class="row">
|
|
54
15
|
<div class="col">
|
|
@@ -223,10 +184,41 @@
|
|
|
223
184
|
</div>
|
|
224
185
|
</div>
|
|
225
186
|
</div>
|
|
226
|
-
</div>
|
|
227
187
|
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
188
|
+
<div class="row py-3">
|
|
189
|
+
<div class="col">
|
|
190
|
+
<h3>Error Messages</h3>
|
|
191
|
+
<table class="table table-sm table-hover">
|
|
192
|
+
<thead>
|
|
193
|
+
<tr>
|
|
194
|
+
<th> </th>
|
|
195
|
+
<th>Test</th>
|
|
196
|
+
<th>seed</th>
|
|
197
|
+
<th>line</th>
|
|
198
|
+
<th>log context</th>
|
|
199
|
+
</tr>
|
|
200
|
+
</thead>
|
|
201
|
+
<tbody>
|
|
202
|
+
{% for msg, job_list in failed_jobs.buckets.items() %}
|
|
203
|
+
<tr class="table-primary">
|
|
204
|
+
<td colspan=5>{{ msg }}</td>
|
|
205
|
+
</tr>
|
|
206
|
+
{% for job in job_list %}
|
|
207
|
+
<tr>
|
|
208
|
+
<th scope="row"></th>
|
|
209
|
+
<td>{{ job.name }}</td>
|
|
210
|
+
<td>{{ job.seed }}</td>
|
|
211
|
+
<td>{{ job.line }}</td>
|
|
212
|
+
<td>
|
|
213
|
+
{% for line in job.log_context %}
|
|
214
|
+
<div>{{ line }}</div>
|
|
215
|
+
{% endfor %}
|
|
216
|
+
</td>
|
|
217
|
+
</tr>
|
|
218
|
+
{% endfor %}
|
|
219
|
+
{% endfor %}
|
|
220
|
+
</tbody>
|
|
221
|
+
</table>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
@@ -4,49 +4,9 @@
|
|
|
4
4
|
# SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
6
|
-->
|
|
7
|
-
|
|
8
7
|
{% set top = summary.top %}
|
|
9
8
|
{% set timestamp = summary.timestamp %}
|
|
10
|
-
|
|
11
|
-
<!doctype html>
|
|
12
|
-
<html lang="en">
|
|
13
|
-
<head>
|
|
14
|
-
<meta charset="utf-8">
|
|
15
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
16
|
-
<title>{{ top.name }} Simulation Results</title>
|
|
17
|
-
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
|
18
|
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
19
|
-
rel="stylesheet"
|
|
20
|
-
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
|
21
|
-
crossorigin="anonymous">
|
|
22
|
-
<style>
|
|
23
|
-
td.c0 { color: #ffffff; background-color: #EF5757; }
|
|
24
|
-
td.c1 { color: #ffffff; background-color: #EF6D57; }
|
|
25
|
-
td.c2 { color: #000000; background-color: #EF8357; }
|
|
26
|
-
td.c3 { color: #000000; background-color: #EF9957; }
|
|
27
|
-
td.c4 { color: #000000; background-color: #EFAF57; }
|
|
28
|
-
td.c5 { color: #000000; background-color: #EFC557; }
|
|
29
|
-
td.c6 { color: #000000; background-color: #EFDB57; }
|
|
30
|
-
td.c7 { color: #000000; background-color: #ECEF57; }
|
|
31
|
-
td.c8 { color: #000000; background-color: #D6EF57; }
|
|
32
|
-
td.c9 { color: #000000; background-color: #C0EF57; }
|
|
33
|
-
td.c10 { color: #000000; background-color: #57EF57; }
|
|
34
|
-
</style>
|
|
35
|
-
</head>
|
|
36
|
-
<body>
|
|
37
|
-
|
|
38
|
-
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
|
39
|
-
<div class="container-fluid">
|
|
40
|
-
<a class="navbar-brand" href="#">Nightly Reports</a>
|
|
41
|
-
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
|
|
42
|
-
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
|
|
43
|
-
aria-expanded="false" aria-label="Toggle navigation">
|
|
44
|
-
<span class="navbar-toggler-icon"></span>
|
|
45
|
-
</button>
|
|
46
|
-
</div>
|
|
47
|
-
</nav>
|
|
48
|
-
|
|
49
|
-
<div class="container-md">
|
|
9
|
+
<div class="container-md">
|
|
50
10
|
<div class="row">
|
|
51
11
|
<div class="col">
|
|
52
12
|
{% if breadcrumbs %}
|
|
@@ -77,25 +37,25 @@
|
|
|
77
37
|
{{ timestamp.strftime("%d/%m/%Y %H:%M:%S") }}
|
|
78
38
|
</span>
|
|
79
39
|
<a class="badge text-bg-secondary link-underline link-underline-opacity-0"
|
|
80
|
-
|
|
40
|
+
href="{{ top.url }}">
|
|
81
41
|
sha: {{ top.commit[:7] }}
|
|
82
42
|
</a>
|
|
83
43
|
<a class="badge text-bg-secondary link-underline link-underline-opacity-0"
|
|
84
|
-
|
|
44
|
+
href="index.json">json</a>
|
|
85
45
|
<span class="badge text-bg-secondary">
|
|
86
46
|
Branch: {{ top.branch }}
|
|
87
47
|
</span>
|
|
88
48
|
</div>
|
|
89
49
|
</div>
|
|
90
50
|
|
|
91
|
-
{% macro coverage_cell(cov, kind) %}
|
|
51
|
+
{% macro coverage_cell(cov, kind) %}
|
|
92
52
|
{% if cov and cov|attr(kind) is not none %}
|
|
93
53
|
{% set value = cov|attr(kind) %}
|
|
94
54
|
<td class="c{{ (value / 10)|int }}">{{ "%.2f"|format(value) }}</td>
|
|
95
55
|
{% else %}
|
|
96
56
|
<td class="text-muted">-</td>
|
|
97
57
|
{% endif %}
|
|
98
|
-
{% endmacro %}
|
|
58
|
+
{% endmacro %}
|
|
99
59
|
|
|
100
60
|
<div class="row py-3">
|
|
101
61
|
<div class="col">
|
|
@@ -132,10 +92,12 @@
|
|
|
132
92
|
{% for block_name in summary.flow_results.keys()|sort %}
|
|
133
93
|
{% set flow = summary.flow_results[block_name] %}
|
|
134
94
|
<tr>
|
|
135
|
-
<td
|
|
136
|
-
|
|
95
|
+
<td class="btn"
|
|
96
|
+
hx-get="{{ block_name }}.html"
|
|
97
|
+
hx-trigger="click"
|
|
98
|
+
hx-push-url="true"
|
|
99
|
+
hx-target="#report-content">
|
|
137
100
|
{{ block_name | upper }}
|
|
138
|
-
</a>
|
|
139
101
|
</td>
|
|
140
102
|
<td>{{ flow.passed }}</td>
|
|
141
103
|
<td>{{ flow.total }}</td>
|
|
@@ -163,9 +125,3 @@
|
|
|
163
125
|
</div>
|
|
164
126
|
</div>
|
|
165
127
|
</div>
|
|
166
|
-
|
|
167
|
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
168
|
-
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
169
|
-
crossorigin="anonymous"></script>
|
|
170
|
-
</body>
|
|
171
|
-
</html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
# Copyright lowRISC contributors (OpenTitan project).
|
|
3
|
+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
-->
|
|
7
|
+
<!DOCTYPE html>
|
|
8
|
+
<html lang="en">
|
|
9
|
+
<head>
|
|
10
|
+
<meta charset="utf-8">
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
12
|
+
<title>Simulation Results</title>
|
|
13
|
+
<script src="js/htmx.min.js"></script>
|
|
14
|
+
<script>
|
|
15
|
+
htmx.config.selfRequestsOnly = false;
|
|
16
|
+
</script>
|
|
17
|
+
<link href="css/bootstrap.min.css" rel="stylesheet">
|
|
18
|
+
<link href="css/style.css" rel="stylesheet">
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
|
|
22
|
+
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
|
23
|
+
<div class="container-fluid">
|
|
24
|
+
<a class="navbar-brand" href="#">Nightly Reports</a>
|
|
25
|
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
26
|
+
<span class="navbar-toggler-icon"></span>
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
</nav>
|
|
30
|
+
|
|
31
|
+
<div id="report-content" hx-get="summary.html" hx-trigger="load" hx-request='{"noHeaders": true}' hx-target="#report-content"></div>
|
|
32
|
+
|
|
33
|
+
<script src="js/bootstrap.bundle.min.js"></script>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|