ibex icon indicating copy to clipboard operation
ibex copied to clipboard

Regression testing failed

Open sofoslav opened this issue 7 years ago • 8 comments

I've tried to run regression test but it has failed a few times. I debugged one of the fails and found differnce between iss_sim and rtl_sim program flows. So, at asm program there is a jump to subroutine. Trace log of this jump looks the same for both iss and rtl simulations but return code differs.

Subrotine call code at main program looks like this (line 54):

                  ...
                  j init_user_mode

And subroutine code is (line 17 287):

init_user_mode:   
                  ...
                  mret

According to trace of ISS simulator it uses "mret (0x30200073)" (line 145) command as the return instruction, but RTL uses "jal (0800006f)" (line 69) in the same case. So, they used different return codes which causes jumping to different addresses. As I've seen ISS uses .o file as the source and rtl simulator .bin which can be a root of the problem, but both of them are generated by gen rule of makefile from the same source.

riscv_illegal_instr_test_0_ASM.TXT riscv_illegal_instr_test.0.log trace_core_00000000.log

sofoslav avatar Nov 21 '19 18:11 sofoslav

Hi @TAD-dev - Thanks for reporting this! It would appear that in the init_user_mode section, there is an access to sstatus, which Ibex does not support. Looks like this is an issue with the instruction generator, rather than the core. I'll prepare a fix in the generator and update the vendor directory accordingly.

udinator avatar Nov 21 '19 19:11 udinator

@TAD-dev - #486 and #487, once merged, should fix this issue; it was mostly fixes on the flow side. Thanks again for raising this issue!

udinator avatar Nov 21 '19 20:11 udinator

Can you sync to the master branch and try running this test again? Everything should be fixed now.

udinator avatar Nov 22 '19 00:11 udinator

After update I've got an error related to randomization on gen step. Please find error message attached below:

if (MSCRATCH inside {implemented_csr}) {
                                             |
ncsim: *E,RNDCNSTE (ibex/vendor/google_riscv-dv/src/riscv_rand_instr.sv,108|45): Randomization constraint has this error, which will cause the randomize function to return 0 and no new rand values will be set:                                            
Unsupported parameter type in constraint.
        `DV_CHECK_RANDOMIZE_WITH_FATAL(branch_instr, category == BRANCH;)
                                                                        |
ncsim: *W,SVRNDF (ibex/vendor/google_riscv-dv/src/riscv_directed_instr_lib.sv,323|72): The randomize method call failed. The unique id of the failed randomize call is 808.                                                                                  
Observed simulation time : 0 FS + 44
UVM_FATAL ibex/vendor/google_riscv-dv/src/riscv_directed_instr_lib.sv(323) @ 0: reporter [instr_stack_enter] Check failed (branch_instr.randomize()) Randomization failed! 

sofoslav avatar Nov 22 '19 11:11 sofoslav

Could you please re-sync to master and re-run the test?

udinator avatar Nov 22 '19 21:11 udinator

I still have the same error.

sofoslav avatar Nov 25 '19 10:11 sofoslav

Are you using IUS or Xcelium to run the simulations?

udinator avatar Dec 03 '19 19:12 udinator

This error happens on gen step where IUS is used for compilation and simulation.

sofoslav avatar Dec 04 '19 12:12 sofoslav