From 65e8850269900ba80f303d6930ac0f64109e050f Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 12 Dec 2024 15:08:03 +0100 Subject: [PATCH] [util] Fix audit_sec_mmio_calls to use the new IP header rules With the new rule, a very easy way to get the list of all Hjson files for IPs is to look at the `ip_hjson` attribute of the definition of //hw/top:top__desc. Since this script kind of assumes earlgrey anyway, explicitely point to the earlgrey description of now. Signed-off-by: Amaury Pouly --- util/py/scripts/audit_sec_mmio_calls.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/util/py/scripts/audit_sec_mmio_calls.py b/util/py/scripts/audit_sec_mmio_calls.py index 07b424facfd57e..8a3140ba075724 100644 --- a/util/py/scripts/audit_sec_mmio_calls.py +++ b/util/py/scripts/audit_sec_mmio_calls.py @@ -63,14 +63,13 @@ def __init__(self): bazel.try_escape_sandbox() def query_hjson_sources(self) -> list[Path]: - """Find hjson files associated with autogen_hjson_c_header targets.""" - log.info("Querying Bazel for autogen_hjson_c_header srcs") + """Find hjson files associated with the top.""" + log.info("Querying Bazel for IP hjson files") query_lines = run.run( "./bazelisk.sh", "cquery", - "labels(srcs, kind(autogen_hjson_c_header, //...))", - "--output=starlark", - "--starlark:expr='\\n'.join([f.path for f in target.files.to_list()])", + "labels(ip_hjson, //hw/top:top_earlgrey_desc)", + "--output=files", ) return [Path(line) for line in query_lines] @@ -255,7 +254,7 @@ def main(log_level: ot_logging.LogLevel = ot_logging.LogLevel.WARNING) -> None: report_lines.append("Callsites where " f"[bold]{function_name}[/bold] " + "is called with hw-writable register " + - f"[purple]{register_token}[/purple]:") + f"[purple]{register_token}[/purple]: ") report_lines.append("") for loc in sorted(callsites, key=lambda c: c.path):