I tried to find the memory map in the spike, like where should I allocate the pages, where is the hardware mapped. How to use the serial to print something out. How can I know know the information about that？Thanks
You can print out the configuration string with “spike --dump-config-string”. You can also get access to this data at runtime; see https://github.com/riscv/riscv-pk/blob/master/machine/configstring.c for an example.
Spike doesn’t yet model a UART, but relies on a tether to the host machine to perform all I/O. You can look at the code in riscv-pk to see it does I/O.