ibex icon indicating copy to clipboard operation
ibex copied to clipboard

RTL Simulation timeout in full regression

Open saurabhsingh-pvips opened this issue 6 years ago • 38 comments

Hi,

While running full regression using command make WAVES=1 VERBOSE=1 ISS=spike COV=1 , RTL simulation gets multiple time outs of the following nature:

INFO     Running RTL simulation...
Tue, 14 Apr 2020 18:58:31 INFO     Command progress: 0/371
Tue, 14 Apr 2020 19:02:48 INFO     Command progress: 1/371
Tue, 14 Apr 2020 19:02:49 INFO     Command progress: 2/371
Tue, 14 Apr 2020 19:02:49 INFO     Command progress: 3/371
Tue, 14 Apr 2020 19:02:49 INFO     Command progress: 4/371
Tue, 14 Apr 2020 19:12:49 ERROR    Timeout[600s]:  env SIM_DIR=out/seed-26187/rtl_sim/riscv_pmp_test.0   out/seed-26187/rtl_sim/vcs_simv +vcs+lic+wait +signature_addr=8ffffffc  -ucli -do ./vcs.tcl  -cm line+tgl+assert+fsm+branch -cm_dir out/seed-26187/rtl_sim/test.vdb -cm_log /dev/null -assert nopostproc -cm_name test_riscv_pmp_test_0      +ntb_random_seed=26187 +UVM_TESTNAME=core_ibex_base_test +bin=out/seed-26187/instr_gen/asm_tests/riscv_pmp_test_0.bin     +ibex_tracer_file_base=out/seed-26187/rtl_sim/riscv_pmp_test.0/trace_core     -l out/seed-26187/rtl_sim/riscv_pmp_test.0/sim.log

One thing I figured out is that there is no file present at path specified here: +ibex_tracer_file_base=out/seed-26187/rtl_sim/riscv_pmp_test.0/trace_core .

Trace log is generated only at following places:

./riscv_arithmetic_basic_test.0/trace_core_00000000.log
./riscv_arithmetic_basic_test.1/trace_core_00000000.log
./riscv_arithmetic_basic_test.2/trace_core_00000000.log
./riscv_arithmetic_basic_test.3/trace_core_00000000.log
./riscv_machine_mode_rand_test.2/trace_core_00000000.log
./riscv_machine_mode_rand_test.3/trace_core_00000000.log
./riscv_machine_mode_rand_test.7/trace_core_00000000.log
./riscv_rand_instr_test.2/trace_core_00000000.log
./riscv_rand_instr_test.3/trace_core_00000000.log
./riscv_rand_instr_test.7/trace_core_00000000.log
./riscv_rand_instr_test.8/trace_core_00000000.log
./riscv_rand_jump_test.5/trace_core_00000000.log
./riscv_rand_jump_test.7/trace_core_00000000.log
./riscv_rand_jump_test.8/trace_core_00000000.log
./riscv_jump_stress_test.4/trace_core_00000000.log
./riscv_mmu_stress_test.2/trace_core_00000000.log
./riscv_debug_basic_test.0/trace_core_00000000.log
./riscv_debug_basic_test.4/trace_core_00000000.log
./riscv_debug_basic_test.8/trace_core_00000000.log
./riscv_debug_stress_test.11/trace_core_00000000.log
./riscv_debug_stress_test.13/trace_core_00000000.log
./riscv_debug_branch_jump_test.5/trace_core_00000000.log
./riscv_debug_wfi_test.4/trace_core_00000000.log
./riscv_debug_wfi_test.5/trace_core_00000000.log
./riscv_debug_wfi_test.6/trace_core_00000000.log
./riscv_debug_wfi_test.8/trace_core_00000000.log
./riscv_debug_ebreak_test.9/trace_core_00000000.log
./riscv_debug_ebreakmu_test.0/trace_core_00000000.log
./riscv_debug_ebreakmu_test.2/trace_core_00000000.log
./riscv_debug_ebreakmu_test.10/trace_core_00000000.log
./riscv_debug_csr_entry_test.2/trace_core_00000000.log
./riscv_debug_csr_entry_test.4/trace_core_00000000.log
./riscv_debug_csr_entry_test.5/trace_core_00000000.log
./riscv_irq_in_debug_mode_test.5/trace_core_00000000.log
./riscv_irq_in_debug_mode_test.7/trace_core_00000000.log
./riscv_single_interrupt_test.7/trace_core_00000000.log
./riscv_single_interrupt_test.11/trace_core_00000000.log
./riscv_single_interrupt_test.14/trace_core_00000000.log
./riscv_debug_single_step_test.12/trace_core_00000000.log

saurabhsingh-pvips avatar Apr 14 '20 13:04 saurabhsingh-pvips

The log extract you give indicates a timeout in the PMP test. Are all of the timeouts in a PMP test?

What simulator logs are present? trace_core_00000000.log will only be generated if the Ibex core successfully starts running. The simulator log gives simulator output that may give clues as to why the test is timing out. They are named sim.log an example path from your log output is out/seed-26187/rtl_sim/riscv_pmp_test.0/sim.log

I believe the PMP tests are still under active development so may not be expected to work perfectly yet @udinator will know more.

You could also try with a longer timeout. This is hard-coded into sim.py you can see the lines that run the simulator here:

https://github.com/lowRISC/ibex/blob/5c51bc7e4d2db8d89f83ad57107961622b308e58/dv/uvm/core_ibex/sim.py#L267

and here:

https://github.com/lowRISC/ibex/blob/5c51bc7e4d2db8d89f83ad57107961622b308e58/dv/uvm/core_ibex/sim.py#L276

