[otbn] Issue a warning in tooling when using BN.ADDI _, _, 0
Nobody has claimed this yet.
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
`BN.ADDI` can be used to move data between two registers. It's nearly identical to `BN.MOV`, but also sets flags. Less visible is another difference: BN.ADDI moves data through the ALU and strips off integrity-protection, while BN.MOV maintains it.
In addition to recommending the use of BN.MOV for register-to-register transfers (see https://github.com/lowRISC/opentitan/issues/3314), we also should issue a warning to software developers when we encounter such code.
We could do that in the assembler (otbn-as), or introduce a linter or something like that.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the otbn-as tooling and the alternative of introducing a linter, then check issue #3314 for the related recommendation. Done means software using BN.ADDI with an immediate of 0 receives a warning, with the chosen location and behavior clarified.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100