beautypg.com

4 local memory, Local memory – Intel NETWORK PROCESSOR IXP2800 User Manual

Page 39

background image

Hardware Reference Manual

39

Intel

®

IXP2800 Network Processor

Technical Description

2.3.4.4

Local Memory

Local Memory is addressable storage within the Microengine. Local Memory is read and written

exclusively under program control. Local Memory supplies operands to the execution datapath as a

source, and receives results as a destination. The specific Local Memory location selected is based
on the value in one of the LM_ADDR registers, which are written by local_csr_wr instructions.

There are two LM_ADDR registers per Context and a working copy of each. When a Context goes

to the Sleep state, the value of the working copies is put into the Context’s copy of LM_ADDR.
When the Context goes to the Executing state, the value in its copy of LM_ADDR are put into the

working copies. The choice of LM_ADDR_0 or LM_ADDR_1 is selected in the instruction.

It is also possible to make use of both or one LM_ADDRs as global by setting

CTX_ENABLE[LM_ADDR_0_GLOBAL] and/or CTX_ENABLE[LM_ADDR_1_GLOBAL].
When used globally, all Contexts use the working copy of LM_ADDR in place of their own

Context specific one; the Context specific ones are unused. There is a three-instruction latency

when writing a new value to the LM_ADDR, as shown in

Example 1

.

LM_ADDR can also be incremented or decremented in parallel with use as a source and/or

destination (using the notation *l$index#++ and *l$index#--), as shown in

Example 2

, where three

consecutive Local Memory locations are used in three consecutive instructions.

Local Memory is written by selecting it as a destination.

Example 3

shows copying a section of

Local Memory to another section. Each instruction accesses the next sequential Local Memory

location from the previous instruction.

Example 4

shows loading and using both Local Memory addresses.

Example 1. Three-Cycle Latency when Writing a New Value to LM_ADDR

;some instruction to compute the address into gpr_m

local_csr_wr[INDIRECT_LM_ADDR_0, gpr_m]; put gpr_m into lm_addr

;unrelated instruction 1

;unrelated instruction 2

;unrelated instruction 3

alu[dest_reg, *l$index0, op, src_reg]

;dest_reg can be used as a source in next instruction

Example 2. Using LM_ADDR in Consecutive Instructions

alu[dest_reg1, src_reg1, op, *l$index0++]

alu[dest_reg2, src_reg2, op, *l$index0++]

alu[dest_reg3, src_reg3, op, *l$index0++]

Example 3. Copying One Section of Local Memory to Another Section

alu[*l$index1++, --, B, *l$index0++]

alu[*l$index1++, --, B, *l$index0++]

alu[*l$index1++, --, B, *l$index0++]

Example 4. Loading and Using Both Local Memory Addresses

local_csr_wr[INDIRECT_LM_ADDR_0, gpr_m]

local_csr_wr[INDIRECT_LM_ADDR_1, gpr_n]

;unrelated instruction 1

;unrelated instruction 2

alu[dest_reg1, *l$index0, op, src_reg1]

alu[dest_reg2, *l$index1, op, src_reg2]