Skip to content

fix: initialize the last 4 bytes of mem to zero#149

Draft
filmil wants to merge 1 commit into
olofk:mainfrom
filmil:dev-fix-mem
Draft

fix: initialize the last 4 bytes of mem to zero#149
filmil wants to merge 1 commit into
olofk:mainfrom
filmil:dev-fix-mem

Conversation

@filmil

@filmil filmil commented Jun 28, 2025

Copy link
Copy Markdown

These last 4 bytes are, in fact, used for register x0, and must be zero. In multi-valued simulators, however, without an explicit init, these bytes start as undefined. Moving x0 to anywhere results in those undefined bytes "infecting" other registers.

Issue: #148

These last 4 bytes are, in fact, used for register `x0`, and must be
zero. In multi-valued simulators, however, without an explicit init,
these bytes start as undefined. Moving `x0` to anywhere results in
those undefined bytes "infecting" other registers.

Issue: olofk#148
@m42uko

m42uko commented May 6, 2026

Copy link
Copy Markdown
Contributor

Hi, I know this PR is sort of old, but I just came back to the project and saw this.

I fully agree with your assessment, and I'm kind of surprised that this isn't giving us trouble in synthesis as well, as the RAM could be initialized to a value other than 0 there as well (depending on the architecture). So I think adding some kind of logic like this is definitely a good idea.

My only question here is: Have you looked into how different synthesis tools handle this way of resetting the bits to zero? Are they still able to map it to an EBR? (Pretty sure Vivado can do it, but not sure about others.)

@filmil

filmil commented May 6, 2026 via email

Copy link
Copy Markdown
Author

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