Table 35.
MASK Region Size Encodings
MASK Encoding
Region Size
0xFFFFFF
256 bytes
0xFFFFFE
512 bytes
0xFFFFFC
1 KB
0xFFFFF8
2 KB
0xFFFFF0
4 KB
0xFFFFE0
8 KB
0xFFFFC0
16 KB
0xFFFF80
32 KB
0xFFFF00
64 KB
0xFFFE00
128 KB
0xFFFC00
256 KB
0xFFF800
512 KB
0xFFF000
1 MB
0xFFE000
2 MB
0xFFC000
4 MB
0xFF8000
8 MB
0xFF0000
16 MB
0xFE0000
32 MB
0xFC0000
64 MB
0xF80000
128 MB
0xF00000
256 MB
0xE00000
512 MB
0xC00000
1 GB
0x800000
2 GB
0x000000
4 GB
The
MASK
field contains the following value, where
region_size
is in bytes:
MASK = 0xFFFFFF << log2(region_size >> 8)
3.4.2.14.2. The LIMIT Field
When the amount of memory reserved for a region is defined by an upper address
limit, the
LIMIT
field specifies the upper address of the memory region plus one. For
example, to achieve a memory range for byte addresses
0x4000
to
0x4fff
with a
256 byte minimum region size, the
BASE
field of the
mpubase
register is set to
0x40
(
0x4000 >> 6
) and the
LIMIT
field is set to
0x50
(
0x5000 >> 8
). Because the
LIMIT
field is one more bit than the number of bits of the
BASE
field of the
mpubase
register, bit 31 of the
mpuacc
register is available to the
LIMIT
field.
3. Programming Model
NII-PRG | 2018.04.18
Nios II Processor Reference Guide
62