Files
gem5/util/cpt_upgraders/x86-add-tlb.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

20 lines
551 B
Python

# Add TLB to x86 checkpoints
def upgrader(cpt):
if cpt.get("root", "isa", fallback="") == "x86":
for sec in cpt.sections():
import re
# Search for all ISA sections
if re.search(r".*sys.*\.cpu.*\.dtb$", sec):
cpt.set(sec, "_size", "0")
cpt.set(sec, "lruSeq", "0")
if re.search(r".*sys.*\.cpu.*\.itb$", sec):
cpt.set(sec, "_size", "0")
cpt.set(sec, "lruSeq", "0")
else:
print("ISA is not x86")
legacy_version = 6