System Memory ARM
System Memory ARM
System Memory ARM
Bi Quc Bo
Memory map
BI QUC BO
1
BI QUC BO
2
Peripheral region
Address: 0x400000000x5FFFFFFF
Intended for peripherals
Cannot execute instruction code in this
region
BI QUC BO
3
External devices
Address: 0xA00000000xDFFFFFFF
intended for external devices and/or
shared memory that needs ordering /
nonbuffered accesses
Cannot execute instruction code in this
region
BI QUC BO
4
System region
Address: 0xE00000000xFFFFFFFF
for private peripherals and vendorspecic devices
Nonexecutable
BI QUC BO
5
Bit-band Operation
Bit-band operation support allows a
single load/store operation to access
(read/write) to a single data bit.
Supported in two predened memory
regions called bit-band regions
BI QUC BO
6
Bit-band regions
Can be accessed like normal memory
Each individual bit can be accessed
separately via a separate memory region
called the bit-band alias
Bit-band regions
Address: 0x200000000x200FFFFF
0x400000000x400FFFFF
BI QUC BO
7
Bit-band alias
BI QUC BO
8
BI QUC BO
9
LDR R0,=0x22000008
LDR R1, [R0]
; Setup address
; Read
BI QUC BO
10
Remapping of Bit-Band
Addresses in Peripheral Memory Region
Bit-band operation in C
#define DEVICE_REG0 ((volatile unsigned long *) (0x40000000))
#define DEVICE_REG0_BIT0 ((volatile unsigned long *) (0x42000000))
#define DEVICE_REG0_BIT1 ((volatile unsigned long *) (0x42000004))
...
*DEVICE_REG0 = 0xAB; // Accessing the hardware register by normal
// address
...
*DEVICE_REG0 = *DEVICE_REG0 | 0x2; // Setting bit 1 without using
// bitband feature
*DEVICE_REG0_BIT1 = 0x1;
// Setting bit 1 using bitband feature
// via the bit band alias address
BI QUC BO
11
BI QUC BO
12
Semaphore
Atomic access
In order to implement a reliable
semaphore, we must guarantee atomic
access.
Reading the semaphore value, checking
it and writing the modified value back
must occur in an uninterruptible
sequence
BI QUC BO
13
LDREX
STREX
store data to memory if the memory location
is tagged, return 0. Otherwise, return 1.
Every access to this memory location will
clear the tag
Syntax
LDREX{cond}
STREX{cond}
LDREXB{cond}
STREXB{cond}
LDREXH{cond}
STREXH{cond}
LDREXD{cond}
TREXD{cond}
BI QUC BO
14
cond
Rd
Rt
Rt2
Rn
offset
BI QUC BO
15