Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

riscv_isac/fp_dataset.py should not have instruction specific knowledge #68

Open
cmuellner opened this issue Apr 6, 2023 · 0 comments

Comments

@cmuellner
Copy link

The documentation of the FP coverpoint generator functions (riscv_isac.fp_dataset.ibm_b1 and friends) are documented without specific knowledge of the instructions they generate for (see https://riscv-isac.readthedocs.io/en/stable/code.html#module-riscv_isac.fp_dataset).

However, the implementation is full of hard-coded assumptions that enforce different behavior for instructions without good reasons (e.g. if opcode.split('.')[0] in ["fadd","fsub","fmul","fdiv","fsqrt","fmadd","fnmadd","fmsub","fnmsub","fcvt","fmv"]:).

The result is, that the generators are useless for new instructions (Q, Zfh, Zfinx, Zfa, etc.). And adding these new instructions into fp_dataset.py is pointless, because there is no need to do so.

fp_dataset.py should be re-implemented with the following ideas in mind:

  • generators should not know anything about FP instructions
  • specific behavior should be controlled via function parameters, which are properly documented
  • constant should be defined on package level, not repeatedly in functions
  • seed functionality needs to be streamlined (that would also make it consistent)
  • code can be easily written to be compatible with Zfh, F, S, or Q by using simple abstractions (e.g. maxnorm = get_maxnorm(flen))
  • if code is copy-and-pasted from function to function, then it should be moved into its own function
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant