Memory Model
The memory model for MicroBlaze classifies the data into four different parts: Small Data
Area, Data Area, Common Un-Initialized Area, and Literals or Constants.
Small Data Area
Global initialized variables which are small in size are stored in this area. The threshold for
deciding the size of the variable to be stored in the small data area is set to 8 bytes in the
MicroBlaze C compiler (mb-gcc), but this can be changed by giving a command line option
to the compiler. Details about this option are discussed in the "GNU Compiler Tools" chapter
of the Embedded System Tools Reference Manual
is allocated for the small data areas. The small data area is accessed using the read-write
small data area anchor (R13) and a 16-bit offset. Allocating small variables to this area
reduces the requirement of adding IMM instructions to the code for accessing global
variables. Any variable in the small data area can also be accessed using an absolute
address.
Data Area
Comparatively large initialized variables are allocated to the data area, which can either be
accessed using the read-write SDA anchor R13 or using the absolute address, depending on
the command line option given to the compiler.
Common Un-Initialized Area
Un-initialized global variables are allocated in the common area and can be accessed either
using the absolute address or using the read-write small data area anchor R13.
Literals or Constants
Constants are placed into the read-only small data area and are accessed using the read-
only small data area anchor R2.
The compiler generates appropriate global pointers to act as base pointers. The actual
values of the SDA anchors are decided by the linker, in the final linking stages. For more
information on the various sections of the memory see the "MicroBlaze Linker Scripts"
section and Appendix B of the Embedded System Tools Reference Manual (UG1043)
The compiler generates appropriate sections, depending on the command line options. See
the "GNU Compiler Tools" chapter in the Embedded System Tools Reference Manual (UG1043)
[Ref 13]
for more information about these options.
MicroBlaze Processor Reference Guide
UG984 (v2018.2) June 21, 2018
Chapter 4: MicroBlaze Application Binary Interface
(UG1043) [Ref
www.xilinx.com
13]. 64 kilobytes of memory
[Ref
Send Feedback
13].
191
Need help?
Do you have a question about the MicroBlaze and is the answer not in the manual?