Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix openocd test #282

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/scripts/gdb_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ terminate_all () {
}

print_logs () {
echo -e "${COLOR_WHITE}======== Simulation log ========${COLOR_OFF}"
cat ${SIM_LOG} || true
echo -e "${COLOR_WHITE}======== OpenOCD log ========${COLOR_OFF}"
cat ${OPENOCD_LOG} || true
echo -e "${COLOR_WHITE}======== Simulation log ========${COLOR_OFF}"
cat ${SIM_LOG} || true
}

echo -e "${COLOR_WHITE}======== Launching interactive simulation ========${COLOR_OFF}"
Expand All @@ -62,9 +62,7 @@ echo -e "Starting simulation..."
SIM_PID=$!

# Wait
wait_for_phrase "${SIM_LOG}" "Start of sim"
# TODO handle proper string in the output instead of waiting
sleep 10s
wait_for_phrase "${SIM_LOG}" "jtag0 is listening on port"
retcode=$?
if [ $retcode -ne 0 ]; then
echo -e "${COLOR_RED}Failed to start the simulation: $retcode ${COLOR_OFF}"
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/openocd/veer-el2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $_TARGETNAME.0 configure -work-area-phys 0x50001000 -work-area-size 0x1000 -work

$_TARGETNAME.0 configure -event gdb-detach {
resume
shutdown
}

$_TARGETNAME.0 riscv expose_csrs 1968=dcsr
Expand Down
30 changes: 6 additions & 24 deletions .github/scripts/test.gdb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ set architecture riscv:rv32
set remotetimeout 360
target extended-remote :3333

echo Connected, waiting...\n
shell sleep 30s

echo Dumping registers...\n
info registers
echo Accessing DCCM...\n
Expand Down Expand Up @@ -121,27 +118,12 @@ set *(0xd0000008) = 0x55555555
set *(0xd000000C) = 0xAAAAAAAA
print/x *0xd0000000@4

echo Setting Breakpoint 1...\n
hbreak *0x1c

echo Continuing...\n
continue

delete

# This causes an error. Let's execute it anyway for coverage.
echo Accessing region at 0xe0000000...\n
set *(0xe0000000) = 0x01234567
set *(0xe0000004) = 0x89ABCDEF
set *(0xe0000008) = 0x55555555
set *(0xe000000C) = 0xAAAAAAAA
print/x *0xe0000000@4
echo Accessing region at 0xf0000000...\n
set *(0xf0000000) = 0x01234567
set *(0xf0000004) = 0x89ABCDEF
set *(0xf0000008) = 0x55555555
set *(0xf000000C) = 0xAAAAAAAA
print/x *0xf0000000@4
# TODO test breakpoint
# echo Setting Breakpoint 1...\n
# hbreak *0x1c
# echo Continuing...\n
# continue
# delete

# end the simulation gracefully
set *(volatile unsigned char*)0xd0580000 = 0xff
2 changes: 1 addition & 1 deletion .github/workflows/test-openocd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
tests:
name: Run OpenOCD tests
runs-on: ubuntu-latest
container: ghcr.io/antmicro/cores-veer-el2:latest
container: ghcr.io/antmicro/cores-veer-el2:20241129
strategy:
fail-fast: false
matrix:
Expand Down
Loading