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

Static update instr #2022

Merged
merged 3 commits into from
Sep 25, 2023
Merged

Static update instr #2022

merged 3 commits into from
Sep 25, 2023

Conversation

erlingrj
Copy link
Collaborator

This PR updates the PRET VM instructions in the C target. For portability, I argue that the right approach is to fix the data types, this is also what the JVM does. A JVM long is always 64 bit, regardless of platform.

I found a very nice way of making the instruction format flexible using union in C. Now the C implementation has the following semantics for instruction operands.

Each operand is either

  1. A pointer to a 64 bit unsigned integer. No requirements on the width of the pointer itself (32bit on NRF52 and 64bit on laptops)
  2. An immediate 64 bit unsigned integer. Here the width is fixed. This we need to be 64bit to encode time.

See the companion PR in reactor-c here: lf-lang/reactor-c#277

Copy link
Collaborator

@lsk567 lsk567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me. Thanks!

@erlingrj erlingrj merged commit 7052656 into static-schedule Sep 25, 2023
@erlingrj erlingrj deleted the static-update-instr branch September 25, 2023 12:55
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

Successfully merging this pull request may close these issues.

2 participants