RISC-V: Fix width inlined with CNop and change width check to using inlined width.
Closes RV-399
What
This MR corrects two issues to align CNop with the rest of the opcodes in having the proper InstrWidth set in the corresponding Args struct. Changing the width-check function from matching against opcodes to now using the width in Args ensures that all checks now use this parameter, rather than based on the opcode itself, to validate the correct width has been set.
NB: Changing the width check showed this misalignment and going forward should provide sufficient check against this happening again.
Why
CNop must be matched with the correct width.
Also moving forward, although opcodes in parser will remain, deduplication on machine_state side will mean that an opcode can be representing different widths, so the check must now be on the inlined width parameter of Args rather than matched against opcode.
How
Manually Testing
make -C src/riscv all
Benchmarking
No change.
Regressions
Tasks for the Author
-
Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes). -
Eliminate dead code and other spurious artefacts introduced in your changes. -
Document new public functions, methods and types. -
Make sure the documentation for updated functions, methods, and types is correct. -
Add tests for bugs that have been fixed. -
Put in reasonable effort to ensure that CI will pass. make -C src/riscvdune build src/lib_riscvdune build src/rust_deps
-
Benchmark performance and populate the table above if needed. -
Explain changes to regression test captures when applicable. -
Write commit messages to reflect the changes they're about. -
Self-review your changes to ensure they are high-quality. -
Complete all of the above before assigning this MR to reviewers.