Skip to content

Commit

Permalink
[!] Fix critical bug: array index out of range in axi2apb_bus1 module…
Browse files Browse the repository at this point in the history
…. Bug leads to stack corruption was not reported by ncsim
  • Loading branch information
sergeykhbr committed Jun 15, 2023
1 parent dec9b8a commit 426af3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sv/rtl/ambalib/axi2apb_bus1.sv
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ always_comb
begin: comb_proc
axi2apb_bus1_registers v;
int iselidx;
apb_in_type vapbi[0: CFG_BUS1_PSLV_TOTAL-1];
apb_in_type vapbi[0: (CFG_BUS1_PSLV_TOTAL + 1)-1];
apb_out_type vapbo[0: (CFG_BUS1_PSLV_TOTAL + 1)-1];

iselidx = 0;
for (int i = 0; i < CFG_BUS1_PSLV_TOTAL; i++) begin
for (int i = 0; i < (CFG_BUS1_PSLV_TOTAL + 1); i++) begin
vapbi[i] = apb_in_none;
end
for (int i = 0; i < (CFG_BUS1_PSLV_TOTAL + 1); i++) begin
Expand Down

0 comments on commit 426af3d

Please sign in to comment.