From 684c365ca74505e1552a07705f16a87ad3418628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 24 Mar 2020 00:00:00 +0000 Subject: [PATCH] 69f5745d3df11d5c741551009df86ea6c61a09cf --- index.html | 94 ++++++++++++++++-------------------------------------- 1 file changed, 27 insertions(+), 67 deletions(-) diff --git a/index.html b/index.html index f546834..d48b446 100644 --- a/index.html +++ b/index.html @@ -1170,7 +1170,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
  • 19.9.3.3. gem5 stats internals
  • -
  • 19.9.4. gem5 config.ini
  • +
  • 19.9.4. gem5 config.ini + +
  • 19.10. m5term
  • @@ -20400,17 +20404,6 @@ clock=500
    -

    You can also get a simplified graphical view of the tree with:

    -
    -
    -
    -
    xdg-open "$(./getvar --arch arm --emulator gem5 m5out_dir)/config.dot.pdf"
    -
    -
    -
    -

    Modifying the config.ini file manually does nothing since it gets overwritten every time.

    -
    -

    Set custom configs with the --param option of fs.py, e.g. we can make gem5 wait for GDB to connect with:

    @@ -20421,6 +20414,27 @@ clock=500

    More complex settings involving new classes however require patching the config files, although it is easy to hack this up. See for example: patches/manual/gem5-semihost.patch.

    +
    +

    Modifying the config.ini file manually does nothing since it gets overwritten every time.

    +
    +
    +
    19.9.4.1. gem5 config.dot
    +
    +

    The m5out/config.dot file contains a graphviz .dot file that provides a simplified graphical view of a subset of the gem5 config.ini.

    +
    +
    +

    This file gets automatically converted to .svg and .pdf, which you can view after running gem5 with:

    +
    +
    +
    +
    xdg-open "$(./getvar --arch arm --emulator gem5 m5out_dir)/config.dot.pdf"
    +xdg-open "$(./getvar --arch arm --emulator gem5 m5out_dir)/config.dot.svg"
    +
    +
    +
    +

    An example of such file can be seen at: config.dot.svg for a TimingSimpleCPU without caches..

    +
    +
    @@ -32516,61 +32530,7 @@ collect2: error: ld returned 1 exit status

    27.6. Baremetal C++

    -

    TODO not working as of 8825222579767f2ee7e46ffd8204b9e509440759 + 1. Not yet properly researched / reported upstream yet.

    -
    - -
    -

    To test it out, I first hack common.py to enable C++:

    -
    -
    -
    -
    consts['baremetal_build_in_exts'] = consts['build_in_exts']
    -
    -
    -
    -

    and then I hack userland/arch/aarch64/inline_asm/multiline.cpp to consist only of an empty main:

    -
    -
    -
    -
    int main() {}
    -
    -
    -
    -

    then for example:

    -
    -
    -
    -
    ./build-baremetal --arch aarch64
    -./run --arch aarch64 --baremetal userland/arch/aarch64/inline_asm/multiline.cpp
    -
    -
    -
    -

    fails with:

    -
    -
    -
    -
    rom: requested regions overlap (rom dtb. free=0x00000000000000a0, addr=0x0000000000000000)
    -qemu-system-aarch64: rom check and register reset failed
    -
    -
    -
    -

    and the gem5 build fails completely:

    -
    -
    -
    -
    ./build-baremetal --arch aarch64 --emulator gem5 userland/arch/aarch64/inline_asm/multiline.cpp
    -
    -
    -
    -

    fails with:

    -
    -
    -
    -
    /tmp/ccFd2YIB.o:(.eh_frame+0x1c): relocation truncated to fit: R_AARCH64_PREL32 against `.text'
    -collect2: error: ld returned 1 exit status
    -
    +

    Didn’t get it working, traking at: https://github.com/cirosantilli/linux-kernel-module-cheat/issues/119