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

Misaligned memory operations are not handled correctly #2

Closed
lupino3 opened this issue Feb 11, 2012 · 0 comments
Closed

Misaligned memory operations are not handled correctly #2

lupino3 opened this issue Feb 11, 2012 · 0 comments

Comments

@lupino3
Copy link
Member

lupino3 commented Feb 11, 2012

The code

LD R1, 2(R0)

should raise an error, as the effective address (0 + 2 = 2) is not 8-byte aligned;

The code

SW R0, 2(R0)

crashes the simulator, with the following error:

edumips64.core.is.AddressErrorException
at edumips64.core.is.SW.MEM(SW.java:64) at edumips64.core.CPU.step(CPU.java:240) at edumips64.ui.CPUGUIThread.run(CPUGUIThread.java:137)

It's obvious that misaligned access must be handled consistently and gracefully.

References: H&P Appendix B.3; MIPS64 Vol. 2 (The MIPS64 Instruction Set) - description of Load/Store instructions

lupino3 added a commit that referenced this issue Feb 18, 2012
The old memory access policy was only by address, but in many places we really
want to access memory by index. The difference is that the by-address access
can issue alignment problems, while the by-index one cannot. This will be
useful later, while handling better the alignment problems described in
Issue #2.
lupino3 added a commit that referenced this issue Feb 26, 2012
lupino3 added a commit that referenced this issue Feb 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant