Skip to content

Commit

Permalink
[keymgr_dpe/rtl] Fix invalid_max_boot_stage
Browse files Browse the repository at this point in the history
Boot stage can be at most one less than the number of supported boot
stages (`DpeNumBootStages` synthesis parameter) for a successful Advance
operation, and boot stage is invalid for all values *greater than* or
equal to that maximum.

This inaccuracy in the RTL code did not lead to a problem in the current
instantiation, where `DpeNumBootStages = 4` and thus
`DpeNumBootStageWidth = 2`, where the width ensures that the value of
boot stage cannot be greater than `DpeNumBootStages`.  But this does not
hold generally and could cause problems if `DpeNumBootStages` is set to
a different value in the future.

Signed-off-by: Andreas Kurth <[email protected]>
  • Loading branch information
andreaskurth committed Jan 15, 2024
1 parent df39601 commit 21650a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/ip/keymgr_dpe/rtl/keymgr_dpe_ctrl.sv
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ module keymgr_dpe_ctrl
assign invalid_allow_child = ~active_slot_policy.allow_child;

logic invalid_max_boot_stage;
assign invalid_max_boot_stage = active_slot_boot_stage == DpeNumBootStages - 1;
assign invalid_max_boot_stage = active_slot_boot_stage >= DpeNumBootStages - 1;

// Check source validity
logic invalid_src_slot;
Expand Down

0 comments on commit 21650a3

Please sign in to comment.