3

I'm trying to boot the Linux kernel in the generated Rocket Chip emulator using the DefaultConfig configuration.

I'm following the steps shown in the RISCV tools repository wiki and I've been able to successfully build and boot the Linux kernel on the ISA emulator spike by:

  • Compiling the riscv64-unknown-linux-gcc cross-compiler.
  • Building the Linux kernel 4.6 (RISC-V flavour found in the riscv-linux repository)
  • Rebuilding the bbl bootloader pointing it to the built vmlinux image (--with-payload option).

However, when trying to run this very same bbl bootloader in the Rocket Chip emulator generated by the default configuration file, the kernel doesn't boot but the process keeps spinning as if it were stuck in an infinite loop. No informative message or errors are given, it just consumes 100% CPU until killed with the Ctrl-C keystroke (after waiting a considerable amount of time).

I believe my generated Rocket Chip emulator is correct as I am able to run cross-compiled programs through the proxy kernel (pk) or even bare metal without any problems. Also, all tests and benchmarks are passed (make run-asm-tests and make run-bmark-tests).

I haven't been able to find any clear documentation of anyone booting the kernel in the chip emulator (most use an FPGA) and at this point I doubt whether it is even possible.

Has anyone been able to achieve it in the emulator? Am I missing any step? Any hint is appreciated.

seldridge
  • 2,704
  • 15
  • 19
poinu
  • 73
  • 1
  • 8
  • What is the full command line for "trying to run this very same bbl bootloader in the Rocket Chip emulator"? – osgx Mar 28 '17 at 14:03
  • @osgx: if the command for booting the kernel on spike is `spike path/to/bbl` then I'd run `./emulator-rocketchip-DefaultConfig path/to/bbl` from the `emulator` directory as I'd do for running the *pk* or any bare-metal program. Am I missing any option on the verilator emulator? – poinu Mar 28 '17 at 16:00
  • 2
    How long had you run the kernel before turning it off? As I know, if you want to run kernel on emulator, it would run for hours and generate several GB size of log file. One way to make it faster is to tune the instruction trace (reducing the amount of print would speed up simulation). Also how do you know it is spinning itself. Kernel would try to initialize the virtual space. Depending on your configuration, it may take a huge time to initialize all pages, which just looked like self-loops. – Wei Song Apr 15 '17 at 15:54
  • Apologies for the late response. The test was run all weekend long, then I killed it with Ctrl-C. That being said, no output was generated nor logged, am I missing a verbose option to do so? Also, at the end we moved to a previous commit of the RocketChip repo which allowed us to boot the kernel properly in the verilator. We are still having the same problem with other configurations, like _DualCoreConfig_, has anyone successfully booted a kernel using the _DualCoreConfig_ given in the repository? Were the cores recognized? Thank you! – poinu Apr 28 '17 at 10:29

0 Answers0