Open rez5427 opened 3 weeks ago
396 tests ±0 396 ✅ ±0 0s ⏱️ ±0s 4 suites ±0 0 💤 ±0 1 files ±0 0 ❌ ±0
Results for commit 01ff2b9f. ± Comparison against base commit 9d86f015.
:recycle: This comment has been updated with latest results.
LGTM but I would add some explanation and move the if to the place where it is actually used. Also move the to_bits
outside the body to make it clearer.
val sys_vext_vl_use_ceil = pure "sys_vext_vl_use_ceil" : unit -> bool
function calculate_new_vl(AVL : int, VLMAX : int) -> xlenbits = {
// See "Constraints on Setting vl" in the vector spec.
let vl =
if AVL <= VLMAX then AVL
else if AVL < 2 * VLMAX then {
// If VLMAX < AVL < 2 * VLMAX then we can use any value
// such that ceil(AVL / 2) <= vl <= VLMAX. Here we provide
// two options: ceil(AVL / 2) or VLMAX.
if sys_vext_vl_use_ceil() then (AVL + 1) / 2 else VLMAX
}
else VLMAX;
to_bits(xlen, vl)
}
(Feel free to copy/paste.)
I don't know whether sail-riscv needs this. The spike uses VLMAX to calculate new vl, and sail-riscv uses (AVL + 1) / 2.
The spec says: