Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop
model_init()
overriding coverage filename
The addition of a `sail_set_coverage_file()` call into `model_init()` in commit 28ef9e9 seems to have unintentionally restricted the ability to use `sail_set_coverage_file()` elsewhere. Any program that calls Sail's `model_init()` after performing its own `sail_set_coverage_file()` call will now behave differently. The coverage filename specified at runtime will be overridden, even if the sail `-c_coverage_output` argument was not used. This issue was found when using the c_emulator/cheri_riscv_rvfi_RV32 binary generated by the CTSRD-CHERI/sail-cheri-riscv repository. It calls `model_init()` as part of resetting between tests when running in a particular multi-test mode. The addition of the `sail_set_coverage_file()` call into `model_init()` seems to have been to allow test/sailcov/run_tests.py to use a coverage filename other than the default ("sail_coverage") specified in lib/coverage/libsail_coverage.a (generated from lib/coverage/src/lib.rs). This can alternately be achieved by adding a `-c` (coverage) argument to the argument parser included in the "simple_if.bin" binary built as part of the test, and removing the changes to `model_init()`. This solution seems to satisfy the original requirement without the adverse change in behaviour in other programs.
- Loading branch information