riscv / sail-riscv

Sail RISC-V model
https://lists.riscv.org/g/tech-golden-model
Other
433 stars 159 forks source link

Check misalignment of AMOs before address translation #471

Closed Timmmm closed 3 months ago

Timmmm commented 4 months ago

This is optional according to the spec - you can check afterwards. However

  1. it seems extremely unlikely that any real designs will do that for atomics, which (ignoring Zam which the model doesn't support yet), always have to be aligned, and
  2. the LR and SC instructions already check before address translation, so this wasn't even consistent.

Ideally in future this would be configurable.

This also includes a minor refactor to reuse the existing alignment checking code.

github-actions[bot] commented 4 months ago

Test Results

712 tests  ±0   712 :white_check_mark: ±0   0s :stopwatch: ±0s   6 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit e1dcef1f. ± Comparison against base commit 7ff6d94e.

:recycle: This comment has been updated with latest results.

Timmmm commented 3 months ago

I'll merge this tomorrow if nobody has any objections...