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

Fix large cluster operations, update dependencies and version to 1.5 #34

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ThadHouse
Copy link
Contributor

@ThadHouse ThadHouse commented Sep 7, 2023

All reads of 4 bytes or less from the FPGA are treated as a u32 read, even if less bytes are read. The value for this is then shifted to fit in the number of bytes actually read by the u8 array read call.

However, any register bigger then 4 bytes isn't treated as a u32 read, but instead an actual array of u8s. This means that for clusters bigger then 4 bytes, we don't have to shift the bits going into the bitset.

Writes have the same issue and are solved the same way.

Closes #22

Because updating dependencies also involves touching this area (it changes how the arrays are turned into bit slices), I'm combining these 2 PR's rather than making 2 separate ones that completely interfere with each other.

Technically, this is a breaking change, because the type exported for FpgaBits changed in a breaking way, due to the dependency updating from pre-release to release. However, this is only exported in order to use from the derive macros, and we don't use any of the functionality that breaks.

@ThadHouse ThadHouse changed the title Fix large cluster reads and writes Fix large cluster operations, update dependencies and version to 1.5 Sep 10, 2023
@ThadHouse
Copy link
Contributor Author

ThadHouse commented Sep 10, 2023

@auscompgeek I had to integrate my takeover for #30 into this PR directly. Both updating the dependencies, and the fix here touched the exact same functionality, so splitting them wasn't possible.

Also, the dependency update is a breaking change (It was in #30 too), but the type is only exported for the derive macros, so I'm not sure we actually care.

Also, I want to make one more change that will also touch this area before an update gets published, but its a bit more, so probably worth doing as a separate PR. But I'd wait to publish until I get that one in as well.

@ThadHouse
Copy link
Contributor Author

FYI I just tested the integration tests on a real roboRIO and they passed.

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.

Investigate memory layout of arrays of non-small clusters
1 participant