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 LOADU8 #156

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Fix LOADU8 #156

merged 2 commits into from
Apr 22, 2024

Conversation

hasekawa-takumi
Copy link
Collaborator

It was generating wrong results

It was generating wrong results
state
.mem_mut()
.write(clk, write_addr_index, cell_to_write, true);
.write(clk, write_addr_index, Word::from_u8(cell_byte), true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm....I was assuming little endian format and that's why the byte is written to [0] with zero_extend_byte but maybe it should be at the end like from_u8?

The C test doesn't work either way probably because there are more bugs. But write is working so perhaps I should indeed use from_u8. If so we should remove zero_extend_byte.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And also then I should change sign_extend_byte. I pushed a commit. Test still not working.

Copy link
Collaborator

@thealmarty thealmarty left a comment

Choose a reason for hiding this comment

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

Checked that words in memory are stored in big endian format.

@hasekawa-takumi hasekawa-takumi merged commit 1f8d3d9 into main Apr 22, 2024
2 checks passed
@hasekawa-takumi hasekawa-takumi deleted the takumi/fix_loadu8 branch April 22, 2024 22:22
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