From 5049fd23f5d9e2b421843889c47c6414ae901ad8 Mon Sep 17 00:00:00 2001 From: Alex Jones Date: Wed, 13 May 2026 16:15:19 +0100 Subject: [PATCH] feat: link to the instrumentation report from the summary HTML report Add a link to the HTML instrumentation report (metrics.html) from the summary HTML report if the instrumentation report exists in the given output directory. This will combine the two different report views together for simulation runs, providing a single central index. Signed-off-by: Alex Jones --- src/dvsim/sim/report.py | 9 ++++++++- src/dvsim/templates/reports/summary_report.html | 14 +++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/dvsim/sim/report.py b/src/dvsim/sim/report.py index c4caafa4..eba04395 100644 --- a/src/dvsim/sim/report.py +++ b/src/dvsim/sim/report.py @@ -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"]) diff --git a/src/dvsim/templates/reports/summary_report.html b/src/dvsim/templates/reports/summary_report.html index 5e4cb08a..77fbdc94 100644 --- a/src/dvsim/templates/reports/summary_report.html +++ b/src/dvsim/templates/reports/summary_report.html @@ -37,9 +37,9 @@

{{ title }}

-
+
+
 
-
 
{{ timestamp.strftime("%d/%m/%Y %H:%M:%S") }} @@ -54,7 +54,7 @@

{{ title }}

sha: {{ meta_info.commit_short }} json + href="index.json">JSON Branch: {{ meta_info.branch }} @@ -64,6 +64,14 @@

{{ title }}

{% endif %}
+ {% if instrumentation_report %} + + {% endif %}
{% macro coverage_cell(cov, kind) %}