How spike exit normally

Anyone can explain the spike how to exit in baremental mode,

I would suggest asking questions someplace more appropriate, such as a riscv.org mailing list. This forum is for discussing SiFive hardware.
https://riscv.org/technical/technical-forums/

I would suggest looking at how github.com/riscv/riscv-tests works. Since spike is simulating a cpu, and a cpu doesn’t “exit”, I think there is some trickery with the htif (host-target interface?) where writing a value to a special location tells htif to shutdown the cpu.

Yeah it seems to just write an exit code to “tohost” in a loop (I presume because Spike only checks every N instructions).