Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[otbn] double increment and dmem byte addressing #3001

Closed
felixmiller opened this issue Jul 28, 2020 · 1 comment · Fixed by #3002
Closed

[otbn] double increment and dmem byte addressing #3001

felixmiller opened this issue Jul 28, 2020 · 1 comment · Fixed by #3002
Assignees
Labels
Component:Software Issue related to Software Type:Bug Bugs

Comments

@felixmiller
Copy link
Contributor

With byte addressing of dmem we need to increment the dmem pointer by 32 (full WLEN word) when auto increment is used. In OTBN we only support a single increment of either the reg pointer or the dmem pointer directly in the load/store instruction. If both pointers are supposed to be incremented we add an additional ADDI. In the modexp code snippet we need to adjust this (e.g. here) in order to work with byte addressing.

There are two options:

  1. Increment the dmem pointer not the reg pointer in the load/store instruction and increment the reg pointer by 1 with the ADDI
  2. Keep incrementing the reg pointer but increment the dmem pointer with ADDI by 32

To me, #1 seems to be the cleaner solution and should also be the default when porting code.

@imphil
Copy link
Contributor

imphil commented Jul 28, 2020

Both options work and don't make much of a difference, the addi immediate can deal with the value 32 without trouble. But I agree with you, option 1 seems slightly nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:Software Issue related to Software Type:Bug Bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants