Skip to content

Commit

Permalink
pmp_random: fix variable declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
kgugala committed Jan 8, 2025
1 parent 9960f46 commit 11afc3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testbench/tests/pmp_random/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ uint32_t generate_napot_mask(uint32_t value) {
int get_effective_range(uint32_t *address, enum RegionType region_type, uint32_t **addr_hi, uint32_t **addr_lo){
*address = legalize_address(*address, region_type);

uint32_t mask = generate_napot_mask(*address);
switch (region_type) {
case OFF:
*addr_lo = 0;
Expand All @@ -244,7 +245,6 @@ int get_effective_range(uint32_t *address, enum RegionType region_type, uint32_t
*addr_hi = *addr_lo + 1;
break;
case NAPOT:
uint32_t mask = generate_napot_mask(*address);
*addr_lo = ((uint32_t)address & ~mask) << 2;
*addr_hi = *addr_lo + (1 << trailing_ones(*address));
break;
Expand Down

0 comments on commit 11afc3d

Please sign in to comment.