[rtl] FPGA bkdr fix#30680
Merged
Merged
Conversation
f643fc1 to
8fe0fb5
Compare
Contributor
Author
|
The first commit of this PR was already merged as part of #30543 |
thommythomaso
approved these changes
Jul 10, 2026
vogelpi
reviewed
Jul 10, 2026
a-will
reviewed
Jul 10, 2026
tgt_idx_err was not set when the index exceeded NumBkdrTgts because it was casted to a logic with fewer bits. The enum is now changed to an 8b enum such that the cast is not dropping any bits. Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
8fe0fb5 to
1cd725b
Compare
Contributor
|
The e2e_bootstrap_disabled_fpga_cw340_rom_with_fake_keys FPGA test failed, but I've seen this failing for other PRs as well. The failure is not related to this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The enum was previously defined as
typedef enum logic [$clog2(NumBkdrTgts)-1:0]andNumBkdrTgtswas 12. Hence, the enum was 4bit wide.The index check (https://github.com/lowRISC/opentitan/blob/master/hw/ip/bkdr_loader/rtl/bkdr_loader.sv#L284)
assign tgt_idx_err = !(bkdr_idx_e'(reg2hw.control.target_idx.q) inside {BkdrValidTgts});It first casts the 8b target_idx signal to the enum size (dropping 4 bits). And then checks if the value is inside the valid targets. Hence, a
target_idxof 13 was seen as a legal value. Actually vivado was interpreting it as always false and was thus always reporting an invalid target.