Files
gem5/util/cpt_upgraders/arm-contextidr-el2.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

16 lines
539 B
Python

# Add the ARM CONTEXTIDR_EL2 miscreg.
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):
miscRegs = cpt.get(sec, "miscRegs").split()
# CONTEXTIDR_EL2 defaults to 0b11111100000000000001
miscRegs[599:599] = [0xFC001]
cpt.set(sec, "miscRegs", " ".join(str(x) for x in miscRegs))
legacy_version = 14