Test termination: Delegate decision to testbench instead of using explicit $finish.
Created by: zchamski
This PR replaces explicit use of $finish()
in RVFI tracer with proper propagation of end-of-test information to the verification testbench:
- Instread of executing a
$finish()
statement the RFVI tracer now outputs the end-of-test event and the test exit code on new outputend_of_test_o
. - The Verilator and VCS C++ testbenches were modified to detect the end-of-test event (write of
1'b1
into bit 0 of memory variabletohost
) and to report the exit code of the test (bits [31:1] of the word written intotohost
upon end-of-test). The Verilator testbench end-of-test messages were aligned on those of the VCS testbench. - The UVM handling of the end-of-test is implemented in the companion core-v-verif PR https://github.com/openhwgroup/core-v-verif/pull/1729.
Once the end-of-test condition is detected, the end_of_test_o
output of RVFI tracer is set and held indefinitely.
FORNOW: Upon hitting the programmable timeout, the RVFI tracer raises an end-of-test condition with the test exit code value 31'h7fff_ffff
, equivalent to writing 32'hffff_ffff
into tohost
. Once the timeout feature is moved outside of the RVFI tracer, this behavior may be removed.