diff --git a/index.html b/index.html index ac10dec..a64bab1 100644 --- a/index.html +++ b/index.html @@ -1082,8 +1082,8 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
see also: Section 18.17, “gem5 ARM platforms”.
+see also: Section 18.18, “gem5 ARM platforms”.
This generates yet new separate images with new magic constants:
@@ -7629,7 +7632,7 @@ time \Since gem5 has to implement syscalls itself in syscall emulation mode, it can of course clearly see which syscalls are bing made, and we can log them for debug purposes with gem5 tracing, e.g.:
+Since gem5 has to implement syscalls itself in syscall emulation mode, it can of course clearly see which syscalls are being made, and we can log them for debug purposes with gem5 tracing, e.g.:
TODO why in User mode simulation QEMU always shows the number of cores of the host. E.g., both of the following output the same as nproc on the host:
gem5 user mode multi core has been particularly flaky compared to QEMU’s.
+gem5 user mode multithreading has been particularly flaky compared to QEMU’s.
You have the limitation that you must have at least one core per guest thread, otherwise pthread_create fails. For example:
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:
+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.
This error happens when the following instruction limits are reached:
In order to use different build options, you might also want to use gem5 build variants to keep the build outputs separate from one another.
Explained at: Section 17.7, “Debug the emulator”.
TODO test properly, benchmark vs GCC.
If there gem5 appears to have a C++ undefined behaviour bug, which is often very difficult to track down, you can try to build it with the following extra SCons options:
Ruby is a system that includes the SLICC domain specific language to describe memory systems: http://gem5.org/Ruby
Python 3 support was mostly added in 2019 Q3 at arounda347a1a68b8a6e370334be3a1d2d66675891e0f1 but remained buggy for some time afterwards.
gem5 has a few in tree CPU models for different purposes. In fs.py and se.py, those are selectable with the --cpu-type option. Here is an overview of the most interesting ones:
MinorCPU: in-order core. Its 4 stage pipeline is described at the "MinorCPU" section of gem5 ARM RSK.
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 ARM bigLITTLE.
The gem5 platform is selectable with the --machine option, which is named after the analogous QEMU -machine option, and which sets the --machine-type.
The interaction uses the Python C extension interface https://docs.python.org/2/extending/extending.html interface through the pybind11 helper library: https://github.com/pybind/pybind11
userland/c/malloc.c: malloc hello world: allocate two ints and use them.
LInux 5.1 / glibc 2.29 implements it with the mmap system call.
Linux 5.1 / glibc 2.29 implements it with the mmap system call.
malloc leads to the infinite joys of Memory leaks.
Added in C11!
+userland/c/atomic.c: atomic_int and thrd_create
Bibliography:
+Example: userland/gcc/empty_struct.c
GCC implements the OpenMP threading implementation: https://stackoverflow.com/questions/3949901/pthreads-vs-openmp
userland/cpp/if_constexpr.cpp: C++17 if constexpr
userland/cpp/thread_hardware_concurrency.cpp std::thread::hardware_concurrency
userland/cpp/thread_get_id.cpp std::thread::get_id
userland/cpp/thread_return_value.cpp: how to return a value from a thread
+Leads to the dreadful "Stack smashing detected" message. Which is infinitely better than a silent break in any case.
+and new IRQ number section appears every second, when a clock interrupt is raised!
TODO make work on gem5. Fails with gem5 simulate() limit reached at the first WFI done in main, which means that the interrupt is never raised.
+Once an interrupt is raised, the interrupt itself sets up a new interrupt to happen in one second in the future after cntv_cval_el0 is reached by the counter.
./run --eval-after './sample_package.out'+
./run --eval-after '/sample_package.out'