From 25767917c9db9f49f26ce01e1b5a0a3d71722768 Mon Sep 17 00:00:00 2001 From: Greg Chadwick Date: Wed, 31 Jan 2024 10:17:28 +0000 Subject: [PATCH] [dv] Fix regression for non PMP configs Programs generated from RISC-V were exiting early in configs that don't have PMP --- .../core_ibex/riscv_dv_extension/ibex_asm_program_gen.sv | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dv/uvm/core_ibex/riscv_dv_extension/ibex_asm_program_gen.sv b/dv/uvm/core_ibex/riscv_dv_extension/ibex_asm_program_gen.sv index 23fbe8b6d9..244d80fa39 100644 --- a/dv/uvm/core_ibex/riscv_dv_extension/ibex_asm_program_gen.sv +++ b/dv/uvm/core_ibex/riscv_dv_extension/ibex_asm_program_gen.sv @@ -153,6 +153,13 @@ class ibex_asm_program_gen extends riscv_asm_program_gen; super.gen_init_section(hart); + // RISCV-DV assumes main is immediately after init when riscv_instr_pkg::support_pmp isn't set. + // This override of gen_init_section breaks that assumption so add a jump to main here so the + // test starts correctly for configurations that don't support PMP. + if (!riscv_instr_pkg::support_pmp) begin + instr_stream.push_back({indent, "j main"}); + end + gen_test_end(.result(TEST_PASS), .instr(instr)); instr_stream = {instr_stream, {format_string("test_done:", LABEL_STR_LEN)},