diff --git a/README.adoc b/README.adoc index 2f64cc5..68f3723 100644 --- a/README.adoc +++ b/README.adoc @@ -12073,13 +12073,17 @@ This does not run the test however. Note that the command and it's corresponding results don't need to show consecutively on stdout because tests are run in parallel. You just have to match them based on the class name `CircleBufTest` to the file `circlebuf.test.cpp`. -Running the larger regression tests is exposed with: +=== gem5 regression tests + +https://stackoverflow.com/questions/52279971/how-to-run-the-gem5-unit-tests + +Running the larger 2019 regression tests is exposed for example with: .... -./build-gem5 --regression-test quick/fs +./gem5-regression --arch aarch64 -- --length quick .... -but TODO: those require magic blobs on `M5_PATH` that we don't currently automate. +TODO skip the build by default with `--skip-build` since we already manage it with `./build-gem5`. But we can't do this because it is the build step that downloads the test binaries. We need to find a way to either download the binaries without building, or to pass the exact same scons build options through `test/main.py`. === gem5 simulate() limit reached @@ -12311,7 +12315,7 @@ gem5 has a few in tree CPU models for different purposes. In fs.py and se.py, th * `BaseSimpleCPU` descendants. Have no CPU pipeline. ** `AtomicSimpleCPU`: the default one. Memory accesses happen instantaneously. The fastest simulation except for KVM, but not realistic at all. Useful to <>. ** `TimingSimpleCPU: memory accesses are realistic, but the CPU has no pipeline. The simulation is faster than detailed models, but slower than `AtomicSimpleCPU`. TODO: application? -* `MinorCPU`: in-order core. Its 4 stage pipeline is described at the "MinorCPU" section of <>. As of 2019, in-order cores are mostly present in low power / cost contexts, for example little cores of https://en.wikipedia.org/wiki/ARM_big.LITTLE[ARM bigLITTLE]. +* `MinorCPU`: in-order core. The weird name "Minor" stands for "M (TODO what is M) IN ONder". Its 4 stage pipeline is described at the "MinorCPU" section of <>. As of 2019, in-order cores are mostly present in low power / cost contexts, for example little cores of https://en.wikipedia.org/wiki/ARM_big.LITTLE[ARM bigLITTLE]. ** `HPI`: derived from `MinorCPU` simply by parametrization. According to <>: "The HPI CPU timing model is tuned to be representative of a modern in-order Armv8-A implementation." * `DerivO3CPU`: out-of-order core. "O3" Stands for "Out Of Order"! diff --git a/build-gem5 b/build-gem5 index fb12689..5ab0306 100755 --- a/build-gem5 +++ b/build-gem5 @@ -13,15 +13,6 @@ class Main(common.BuildCliFunction): description='''\ Build gem5. https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-buildroot-setup -''' - ) - self.add_argument( - '--regression-test', - action='append', - default=[], - help='''\ -Build and run the given gem5 regression test. -https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-tests ''' ) self.add_argument( @@ -122,17 +113,6 @@ https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-t self.sh.cp(m5term_build, self.env['gem5_m5term']) if self.env['unit_test']: targets = [self.get_gem5_target_path(self.env, test) for test in self.env['unit_test']] - elif self.env['regression_test']: - targets = [ - os.path.join( - self.env['gem5_executable_dir'], - 'tests', - self.env['gem5_build_type'], - test - ) - for test - in self.env['regression_test'] - ] elif self.env['unit_tests']: targets = [self.env['gem5_unit_test_target']] else: diff --git a/gem5-regression b/gem5-regression new file mode 100755 index 0000000..afd24d7 --- /dev/null +++ b/gem5-regression @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +from shell_helpers import LF + +import os +import pathlib +import subprocess + +import common +from shell_helpers import LF + +class Main(common.LkmcCliFunction): + def __init__(self): + super().__init__( + description='''\ +Run gem5 regression tests. +https://cirosantilli.com/linux-kernel-module-cheat#gem5-regression-tests +''' + ) + self.add_argument( + 'extra_args', + metavar='extra-args', + nargs='*', + ) + + def timed_main(self): + return self.sh.run_cmd([ + os.path.join(self.env['gem5_source_dir'], 'tests', 'main.py'), LF, + 'run', LF, + '--base-dir', self.env['gem5_source_dir'], LF, + '--build-dir', self.env['gem5_build_build_dir'], LF, + '--isa', self.env['gem5_arch'], LF, + '--variant', self.env['gem5_build_type'], LF, + '-j', str(self.env['nproc']), LF, + '-t', str(self.env['nproc']), LF, + ], + cwd=os.path.join(self.env['gem5_source_dir'], 'tests'), + ) + +if __name__ == '__main__': + Main().cli()