From 649701c087d9721954d3307fed36a40230ac09cc Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Fri, 19 Jul 2024 12:36:23 +0200 Subject: [PATCH] Change read/write commands to test each bit of addr and data Internal-tag: [#60812] Signed-off-by: Ryszard Rozak --- testbench/openocd_scripts/jtag_cg.tcl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/testbench/openocd_scripts/jtag_cg.tcl b/testbench/openocd_scripts/jtag_cg.tcl index 1c8dbce3b96..51291eecd4d 100644 --- a/testbench/openocd_scripts/jtag_cg.tcl +++ b/testbench/openocd_scripts/jtag_cg.tcl @@ -29,10 +29,12 @@ puts "" riscv set_mem_access sysbus -set addr1 0x00020008 -set addr2 0x00020508 +set addr1 0xFFFF0000 +set addr2 0x0000FFF0 +set addr3 0x0000FFFF set data1 0x05050505 -set data2 0x12345678 +set data2 0xFAFAFAFA +set data3 0xAB puts "Write few bytes" write_memory $addr1 32 $data1 phys @@ -61,6 +63,15 @@ if {[compare $actual $data1] != 0} { shutdown error } +puts "Write 1 byte" +write_memory $addr3 8 $data3 phys + +puts "Read 1 byte" +set actual [read_memory $addr3 8 1 phys] +if {[compare $actual $data3] != 0} { + shutdown error +} + # Send signal to call $finish write_memory 0xd0580000 8 0xFF phys