gem5: move to 2019 regressions

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-09-18 00:00:00 +00:00
parent e14f0e3679
commit e839078a37
3 changed files with 48 additions and 24 deletions

View File

@@ -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`. 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 === 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. * `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 <<gem5-restore-checkpoint-with-a-different-cpu>>. ** `AtomicSimpleCPU`: the default one. Memory accesses happen instantaneously. The fastest simulation except for KVM, but not realistic at all. Useful to <<gem5-restore-checkpoint-with-a-different-cpu>>.
** `TimingSimpleCPU: memory accesses are realistic, but the CPU has no pipeline. The simulation is faster than detailed models, but slower than `AtomicSimpleCPU`. TODO: application? ** `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 <<gem5-arm-rsk>>. 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 <<gem5-arm-rsk>>. 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 <<gem5-arm-rsk>>: "The HPI CPU timing model is tuned to be representative of a modern in-order Armv8-A implementation." ** `HPI`: derived from `MinorCPU` simply by parametrization. According to <<gem5-arm-rsk>>: "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"! * `DerivO3CPU`: out-of-order core. "O3" Stands for "Out Of Order"!

View File

@@ -13,15 +13,6 @@ class Main(common.BuildCliFunction):
description='''\ description='''\
Build gem5. Build gem5.
https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-buildroot-setup 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( 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']) self.sh.cp(m5term_build, self.env['gem5_m5term'])
if self.env['unit_test']: if self.env['unit_test']:
targets = [self.get_gem5_target_path(self.env, test) for test in 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']: elif self.env['unit_tests']:
targets = [self.env['gem5_unit_test_target']] targets = [self.env['gem5_unit_test_target']]
else: else:

40
gem5-regression Executable file
View File

@@ -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()