EasyManua.ls Logo

NXP Semiconductors KL25 Series - Page 285

NXP Semiconductors KL25 Series
807 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
17.4.2.2 Decorated Load: Load-and-Set 1 Bit (LAS1)
This command loads a 1-bit field defined by the LSB position (b) into the core's general
purpose destination register (Rt) and sets the bit in the memory space after performing an
atomic read-modify-write sequence.
The extracted one bit data field from the memory address is right justified and zero filled
in the operand returned to the core.
The data size is specified by the read operation and can be byte (8-bit), halfword (16-bit)
or word (32-bit).
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
iolas1b 0 1 0 0 1 1 - - b b b - mem_addr
iolas1h
0 1 0 0 1 1 - b b b b - mem_addr 0
iolas1w
0 1 0 0 1 1 b b b b b - mem_addr 0 0
Figure 17-10. Decorated load address: load-and-set 1 bit
where addr[28:26] = 011 specifies the load-and-set 1 bit operation, addr[25:21] is "b", the
bit identifier, and mem_addr[19:0] specifies the address offset into the peripheral space
based at 0x4000_0000. The "-" indicates an address bit "don't care".
The decorated Load-and-Set 1 Bit read operation is defined in the following pseudo-code
as:
rdata = iolas1<sz>(accessAddress) // decorated load-and-set 1
tmp = mem[accessAddress & 0xE00FFFFF, size] // memory read
mask = 1 << b // generate bit mask
rdata = (tmp & mask) >> b // read data returned to core
tmp = tmp | mask // modify
mem[accessAddress & 0xE00FFFFF, size] = tmp // memory write
The cycle-by-cycle BME operations are detailed in the following table.
Table 17-6. Cycle definitions of decorated load: load-and-set 1-bit
Pipeline Stage Cycle
x x+1 x+2
BME AHB_ap Forward addr to memory;
Decode decoration; Capture
address, attributes
Recirculate captured addr +
attr to memory as slave_wt
<next>
BME AHB_dp <previous> Perform memory read; Form
bit mask; Extract bit from
rdata; Form (rdata | mask)
and capture destination data
in register
Return extracted bit to master;
Perform write sending
registered data to memory
Chapter 17 Bit Manipulation Engine (BME)
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc. 285

Table of Contents

Related product manuals