This directory is for tools developed specifically for the development of the RISC-V backend.
This is a simple tool to parse debug output from the RISC-V assembler and simulator to generate information useful for debugging.
Current features:
- Call stack
To use the tool, first execute your test with the flags --print-all-code
and
--trace-sim
, dumping the output to a file. Then execute this tool, passing
it that dump file and it will generate the call stack to stdout.
$ cctest --print-all-code -trace-sim test-interpreter-intrinsics/Call &> out
$ analyze.py out
The full usage information can be printed using --help
:
usage: analyze.py [-h] [--inline] [--target TARGET] [--print-host-calls]
[--fp]
logfile
positional arguments:
logfile
optional arguments:
-h, --help show this help message and exit
--inline Print comments inline with trace
--target TARGET Specify the target architecture
--print-host-calls Print info about calls to host functions
--fp Print floating point arguments and return values
This is a simple tool to collect statistics and compare codes generated by two different backends.
usage:
python3 ./v8-riscv-tools/CountInstr.py path_to_riscv_d8 path_to_mips_d8 [args of d8]
example:
python3 ./v8-riscv-tools/CountInstr.py ./out/riscv64.sim/d8 ./out/mips64el.debug/d8 test.js --test --enable-slow-check
This is a simple tool to collect statistics on instructions that can be directly rewritten into C-extension instructions.
To use the tool, first execute your test with the flags --print-all-code
or
--print-code
, dumping the output to a file. Then execute this tool, passing
it that dump file and it will print statistics on convertible instructions.
$ cctest --print-all-code test-interpreter-intrinsics/Call &> out.log
$ collect-convertible.py out.log
The full usage information can be printed using --help
:
usage: collect-convertible.py [-h] [-v] logfile
positional arguments:
logfile
optional arguments:
-h, --help show this help message and exit
-v, --verbose print all convertible instructions