Contents
Previous Chapter
Next Chapter



4 Memory Management Unit

The Memory Management Unit (MMU) allows the combination of a variety of internal and external memories into a single logical memory structure. The memory structure, or memory model, has both code space and data space address locations, because the Harvard architecture CPU has a separate code and data bus. The MMU provides code space translations for program code, and data space translations for variables and constants.

The translation of logical memory addresses to physical memory addresses is required as almost all physical memories start with an address of 0x0000. To avoid any address conflicts due to common memory base addresses and to create a linear address range, a logical memory address to physical memory address translation is provided by the MMU.

All address translations, the translation of logical addresses seen by the CPU to physical addresses presented to physical memories, are provided by translator blocks inside the MMU.

The diagram shows graphically the operation of the MMU. The physical collection of memory devices are arranged logically into a memory model, designed for the required application.

Figure 5: Abstract view of MMU operation.

The MMU allows full use of the available addresses and increases the range of memory devices that the processor can access, without needing to increase its address range or to add extra internal memory. A single physical memory can be mapped to both code and data space if required.

4.1 Operation

The purpose of the MMU is to receive memory access requests from the CPU, select a physical memory depending on the MMU configuration and translate the CPU logical memory address into a physical memory address to the memory device. Address translations are controlled using address translator blocks.

There are 20 translator blocks in the MMU, 7 for code and 13 for data space translations. The following list shows both the code and data space translators and their order of precedence.

Code Space Translations (read only):

  1. Internal flash memory block 0 (default translation at reset, always enabled)
  2. Internal RAM
  3. External chip select CS0 block 0
  4. External chip select CS1 block 0
  5. Internal flash memory block 1
  6. External chip select CS0 block 1
  7. External chip select CS1 block 1

Data Space Translations (read/write):

  1. Internal I/O registers (fixed at 0xF800 to 0xFFBF, always enabled)
  2. USB registers (fixed size 2048 bytes and physical address 0x0)
  3. Ethernet MAC registers (fixed size 512 bytes and physical address 0x0)
  4. Internal RAM block 0 (default translation at reset, always enabled)
  5. Internal RAM block 1
  6. Internal RAM block 2 scratchpad (fixed size 256 bytes and logical address 0xFF00, with 64 bytes visible above internal peripheral registers)
  7. Internal flash memory block 0
  8. Internal flash memory block 1
  9. Cache as RAM (fixed size 4096 bytes and physical address 0x0)
  10. External chip select CS0 block 0
  11. External chip select CS1 block 0
  12. External chip select CS0 block 1
  13. External chip select CS1 block 1

The MMU provides a facility to overlap physical memory locations. For instance, in data space, a small piece of flash memory can be located inside the address boundaries of a larger piece of external memory. The result of this is that the two memories have a range of addresses that are common to both. Accesses to this overlapping address range cause an access to the flash memory only, as it has a higher precedence than the external memories (from the above list, flash = 7 and external memories = 10 to 13). Furthermore, owing to the higher priority of the flash, the overlapping address range in the external memory is unavailable for access.

The following diagram shows the available translator blocks and the memories that can be accessed by each block. Note that some physical memory blocks can be mapped into both code and data space, while others can be mapped only into data space. In addition, some physical memories can have more than one area mapped into the same address space, set up with different values for the logical address, physical address and size.

Figure 6: MMU translator blocks

Most translator blocks have three registers to control the translation function: a logical address, a physical address and a size register, as shown below. Some translators have a fixed size, logical or physical address, and therefore do not have the corresponding registers.

The logical address register defines the logical base address that the eCOG1 processor core uses to access a physical memory. The physical address register defines the base address used to access the actual block of memory. The size register controls the size of the block of memory that is mapped by the translator; this is used to detect accesses to areas of the logical address map that do not translate to a physical memory and to raise an MMU address error exception.

Code and data space translators may address the same memory area (map to the same physical address), in which case the programmer must take care not to modify the memory in data space while it is also being used to execute code.

When configuring the logical and physical addresses, note that the value written to the register is the logical or physical byte address shifted right by 9 bits.

A segment size must be an integer power of 2, with a lower limit of 512 bytes (29), and an upper limit of 225 for code space and 217 for data space. For a segment size of 2n, the size register is set to 2n - 1. Both the logical and physical start addresses of the segment must be an integer multiple of the segment size.

The size can be calculated as follows...

size (in bytes) = 512 x (size register value + 1)
The size register must contain a value of 2n - 1 where n is an integer.

...or taken from the following table, which lists all valid register settings. Other register values are not allowed and give unpredictable results.

