sail-riscv icon indicating copy to clipboard operation
sail-riscv copied to clipboard

riscv_sim.cpp: add SIGINT processor.

Open Arielfoever opened this issue 4 months ago • 4 comments

Arielfoever avatar Jul 26 '25 13:07 Arielfoever

What's the motivation here? Adding explicit signal handlers is usually something that should be avoided if at all possible.

Timmmm avatar Jul 26 '25 13:07 Timmmm

Test Results

2 101 tests  ±0   2 101 ✅ ±0   18m 1s ⏱️ +3s     1 suites ±0       0 💤 ±0      1 files   ±0       0 ❌ ±0 

Results for commit fdec1ae1. ± Comparison against base commit 87eb6fb8.

github-actions[bot] avatar Jul 26 '25 13:07 github-actions[bot]

What's the motivation here? Adding explicit signal handlers is usually something that should be avoided if at all possible.

to generate the show execution times on ctrl-c.

[ariel@archlinux sail-riscv]$ build/c_emulator/sail_riscv_sim os-boot/linux/fw_payload.elf --no-trace -p --device-tree-blob os-boot/linux/build/sail.dtb -l 1000000000
will show execution times on completion.
using os-boot/linux/build/sail.dtb as DTB file.
Read 1655 bytes of DTB from os-boot/linux/build/sail.dtb.
Running file os-boot/linux/fw_payload.elf.
ELF Entry @ 0x80000000
HTIF located at 0x80042a78
^CInitialization:   144 msecs
Execution:        1909 msecs
Instructions:     116907
Perf:             61.240 Kips

Arielfoever avatar Jul 26 '25 13:07 Arielfoever

Yeah we should avoid touching signal handlers at all costs. They're extremely error prone (see Alex's comment for example) and this doesn't seem like a big enough benefit.

Timmmm avatar Jul 28 '25 11:07 Timmmm