From 59af60bdd52cd8ed7376f6362ed2f2d07a3914e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Str=C3=B6mbergson?= Date: Tue, 9 May 2023 13:07:12 +0200 Subject: [PATCH] Add test4: writing and reading blake2s entry point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joachim Strömbergson --- hw/application_fpga/core/tk1/tb/tb_tk1.v | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/hw/application_fpga/core/tk1/tb/tb_tk1.v b/hw/application_fpga/core/tk1/tb/tb_tk1.v index cabfb8d..93033c6 100644 --- a/hw/application_fpga/core/tk1/tb/tb_tk1.v +++ b/hw/application_fpga/core/tk1/tb/tb_tk1.v @@ -416,6 +416,39 @@ module tb_tk1(); endtask // test3 + //---------------------------------------------------------------- + // test4() + // Write and read blake2s entry point. + //---------------------------------------------------------------- + task test4; + begin + tc_ctr = tc_ctr + 1; + + $display(""); + $display("--- test4: Reset DUT to switch to fw mode."); + reset_dut(); + + $display("--- test4: Write Blake2s entry point."); + write_word(ADDR_BLAKE2S, 32'hcafebabe); + + $display("--- test4: Read Blake2s entry point."); + read_word(ADDR_BLAKE2S, 32'hcafebabe); + + $display("--- test4: Switch to app mode."); + write_word(ADDR_SWITCH_APP, 32'hf00ff00f); + + $display("--- test4: Write Blake2s entry point again."); + write_word(ADDR_BLAKE2S, 32'hdeadbeef); + + $display("--- test4: Read Blake2s entry point again"); + read_word(ADDR_BLAKE2S, 32'hcafebabe); + + $display("--- test4: completed."); + $display(""); + end + endtask // test4 + + //---------------------------------------------------------------- // tk1_test //---------------------------------------------------------------- @@ -432,6 +465,7 @@ module tb_tk1(); test1(); test2(); test3(); + test4(); display_test_result(); $display("");