User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 98
UG585 (v1.11) September 27, 2016
Chapter 3: Application Processing Unit
3.4.5 Enabling and Disabling the L2 Cache Controller
The L2 cache is disabled by default and can be enabled by setting bit 0 of the L2 cache control
register independently of the L1 caches. When the cache controller block is not enabled, depending
on their addresses, transactions pass through to the DDR memory or the main interconnect on the
cache controller master ports. The address latency introduced by the disabled cache controller is one
cycle in the slave port from the SCU plus one cycle in the master ports.
3.4.6 RAM Access Latency Control
The L2 cache data and tag RAMs use the same clock as the Cortex-A9 processors; however, it is not
feasible to access these RAMs in a single cycle when the clock runs at its maximum speed. To address
this issue, the L2-cache controller provides a mechanism to adjust the latencies for the write access,
read access, and setup of both RAM arrays by respectively setting bits [10:8], [6:4], and [2:0] of its tag
RAM and data RAM latency control registers. The default value for these fields is 3'b111 for both
registers, which corresponds to the maximum latency of eight CPU_6x4x cycles for the three
attributes of each RAM array. Because these large latencies result in very poor cache performance,
the software should program the attributes as follows:
Set the latencies for the three tag RAM attributes to 2 by writing 3'b001 to bits [10:8], [6:4],
and [2:0] of the tag RAM latency control register.
Set the latencies for the write access and setup of the data RAM to 2 by writing 3'b001 to bits
[10:8] and [2:0] of the data RAM latency control register.
Set the read access latency of the data RAM to 3 by writing 3'b010 to bits [6:4] of the data RAM
latency control register.
3.4.7 Store Buffer Operation
Two buffered write accesses to the same address and the same security bit cause the first write
access to be overridden if the controller does not drain the store buffer after the first access. The
store buffer has merging capabilities, so it merges successive writes to the same line address into the
same buffer slot. This means that the controller does not drain the slots as soon as they contain data,
but rather waits for other potential accesses that target the same cache line. The store buffer
draining policy is as follows. Slave port refers to the port from the SCU to the L2 cache controller:
The store buffer slot is immediately drained if targeting device memory area.
The store buffer slots are drained as soon as they are full.
The store buffer is drained at each strongly-ordered read occurrence in the slave port.
The store buffer is drained at each strongly ordered write occurrence in the slave port.
If the three slots of the store buffer contain data, the least recently accessed slot is drained.
If a hazard is detected with one store buffer slot, it is drained to resolve the hazard. Hazards can
occur when data is present in the cache buffers, but not yet present in the cache RAM or
external memory.
The store buffer slots are drained when a locked transaction is received by the slave port.
The store buffer slots are drained when a transaction targeting the configuration registers is
received by the slave port.