
Chapter 8. Local Memory
For More Information On This Product,
Go to: www.freescale.com
8-27
SRAM Overview
; stack arguments and locations
; +0
saved d2
; +4
saved d3
; +8
saved d4
; +12
returnPc
; +16
pointer to source operand
; +20
destinationOffset
; +24
bytesToMove
move.l
movec.l
RAMBASE+RAMVALID,a0 ;define RAMBAR0 contents
a0,rambar0
;load it
move.l
16(a7),a0
;load argument defining *src
lea.l
add.l
RAMBASE,a1
20(a7),a1
;memory pointer to RAM base
;include destination nOffset
move.l
asr.l
24(a7),d4
#4,d4
;load byte count
;divide by 16 to convert to loop count
.align
movem.l
movem.l
lea.l
lea.l
subq.l
bne.b
4
(a0),#0xf
#0xf,(a1)
16(a0),a0
16(a1),a1
#1,d4
loop
;force loop on 0-mod-4 address
;read 16 bytes from source
;store into RAM destination
;increment source pointer
;increment destination pointer
;decrement loop counter
;if done, then exit, else continue
loop:
movem.l
lea.l
rts
(a7),#0x1c
12(a7),a7
;restore d2/d3/d4 registers
;deallocate temporary space
8.5.5 Programming RAMBARs for Power Management
Because processor memory references may be simultaneously sent to an SRAM module
and cache, power can be minimized by configuring RAMBAR address space masks as
precisely as possible. For example, if an SRAM is mapped to the internal instruction bus
and contains supervisor instruction data, setting the ASn mask bits associated with all
operand references and user-mode instruction fetches can decrease power dissipation.
Similarly, if the SRAM contains only supervisor data, setting the ASn bits associated with
instruction fetches and user-mode data accesses minimizes power.
Table 8-23 shows typical RAMBAR configurations.
.
Table 8-23. Examples of Typical RAMBAR Settings
RAMBAR[7–0]
Data Contained in SRAM
0x21
Both code and data
0x2B
Code only
0x35
Data only
0x35
Supervisor and user data
0x37
Supervisor-only data
0x3C
User-only data
0xAB
Supervisor and user code
F
Freescale Semiconductor, Inc.
n
.