Table 9: MMU size register values.

Register
Contents

Size

Address range (hex)

0x0000

29 = 512 bytes

0x0000000 - 0x00001FF

0x0001

210 = 1024 (1 Kbytes)

0x0000000 - 0x00003FF

0x0003

211 = 2048 (2 Kbytes)

0x0000000 - 0x00007FF

0x0007

212 = 4096 (4 Kbytes)

0x0000000 - 0x0000FFF

0x000F

213 = 8192 (8 Kbytes)

0x0000000 - 0x0001FFF

0x001F

214 = 16384 (16 Kbytes)

0x0000000 - 0x0003FFF

0x003F

215 = 32768 (32 Kbytes)

0x0000000 - 0x0007FFF

0x007F

216 = 65536 (64 Kbytes)

0x0000000 - 0x000FFFF

0x00FF

217 = 131072 (128 Kbytes)

0x0000000 - 0x001FFFF

0x01FF

218 = 262144 (256 Kbytes)

0x0000000 - 0x003FFFF

0x03FF

219 = 524288 (512 Kbytes)

0x0000000 - 0x007FFFF

0x07FF

220 = 1048576 (1 Mbytes)

0x0000000 - 0x00FFFFF

0x0FFF

221 = 2097152 (2 Mbytes)

0x0000000 - 0x01FFFFF

0x1FFF

222 = 4194304 (4 Mbytes)

0x0000000 - 0x03FFFFF

0x3FFF

223 = 8388608 (8 Mbytes)

0x0000000 - 0x07FFFFF

0x7FFF

224 = 16777216 (16 Mbytes)

0x0000000 - 0x0FFFFFF

0xFFFF

225 = 33554432 (32 Mbytes)

0x0000000 - 0x1FFFFFF

4.2 Configuration

4.2.1 Reset State

After power up, 512 bytes of flash memory and SRAM are mapped into the bottom of code and data space respectively:

Figure 7: MMU reset configuration.

4.2.2 Set-up

The translate enable register (mmu.translate_en) acts as a switch to enable the logical to physical address translation. Each bit of the register contains an enable for each configured memory.

The recommended procedure for configuring the translation blocks is to set the enable bit of the translate register to zero (hence disabling any translation), then to set up the logical, physical and size registers for that memory, and finally to set the relevant memory enable bit to one to enable the translation.

For example, in order to configure an external memory of size 8Mbytes into the code space address range 0x800000 to 0xFFFFFF, the following values are written into the MMU registers.

Address

Register Name

Value

0xFDCA

mmu.translate_en0

'xxxxxxxxxxxxxx0x'

0xFDDA

mmu.ext_cs0_code0_log

0x4000

0xFDDC

mmu.ext_cs0_code0_phy

0x0000

0xFDDE

mmu.ext_cs0_code0_size

0x3FFF

0xFDCA

mmu.translate_en0

'xxxxxxxxxxxxxx1x'

To increase the size of the flash mapped into code space from 512 bytes (0x00000 to 0x001FF) to 64K bytes (0x00000 to 0x0FFFF), the values in the table below are written to the flash code space block zero translation registers. Note that in this case the logical and physical addresses are unchanged, and the code space enable bit for this first internal flash memory block is reserved as it is always mapped to code space.

Address

Register Name

Value

0xFDCE

mmu.flash_code0_log

0x0000

0xFDD0

mmu.flash_code0_phy

0x0000

0xFDD2

mmu.flash_code0_size

0x007F

Following the above setting, the final memory model is:

Figure 8: MMU example configuration.

4.3 Internal RAM Organisation

The internal SRAM (IRAM) is divided into three banks. Bank 0 is always available, while banks 1 and 2 may be enabled or disabled. The control bits for this are located in the mmu.ram_ctrl register.

Table 10: Internal RAM organisation

Bank

Physical address

Function

Control

0

0x0000 to 0x3FFF
(0 to 16K bytes)

Main IRAM block

Always available for IRAM access

1

0x4000 to 0x4FFF
(16K to 20K bytes)

Optional extra IRAM

Normally enabled
Can be disabled to save power

2

0x5000 to 0x5FFF
(20K to 24K bytes)

Optional extra IRAM, also used for USB endpoint data buffer

Normally enabled
Can be disabled to save power
Available for USB when disabled

4.4 Memory Management Unit Registers

The Memory Management Unit contains the following registers:

Table 11: Memory Management Unit registers

Address

Name

Reset

Type

Page

0xFDCA

mmu.translate_en0

