Activate DureMark as a benchmark - #15
Merged
Merged
Conversation
DureMark was build-only: "rvopt mux" could not lower it because libgcc's soft div/mod return through a "jr t0" runtime JALR, and GCC hoisted the ecall syscall number out of each ecall's own basic block (rvopt resolves it only from in-block constants). Fix both at the source: - soft.c supplies self-contained __mulsi3/__udivsi3/__umodsi3/__modsi3 (jal/ret only, shift/subtract so they cannot recurse into libgcc). It is linked before libgcc, so its four helpers win and the "jr t0" millicode is never pulled; libgcc trails only as a fallback for any other pure-RV32I helper a future codegen might emit. - run.c loads a7 inside the ecall asm template with an a7 clobber, so the syscall number materializes in the ecall's own block. - ITERATIONS 1 -> 500 makes the run a substantial (~15 s) benchmark; the count feeds the checksum, re-pinned to 1069216870 and gated by rv32i-check. Add benchmark targets: bench-forth times seven compute-bound eForth kernels, bench-rv32i delegates to the duremark sub-make run target (build + lower + bounded VM run + checksum assert) with a TIME_P prefix so the benchmark times exactly the gated path, and bench runs both. Timing uses /usr/bin/time -p; runs are bounded by timeout. Wire make bench into the CI rv32i job (and install GNU time there).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DureMark was build-only: "rvopt mux" could not lower it because libgcc's soft div/mod return through a "jr t0" runtime JALR, and GCC hoisted the ecall syscall number out of each ecall's own basic block (rvopt resolves it only from in-block constants). Fix both at the source:
__mulsi3/__udivsi3/__umodsi3/__modsi3(jal/ret only, shift/subtract so they cannot recurse into libgcc). It is linked before libgcc, so its four helpers win and the "jr t0" millicode is never pulled; libgcc trails only as a fallback for any other pure-RV32I helper a future codegen might emit.Add benchmark targets: bench-forth times seven compute-bound eForth kernels, bench-rv32i delegates to the duremark sub-make run target (build
Summary by cubic
Activate DureMark as a timed benchmark by making it fully lowerable with
rvopt muxand wiring newbenchtargets into CI. This adds a deterministic checksum gate and measures both eForth kernels and the rvopt‑lowered DureMark path.soft.cwith RV32I__mulsi3/__udivsi3/__umodsi3/__modsi3(no libgcc JALR), andrun.cloadsa7inside theecalltemplate. Iterations set to 500; checksum pinned to 1069216870.bench-forth(7 compute kernels) andbench-rv32i(delegates totests/rv32i/duremark run), plusbenchto run both. Uses/usr/bin/time -p; runs are bounded bytimeout.rv32i-checknow lowers and runs DureMark alongside demo and unopt programs.timeand runsmake benchin the RV32I job.Written for commit 6a17d01. Summary will update on new commits.