Skip to content

Commit a7ce799

Browse files
author
dmi3
committed
Added configuration for launch on Spike simulator.
1 parent 07a3244 commit a7ce799

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

launch-sh/openocd_gdb_launch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12

23
source ../paths
34

launch-sh/spike.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
interface remote_bitbang
2+
remote_bitbang_host localhost
3+
remote_bitbang_port 9824
4+
5+
set _CHIPNAME riscv
6+
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10e31913
7+
8+
set _TARGETNAME $_CHIPNAME.cpu
9+
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
10+
11+
gdb_report_data_abort enable
12+
13+
init
14+
halt

launch-sh/spike_openocd_gdb_launch.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
source ../paths
4+
5+
ELF="$1"
6+
7+
8+
SPIKE_LAUNCH="$SPIKE --rbb-port=9824 -m0xc000000:0x90000000 -H $ELF"
9+
OPENOCD_LAUNCH="$OPENOCD -f $OPENOCD_CFG_SPIKE"
10+
GDB_LAUNCH="$GDB -x $GDB_SCRIPT --silent $ELF"
11+
12+
13+
# For Spike launch
14+
export LD_LIBRARY_PATH="$LD_LIB_PATH"
15+
16+
17+
#Launch: Spike + OpenOCD + GDB
18+
xfce4-terminal \
19+
--tab --title=Spike -e "$SPIKE_LAUNCH" \
20+
--tab --title=OpenOCD -e "$OPENOCD_LAUNCH" \
21+
--tab --title=GDB --hold -e "$GDB_LAUNCH"
22+
23+
exit 0

paths

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
OPENOCD="/home/user/eclipse_4.4.1/TOOLS/riscv-openocd-0.10.0-2020.12.1-x86_64-linux-ubuntu14/bin/openocd"
66
OPENOCD_CFG_HW="./riscpoa.cfg"
77

8-
#GDB="/home/user/eclipse_4.4.1/TOOLS/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin/riscv64-unknown-elf-gdb-py"
98
GDB="/home/user/eclipse_4.4.1/TOOLS/gdb_overlay/riscv64-unknown-elf-gdb-10.1.0-2020.12.8-x86_64-linux-ubuntu14/bin/riscv64-unknown-elf-gdb-py"
109

10+
#--------------------------------
11+
#For Spike:
12+
SPIKE="/home/user/eclipse_4.4.1/TOOLS/riscv_tui_12.12.18/bin/spike"
13+
LD_LIB_PATH="/home/user/eclipse_4.4.1/TOOLS/riscv_tui_12.12.18/lib/"
14+
OPENOCD_CFG_SPIKE="./spike.cfg"
15+
1116
#--------------------------------
1217
#Launch configurations:
13-
# "/gdb.py" => Launch execution
18+
# "/gdb_launch.py" => Launch execution
1419
# "/gdb_ovmgr_replace.py" => Launch unit tests
1520

1621
GDB_SCRIPT="../gdb-py/gdb_launch.py"

0 commit comments

Comments
 (0)