0x0000

RW

4.4.1

0xFDCC

mmu.translate_en1

0x0000

RW

4.4.2

0xFDCE

mmu.flash_code0_log

0x0000

RW

4.4.3

0xFDD0

mmu.flash_code0_phy

0x0000

RW

4.4.4

0xFDD2

mmu.flash_code0_size

0x0000

RW

4.4.5

0xFDD4

mmu.ram_code_log

0x0000

RW

4.4.6

0xFDD6

mmu.ram_code_phy

0x0000

RW

4.4.7

0xFDD8

mmu.ram_code_size

0x0000

RW

4.4.8

0xFDDA

mmu.ext_cs0_code0_log

0x0000

RW

4.4.9

0xFDDC

mmu.ext_cs0_code0_phy

0x0000

RW

4.4.10

0xFDDE

mmu.ext_cs0_code0_size

0x0000

RW

4.4.11

0xFDE0

mmu.ext_cs1_code0_log

0x0000

RW

4.4.12

0xFDE2

mmu.ext_cs1_code0_phy

0x0000

RW

4.4.13

0xFDE4

mmu.ext_cs1_code0_size

0x0000

RW

4.4.14

0xFDE6

mmu.flash_code1_log

0x0000

RW

4.4.15

0xFDE8

mmu.flash_code1_phy

0x0000

RW

4.4.16

0xFDEA

mmu.flash_code1_size

0x0000

RW

4.4.17

0xFDEC

mmu.ext_cs0_code1_log

0x0000

RW

4.4.18

0xFDEE

mmu.ext_cs0_code1_phy

0x0000

RW

4.4.19

0xFDF0

mmu.ext_cs0_code1_size

0x0000

RW

4.4.20

0xFDF2

mmu.ext_cs1_code1_log

0x0000

RW

4.4.21

0xFDF4

mmu.ext_cs1_code1_phy

0x0000

RW

4.4.22

0xFDF6

mmu.ext_cs1_code1_size

0x0000

RW

4.4.23

0xFDF8

mmu.ram_data0_log

0x0000

RW

4.4.24

0xFDFA

mmu.ram_data0_phy

0x0000

RW

4.4.25

0xFDFC

mmu.ram_data0_size

0x0000

RW

4.4.26

0xFDFE

mmu.ram_data1_log

0x0000

RW

4.4.27

0xFE00

mmu.ram_data1_phy

0x0000

RW

4.4.28

0xFE02

mmu.ram_data1_size

0x0000

RW

4.4.29

0xFE04

reserved

0x0000

RW

4.4.30

0xFE06

mmu.flash_data0_log

0x0000

RW

4.4.31

0xFE08

mmu.flash_data0_phy

0x0000

RW

4.4.32

0xFE0A

mmu.flash_data0_size

0x0000

RW

4.4.33

0xFE0C

mmu.flash_data1_log

0x0000

RW

4.4.34

0xFE0E

mmu.flash_data1_phy

0x0000

RW

4.4.35

0xFE10

mmu.flash_data1_size

0x0000

RW

4.4.36

0xFE12

mmu.cache_data_log

0x0000

RW

4.4.37

0xFE14

mmu.ext_cs0_data0_log

0x0000

RW

4.4.38

0xFE16

mmu.ext_cs0_data0_phy

0x0000

RW

4.4.39

0xFE18

mmu.ext_cs0_data0_size

0x0000

RW

4.4.40

0xFE1A

mmu.ext_cs1_data0_log

0x0000

RW

4.4.41

0xFE1C

mmu.ext_cs1_data0_phy

0x0000

RW

4.4.42

0xFE1E

mmu.ext_cs1_data0_size

0x0000

RW

4.4.43

0xFE20

mmu.ext_cs0_data1_log

0x0000

RW

4.4.44

0xFE22

mmu.ext_cs0_data1_phy

0x0000

RW

4.4.45

0xFE24

mmu.ext_cs0_data1_size

0x0000

RW

4.4.46

0xFE26

mmu.ext_cs1_data1_log

0x0000

RW

4.4.47

0xFE28

mmu.ext_cs1_data1_phy

0x0000

RW

4.4.48

0xFE2A

mmu.ext_cs1_data1_size

0x0000

RW

4.4.49

0xFE2C

mmu.usb_data_log

0x0000

RW

4.4.50

0xFE2E

mmu.emac_data_log

0x0000

RW

4.4.51

0xFE30

mmu.flash_ctrl

0x0000

RW

4.4.52

0xFE32

mmu.ram_ctrl

0x0000

