Lecture 4 On Chip Interfaces 2023
Lecture 4 On Chip Interfaces 2023
a.k.a., “Everything you wanted to know about a computer but were afraid to ask”
On-Chip Interconnect
Prof. Adam Teman
EnICS Labs, Bar-Ilan University
1 May 2023
This Lecture
Source: ARM
2 © Adam Teman,
May 1, 2023
Lecture Overview
3 © Adam Teman,
May 1, 2023
Higher
On-Chip Connecting with Simple Bus
Performance
Communication Peripherals Operation
Buses
On-Chip Communication
Typical Computing System
• On-Chip Interconnect
• Processors
• IP Blocks
• On Chip Memory
• Off-Chip Interconnect
• Off-chip peripherals
• Off-chip memory
• Off-chip ASICs
• In this lecture, we will focus
on On-Chip Interconnect
© Adam Teman,
May 1, 2023
Communication Considerations
System-level issues and specifications for choosing communication architecture:
• Communication Bandwidth
• Rate of information transfer (bytes/sec)
• Communication Latency
• Time delay between a request and response
• Application dependent, e.g., Video Streaming vs. two-way communication
• Master and Slave
• Who can control transactions? What can be controlled?
• Concurrency Requirement
• The number of independent simultaneous channels open in parallel.
• Multiple Clock Domains
• Different IPs may operate at different frequencies.
6 © Adam Teman,
May 1, 2023
System-level Trends
• Heterogeneity among components that need to be interconnected
• Increasing volume and diversity of traffic
• Complexity of
communication logic can
easily compare to a small
microprocessor!
7 © Adam Teman,
May 1, 2023
Interconnect Scaling Trends
• Global wires scale slower than
transistors/gates
• Gates, local wires scale with technology,
global wires do not
• Global on-chip comm to operation
delay changed from 2:1 to 9:1 over
a few technology generations
© Adam Teman,
May 1, 2023
On-Chip Communication Architecture Design
Three topics to consider when discussing on-chip communication architecture:
• Communication Topology
• How the communication resources are connected
• Simple shared bus, hierarchical bus structures,
rings, mesh, custom bus networks
• Protocols
• How you manage the communication resources
• Static priority, TDMA, round-robin, token passing
• Mapping of System Communications
• Which components connect where?
• e.g., exploit locality, by putting close
components on same bus Wingard, Kurosawa,
10 IEEE CICC, 1998
© Adam Teman,
May 1, 2023
Higher
On-Chip Connecting with Simple Bus
Performance
Communication Peripherals Operation
Buses
Connecting with
Peripherals
11
Connecting with Memory
• In our discussion of Microprocessors,
we assumed the existence of external memory components:
• In a Princeton Architecture, one homogenous memory space.
• In a Harvard Architecture, separate channels for Instruction and Data Memory
Source: Wolf,
Princeton Architecture Harvard Architecture Computers as Components
• Therefore,
we need a System Bus.
Source: Greaves, U. Cambridge
14 © Adam Teman,
May 1, 2023
System Bus
• A collection of signals (wires) to which one or more IP components
(which need to communicate data with each other) are connected.
• In addition to the clock, a synchronous bus consists of:
• An Address Bus
• A Data Bus
• A Control Bus
• In a typical system, the CPU serves
as the bus master (a.k.a. “manager”)
Source: Wolf,
and initiates all transfers. Computers as Components
(e.g., “start operation” command) as well as to transfer data to and from them.
16 © Adam Teman,
May 1, 2023
Bus Terminology
Slave
(Subordinate) 1
Address
Decoder Slave
(Subordinate) 2
Master
Multiplexor
(Manager) Select Slave
(Subordinate) 3
(Subordinate)
Multiplexor
Slave
Source: ARM
17 © Adam Teman,
May 1, 2023
Bus Terminology
• Master (or Manager)
• Component that initiates a read or write data transfer.
• Slave (or Subordinate) A bus can accommodate multiple
• Component that does not initiate transfers Masters and multiple Slaves
and only responds to incoming transfer requests.
• Decoder
• Determines which component a transfer is intended for.
• Bridge
• Connects two busses. Slave on one side and master on the other.
• Arbiter
• Controls access to the shared bus.
Selects master to grant access to bus.
18 © Adam Teman,
May 1, 2023
Basic Bus Topologies
• Shared bus
• Components share a single set of signals.
• Only one transaction can exist at a time.
• Hierarchical busses enable multiple transactions.
• Ring
• Very low cost connection (only connect to neighbor).
• Potential long propagation delay.
• Multiple concurrent transactions.
• Crossbar
• Point-to-point connection between all.
• Very high throughput, but very costly wiring.
• Can be reduced into partial crossbar/matrix.
19 © Adam Teman,
May 1, 2023
Higher
On-Chip Connecting with Simple Bus
Performance
Communication Peripherals Operation
Buses
20
How does communication work?
• Communication through ports consisting of:
• An Interface – set of pins/wires that connect the components.
• A Protocol – set of rules for changing the logic levels and meaning of data.
• Flow-control is implemented through handshaking
• Data is transferred when both the sender and receiver are happy to receive.
• “ack”s and “nack”s are used for communicating readiness.
• Communication is convened between:
• A Master – the port initiating the communication.
• A Slave – the port responding to the communication.
• Interfaces can be:
• Synchronous – both sides are clocked by the same clock.
• Asynchronous – data is transferred through a clock domain crossing.
21 © Adam Teman,
May 1, 2023
Handshaking
• In order to ensure that both devices are ready to communicate
over the bus, a handshaking protocol is required.
• A conceptual handshake protocol utilizes two signals:
• ENQ (enquiry) – from transmitter to receiver
• ACK (acknowledge) – from receiver to transmitter
• The four-cycle handshake process includes:
• Device 1 raises ENQ to initiate transfer
• Device 2 raises ACK, when
ready and transmission can start
• Device 2 lowers ACK to
signal that data was received
• Device 1 lowers ENQ to finish Source: Wolf,
Computers as Components
22 © Adam Teman,
May 1, 2023
Bus Arbitration
• Only one master can control the bus
• Need some way of deciding who is master
Arbiter
• And to make sure the right slave answers
• Arbitration Source: Ques10.com
Slave (Subordinate)
address to the address bus. transfer size at the same time
Master (Manager)
• At the same time, it sets control signals,
such as read or write and transfer size. Data bus
Send data back to processor
PSELn
• PSELx: the select line for each slave device PSLVERR
• PENABLE: indicates the 2nd cycle of an APB transfer APB
Bridge PENABLE
• PWRITE: indicates transfer direction (Write=H, Read=L) PWRITE
PWDATA: the write data bus (up to 32-bits wide) PREADY1
32
• PADDR
PREADY2
• PREADYX: used to extend a transfer 32
PWDATA
• PRDATA: the read data bus (up to 32-bits wide) PREADYn
• PSLVERR: indicates a transfer error (OKAY=L, ERROR=H)
25 © Adam Teman,
May 1, 2023
PWRITE
PWRITE
PSEL[1] Slave 1
1 2 3 PENABLE
PADDR[31:0] PRDATA[31:0]
PWDATA[31:0] PREADY[1]
PCLK PSEL[1:N]
Master PENABLE
PWRITE PRDATA[31:0] PWRITE
PREADY[1:N] PADDR[31:0]
PWDATA[31:0]
PADDR A0 A1 PSEL[2] Slave 2
PENABLE
PWDATA PRDATA[31:0]
D0 D1 PREADY[2]
Slave 1
• PWRITE, PADDR, PWDATA are set
Select
PSEL2 Slave 2 • PSEL is raised for selected Slave
PENABLE
• Access Phase 2
PWRITE
PSEL[1] Slave 1
1 2 3 PENABLE
PADDR[31:0] PRDATA[31:0]
PWDATA[31:0] PREADY[1]
PCLK PSEL[1:N]
Master PENABLE
PWRITE PRDATA[31:0] PWRITE
PREADY[1:N] PADDR[31:0]
PWDATA[31:0]
PADDR A0 A1 PSEL[2] Slave 2
PENABLE
PWDATA PRDATA[31:0]
PREADY[2]
PSEL1 Select
• Setup Phase 1
Slave 1 • PWRITE is lowered, PADDR is set
Select
PSEL2 Slave 2 • PSEL is raised for selected Slave
• Access Phase 2
PENABLE
• PENABLE is raised, with other signals held
PRDATA D0 • Slave raises PREADY and drives PRDATA
Can extend
to delay read • Next Transfer 3
PREADY1
• PENABLE is lowered by Master
PREADY2 • PREADY may be lowered by Slave
© Adam Teman,
May 1, 2023
See straightforward RTL implementation
29
Increasing Bus Performance
• The APB example was a simple low-performance bus
• Two-cycles to carry out a single transfer
• Each transfer requires the definition of address and data
• However, this can be easily improved by:
• Pipelining transfers:
Overlap Setup and Access phases
to achieve single-clock edge transfers.
• Burst operations:
Provide a single address with
multiple (sequential) data.
• Wide bus widths:
Support 64-bit, 128-bit, or even wider buses.
30 source: gruzovikpress.ru/
© Adam Teman,
May 1, 2023
Example: Advanced High-Performance Bus
• A more advanced bus defined within the AMBA specification
Decoder selects the correct is the Advanced High-Performance (AHB) bus.
slave according to the address. HWRITE
HREADY HADDR[31:0]
HRESP HWDATA[31:0]
HSIZE[2:0]
HRDATA[31:0] Master HBURST[2:0]
HRESETn HPROT[3:0]
HTRANS[1:0]
HCLK
HMASTLOCK
HSELx
HREADYOUT
HWRITE
HRESPx
HADDR[31:0]
HWDATA[31:0] HRDATAx[31:0]
HSIZE[1:0]
HBURST[2:0]
Slave
HPROT[3:0]
HTRANS[1:0] HRESETn
HMASTLOCK HCLK
HREADY
Source: ARM
Multiplexor multiplexes the correct read data bus
and response from the selected slave. © Adam Teman,
May 1, 2023
31
AHB Basic Read Operation
• An AHB transfer consists of two (overlapped) phases:
• The address phase: Master drives address and control signals onto the bus.
• The data phase: Selected Slave responds with HRDATA.
HREADY is lowered to extend the data phase
• The next address phase is applied during the current data phase.
HCLK
HRDATA [31:0]
Read Data 0 Read Data 1 Read Data 2
HWRITE
35 © Adam Teman,
May 1, 2023
Even More Performance
• To get even more performance, a bus can have the following capabilities:
• Independent read and write channels:
Simultaneous reads and writes → Improved bandwidth
• Multiple outstanding addresses:
Master can issue new transactions without waiting for previous to complete
• Out-of-order transaction completion:
A later transaction can complete before a previously launched one.
• Independent address and data operations:
If there is no strict timing relationship between address and data operations,
they can be arbitrarily separated
• These and other features are supported by the
Advanced eXtensible Interface (AXI) bus of the AMBA specification.
36 © Adam Teman,
May 1, 2023
The Advanced eXtensible Interface (AXI)
• AXI is an interface specification that defines the interface of IP blocks,
rather than the interconnect itself.
• AXI supports multiple masters (Managers)
and multiple slaves (Subordinates)
• AXI uses five main channels
(i.e., groups of signals) for communication:
• Write Address (AW)
• Write Data (W)
• Write Response (B)
• Read Address (AR)
• Read Data (R)
• Read response is passed as part of Read Data
37 Source: ARM © Adam Teman,
May 1, 2023
Channel handshake
• All channels have VALID (from source)
and READY (from destination) signals
• VALID remains high until
READY signal rises.
(1) Source Information is ready.
VALID goes high.
• Example of a more
complex transaction
Source: ARM
40 © Adam Teman,
May 1, 2023
Multi-Level Buses
• A microprocessor system often has more than one bus.
• Complexity: High speed buses are more complex (wider and implement
sophisticated protocols), often not required for simple, slower devices.
• Parallelism: Breaking up the bus can provide less contention between devices
that operate independently.
• A bridge connects two buses:
• Acts as a slave on one bus
(e.g., the fast bus)
• Acts as a master on the second
bus (e.g., the slow bus)
• Provides protocol translation
and speed synchronization.
Source: Wolf,
Computers as Components
41 © Adam Teman,
May 1, 2023
AMBA Multi-Level Approach PULPino architecture
https://pulp-platform.org/
Source: ARM
42 © Adam Teman,
May 1, 2023
References
• Anand Raghunathan, ECE 695R: System-on-Chip Design
• https://nanohub.org/courses/ECE695R/o1a
• Lectures 1.7, 4.1, 4.2
• Pasricha, Dutt, “On-Chip Communication Architectures”, 2008
• Flynn, Luk “Computer System Design: System-on-Chip”, 2011
• University of Texas, EE319K Introduction to Embedded Systems
• Circuits Basics “BASICS OF UART COMMUNICATION
• ARM AMBA Bus specifications
• ARM Education Kits
• AXI Protocol Overview,
https://developer.arm.com/documentation/102202/0200/AXI-protocol-overview
43 © Adam Teman,
May 1, 2023