17.4.2.1 Decorated Load Load-and-Clear 1 Bit (LAC1)
This command loads a 1-bit field defined by the LSB position (b) into the core's general
purpose destination register (Rt) and zeroes 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
iolac1b 0 1 0 0 1 0 - - b b b - mem_addr
iolac1h
0 1 0 0 1 0 - b b b b - mem_addr 0
iolac1w
0 1 0 0 1 0 b b b b b - mem_addr 0 0
Figure 17-9. Decorated load address: load-and-clear 1 bit
where addr[28:26] = 010 specifies the load-and-clear 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-Clear 1 Bit read operation is defined in the following pseudo-
code as:
rdata = iolac1<sz>(accessAddress) // decorated load-and-clear 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-5. Cycle definitions of decorated load: load-and-clear 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
Functional Description
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
284 Freescale Semiconductor, Inc.