RW

4.4.53

0xFE34

mmu.dma_ctrl

0x0000

RW

4.4.54

0xFE36

mmu.adr_err

0x0000

RW

4.4.55

0xFE38

mmu.data_cache_sts

0x0000

RW

4.4.55

4.4.1 mmu.translate_en0

Address: 0xFDCA

Reset: 0x0000

Type: RW

MMU address translator enable register; setting a bit in this register enables the respective address translator in the MMU. A translator may not be enabled or disabled while data or code is being accessed through it.

The register contains the following fields.

Bits

Field

Type

15

usb_data: When set to '1', this bit enables the USB interface register block to be mapped into data space.

RW

14

ext_cs1_data1: When set to '1', this bit enables the device connected to external chip select CS1 to be mapped into data space. This is the second of two data space translator block enables mapped to CS1.

RW

13

ext_cs0_data1: When set to '1', this bit enables the device connected to external chip select CS0 to be mapped into data space. This is the second of two data space translations mapped to CS0.

RW

12

ext_cs1_data0: When set to '1', this bit enables the device connected to external chip select CS1 to be mapped into data space. This is the first of two data space translations mapped to CS1.

RW

11

ext_cs0_data0: When set to '1', this bit enables the device external connected to chip select CS0 to be mapped into data space. This is the first of two data space translations mapped to CS0.

RW

10

cache_data: When set to '1', this bit enables the cache RAM block to be mapped into data space. Cache RAM must be mapped to data space when initialising the cache contents before enabling the instruction cache function. The cache must be disabled for the memory mapping to operate.

RW

9

flash_data1: When set to '1', this bit enables the internal flash memory to be mapped into data space. This is the second of two data space translations mapped to internal flash.

RW

8

flash_data0: When set to '1', this bit enables the internal flash memory to be mapped into data space. This is the first of two data space translations mapped to internal flash.

RW

6

ram_data1: When set to '1', this bit enables the internal RAM to be mapped into data space. This is the second of two data space translations mapped to internal RAM.

RW

5

ext_cs1_code1: When set to '1', this bit enables the device external connected to chip select CS1 to be mapped into code space. This is the second of two code space translations mapped to CS1.

RW

4

ext_cs0_code1: When set to '1', this bit enables the device connected to external chip select CS0 to be mapped into code space. This is the second of two code space translations mapped to CS0.

RW

3

flash_code1: When set to '1', this bit enables a second translation for the internal flash memory to be mapped into code space.

RW

2

ext_cs1_code0: When set to '1', this bit enables the device connected to external chip select CS1 to be mapped into code space. This is the first of two code space translations mapped to CS1.

RW

1

ext_cs0_code0: When set to '1', this bit enables the device connected to external chip select CS0 to be mapped into code space. This is the first of two code space translations mapped to CS0.

RW

0

ram_code: When set to '1', this bit enables the internal RAM to be mapped into code space.

RW

4.4.2 mmu.translate_en1

Address: 0xFDCC

Reset: 0x0000

Type: RW

MMU address translator enable register; setting a bit in this register enables the respective address translator in the MMU. A translator may not be enabled or disabled while data or code is being accessed through it.

The register contains the following fields.

Bits

Field

Type

0

emac_data: When set to '1', this bit enables the Ethernet MAC register block to be mapped into data space.

RW

4.4.3 mmu.flash_code0_log

Address: 0xFDCE

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit logical start address for the first flash memory block mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

flash_code0_log: Logical start address for the first segment of internal flash memory mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.4 mmu.flash_code0_phy

Address: 0xFDD0

Reset: 0x0000

Type: RW

This register specifies the top 10 bits of the 19-bit physical start address for the first flash memory block mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

9:0

flash_code0_phy: Physical start address for the first segment of internal flash memory mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.5 mmu.flash_code0_size

Address: 0xFDD2

Reset: 0x0000

Type: RW

This register specifies the size of the first flash memory segment to be mapped into code space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

9:0

flash_code0_size: Size of segment of internal flash memory to be mapped into code space. The allowed segment size range is 512 bytes (29) to 512K bytes (219).

RW

4.4.6 mmu.ram_code_log

Address: 0xFDD4

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit logical start address for the internal RAM memory block mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ram_code_log: Logical start address for a segment of internal memory mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.7 mmu.ram_code_phy

Address: 0xFDD6

Reset: 0x0000

Type: RW

This register specifies the top 6 bits of the 15-bit physical start address for the internal RAM memory block mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

5:0

ram_code_phy: Physical start address for a segment of internal memory mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.8 mmu.ram_code_size

Address: 0xFDD8

Reset: 0x0000

Type: RW

This register specifies the size of the internal RAM memory segment to be mapped into code space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

5:0

ram_code_size: Size of segment of internal SRAM to be mapped into code space. The allowed segment size range is 512 bytes (29) to 32K bytes (215).

RW

4.4.9 mmu.ext_cs0_code0_log

Address: 0xFDDA

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit logical start address for the first external memory segment on chip select CS0 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_code0_log: Logical start address for the first external memory segment on CS0 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.10 mmu.ext_cs0_code0_phy

Address: 0xFDDC

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the first external memory segment on chip select CS0 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_code0_phy: Physical start address for the first external memory segment on CS0 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.11 mmu.ext_cs0_code0_size

Address: 0xFDDE

Reset: 0x0000

Type: RW

This register specifies the size of the first external memory segment on chip select CS0 to be mapped into code space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_code0_size: Size of the first external memory segment on CS0 to be mapped into code space. The allowed segment size range is 512 bytes (29) to 32M bytes (225).

RW

4.4.12 mmu.ext_cs1_code0_log

Address: 0xFDE0

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit logical start address for the first external memory segment on chip select CS1 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_code0_log: Logical start address for the first external memory segment on CS1 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.13 mmu.ext_cs1_code0_phy

Address: 0xFDE2

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the first external memory segment on chip select CS1 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_code0_phy: Physical start address for the first external memory segment on CS1 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.14 mmu.ext_cs1_code0_size

Address: 0xFDE4

Reset: 0x0000

Type: RW

This register specifies the size of the first external memory segment on chip select CS1 to be mapped into code space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_code0_size: Size of the first external memory segment on CS1 to be mapped into code space. The allowed segment size range is 512 bytes (29) to 32M bytes (225).

RW

4.4.15 mmu.flash_code1_log

Address: 0xFDE6

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit logical start address for the second flash memory block mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

flash_code1_log: Logical start address for the second segment of internal flash memory mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.16 mmu.flash_code1_phy

Address: 0xFDE8

Reset: 0x0000

Type: RW

This register specifies the top 10 bits of the 19-bit physical start address for the second flash memory block mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

9:0

flash_code1_phy: Physical start address for the second segment of internal flash memory mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.17 mmu.flash_code1_size

Address: 0xFDEA

Reset: 0x0000

Type: RW

This register specifies the size of the second flash memory segment to be mapped into code space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

9:0

flash_code1_size: Size of second segment of internal flash memory to be mapped into code space. The allowed segment size range is 512 bytes (29) to 512K words (219).

RW

4.4.18 mmu.ext_cs0_code1_log

Address: 0xFDEC

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit logical start address for the second external memory segment on chip select CS0 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_code1_log: Logical start address for the second external memory segment on CS0 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.19 mmu.ext_cs0_code1_phy

Address: 0xFDEE

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the second external memory segment on chip select CS0 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_code1_phy: Physical start address for the second external memory segment on CS0 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.20 mmu.ext_cs0_code1_size

Address: 0xFDF0

Reset: 0x0000

Type: RW

This register specifies the size of the second external memory segment on chip select CS0 to be mapped into code space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_code1_size: Size of the second external memory segment on CS0 to be mapped into code space. The allowed segment size range is 512 bytes (29) to 32M bytes (225).

RW

4.4.21 mmu.ext_cs1_code1_log

Address: 0xFDF2

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit logical start address for the second external memory segment on chip select CS1 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_code1_log: Logical start address for the second external memory segment on CS1 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.22 mmu.ext_cs1_code1_phy

Address: 0xFDF4

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the second external memory segment on chip select CS1 mapped into code space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_code1_phy: Physical start address for the second external memory segment on CS1 mapped into code space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.23 mmu.ext_cs1_code1_size

Address: 0xFDF6

Reset: 0x0000

Type: RW

This register specifies the size of the second external memory segment on chip select CS1 to be mapped into code space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_code1_size: Size of the second external memory segment on CS1 to be mapped into code space. The allowed segment size range is 512 bytes (29) to 32M bytes (225).

RW

4.4.24 mmu.ram_data0_log

Address: 0xFDF8

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the internal RAM memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ram_data0_log: Logical start address for a segment of internal memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.25 mmu.ram_data0_phy

Address: 0xFDFA

Reset: 0x0000

Type: RW

This register specifies the top 6 bits of the 15-bit physical start address for the internal RAM memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

5:0

ram_data0_phy: Physical start address for a segment of internal memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.26 mmu.ram_data0_size

Address: 0xFDFC

Reset: 0x0000

Type: RW

This register specifies the size of the internal RAM (block 0) memory segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

5:0

ram_data0_size: Size of first segment of internal memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 32K bytes (215).

RW

4.4.27 mmu.ram_data1_log

Address: 0xFDFE

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the RAM memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ram_data1_log: Logical start address for a segment of memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.28 mmu.ram_data1_phy

Address: 0xFE00

Reset: 0x0000

Type: RW

This register specifies the top 6 bits of the 15-bit physical start address for the RAM memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

5:0

ram_data1_phy: Physical start address for a segment of RAM memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.29 mmu.ram_data1_size

Address: 0xFE02

Reset: 0x0000

Type: RW

This register specifies the size of the internal RAM (block 1) memory segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

5:0

ram_data1_size: Size of second segment of internal memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 32K bytes (215).

RW

4.4.30 reserved

Address: 0xFF02

Reset: 0x0000

Type: RW

This register is not available for use in the CyanIDE 2 environment.

4.4.31 mmu.flash_data0_log

Address: 0xFE06

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the first internal flash memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

flash_data0_log: Logical start address for a segment of internal flash memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.32 mmu.flash_data0_phy

Address: 0xFE08

Reset: 0x0000

Type: RW

This register specifies the top 10 bits of the 19-bit physical start address for the first internal flash memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

9:0

flash_data0_phy: Physical start address for a segment of internal flash memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.33 mmu.flash_data0_size

Address: 0xFE0A

Reset: 0x0000

Type: RW

This register specifies the size of the first internal flash memory segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

7:0

flash_data0_size: Size of segment of internal flash memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 128K bytes (217).

RW

4.4.34 mmu.flash_data1_log

Address: 0xFE0C

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the second internal flash memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

flash_data1_log: Logical start address for a segment of internal flash memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.35 mmu.flash_data1_phy

Address: 0xFE0E

Reset: 0x0000

Type: RW

This register specifies the top 10 bits of the 19-bit physical start address for the second internal flash memory block mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

9:0

flash_data1_phy: Physical start address for a segment of internal flash memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.36 mmu.flash_data1_size

Address: 0xFE10

Reset: 0x0000

Type: RW

This register specifies the size of the second internal flash memory segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

7:0

flash_data1_size: Size of segment of internal flash memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 128K bytes (217).

RW

4.4.37 mmu.cache_data_log

Address: 0xFE12

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the cache memory block mapped into data space. The cache memory block has a fixed size of 2048 words and a fixed physical start address of zero. The logical start address must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

cache_data_log: Logical start address for the cache memory block mapped into data space. This segment is a fixed size of 4096 bytes.

RW

4.4.38 mmu.ext_cs0_data0_log

Address: 0xFE14

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the external memory (cs0, data block0) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs0_data0_log: Logical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.39 mmu.ext_cs0_data0_phy

Address: 0xFE16

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the external memory (cs0, data block0) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_data0_phy: Physical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.40 mmu.ext_cs0_data0_size

Address: 0xFE18

Reset: 0x0000

Type: RW

This register specifies the size of the external memory (cs0, data block0) segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs0_data0_size: Size of segment of external memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 128K bytes (217).

RW

4.4.41 mmu.ext_cs1_data0_log

Address: 0xFE1A

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the external memory (cs1, data block0) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs1_data0_log: Logical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.42 mmu.ext_cs1_data0_phy

Address: 0xFE1C

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the external memory (cs1, data block0) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_data0_phy: Physical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.43 mmu.ext_cs1_data0_size

Address: 0xFE1E

Reset: 0x0000

Type: RW

This register specifies the size of the external memory (cs1, data block0) segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs1_data0_size: Size of segment of external memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 128K bytes (217).

RW

4.4.44 mmu.ext_cs0_data1_log

Address: 0xFE20

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the17-bit logical start address for the external memory (cs0, data block1) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs0_data1_log: Logical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.45 mmu.ext_cs0_data1_phy

Address: 0xFE22

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the external memory (cs0, data block1) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs0_data1_phy: Physical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.46 mmu.ext_cs0_data1_size

Address: 0xFE24

Reset: 0x0000

Type: RW

This register specifies the size of the external memory (cs0, data block1) segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs0_data1_size: Size of segment of external memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 128K bytes (217).

RW

4.4.47 mmu.ext_cs1_data1_log

Address: 0xFE26

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the external memory (cs1, data block1) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs1_data1_log: Logical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.48 mmu.ext_cs1_data1_phy

Address: 0xFE28

Reset: 0x0000

Type: RW

This register specifies the top 16 bits of the 25-bit physical start address for the external memory (cs1, data block1) segment mapped into data space. Both the logical and physical start addresses must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

15:0

ext_cs1_data1_phy: Physical start address for a segment of external memory mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.49 mmu.ext_cs1_data1_size

Address: 0xFE2A

Reset: 0x0000

Type: RW

This register specifies the size of the external memory (cs1, data block1) segment to be mapped into data space. The size of the segment in bytes is 512 x (register value + 1) and only register values of the form 2n - 1 (where n is an integer) are valid. Setting this register to any other value produces erroneous behaviour.

The register contains the following field.

Bits

Field

Type

7:0

ext_cs1_data1_size: Size of segment of external memory to be mapped into data space. The allowed segment size range is 512 bytes (29) to 128K bytes (217).

RW

4.4.50 mmu.usb_data_log

Address: 0xFE2C

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the USB peripheral register block mapped into data space. The USB register block has a fixed size of 2048 bytes and a fixed physical start address of zero. The logical start address must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ext_usb_data_log: Logical start address for the USB peripheral register block mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.51 mmu.emac_data_log

Address: 0xFE2E

Reset: 0x0000

Type: RW

This register specifies the top 8 bits of the 17-bit logical start address for the Ethernet MAC peripheral register block mapped into data space. The Ethernet MAC register block has a fixed size of 512 bytes and a fixed physical start address of zero. The logical start address must be an integer multiple of the segment size.

The register contains the following field.

Bits

Field

Type

7:0

ext_emac_data_log: Logical start address for the Ethernet MAC peripheral register block mapped into data space. The value in the register must be shifted up by 9 bits to get the actual start address.

RW

4.4.52 mmu.flash_ctrl

Address: 0xFE30

Reset: 0x0000

Type: RW

Flash memory control register. Generally these bits should be considered as configuration bits, but it is necessary to change their state while the processor is running. It is recommended that a slow CPU clock is selected before this register is updated.

The register contains the following fields.

Bits

Field

Type

15

cache_dis: When set to '1', this bit disables the data from the flash from being written back to the code cache.

RW

14:8

data_release: Allows separate control over the flash read time when the flash memory is set to slow mode operation. The flash memory access controller counts down from the value in the wait_states field, and the cycle completes after it reaches zero. When the flash memory is configured in slow mode, it is useful to end the read cycle early before the flash memory access cycle completes. In this mode, the complete read cycle time is 60µs, but read data is available after only 2µs. This field specifies the access controller count value at which the read cycle is released.

Note that it must never be set to a value greater than that in the wait_states bit field. If this occurs, then the next access to flash locks up the interface and the CPU stops execution.

RW

6:0

wait_states: This field specifies the number of additional CPU clock cycles that are required for flash memory read cycles.

RW

Wait states (fast mode)

CPU clock frequency

 

0

0 to <22.5MHz

 

1

22.5MHZ to <45MHz

 

2

45MHz to <67.5MHz

 

3

>67.5MHz

 

4.4.53 mmu.ram_ctrl

Address: 0xFE32

Reset: 0x0000

Type: RW

Internal RAM control register. Generally these bits should be considered as configuration bits, but it is necessary to change their state while the processor is running. It is recommended that a slow CPU clock is selected before this register is updated.

The internal RAM is divided into three banks. Bank 0 is always available, while banks 1 and 2 may be enabled or disabled by writing to the bank1_dis and bank2_dis bit fields.

Bank

Physical address

Function

Control

0

0x0000 to 0x3FFF
(0 to 16K bytes)

Main IRAM block

Always available for IRAM access

1

0x4000 to 0x4FFF
(16K to 20K bytes)

Optional extra IRAM

Normally enabled
Can be disabled to save power

2

0x5000 to 0x5FFF
(20K to 24K bytes)

Optional extra IRAM,
also used for USB endpoint data buffer

Normally enabled
Can be disabled to save power
Available for USB when disabled

The register contains the following fields.

Bits

Field

Type

5

bank2_dis: When set to '1', internal RAM bank 2 is disabled to save power (physical addresses 0x5000 to 0x5FFF). When this bank is disabled, it is still available for use as the USB endpoint buffer area.

W

4

bank1_dis: When set to '1', internal RAM bank 1 is disabled to save power (physical addresses 0x4000 to 0x4FFF).

W

