| |||
| Home > Configuring Custom Memory Maps, Registers and Peripherals > Creating memory map rules | |||
Memory map rules enable you to control how memory map blocks are displayed. Typically, map rules are required when multiple memory map blocks are defined that occupy the same area of memory, but only one of the blocks is to be active at a time. For example, when a target supports memory remapping. These memory map blocks are referred to as controlled memory map blocks.
The active memory map block is determined by examining the value of a custom register or peripheral register. There must be a map rule for each memory map block that is to be controlled by that register. Each map rule associates a unique register value with a specific memory map block.
Before you create map rules:
Create the required memory map blocks.
Either:
create a custom register
create a custom peripheral register.
To create the rules that control which memory block is used:
Select Connection Properties... from the Target menu to display the Connection Properties window.
Expand the (*.bcd) Board/Chip Definitions group.
Expand ...\MP3.bcd in the definitions
list.
Expand the following groups in turn:
*BOARD=MP3
*Advanced_Information
*ARM
Map_rule.
Select the Default group.
Rename the Default group of Map_rule to R_FastRAM.
Set the following values:
Set Register to Newreg (use
the context menu).
Set Mask to 0x0001 (to
check the value of the B_REMAP bit field only).
Set Value to 0 (M_FastRAM displayed
when B_REMAP bit field is set to Disable).
Set On_equal to M_FastRAM.
Figure 4.27 shows an example:
Create the R_SlowROM rule:
Right-click on R_FastRAM to display
the context menu.
Select Make Copy... from
the context menu to display the Enter Name of New object dialog
box. The name R_FastRAM_1 is inserted.
If the name of a rule you are copying ends with a number, then RealView Debugger increments the number for the new rule.
Change the name to R_SlowROM.
Click Create.
Select R_SlowROM and set Value to 1.
That is, display the M_SlowROM memory block when
the B_REMAP bit field is set to Enable.
Set the value of *On_equal to M_SlowROM.
Figure 4.28 shows an example:
All board file entries are now complete.
Select Save and Close from the File menu to save your changes and close the Connection Properties window.
See also: