From a0a1b26b8335163117eef3424bf07cab7b9134cc Mon Sep 17 00:00:00 2001 From: BOISSON Brice <63735982+BriceBoisson@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:43:15 +0900 Subject: [PATCH] Fix: test 4 mem val to check mem value --- tb/tb_risc_v_cpu-dyn.v | 2 +- tb/tb_tools.vh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tb/tb_risc_v_cpu-dyn.v b/tb/tb_risc_v_cpu-dyn.v index a284d65..9520fd1 100644 --- a/tb/tb_risc_v_cpu-dyn.v +++ b/tb/tb_risc_v_cpu-dyn.v @@ -155,7 +155,7 @@ module tb_risc_v_cpu (); end else if (reg_number == 6'b100000) begin `assert_no_wait_pc("FINAL", 1'bx, reg_test_value, risc_v_cpu.program_counter.pc_addr) end else if (reg_number > 6'b100000) begin - `assert_no_wait_mem("FINAL", 1'bx, reg_number, reg_test_value, risc_v_cpu.memory.memory[test[curent_addr][5:0]]) + `assert_no_wait_mem("FINAL", 1'bx, reg_number - 6'b100001, reg_test_value, {risc_v_cpu.memory.memory[(test[curent_addr][5:0] - 6'b100001) * 4 + 3], risc_v_cpu.memory.memory[(test[curent_addr][5:0] - 6'b100001) * 4 + 2], risc_v_cpu.memory.memory[(test[curent_addr][5:0] - 6'b100001) * 4 + 1], risc_v_cpu.memory.memory[(test[curent_addr][5:0] - 6'b100001) * 4]}) end end end diff --git a/tb/tb_tools.vh b/tb/tb_tools.vh index 6479aa4..936fba1 100644 --- a/tb/tb_tools.vh +++ b/tb/tb_tools.vh @@ -35,7 +35,7 @@ end else if (test[curent_addr][addr_range:addr_range - 5] == 6'b100000) begin \ `assert_no_wait_pc(message, curent_addr, test[curent_addr][test_range:test_range - 31], risc_v_cpu.program_counter.pc_addr) \ end else if (test[curent_addr][addr_range:addr_range - 5] > 6'b100000) begin \ - `assert_no_wait_mem(message, curent_addr, test[curent_addr][addr_range:addr_range - 5], test[curent_addr][test_range:test_range - 31], risc_v_cpu.memory.memory[test[curent_addr][addr_range:addr_range - 5]]) \ + `assert_no_wait_mem(message, curent_addr, test[curent_addr][addr_range:addr_range - 5] - 6'b100001, test[curent_addr][test_range:test_range - 31], {risc_v_cpu.memory.memory[(test[curent_addr][addr_range:addr_range - 5] - 6'b100001) * 4 + 3], risc_v_cpu.memory.memory[(test[curent_addr][addr_range:addr_range - 5] - 6'b100001) * 4 + 2], risc_v_cpu.memory.memory[(test[curent_addr][addr_range:addr_range - 5] - 6'b100001) * 4 + 1], risc_v_cpu.memory.memory[(test[curent_addr][addr_range:addr_range - 5] - 6'b100001) * 4]}) \ end `define end_message $display("\033[0;32mIf no \033[0mFAIL\033[0;32m messages, all tests passed!\033[0m");