Skip to content

Ensure preloading supports byte granularity#128

Merged
phsauter merged 2 commits intomainfrom
cr/fix-sub-word-preload
Apr 21, 2026
Merged

Ensure preloading supports byte granularity#128
phsauter merged 2 commits intomainfrom
cr/fix-sub-word-preload

Conversation

@creinwar
Copy link
Copy Markdown
Contributor

Currently, HEX file lines that end between word boundaries are silently dropped.
This fix pads them with 0 to a full word to allow preloading.

@creinwar creinwar self-assigned this Apr 20, 2026
@creinwar creinwar requested a review from phsauter April 20, 2026 21:17
@phsauter
Copy link
Copy Markdown
Collaborator

Wouldn't it make more sense to add something like the following after the inner while loop to 'clean up' remaining bytes?

if (byte_count != 0) begin
  data >>= 8 * (4 - byte_count); // zero-pad remaining bytes
  jtag_write(dm::SBData0, data);
  addr += 4;
  byte_count = 0;
  data = 32'h0;
end

@phsauter phsauter merged commit a72ac31 into main Apr 21, 2026
5 checks passed
@creinwar creinwar deleted the cr/fix-sub-word-preload branch April 21, 2026 14:03
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