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) %}