Coherent Interconnects: ACE and CHI in One Picture
A snoop bus works for two caches. A chip with dozens of caching agents needs a fabric that knows where each line lives. Follow one read through ACE, then CHI, and see what the home node is for.
You Will Be Able To
- Name the snoop channels ACE adds to AXI and the node types and channels of CHI.
- Order the messages of a coherent read that finds the line dirty in another cache.
- Explain why a home node must snoop before it trusts memory.
- Lesson
- S9.4
- Time
- 30 min
- Runs on
- Your browser
- Check
- 5 questions
In S9.3 every cache watched one bus. Picture forty caches there, each checking its tags for every miss anyone makes, and almost always answering "not here".
ACE answers by adding snoop channels to AXI, and CHI by sending messages to a home node. Follow one read through both.
Before You Start
This lesson is senior material, and it is not yet rebuilt in the form of the lessons before it. It uses many names of two Arm specifications without defining each one.
You need Cache Coherence: MSI and MESI: the states of a line, snooping, and the holder of a dirty copy that answers in place of memory.
You need AXI: its five channels and the handshake on each. The Protocols track teaches them in AXI in One Picture and the three lessons after it. Inside an AXI Crossbar shows how an interconnect joins them.
Every Manager Is a Party
Start with ap_soc. Its AHB-Lite fabric has no snoop channels, and today no manager has a cache, so all of them see SRAM directly. Give the processor a data cache, and one DMA write leaves its copy old without anyone knowing.
- DMA
- AHB-Lite fabric
- SRAM
Read the chip as text
Managers connect to the AHB-Lite backbone. A bridge connects its peripheral window to APB. Arrows show request or signal direction. Dashed lines distribute clock and reset.
- AHB-Lite fabric · AHB-Lite fabric
- APB peripheral bus · APB peripheral bus
- ap_rv32 · Issues instruction fetches, loads and stores.
- JTAG debug · Provides external debug access to the core and fabric.
- AHB-to-APB bridge · Accepts AHB transfers and issues APB peripheral accesses.
- ap_crg · Distributes clocks and resets.
- Power control · Sequences supply domains.
- Pin mux · Selects the peripheral function connected to each pad.
- Boot ROM · Reset vector and boot code.
- ap_clint · Core-local timer and software interrupts.
- ap_plic · Platform interrupt controller, 16 sources.
- UART0 · Serial console.
- GPIO · 16 general-purpose pins.
- Timer / PWM · Timer and pulse-width modulation.
- Watchdog · Watchdog reset control.
- ap_sysctl · Chip ID, reset cause, clock control, pin mux and straps.
- SPI · SPI controller.
- DMA · DMA control registers; transfers use its AHB manager port.
- SRAM · Program and data memory.
- CLK · Package connection.
- RST · Package connection.
- JTAG · Package connection.
- UART TX · Package connection.
- UART RX · Package connection.
- GPIO pins · Package connection.
- CLK → ap_crg (clock)
- RST → ap_crg (clock)
- Power control → ap_crg (power)
- ap_crg → ap_rv32 (clock)
- ap_crg → AHB-Lite fabric (clock)
- ap_crg → Boot ROM (clock)
- ap_crg → APB peripheral bus (clock)
- ap_clint → ap_rv32 (interrupt)
- ap_plic → ap_rv32 (interrupt)
- AHB-Lite fabric → ap_clint (data)
- JTAG → JTAG debug (debug)
- DMA → AHB-Lite fabric (data)
- UART0 → Pin mux (data)
- GPIO → Pin mux (data)
- Pin mux → UART TX (data)
- UART RX → Pin mux (data)
- Pin mux → GPIO pins (data)
- ap_rv32 → AHB-Lite fabric (data)
- JTAG debug → AHB-Lite fabric (data)
- AHB-to-APB bridge → APB peripheral bus (data)
- AHB-Lite fabric → AHB-to-APB bridge (data)
- AHB-Lite fabric → Boot ROM (data)
- AHB-Lite fabric → ap_plic (data)
- APB peripheral bus → UART0 (data)
- APB peripheral bus → GPIO (data)
- APB peripheral bus → Timer / PWM (data)
- APB peripheral bus → Watchdog (data)
- APB peripheral bus → ap_sysctl (data)
- APB peripheral bus → SPI (data)
- APB peripheral bus → DMA (data)
- AHB-Lite fabric → SRAM (data)
- The DMA engine has no cache. CHI calls such a requester an RN-I (B1.6).
- ap_soc uses AHB-Lite here, with no snoop channels.
- The write lands in SRAM. A cached copy elsewhere is now old unless the fabric snooped it.
A coherent fabric answers one question on every request: does any cache hold a newer copy? The lab below is a model, not ap_soc RTL. Two caching requesters, a home and memory print each message by its specification name.
Both specifications use five full states (ACE D1.2.3, CHI B4.1). UC and UD are unique, SC and SD may be shared, and I is invalid. D means dirty. CHI adds partial and empty states, left out here.
Set beside S9.3, UC behaves like MESI's E and UD like its M. That comparison is ours, not the specifications'. One difference: an SC copy may differ from memory while another cache holds the line SD.
Snoop Channels Added to AXI
In S9.3 every cache heard every command, because all of them shared one bus. AXI has no such path, so ACE adds three channels for each caching manager (D1.3.2). AC brings a snoop address in, CR carries the one response every snoop needs, and the optional CD carries snooped data out.
The read data gains two response bits (D3.2.1). IsShared tells the requester to hold the line shared or unique. PassDirty tells it whether it now owes memory a write-back. RACK then tells the interconnect the read is done (D1.3.3).
Nodes and Channels in CHI
CHI drops the bus picture and sends messages between nodes (B1.6). A requester with a coherent cache is an RN-F. The home node, HN-F, owns coherence for its addresses, and memory sits behind a subordinate node, SN-F.
Every request for a line meets at its home, so one place decides the order and the snoops. The home is the point of coherence and is expected to be the point of serialisation (B1.3, B1.6). Messages use four channels: REQ, SNP, RSP for responses without data, and DAT (B2.1).
| Question | ACE (IHI 0022H.c) | CHI (IHI 0050 issue G) |
|---|---|---|
| Who decides what to snoop? | The interconnect | The home node, the point of coherence |
| How does the snoop arrive? | AC channel into each caching manager | A snoop message on SNP |
| Where does snoop data go? | CD channel to the interconnect only | To the home, or forwarded straight to the requester |
| How is the result reported? | RRESP bits IsShared and PassDirty | The state in the response, such as CompData_SC |
| How does the requester finish? | RACK | CompAck on RSP |
ACE sections D1.3, D3.2.1 and D3.7; CHI sections B1.6, B1.7 and B2.1.
A Read That Needs a Snoop
In the CHI view, RN-F1 takes the line with ReadUnique, then stores 5a with no message. A store to a Unique line is silent (B4.6), so memory still holds 00.
t1 RN-F1 -> HN-F REQ ReadUnique
t2 HN-F -> RN-F0 SNP SnpUnique
t3 RN-F0 -> HN-F RSP SnpResp_I
t4 HN-F -> SN-F REQ ReadNoSnp
t5 SN-F -> RN-F1 DAT CompData_UC data=00
t6 RN-F1 -> HN-F RSP CompAck
after the store: RN-F0=I RN-F1=UD memory=00
t7 RN-F0 -> HN-F REQ ReadShared
t8 HN-F -> RN-F1 SNP SnpShared
t9 RN-F1 -> HN-F DAT SnpRespData_SC_PD data=5a
t10 HN-F -> RN-F0 DAT CompData_SC data=5a
t11 RN-F0 -> HN-F RSP CompAck
t12 HN-F -> SN-F REQ WriteNoSnp
t13 SN-F -> HN-F RSP CompDBIDResp
t14 HN-F -> SN-F DAT NCBWrData data=5a
after the read: RN-F0=SC RN-F1=SC memory=5a- Processor
- Bus
- Memory
- Request
RN-F0 sends ReadShared on REQ.
- Snoop
The home sends SnpShared on SNP.
- Snoop data
RN-F1 returns the line, keeps SC and passes the dirt.
- Completion
CompData_SC goes to RN-F0, which answers CompAck.
- Clean memory
The home writes the line to the subordinate.
Read the diagram as text
- RN-F0: requester, holds I
- HN-F: home node
- RN-F1: requester, holds UD
- SN-F: subordinate: memory
- RN-F0 → HN-F: ReadShared
- HN-F → RN-F1: SnpShared
- RN-F1 → HN-F: SnpRespData_SC_PD
- HN-F → RN-F0: CompData_SC
- HN-F → SN-F: WriteNoSnp, NCBWrData
The S9.4 lab in CHI terms (B1.6, B2.1). The read matches the start of Figure B5.25; the clean follows Figure B5.4.
At t8 the home snoops RN-F1, which answers SnpRespData_SC_PD: here is the data, I keep SC, the dirt is yours. RN-F0 gets 5a at t10 and sends CompAck. The home now owes memory the write, paid at t12 to t14.
Two steps are our home's choices. Table B4.25 expects SnpSharedFwd for ReadShared, and B4.4.2 permits plain SnpShared instead. Table B4.46 expects UD to keep its dirt as SD; dropping to SC with PD is permitted.
Back at t5, memory sent the data straight to RN-F1: Direct Memory Transfer (B1.7). Now the same read in ACE.
t8 M0 -> ICN AR ReadShared
t9 ICN -> M1 AC ReadShared
t10 M1 -> ICN CR DataTransfer=1 PassDirty=1 IsShared=1
t11 M1 -> ICN CD data=5a
t12 ICN -> M0 R data=5a IsShared=1 PassDirty=0
t13 M0 -> ICN RACK
t14 ICN -> MEM AW+W write data=5a
t15 MEM -> ICN B OKAY
after the read: M0=SC M1=SC memory=5a- Processor
- Bus
- Memory
- Read address
M0 sends ReadShared on AR.
- Snoop
The interconnect snoops M1 on AC.
- Snoop answer
M1 answers on CR and sends the line on CD.
- Read data
M0 gets the line on R with IsShared set, then raises RACK.
- Clean memory
The interconnect writes the dirty line to memory.
Read the diagram as text
- Manager M0: loads, holds I
- Interconnect: snoops, then answers
- Manager M1: holds the line UD
- Memory: AXI subordinate
- Manager M0 → Interconnect: AR ReadShared
- Interconnect → Manager M1: AC snoop
- Manager M1 → Interconnect: CR + CD data
- Interconnect → Manager M0: R data, IsShared
- Interconnect → Memory: AW + W write
Architecture drawing of the S9.4 lab in ACE terms (IHI 0022H.c, D1.3 and D5.3.2).
The order matches: the request at t8, the snoop at t9, the answer at t10 and t11, then R, RACK and the write. But ACE snoop data always goes to the interconnect on CD, which returns it on R (D1.3.4). CHI can skip that hop.
Let the Owner Send the Data
In the CHI run, 5a crossed the fabric twice, at t9 and t10. Direct Cache Transfer cuts a hop (B1.7). The home sends one RN-F a forwarding snoop, such as SnpSharedFwd, naming the requester (B4.4.1). That cache sends CompData to the requester and a snoop response to the home. CompAck still goes to the home.
Snoop response names follow one pattern (B4.5.3). SnpResp carries no data and uses RSP. SnpRespData carries the line to the home on DAT. Then come the state the cache keeps, _PD if it passes the dirt, and _Fwded_ with the state it forwarded.
Must the line go to the home? For a plain snoop, dirty data always does, Shared Clean data only when RetToSrc is set, and Unique Clean data may. For a forwarding snoop with RetToSrc clear, clean data never does. Dirty data does only when the dirt can neither stay nor travel with the copy (B4.9).
For SnpShared, Table B4.46 expects the cache to give up only uniqueness. UC becomes SC, and UD becomes SD unless DoNotGoToSD is set (B4.10). S9.4.1 asks you to build both forwarding flows from these rules.
Why the Home Snoops First
Suppose the home skipped t8 and read memory at once. RN-F0 would fill with 00 while RN-F1 held 5a: the S9.3 bug, one level up. So the home must snoop a Unique Dirty holder (B4.4.1). In Figure B5.2 it sends ReadNoSnp only after the snoop response.
To avoid snooping everyone, a home keeps a snoop filter of requesters that may hold each line (B1.6). Clean lines drop silently (B4.6), so an entry may be stale, which only wastes a snoop. Missing a holder is the real bug, and S9.4.2 hands you one.
From a Crossbar to a Packet Network
A crossbar is simple and ordered but suits few nodes. A ring trades wiring for latency, and a mesh scales by adding rows and columns of switches (B1.2). So each CHI packet carries source and target node IDs (B1.3, B3.2). A system address map turns an address into the home's node ID (B3.1), like S4.1's memory map one level up.
What the Full Specifications Add
CHI also defines exclusive accesses (B6), cache stashing (B7), DVM (B8), error handling (B9) and memory tagging (B12). A credited link layer sits below (B13, B14). ACE adds barriers and DVM messages (D1.2.1). A full CHI module belongs to the Protocols track.
At Scale
The lab has one home and two requesters. A server mesh has many homes, each owning a slice of the addresses.
Spread the homes
The address map spreads lines across several home nodes, so no single point serialises the chip.
Filter the snoops
An imprecise filter wastes snoops. A filter that misses a holder returns stale data.
Shorten the path
Direct Memory and Direct Cache Transfer send data straight to the requester, removing a hop (B1.7).
Order the Messages of a Shared Read practises the flows; A Home Node That Skips the Snoop breaks the promise.
Try It
Sources for the Flows
Arm AMBA CHI Architecture Specification, IHI 0050 issue G: B1.6, B1.7, B2.1, B4.1, B4.4, B4.5.3, B4.6, B4.9 and B4.10.
The same specification: Tables B4.25 and B4.46 and Figures B5.2 to B5.4 and B5.25.
Arm AMBA AXI and ACE Protocol Specification, IHI 0022H.c: D1.2.3, D1.3, D3.2.1 and D3.7.
The same specification: Table D5-8 for snoop responses.
Teaching choices of this model: the home with no snoop filter, the plain SnpShared and the SC end state.
The 8-bit line and the immediate memory write are teaching choices too.
Run with VIEW = 0, then VIEW = 1. Match each CHI line to its ACE line.
Find the message that tells the home RN-F1 kept a copy. Which part of its name says so?
Remove the store that makes RN-F1 Unique Dirty and run again. Which path does the read take now?
t1 RN-F1 -> HN-F REQ ReadUnique t2 HN-F -> RN-F0 SNP SnpUnique t3 RN-F0 -> HN-F RSP SnpResp_I t4 HN-F -> SN-F REQ ReadNoSnp t5 SN-F -> RN-F1 DAT CompData_UC data=00 t6 RN-F1 -> HN-F RSP CompAck after the store: RN-F0=I RN-F1=UD memory=00 t7 RN-F0 -> HN-F REQ ReadShared t8 HN-F -> RN-F1 SNP SnpShared t9 RN-F1 -> HN-F DAT SnpRespData_SC_PD data=5a t10 HN-F -> RN-F0 DAT CompData_SC data=5a t11 RN-F0 -> HN-F RSP CompAck t12 HN-F -> SN-F REQ WriteNoSnp t13 SN-F -> HN-F RSP CompDBIDResp t14 HN-F -> SN-F DAT NCBWrData data=5a after the read: RN-F0=SC RN-F1=SC memory=5aCheck Yourself
Common Mistakes
Wrong Read memory as soon as the request arrives.
A Unique Dirty copy elsewhere makes memory stale.
Fix Snoop the holder first and use its data when it returns some.
Wrong Treat a snoop filter entry as proof that a cache holds the line.
Clean lines can be dropped silently, so entries may be stale.
Fix Keep the filter a superset and expect SnpResp_I sometimes.
Wrong Expect ACE to forward data between caches.
ACE snoop data goes to the interconnect on CD.
Fix Use CHI forwarding snoops for Direct Cache Transfer.
Remember
- ACE adds AC, CR and CD channels and the IsShared and PassDirty bits to AXI.
- CHI sends messages between requester, home and subordinate nodes on REQ, SNP, RSP and DAT.
- A home must snoop a Unique Dirty holder before memory may answer.