Difference between revisions of "Board:emulation/spike-riscv"

From coreboot
Jump to: navigation, search
(Building coreboot without a payload)
(Building the toolchain)
Line 8: Line 8:
* clone the coreboot git repository
* clone the coreboot git repository
* download and apply [https://review.coreboot.org/#/c/14604/ this patch] and [https://review.coreboot.org/#/c/14257 this patch].
* download and apply the following patches:
** [https://review.coreboot.org/#/c/14604/| 14604: xcompile: rename riscv to riscv64]
** [https://review.coreboot.org/#/c/14257/| 14257: buildgcc: Update to GCC 6.1.0, and binutils riscv update].
* run <code>make crossgcc-riscv</code> and a have a cup of $BEVERAGE
* run <code>make crossgcc-riscv</code> and a have a cup of $BEVERAGE

Revision as of 01:11, 30 June 2016

SPIKE is RISC-V's primary emulator. The Spike support in coreboot is mostly being developed by jn as part of his GSoC 2016.

Build instructions

These instructions may easily become out of date as coreboot or RISC-V moves forward. If that happens, please complain on the discussion page or IRC (or just fix it).

Building the toolchain

Building spike

Building coreboot without a payload

For general spike usage, look at its GitHub page.

Building Linux

  • git clone https://github.com/riscv/riscv-linux
  • download linux 4.6.x from kernel.org
  • cd linux-4.6.x/arch; ln -s ../../riscv-linux/arch/riscv .
  • make ARCH=riscv defconfig
  • make ARCH=riscv menuconfig, configure General setup/Cross-compiler tool prefix
  • make ARCH=riscv

Building bbl

  • TODO: libc stuff
  • TODO: payload linker script foo
  • TODO: patching the console output handler
  • mkdir build
  • cd build; ../configure --with-payload=path/to/vmlinux CC=path/to/riscv64-unknown-elf-gcc LD=path/to/riscv64-unknown-elf-ld
  • make

Building coreboot with bbl

  • apply the same coreboot patches as above, and select Emulation/Spike ucb riscv
  • in the Payload menu of menuconfig, select "ELF Payload" and enter the path to the bbl binary
  • run make and the make-spike-elf.sh script as described above

boot log