The first line is running via LSF (hence run_parallel_cmd) and the other without LSF. The 600/300 are the timeouts in seconds respectively. Your timeout of 600s from your log indicates you're running via LSF, is that expected? That could also be the source of the problem if the job isn't running correctly on LSF or times out awaiting a slot.

GregAC avatar Apr 15 '20 11:04 GregAC

The simulator log for riscv_pmp_test looks fine to me

Command: /home/saurabh/projects/rig/work/ibex/dv/uvm/core_ibex/out/seed-26187/rtl_sim/vcs_simv +vcs+lic+wait +signature_addr=8ffffffc -ucli -do ./vcs.tcl -cm line+tgl+assert+fsm+branch -cm_dir out/seed-26187/rtl_sim/test.vdb -cm_log /dev/null -assert nopostproc -cm_name test_riscv_pmp_test_0 +ntb_random_seed=26187 +UVM_TESTNAME=core_ibex_base_test +bin=out/seed-26187/instr_gen/asm_tests/riscv_pmp_test_0.bin +ibex_tracer_file_base=out/seed-26187/rtl_sim/riscv_pmp_test.0/trace_core -l out/seed-26187/rtl_sim/riscv_pmp_test.0/sim.log
Chronologic VCS simulator copyright 1991-2019
Contains Synopsys proprietary information.
Compiler version P-2019.06-SP2-3_Full64; Runtime version P-2019.06-SP2-3_Full64;  Apr 15 17:31 2020

Strange observation I made is that riscv_pmp_test doesn't cause issue when run alone. The timeout is only observed when regression is run. Does it still make sense to increase the timeout and try again?

saurabhsingh-pvips avatar Apr 15 '20 12:04 saurabhsingh-pvips

Trying again with an increased timeout would be the next logical step, though if it's not producing a trace file that does indicate some issue that's stopping the test from running (rather than a test that's just taking longer than normal to run).

GregAC avatar Apr 15 '20 13:04 GregAC

Tried with 1200s timeout. Same error.

saurabhsingh-pvips avatar Apr 16 '20 09:04 saurabhsingh-pvips

Hi Saurabh, thanks for bringing this up. I suspect that this timeout has something to do with the active-development status of PMP verification work for the time being; I have a rather large PR in the works on the riscv-dv side that when ready should hopefully fix these timeout errors. I'll look more into what is going on tomorrow. Are you running these simulations on LSF (or some equivalent)?

udinator avatar Apr 16 '20 09:04 udinator

Alright. Thanks.

No, I am not running on LSF.

saurabhsingh-pvips avatar Apr 16 '20 12:04 saurabhsingh-pvips

Hi @saurabhsingh-pvips, I have opened #797 to hopefully solve this issue of hanging PMP tests, I'll update this thread again to let you know once it gets merged.

udinator avatar Apr 18 '20 00:04 udinator

@saurabhsingh-pvips - could you try running the pmp test again? Several changes have been merged that should hopefully allow this test to run to completion.

udinator avatar Apr 20 '20 16:04 udinator

This still fails in regression but passes as individual test. Nothing fishy appears in sim.log

saurabhsingh-pvips avatar Apr 21 '20 11:04 saurabhsingh-pvips

I've identified the cause of this issue, and have opened #804 to fix it, will update once it gets merged.

udinator avatar Apr 21 '20 17:04 udinator

@saurabhsingh-pvips could you try this again? Some fixes have been submitted relating to how LSF commands are passed in that might fix this hanging error.

udinator avatar May 01 '20 19:05 udinator

Running on SPIKE gets the following error: error: bad --isa option rv32imcb

Tried with OVPsim, test runs but time out before completion: ERROR Timeout[10s] How do I increase the timeout for OVPsim? Added --finishtime 1200 to iss.yaml but that doesn't work.

saurabhsingh-pvips avatar May 04 '20 10:05 saurabhsingh-pvips

This is because we've recently added support for the bitmanip extension in Ibex. The master branch of Spike doesn't support that at the moment (probably because the extension hasn't yet been ratified). See the Verification page of the docs for instructions of how to install the version of Spike that you need.

rswarbrick avatar May 04 '20 11:05 rswarbrick

Tried with this version of spike: https://github.com/riscv/riscv-isa-sim/tree/riscv-bitmanip Doesn't help. error: bad --isa option 'rv32imcb'. unsupported extension 'b'

saurabhsingh-pvips avatar May 04 '20 15:05 saurabhsingh-pvips

Hi @saurabhsingh-pvips , did you compile the riscv-bitmanipbranch of Spike with a compiler that actually has support for the bitmanip extension?

vogelpi avatar May 04 '20 15:05 vogelpi

Also, when you call Spike, does it actually try to use the compiler with bitmanip support? I suspect that the error you see is because Spike tries to call the compiler that does not support bitmanip and thus does not recognize the flag.

vogelpi avatar May 04 '20 15:05 vogelpi

I'm using the lowrisc-toolchain via here.

I guess I am missing on applying bitmanip patch (here). Can you confirm this?

saurabhsingh-pvips avatar May 04 '20 16:05 saurabhsingh-pvips

No, the toolchain you're referring to already contains all necessary patches to GCC and binutils to work with bitmanip. Spike is not part of the toolchain, you need to/did build it separately.

imphil avatar May 04 '20 16:05 imphil

I had a similar problem and it turned out that even though I had the new compiler installed, Spike was still using the old one because I did not change the RISCV_TOOLCHAIN environment variable.

vogelpi avatar May 04 '20 16:05 vogelpi

@imphil Yes, I did that. This response was to @vogelpi's query

Also, when you call Spike, does it actually try to use the compiler with bitmanip support? I suspect that the error you see is because Spike tries to call the compiler that does not support bitmanip and thus does not recognize the flag.

saurabhsingh-pvips avatar May 05 '20 05:05 saurabhsingh-pvips