最近在浏览某大型程序员交友 网站的时候发现一个好玩的项目,介绍如下:
A small program that handles mie, msi, mti and trap interrupts and updates some global variables on interrupts.
重点是他下面还放了一张图:
能看到RISCV CSR的行为太酷啦!!!
下面一起setup一下,万一以后项目能用到呢。
写这篇博客的时候,我已经go through了一遍,所以下面我会用一种顶层设计的方法来介绍怎么setup。
$ sudo apt install gcc g++ build-essential pip
Spike RISC-V ISA Simulator
$ git clone https://github.com/five-embeddev/riscv-isa-sim.git -b vcd_trace
$ git submodule update --init
$ sudo apt-get install device-tree-compiler
$ mkdir build
$ cd build
$ ../configure --prefix=/tmp/riscv-isa-sim/__install
$ make
$ [sudo] make install
你可以在/tmp/riscv-isa-sim/__install/bin
下找到spike
/tmp/riscv-isa-sim/__install/bin$ ./spike
Spike RISC-V ISA Simulator 1.1.1-dev
usage: spike [host options] <target program> [target options]
Host Options:
-p<n> Simulate <n> processors [default 1]
-m<n> Provide <n> MiB of target memory [default 2048]
-m<a:m,b:n,...> Provide memory regions of size m and n bytes
at base addresses a and b (with 4 KiB alignment)
-d Interactive debug mode
-g Track histogram of PCs
-l Generate a log of execution
-h, --help Print this help message
-H Start halted, allowing a debugger to connect
--log=<name> File name for option -l
--debug-cmd=<name> Read commands from file (use with -d)
--isa=<name> RISC-V ISA string [default RV64IMAFDC]
--priv=<m|mu|msu> RISC-V privilege modes supported [default MSU]
--varch=<name> RISC-V Vector uArch string [default vlen:128,elen:64]
--pc=<address> Override ELF entry point
--hartids=<a,b,...> Explicitly specify hartids, default is 0,1,...
--ic=<S>:<W>:<B> Instantiate a cache model with S sets,
--dc=<S>:<W>:<B> W ways, and B-byte blocks (with S and
--l2=<S>:<W>:<B> B both powers of 2).
--device=<P,B,A> Attach MMIO plugin device from an --extlib library
P -- Name of the MMIO plugin
B -- Base memory address of the device
A -- String arguments to pass to the plugin
This flag can be used multiple times.
The extlib flag for the library must come first.
--log-cache-miss Generate a log of cache miss
--extension=<name> Specify RoCC Extension
This flag can be used multiple times.
--extlib=<name> Shared library to load
This flag can be used multiple times.
--rbb-port=<port> Listen on <port> for remote bitbang connection
--dump-dts Print device tree string and exit
--disable-dtb Don't write the device tree blob into memory
--kernel=<path> Load kernel flat image into memory
--initrd=<path> Load kernel initrd into memory
--bootargs=<args> Provide custom bootargs for kernel [default: console=hvc0 earlycon=sbi]
--real-time-clint Increment clint time at real-time rate
--dm-progsize=<words> Progsize for the debug module [default 2]
--dm-sba=<bits> Debug system bus access supports up to <bits> wide accesses [default 0]
--dm-auth Debug module requires debugger to authenticate
--dmi-rti=<n> Number of Run-Test/Idle cycles required for a DMI access [default 0]
--dm-abstract-rti=<n> Number of Run-Test/Idle cycles required for an abstract command to execute [default 0]
--dm-no-hasel Debug module supports hasel
--dm-no-abstract-csr Debug module won't support abstract to authenticate
--dm-no-halt-groups Debug module won't support halt groups
--dm-no-impebreak Debug module won't support implicit ebreak in program buffer
--vcd-log=<file> Log VCD to this file.
--max-cycles=<cycle count> Limit simulation to this number of cycles.
gtkwave
$ sudo apt install meson gperf flex desktop-file-utils libgtk-3-dev libbz2-dev libjudy-dev libgirepository1.0-dev
升级meson到 > 1.0,ubuntu自带的是0.61.2版本,不能满足项目的编译要求
$ pip install --upgrade meson
Building GTKWave
$ git clone https://github.com/gtkwave/gtkwave.git
$ cd gtkwave
$ meson setup build
$ meson compile -C build
你可以在/tmp/gtkwave/build/src/helpers/
下找到fst2vcd
,在/tmp/gtkwave/build/src/
下找到gtkwave
,将在下面的riscv-scratchpad
用到。
riscv-scratchpad
$ git clone https://github.com/five-embeddev/riscv-scratchpad.git
$ cd riscv-scratchpad/baremetal-vcd-trace
$ make -j$(nproc)
# 把run_sim.sh里SPIKE=改到你刚才编译出来spike的路径,比如:SPIKE=/tmp/riscv-isa-sim/__install/bin/spike
$ source ./run_sim.sh
这里执行完的log如下
Warning: the memory at [0x20010000, 0x2007A11F] has been realigned
to the 4 KiB page size: [0x20010000, 0x2007AFFF]
warning: tohost and fromhost symbols not in ELF; can't communicate with target
echo on
trace timestamp
Tracing timestamp, 8bytes @0x80000028
trace count_123
Tracing count_123, 1bytes @0x80000020
trace wakeup_count
Tracing wakeup_count, 8bytes @0x80000018
trace mei_count
Tracing mei_count, 4bytes @0x80000000
trace mti_count
Tracing mti_count, 4bytes @0x80000008
trace msi_count
Tracing msi_count, 4bytes @0x80000004
trace ecall_count
Tracing ecall_count, 8bytes @0x80000010
until pc 0 main
Run until pc == 0x20010100
TRACE: mei_count @ 0x80000000 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: msi_count @ 0x80000004 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: mti_count @ 0x80000008 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x0 & 0xffffffff00000000
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x0 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x0-> 0x0 & 0xff
TRACE: timestamp @ 0x80000028 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: timestamp @ 0x80000028 + 0x4= 0x0-> 0x0 & 0xffffffff00000000
pc 0
0x20010100
run 1000
TRACE: count_123 @ 0x80000020 + 0x0= 0x1-> 0x1 & 0xff
MEI = 0
MEI = 1
MEI = 0
MEI = 0
TRACE: mti_count @ 0x80000008 + 0x0= 0x1-> 0x1 & 0xffffffff
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
TRACE: timestamp @ 0x80000028 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: timestamp @ 0x80000028 + 0x4= 0x0-> 0x0 & 0xffffffff00000000
MEI = 0
MEI = 0
TRACE: timestamp @ 0x80000028 + 0x0= 0x0-> 0x0 & 0xffffffff
TRACE: timestamp @ 0x80000028 + 0x4= 0x0-> 0x0 & 0xffffffff00000000
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
MEI = 0
TRACE: count_123 @ 0x80000020 + 0x0= 0x2-> 0x2 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x1-> 0x1 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x1 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x1-> 0x1 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x1 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x2-> 0x2 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x2 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x2-> 0x2 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x2 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x3-> 0x3 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x3 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x3-> 0x3 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x3 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x4-> 0x4 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x4 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x4-> 0x4 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x4 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x5-> 0x5 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x5 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x5-> 0x5 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x5 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x6-> 0x6 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x6 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x6-> 0x6 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x6 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x7-> 0x7 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x7 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x7-> 0x7 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x7 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x8-> 0x8 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x8 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x8-> 0x8 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x8 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x9-> 0x9 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x9 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x9-> 0x9 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x9 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0xa-> 0xa & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0xa & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0xa-> 0xa & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0xa & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0xb-> 0xb & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0xb & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0xb-> 0xb & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0xb & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0xc-> 0xc & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0xc & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0xc-> 0xc & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0xc & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0xd-> 0xd & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0xd & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0xd-> 0xd & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0xd & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0xe-> 0xe & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0xe & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0xe-> 0xe & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0xe & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0xf-> 0xf & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0xf & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0xf-> 0xf & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0xf & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x10-> 0x10 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x10 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x10-> 0x10 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x10 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x11-> 0x11 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x11 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x11-> 0x11 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x11 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x12-> 0x12 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x12 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x12-> 0x12 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x12 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
pc 0
0x20010152
mem timestamp
0x00000000
mem count_123
0x00000003
mem wakeup_count
0x00000012
mem mei_count
0x00000000
mem mti_count
0x00000001
mem msi_count
0x00000000
mem ecall_count
0x00000012
interrupt 0 raise mei
MEI = 1
run 100
TRACE: mei_count @ 0x80000000 + 0x0= 0x1-> 0x1 & 0xffffffff
TRACE: mei_count @ 0x80000000 + 0x0= 0x2-> 0x2 & 0xffffffff
TRACE: mei_count @ 0x80000000 + 0x0= 0x3-> 0x3 & 0xffffffff
TRACE: mei_count @ 0x80000000 + 0x0= 0x4-> 0x4 & 0xffffffff
TRACE: mei_count @ 0x80000000 + 0x0= 0x5-> 0x5 & 0xffffffff
TRACE: mei_count @ 0x80000000 + 0x0= 0x6-> 0x6 & 0xffffffff
TRACE: mei_count @ 0x80000000 + 0x0= 0x7-> 0x7 & 0xffffffff
TRACE: mei_count @ 0x80000000 + 0x0= 0x8-> 0x8 & 0xffffffff
interrupt 0 clear mei
MEI = 0
pc 0
0x20010270
mem timestamp
0x00000000
mem count_123
0x00000003
mem wakeup_count
0x00000012
mem mei_count
0x00000008
mem mti_count
0x00000001
mem msi_count
0x00000000
mem ecall_count
0x00000012
run 1000
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x13-> 0x13 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x13 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x13-> 0x13 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x13 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x14-> 0x14 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x14 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x14-> 0x14 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x14 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x15-> 0x15 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x15 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x15-> 0x15 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x15 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x16-> 0x16 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x16 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x16-> 0x16 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x16 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x17-> 0x17 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x17 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x17-> 0x17 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x17 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x18-> 0x18 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x18 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x18-> 0x18 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x18 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x19-> 0x19 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x19 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x19-> 0x19 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x19 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x1a-> 0x1a & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x1a & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x1a-> 0x1a & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x1a & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x1b-> 0x1b & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x1b & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x1b-> 0x1b & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x1b & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x1c-> 0x1c & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x1c & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x1c-> 0x1c & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x1c & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x1d-> 0x1d & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x1d & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x1d-> 0x1d & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x1d & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x1e-> 0x1e & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x1e & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x1e-> 0x1e & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x1e & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x1f-> 0x1f & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x1f & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x1f-> 0x1f & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x1f & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x20-> 0x20 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x20 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x20-> 0x20 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x20 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x21-> 0x21 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x21 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x21-> 0x21 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x21 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x22-> 0x22 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x22 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x22-> 0x22 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x22 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x23-> 0x23 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x23 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x23-> 0x23 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x23 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x24-> 0x24 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x24 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x24-> 0x24 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x24 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x25-> 0x25 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x25 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x25-> 0x25 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x25 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x26-> 0x26 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x26 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x26-> 0x26 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x26 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x27-> 0x27 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x27 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x27-> 0x27 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x27 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x28-> 0x28 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x28 & 0xffffffff00000000
mem timestamp
0x00000000
mem count_123
0x00000003
mem wakeup_count
0x00000028
mem mei_count
0x00000008
mem mti_count
0x00000001
mem msi_count
0x00000000
mem ecall_count
0x00000027
run 5000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x28-> 0x28 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x28 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x29-> 0x29 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x29 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x29-> 0x29 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x29 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x2a-> 0x2a & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x2a & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x2a-> 0x2a & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x2a & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x2b-> 0x2b & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x2b & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x2b-> 0x2b & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x2b & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x2c-> 0x2c & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x2c & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x2c-> 0x2c & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x2c & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x2d-> 0x2d & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x2d & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x2d-> 0x2d & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x2d & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x2e-> 0x2e & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x2e & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x2e-> 0x2e & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x2e & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x2f-> 0x2f & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x2f & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x2f-> 0x2f & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x2f & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x30-> 0x30 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x30 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x30-> 0x30 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x30 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x31-> 0x31 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x31 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x31-> 0x31 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x31 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x32-> 0x32 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x32 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x32-> 0x32 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x32 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x33-> 0x33 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x33 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x33-> 0x33 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x33 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x34-> 0x34 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x34 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x34-> 0x34 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x34 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x35-> 0x35 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x35 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x35-> 0x35 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x35 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x36-> 0x36 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x36 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x36-> 0x36 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x36 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x37-> 0x37 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x37 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x37-> 0x37 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x37 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x38-> 0x38 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x38 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x38-> 0x38 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x38 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x39-> 0x39 & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x39 & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x39-> 0x39 & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x39 & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x3a-> 0x3a & 0xffffffff
TRACE: wakeup_count @ 0x80000018 + 0x4= 0x0-> 0x3a & 0xffffffff00000000
TRACE: ecall_count @ 0x80000010 + 0x0= 0x3a-> 0x3a & 0xffffffff
TRACE: ecall_count @ 0x80000010 + 0x4= 0x0-> 0x3a & 0xffffffff00000000
TRACE: count_123 @ 0x80000020 + 0x0= 0x3-> 0x3 & 0xff
TRACE: wakeup_count @ 0x80000018 + 0x0= 0x3b-> 0x3b &</