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

Handle address translation for misaligned loads and stores better #467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 28, 2024

  1. Handle address translation for misaligned loads and stores better

    Refactor the LOAD and STORE instruction so they split misaligned
    accesses into multiple sub-accesses and perform address translation
    separately. This means we should handle the case where a misaligned
    access straddles a page boundary in a sensible way, even if we don't
    yet cover the full range of possibilities allowed for any RISC-V
    implementation.
    
    There are options for the order in which misaligned happen, i.e. from
    high-to-low or from low-to-high as well as the granularity of the splitting,
    either all the way to bytes or to the largest aligned size. The splitting
    can also be disabled if an implementation supports misaligned accesses in hardware.
    
    The Zama16b extension is support with an --enable-zama16b flag on the simulator.
    
    In addition tidy up the implementation in a few ways:
    
    - Very long lines on the LOAD encdec were fixed by adding a helper
    
    - Add some linebreaks in the code so it reads as less claustrophobic
    
    - Ensure we use the same names for arguments in encdec/execute/assembly.
      Previously we used 'size' and 'width'. I opted for 'width' consistently.
    Alasdair committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    91a16b4 View commit details
    Browse the repository at this point in the history