misc: Run pre-commit autoupdate (#419)

1. Runs `pre-commit autoupdate`.
2. Runs `pre-commit run --all-files`.
3. Adds (2.) to ".git-blame-ignore-rev".
This commit is contained in:
Bobby R. Bruce
2023-10-10 21:41:33 -07:00
committed by GitHub
185 changed files with 125 additions and 177 deletions

View File

@@ -44,7 +44,6 @@ def test_boot(
length: str,
to_tick: Optional[int] = None,
):
name = f"{cpu}-cpu_{num_cpus}-cores_{mem_system}_{memory_class}_\
arm_boot_test"

View File

@@ -370,7 +370,6 @@ class DownloadedArchive(DownloadedProgram):
with tarfile.open(self.filename) as tf:
def is_within_directory(directory, target):
abs_directory = os.path.abspath(directory)
abs_target = os.path.abspath(target)
@@ -381,7 +380,6 @@ class DownloadedArchive(DownloadedProgram):
def safe_extract(
tar, path=".", members=None, *, numeric_owner=False
):
for member in tar.getmembers():
member_path = os.path.join(path, member.name)
if not is_within_directory(path, member_path):

View File

@@ -53,7 +53,7 @@ class Sequential:
def __init__(self, cpus):
self.first_cpu = None
for (cpuno, cpu) in enumerate(cpus):
for cpuno, cpu in enumerate(cpus):
if not cpu.switched_out:
if self.first_cpu != None:
fatal("More than one CPU is switched in")
@@ -141,7 +141,6 @@ def run_test(root, switcher=None, freq=1000, verbose=False):
exit_cause == "target called exit()"
or exit_cause == "m5_exit instruction encountered"
):
sys.exit(0)
else:
print(f"Test failed: Unknown exit cause: {exit_cause}")

View File

@@ -180,7 +180,6 @@ log.test_log.message(
)
# 'False' is used to disable the tests.
if False: # os.access("/dev/kvm", mode=os.R_OK | os.W_OK):
# The x86-parsec-benchmarks uses KVM cores, this test will therefore only
# be run on systems that support KVM.
gem5_verify_config(

View File

@@ -41,7 +41,6 @@ else:
def test_kvm_fork_run(cpu: str, num_cpus: int, mem_system: str, length: str):
if not os.access("/dev/kvm", mode=os.R_OK | os.W_OK):
# Don't run the tests if KVM is unavailable.
return

View File

@@ -41,7 +41,6 @@ else:
def test_kvm_switch(cpu: str, num_cpus: int, mem_system: str, length: str):
if not os.access("/dev/kvm", mode=os.R_OK | os.W_OK):
# Don't run the tests if KVM is unavailable.
return

View File

@@ -147,7 +147,6 @@ args = parser.parse_args()
# Setup the cachie hierarchy.
if args.mem_system == "classic":
from gem5.components.cachehierarchies.classic.private_l1_private_l2_cache_hierarchy import (
PrivateL1PrivateL2CacheHierarchy,
)
@@ -214,6 +213,7 @@ board.set_kernel_disk_workload(
readfile_contents=command,
)
# Here we define some custom workbegin/workend exit event generators. Here we
# want to switch to detailed CPUs at the beginning of the ROI, then continue to
# the end of of the ROI. Then we exit the simulation.

View File

@@ -43,7 +43,6 @@ def test_parsec(
size: str,
length: str,
):
if (boot_cpu == "kvm" or detailed_cpu == "kvm") and not os.access(
"/dev/kvm", mode=os.R_OK | os.W_OK
):

View File

@@ -52,7 +52,6 @@ from m5.objects.ReplacementPolicies import RRIPRP as rp
def python_generator(generator):
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 100, 0)
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 100, 0)
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 100, 0)

View File

@@ -52,7 +52,6 @@ from m5.objects.ReplacementPolicies import RRIPRP as rp
def python_generator(generator):
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 0, 0)
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 0, 0)
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 0, 0)

View File

@@ -52,7 +52,6 @@ from m5.objects.ReplacementPolicies import SecondChanceRP as rp
def python_generator(generator):
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 100, 0)
yield generator.createLinear(60000, 128, 191, 64, 30000, 30000, 100, 0)
yield generator.createLinear(60000, 256, 319, 64, 30000, 30000, 100, 0)

View File

@@ -54,7 +54,6 @@ from m5.objects.ReplacementPolicies import SecondChanceRP as rp
def python_generator(generator):
yield generator.createLinear(60000, 0, 63, 64, 30000, 30000, 0, 0)
yield generator.createLinear(60000, 128, 191, 64, 30000, 30000, 0, 0)
yield generator.createLinear(60000, 256, 319, 64, 30000, 30000, 0, 0)

View File

@@ -44,7 +44,6 @@ def test_boot(
length: str,
to_tick: Optional[int] = None,
):
name = "{}-cpu_{}-cores_{}_{}_riscv-boot-test".format(
cpu, str(num_cpus), cache_type, memory_class
)

View File

@@ -90,7 +90,6 @@ stdout_verifier = verifier.MatchRegex(regex)
def verify_config(isa, binary, cpu, hosts, verifier, input):
gem5_verify_config(
name="test-" + binary + "-" + cpu,
fixtures=(),

View File

@@ -98,7 +98,6 @@ def gem5_verify_config(
for host in valid_hosts:
for opt in valid_variants:
for isa in valid_isas:
# Create a tempdir fixture to be shared throughout the test.
tempdir = TempdirFixture()
gem5_returncode = VariableFixture(

View File

@@ -44,7 +44,6 @@ def test_memory(
memory: str,
*args,
) -> None:
name = (
"test-memory-"
+ f"{generator}-{generator_cores}-{cache}-{module}-{memory}"

View File

@@ -139,7 +139,6 @@ class DerivedGoldStandard(MatchGoldStandard):
def __init__(
self, standard_filename, ignore_regex=__ignore_regex_sentinel, **kwargs
):
if ignore_regex == self.__ignore_regex_sentinel:
ignore_regex = self._default_ignore_regex

View File

@@ -44,7 +44,6 @@ def test_boot(
boot_type: str = "init",
to_tick: Optional[int] = None,
):
name = "{}-cpu_{}-cores_{}_{}_{}_x86-boot-test".format(
cpu, str(num_cpus), mem_system, memory_class, boot_type
)

View File

@@ -318,7 +318,6 @@ class LooppointTestSuite(unittest.TestCase):
self.assertEquals(PcCountPair(101, 202), targets[5])
def test_get_region_start_id_map(self):
region1 = LooppointRegion(
simulation=LooppointSimulation(
start=LooppointRegionPC(pc=56, globl=2345, relative=344),

View File

@@ -75,7 +75,6 @@ class MD5DirTestSuite(unittest.TestCase):
"""Test cases for gem5.resources.md5_utils.md5_dir()"""
def _create_temp_directory(self) -> Path:
dir = tempfile.mkdtemp()
with open(os.path.join(dir, "file1"), "w") as f:

View File

@@ -161,6 +161,7 @@ test_progs = os.environ.get("M5_TEST_PROGS", "/dist/m5/regression/test-progs")
if not os.path.isdir(test_progs):
test_progs = joinpath(tests_root, "test-progs")
# generate path to binary file
def binpath(app, file=None):
# executable has same name as app unless specified otherwise
@@ -234,6 +235,7 @@ exec(
)
)
# Initialize all CPUs in a system
def initCPUs(sys):
def initCPU(cpu):