-
Notifications
You must be signed in to change notification settings - Fork 120
Description
Hello!
I am using NEMU as a reference to align the rvv instruction implementation in GEM5. I noticed that the implementation of fredusum in NEMU is aligned with the RTL implementation. Specifically, in NEMU/src/isa/riscv64/instr/rvv/vcompute.h, the implementation of fredusum is as follows:
def_EHelper(vfredusum) {
#ifdef CONFIG_DIFFTEST
FREDUCTION(FREDUSUM) // use ordered reduction
#else
float_reduction_computing(s); // when NEMU is ref, use unordered reduction which is same as XiangShan
#endif
}
Currently, using NEMU as the reference causes GEM5's difftest to fail (we need to remove the #ifdef CONFIG_DIFFTEST lines in order to execute FREDUCTION(FREDUSUM)).
Since the RTL implementation might change again for implementation-specific reasons, I’d like to propose adding a configuration option (e.g., in nemuconfig) to distinguish whether the behavior should align specifically with RTL. This would help maintain flexibility and improve compatibility for different use cases.