Skip to content

Commit

Permalink
Merge pull request openhwgroup#1706 from AyoubJalali/core_dev
Browse files Browse the repository at this point in the history
Add new mechanism of the end of test for generated tests
  • Loading branch information
MikeOpenHWGroup authored Mar 24, 2023
2 parents 1c4b3e7 + edf75a1 commit e08ef4e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cva6/env/corev-dv/cva6_asm_program_gen.sv
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//-----------------------------------------------------------------------------------------
// CVA6 assembly program generator - extension of the RISC-V assembly program generator.
//
// Overrides gen_program_header()
// Overrides gen_program_header() and gen_test_done()
//-----------------------------------------------------------------------------------------

class cva6_asm_program_gen_c extends riscv_asm_program_gen;
Expand All @@ -39,6 +39,7 @@ class cva6_asm_program_gen_c extends riscv_asm_program_gen;
virtual function void gen_program_header();
string str[$];
instr_stream.push_back(".include \"user_define.include\"");
instr_stream.push_back(".include \"user_define.h\"");
instr_stream.push_back(".globl _start");
instr_stream.push_back(".section .text");
if (cfg.disable_compressed_instr) begin
Expand All @@ -55,6 +56,15 @@ class cva6_asm_program_gen_c extends riscv_asm_program_gen;
end
endfunction


virtual function void gen_test_done();
string str = format_string("test_done:", LABEL_STR_LEN);
instr_stream.push_back(str);
instr_stream.push_back({indent, "li gp, 1"});
instr_stream.push_back({indent, "sw gp, tohost, t5"});
instr_stream.push_back({indent, "wfi"});
endfunction

endclass : cva6_asm_program_gen_c

`endif // __CVA6_ASM_PROGRAM_GEN_SV__

0 comments on commit e08ef4e

Please sign in to comment.