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

Incomplete semantics for mrc instruction #56

Open
RyanGlScott opened this issue Aug 22, 2024 · 0 comments
Open

Incomplete semantics for mrc instruction #56

RyanGlScott opened this issue Aug 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@RyanGlScott
Copy link
Contributor

AArch32 defines an mrc instruction (Move Register to Coprocessor) which has many different uses, depending on which coprocessor is specified. Among other things, mrc can be used to access thread-local state. For a more complete writeup on how mrc can be used, refer to a reference manual for a specific ARM CPU (e.g., for Cortex-A7).

Unfortunately, asl-translator's semantics for the mrc instruction (Move Register to Coprocessor) are incomplete. This is because mrc is defined in terms of the AArch32.SysRegRead primitive, but that is simply defined as:

bits(32) AArch32.SysRegRead(integer cp_num, bits(32) instr)
assert FALSE;
return Zeros(32);

This simply returns zeroes, which is almost certainly not going to behave like one would expect it to.

Defining the full semantics for mrc will likely be a lot of work, as there are many different ARM coprocessor flavors out there. We may want to add support for a single coprocessor at a time as the need arises.

@RyanGlScott RyanGlScott added the bug Something isn't working label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant