AMBA AHB Protocol Presentation
AMBA AHB Protocol Presentation
By: A R. Chaurasiya
June 2008
• Features Agenda
• AMBA Based System
• AHB Components
• AHB Signal Descriptions
• AHB Single Read/Write
• AHB Control Signals
• AHB Burst Operation
• Address Decoding
• Slave Responses
• Data Buses
• Arbitration
• Split Transfers
Features
• Master
• Slave
• Arbiter
• AHB Signal Descriptions
• Arbitration Signals
AHB Master
AHB Slave
AHB Arbiter
AHB Signal Descriptions
Arbitration Signals
Single Read/Write
Master Drives Address & Control signals after rising edge of HCLK.
Slave Samples the Address & Control information on the next rising edge of the
HCLK.
Then slave drives the appropriate response.
This is sampled by master on the third rising edge of the clock.
Transfer with wait states
For Write Operations bus master will hold the data stable throughout the extended
cycles.
For read transfers the slave does not have to provide valid data untill the transfer is
about to complete
Multiple Transfers
Transfer to addresses A & C are both zero wait states .
The transfer to address B is one wait state.
Extending the data phase of the transfer to address B has the effect of extending
the address phase of the transfer to address C.
Control Signals
• provide additional information about a bus access and are primarily intended
for use by any module that wishes to implement some level of protection.
• Indicates :
– An opcode fetch or data access
– A privileged mode access or user mode access.
– Bufferable or Not Bufferable.
– Cacheable or Not Cacheable.
AHB Burst Operation
• Four, eight and sixteen-beat bursts are defined in the AMBA AHB
protocol,
• Undefined-length bursts and single transfers.
• Both incrementing and wrapping bursts are supported in the protocol.
• The total amount of data transferred in a burst is calculated by
multiplying the number of beats (as indicated by HBURST) by the
amount of data in each beat(as indicated by HSIZE[2:0]).
• All transfers within a burst must be aligned to the address boundary
equal to the size of the transfer.
Burst Examples: 4 beat Wrapping Burst
Burst Examples: 4 beat Incrementing Operation
Burst Example: Undefined length Bursts
Address Decoding
Address Decoding
• A slave must only sample the address and control signals and HSELx
when HREADY is HIGH.
• The minimum address space that can be allocated to a single slave is
1kB.
• All bus masters are designed such that they will not perform
incrementing transfers over a 1kB boundary, thus ensuring that a burst
never crosses an address decode boundary.
• A default slave should be implemented to provide a response when any
of the nonexistent address locations are accessed.
• If a NONSEQUENTIAL or SEQUENTIAL transfer is attempted to a
nonexistent address location then the default slave should provide an
ERROR response.
• IDLE or BUSY transfers to nonexistent locations should result in a zero
wait state OKAY response.
Slave Responses
• HRESP description
• Slave Response Rules
• Two Cycle Responses
• Transfer with a Retry Response
• Transfer with a Error Response
• SPLIT & RETRY
HRESP Description
Slave Response rules
If a slave provides an ERROR response then the master may choose to cancel the
remaining transfers in the burst.
However, this is not a strict requirement and it is also acceptable for the master to
continue the remaining transfers in the burst.
A slave which issues RETRY responses must only be accessed by one master at a
time. It is not enforced by Protocol but should be ensured by system architecture.
Transfer with a Error Response
• A bus master uses the HBUSREQx signal to request access to the bus and may
request the bus during any cycle.
• The arbiter will sample the request on the rising of the clock and then use an
internal priority algorithm to decide which master will be the next to gain access
to the bus.
• When a master is granted the bus and is performing a fixed length burst it is not
necessary to continue to request the bus in order to complete the burst.
• The arbiter observes the progress of the burst and uses the HBURST[2:0]
signals to determine how many transfers are required by the master.
• If the master wishes to perform a second burst after the one that is currently in
progress then it should re-assert the request signal during the burst.
• If a master loses access to the bus in the middle of a burst then it must re-assert
the HBUSREQx request line to regain access to the bus.
• For undefined length bursts the master should continue to assert the request
until it has started the last transfer.
• if a master does not require access to the bus it drives the transfer type
HTRANS to indicate an IDLE transfer.
Granting Bus Access
• The arbiter indicates which bus master is currently the highest priority
requesting the bus by asserting the appropriate HGRANTx signal.
• When the current transfer completes, as indicated by HREADY
HIGH, then the master will become granted and the arbiter will change
the HMASTER[3:0] signals to indicate the bus master number.
Bus Handover after Burst
The arbiter changes the HGRANTx signals when the penultimate (one
before last) address has been sampled.
The new HGRANTx information will then be sampled at the same point as
the last address of the burst is sampled.
Early Burst Termination
• Every system must include a default bus master which is granted the
bus if all other masters are unable to use the bus.
• When granted, the default bus master must only perform IDLE
transfers.
• If no masters are requesting the bus then the arbiter may either grant
the default master or alternatively it may grant the master that would
benefit the most from having low access latency to the bus.
• Granting the default master access to the bus also provides a useful
mechanism for ensuring that no new transfers are started on the bus
and is a useful step to perform prior to entering a low-power mode of
operation.
• The default master must be granted if all other masters are waiting for
SPLIT transfers to complete.
Split Transfers
• SPLIT transfers improve the overall utilization of the bus by separating (or
splitting) the operation of the master.
• When a transfer occurs the slave can decide to issue a SPLIT response if it
believes the transfer will take a large number of cycles to perform.
• This signals to the arbiter that the master which is attempting the transfer
should not be granted access to the bus until the slave indicates it is ready to
complete the transfer.
• During every transfer the arbiter broadcasts a number, or tag, showing which
master is using the bus using HMASTER[3:0].
• Therefore the arbiter is responsible for observing the response signals and
internally masking any requests from masters which have been SPLIT.
• Later, when the slave can complete the transfer, it asserts the appropriate bit,
according to the master number, on the HSPLITx[15:0] signals from the slave
to the arbiter.
• Eventually the arbiter will grant the master so it can re-attempt the transfer. This
may not occur immediately if a higher priority master is using the bus.
• When the transfer eventually takes place the slave finishes with an OKAY
transfer response.
Split Transfer