3

if_clk_en: In normal operation, the internal register interface clock (if_clk) is enabled automatically only when required, to minimise power consumption. Writing a '1' to this bit field enables this clock at all times and disables the automatic power-saving feature.

RW

2

dma1_little_endian: When set to '1', 32 bit data on DMA channel 1 is stored in little-endian format in the SRAM, otherwise big-endian format is used. This bit must not be changed while a DMA operation is active.

RW

1

cache_dis: When set to '1', this bit disables writes back to the code cache when data is written to the internal RAM.

RW

0

read_wait_state: When set to '1', this bit enables an extra clock cycle for accesses to internal RAM. Default operation is single cycle access.

This bit is not required in normal operation, it is provided for testing.

RW

4.4.54 mmu.dma_ctrl

Address: 0xFE34

Reset: 0x0000

Type: RW

DMA control register for the USB and Ethernet MAC peripherals. These bits should not be changed while any DMA transfers are in progress.

The register contains the following fields.

Bits

Field

Type

12

emac_rd_prefetch_force: Normal operation is for the EMAC DMA read channel to prefetch only the next three long words of data after a DMA read. When this bit is set to '1', the DMA read channel always prefetches the next long word of data, provided the DMA read FIFO still has space available.

RW

11

emac_rd_prefetch_dis: Normal operation is for the EMAC DMA read channel to prefetch the next three long words of data after a DMA read. When this bit is set to '1', this prefetch is disabled and all DMA reads are on-demand.

RW

10

emac_rd_fifo_clr: When set to '1', this bit disables the EMAC DMA read transfer FIFO and clears its contents. When set to '0', the EMAC DMA read transfer FIFO is enabled.

RW

9

emac_wr_fifo_clr: When set to '1', this bit disables the EMAC DMA write transfer FIFO and clears its contents. When set to '0', the EMAC DMA write transfer FIFO is enabled.

RW

8

emac_clk_en: When set to '1', this bit enables the clock to the Ethernet MAC peripheral DMA interface. DMA transfers do not complete if this bit is not set.

W

4

usb_rd_prefetch_force: Normal operation is for the USB DMA read channel to prefetch only the next three long words of data after a DMA read. When this bit is set to '1', the DMA read channel always prefetches the next long word of data, provided the DMA read FIFO still has space available.

RW

3

usb_rd_prefetch_dis: Normal operation is for the USB DMA read channel to prefetch the next three long words of data after a DMA read. When this bit is set to '1', this prefetch is disabled and all DMA reads are on-demand.

RW

2

usb_rd_fifo_clr: When set to '1', this bit disables the USB DMA read transfer FIFO and clears its contents. When set to '0', the USB DMA read transfer FIFO is enabled.

RW

1

usb_wr_fifo_clr: When set to '1', this bit disables the USB DMA write transfer FIFO and clears its contents. When set to '0', the USB DMA write transfer FIFO is enabled.

RW

0

usb_clk_en: When set to '1', this bit enables the clock to the USB peripheral DMA interface. USB DMA transfers do not complete if this bit is not set.

W

4.4.55 mmu.adr_err

Address: 0xFE36

Reset: 0x0000

Type: RW

Address error interrupt status and clear register.

The register contains the following fields.

Bits

Field

Type

5

word_int_clr: Writing a '1' to this bit clears the word address error status bit and the address error exception.

W

4

word_sts: This field is set to '1' when there is a word address error, caused by a CPU word access to an odd byte address.

R

3

data_int_clr: Writing a '1' to this bit clears the data space address error status bit and the address error exception.

W

2

data_sts: This field is set to '1' when there is an MMU data space address error, caused by a CPU access to a logical address in data space that is not mapped.

R

1

code_int_clr: Writing a '1' to this bit clears the code space address error status bit and the address error exception.

W

0

code_sts: This field is set to '1' when there is an MMU code space address error, caused by a CPU access to a logical address in code space that is not mapped.

R

4.4.56 mmu.data_cache_sts

Address: 0xFE38

Reset: 0x0000

Type: RW

This register provides status information for the flash memory mini data cache (data prefetch buffer).

The register contains the following fields.

Bits

Field

Type

4

rst_hit_sts: Writing a '1' to this bit resets the hit status counter for the flash memory mini data cache (data prefetch buffer).

W

3:0

hit_sts: This field is for indication only. It contains a 4-bit (modulo 16) count of the number of mini data cache misses since the cache was enabled or since a '1' was written to the rst_hit_sts bit.

R

 


Contents
Previous Chapter
Next Chapter