Skip to content

Commit

Permalink
Parse LiteX config file instead of generated headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-holenko committed Feb 19, 2020
1 parent fee8231 commit 07140bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,14 @@ if [ ${CPU} = vexriscv ]; then
(
cd $TOP_DIR

GENERATED_MEM_HEADERS="$TARGET_BUILD_DIR/software/include/generated/mem.h"
if [ ! -f "$GENERATED_MEM_HEADERS" ]; then
LITEX_RENODE="$TOP_DIR/third_party/litex-renode"
LITEX_CONFIG_FILE="$TARGET_BUILD_DIR/test/csr.csv"
if [ ! -f "$LITEX_CONFIG_FILE" ]; then
make firmware
fi

source $SCRIPT_DIR/build-common.sh
EMULATOR_RAM_BASE_ADDRESS=$(parse_generated_header "mem.h" EMULATOR_RAM_BASE)
RAM_BASE_ADDRESS=$(parse_generated_header "mem.h" MAIN_RAM_BASE)
# get rid of 'L' suffix
RAM_BASE_ADDRESS=${RAM_BASE_ADDRESS::-1}
EMULATOR_RAM_BASE_ADDRESS=${EMULATOR_RAM_BASE_ADDRESS::-1}
EMULATOR_RAM_BASE_ADDRESS=`python $LITEX_RENODE/litex-config-parser.py $LITEX_CONFIG_FILE --memory_base emulator_ram || true`
RAM_BASE_ADDRESS=`python $LITEX_RENODE/litex-config-parser.py $LITEX_CONFIG_FILE --memory_base main_ram || true`

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

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-renode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [ ! -f "$LITEX_CONFIG_FILE" ]; then
fi

# Ethernet
ETH_BASE_ADDRESS=$(parse_generated_header "csr.h" CSR_ETHMAC_BASE)
ETH_BASE_ADDRESS=`python $LITEX_RENODE/litex-config-parser.py $LITEX_CONFIG_FILE --csr_base ethmac || true`
if [ ! -z "$ETH_BASE_ADDRESS" ]; then
RENODE_NETWORK=${RENODE_NETWORK:-tap}
case $RENODE_NETWORK in
Expand Down

0 comments on commit 07140bc

Please sign in to comment.