tests/tcg/aarch64: Add test case for SME2 gdbstub registers
Test the SME2 register exposure over gdbstub, in the same way we already do for SME. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20251017153027.969016-4-peter.maydell@linaro.org
This commit is contained in:
parent
7fd82461dd
commit
caa0e96097
2 changed files with 44 additions and 1 deletions
|
|
@ -164,7 +164,14 @@ run-gdbstub-sysregs-sme-tile-slice: sysregs
|
|||
"selected gdb ($(GDB)) does not support SME ZA tile slices")
|
||||
endif
|
||||
|
||||
EXTRA_RUNS += run-gdbstub-sysregs-sme run-gdbstub-sysregs-sme-tile-slice
|
||||
run-gdbstub-sysregs-sme2: sysregs
|
||||
$(call run-test, $@, $(GDB_SCRIPT) \
|
||||
--gdb $(GDB) \
|
||||
--qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
|
||||
--bin $< --test $(AARCH64_SRC)/gdbstub/test-sme2.py, \
|
||||
gdbstub SME ZA tile slice support)
|
||||
|
||||
EXTRA_RUNS += run-gdbstub-sysregs-sme run-gdbstub-sysregs-sme-tile-slice run-gdbstub-sysregs-sme2
|
||||
|
||||
endif
|
||||
|
||||
|
|
|
|||
36
tests/tcg/aarch64/gdbstub/test-sme2.py
Normal file
36
tests/tcg/aarch64/gdbstub/test-sme2.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#
|
||||
# Copyright (C) 2025 Linaro Ltd.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#
|
||||
# Test the SME2 registers are visible and changeable via gdbstub
|
||||
#
|
||||
# This is launched via tests/guest-debug/run-test.py
|
||||
#
|
||||
|
||||
import gdb
|
||||
from test_gdbstub import main, report
|
||||
|
||||
|
||||
def run_test():
|
||||
"""Test reads and writes of the SME2 registers"""
|
||||
frame = gdb.selected_frame()
|
||||
rname = "zt0"
|
||||
zt0 = frame.read_register(rname)
|
||||
report(True, "Reading %s" % rname)
|
||||
|
||||
# Writing to the ZT0 register, byte by byte.
|
||||
for i in range(0, 64):
|
||||
cmd = "set $zt0[%d] = 0x01" % (i)
|
||||
gdb.execute(cmd)
|
||||
report(True, "%s" % cmd)
|
||||
|
||||
# Reading from the ZT0 register, byte by byte.
|
||||
for i in range(0, 64):
|
||||
reg = "$zt0[%d]" % (i)
|
||||
v = gdb.parse_and_eval(reg)
|
||||
report(str(v.type) == "uint8_t", "size of %s" % (reg))
|
||||
report(v == 0x1, "%s is 0x%x" % (reg, 0x1))
|
||||
|
||||
main(run_test, expected_arch="aarch64")
|
||||
Loading…
Add table
Add a link
Reference in a new issue