Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/dvsim/sim/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,20 @@ def render(
if outdir is not None:
(outdir / block_file).write_text(artifacts[block_file])

# If instrumentation report data is available, we should also link to that generated report
instrumentation_report = None
if outdir is not None:
instrumentation_path = outdir / "metrics.html"
if instrumentation_path.exists() and instrumentation_path.is_file():
instrumentation_report = "metrics.html"

# Regardless of whether we have a top or there is only one block, we always generate a
# summary page for now.
top_log_suffix = "" if summary.top is None else f" for {summary.top.name}"
log.debug("Generating HTML summary report%s", top_log_suffix)
artifacts["index.html"] = render_template(
path="reports/summary_report.html",
data={"summary": summary},
data={"summary": summary, "instrumentation_report": instrumentation_report},
)
if outdir is not None:
(outdir / "index.html").write_text(artifacts["index.html"])
Expand Down
14 changes: 11 additions & 3 deletions src/dvsim/templates/reports/summary_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ <h2>{{ title }}</h2>
</div>
</div>

<div class="row">
<div class="row justify-content-between">
<div class="text-center mb-2">&nbsp;</div>
<div class="col-4 col-md-3">
<div class="text-center mb-2">&nbsp;</div>
<span class="badge text-bg-secondary">
{{ timestamp.strftime("%d/%m/%Y %H:%M:%S") }}
</span>
Expand All @@ -54,7 +54,7 @@ <h2>{{ title }}</h2>
sha: {{ meta_info.commit_short }}
</a>
<a class="badge text-bg-secondary link-underline link-underline-opacity-0"
href="index.json">json</a>
href="index.json">JSON</a>
<span class="badge text-bg-secondary">
Branch: {{ meta_info.branch }}
</span>
Expand All @@ -64,6 +64,14 @@ <h2>{{ title }}</h2>
</span>
{% endif %}
</div>
{% if instrumentation_report %}
<div class="col-4 col-md-3">
<a class="badge text-bg-secondary link-underline link-underline-opacity-0 fs-6"
href="{{ instrumentation_report }}">
Instrumentation Report
</a>
</div>
{% endif %}
</div>

{% macro coverage_cell(cov, kind) %}
Expand Down
Loading