Skip to content

Commit

Permalink
fix building emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-holenko committed Jun 25, 2020
1 parent cce7607 commit de793b6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@
[submodule "third_party/liteiclink"]
path = third_party/liteiclink
url = https://github.com/enjoy-digital/liteiclink.git
[submodule "third_party/VexRiscv"]
path = third_party/VexRiscv
url = https://github.com/SpinalHDL/VexRiscv.git
82 changes: 0 additions & 82 deletions patches/0001-emulator-Use-external-hw-common.h-from-LiteX.patch

This file was deleted.

11 changes: 2 additions & 9 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,10 @@ if [ ${CPU} = vexriscv ]; then
# get rid of 'L' suffix
RAM_BASE_ADDRESS=${RAM_BASE_ADDRESS::-1}

# this is a temp fix for building the emulator
cd $TOP_DIR/third_party/litex/litex/soc/cores/cpu/vexriscv/verilog/ext/VexRiscv
if [ ! -e .patched ]; then
git am $TOP_DIR/patches/0001-emulator-Use-external-hw-common.h-from-LiteX.patch
touch .patched
fi

cd $TOP_DIR/third_party/litex/litex/soc/cores/cpu/vexriscv/verilog/ext/VexRiscv/src/main/c/emulator
cd $TOP_DIR/third_party/VexRiscv/src/main/c/emulator

# offsets are hardcoded in BIOS
export CFLAGS="-DOS_CALL=$((RAM_BASE_ADDRESS + 0x0)) -DDTB=$((RAM_BASE_ADDRESS + 0x01000000)) -Wl,--defsym,__ram_origin=$((RAM_BASE_ADDRESS + 0x01100000))"
export CFLAGS="-DOS_CALL=$((RAM_BASE_ADDRESS + 0x0)) -DDTB=$((RAM_BASE_ADDRESS + 0x01000000)) -Wl,--defsym,__ram_origin=$((RAM_BASE_ADDRESS + 0x01100000)) -I$TOP_DIR/third_party/litex/litex/soc/cores/cpu/vexriscv"
export LITEX_GENERATED="$TOP_DIR/$TARGET_BUILD_DIR/software/include"
export LITEX_BASE="$TOP_DIR/third_party/litex"
export RISCV_BIN="${CPU_ARCH}-elf-newlib-"
Expand Down
1 change: 1 addition & 0 deletions third_party/VexRiscv
Submodule VexRiscv added at 2942d0

0 comments on commit de793b6

Please sign in to comment.