Skip to content

Commit

Permalink
[util] Fix audit_sec_mmio_calls to use the new IP header rules
Browse files Browse the repository at this point in the history
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_<name>_desc. Since this script kind
of assumes earlgrey anyway, explicitely point to the earlgrey
description of now.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Dec 13, 2024
1 parent 4d3e2e6 commit 65e8850
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions util/py/scripts/audit_sec_mmio_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 65e8850

Please sign in to comment.