From fe16cc9f721b6f24079d1bdcfb140c4156b0c9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=85gren?= Date: Wed, 18 Dec 2024 09:02:39 +0100 Subject: [PATCH] PoC: tb: Fix tb_tk1 test3 (CDI) Fix test1. It broke while implementing interrupt based syscalls. Instead of writing to ADDR_SYSTEM_MODE_CTRL, app mode is now entered automatically when executing outside of ROM. --- hw/application_fpga/core/tk1/tb/tb_tk1.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/application_fpga/core/tk1/tb/tb_tk1.v b/hw/application_fpga/core/tk1/tb/tb_tk1.v index 22ed927..6262856 100644 --- a/hw/application_fpga/core/tk1/tb/tb_tk1.v +++ b/hw/application_fpga/core/tk1/tb/tb_tk1.v @@ -62,6 +62,7 @@ module tb_tk1 (); localparam ADDR_SPI_XFER = 8'h81; localparam ADDR_SPI_DATA = 8'h82; + localparam APP_RAM_START = 32'h40000000; //---------------------------------------------------------------- // Register and Wire declarations. @@ -468,7 +469,7 @@ module tb_tk1 (); read_check_word(ADDR_CDI_LAST + 0, 32'h70717273); $display("--- test3: Switch to app mode."); - write_word(ADDR_SYSTEM_MODE_CTRL, 32'hdeadbeef); + fetch_instruction(APP_RAM_START); $display("--- test3: Try to write CDI again."); write_word(ADDR_CDI_FIRST + 0, 32'hfffefdfc);