Skip to content

Proposal: Add a configuration option for RTL-specific difftest #893

@tqxu23

Description

@tqxu23

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions