Files
gem5/util/cpt_upgraders/arm-miscreg-teehbr.py
Bobby R. Bruce 298119e402 misc,python: Run pre-commit run --all-files
Applies the `pyupgrade` hook to all files in the repo.

Change-Id: I9879c634a65c5fcaa9567c63bc5977ff97d5d3bf
2023-10-10 21:47:07 -07:00

19 lines
632 B
Python

# Add the ARM MISCREG TEEHBR
def upgrader(cpt):
if cpt.get("root", "isa", fallback="") == "arm":
for sec in cpt.sections():
import re
# Search for all ISA sections
if re.search(r".*sys.*\.cpu.*\.isa$", sec):
mr = cpt.get(sec, "miscRegs").split()
if len(mr) == 161:
print("MISCREG_TEEHBR already seems to be inserted.")
else:
mr.insert(51, 0)
# Add dummy value for MISCREG_TEEHBR
cpt.set(sec, "miscRegs", " ".join(str(x) for x in mr))
legacy_version = 8