Ahb Questions
Ahb Questions
Ahb Questions
Arbitration: What is the relationship between the HLOCK signal and the
HMASTLOCK signal?
Applies to: AHB
At the start of the address phase of every transfer the arbiter will sample the
HLOCK signal of the master that is about to start driving the address bus and if
HLOCK is asserted at this point then HMASTLOCK will be asserted by the arbiter
for the duration of the address phase of the transfer.
Arbitration: When can the HGRANT signal change?
Applies to: AHB
The HGRANT signal can change in any cycle and the following cases are
possible:
It is possible that the HGRANT signal may be asserted and then removed
before the current transfer completes. This is acceptable because the
HGRANT signal is only sampled by masters when HREADY is high.
The above point also means that it is possible to be granted the bus in the
same cycle that it is requested. This can occur if the master is
coincidentally granted the bus in the same cycle that it requests it.
In general, an AHB master should not change control signals whilst HREADY is
low. However it is allowable to change HTRANS in the following conditions:
HTRANS = IDLE
The AHB master is performing internal operations and has not yet
committed to a bus transfer. However during the AHB wait states
(HREADY low) the master may determine that a bus transfer is required
and change HTRANS on the next cycle to NONSEQ.
HTRANS = BUSY
HTRANS is being used to give the master time to complete internal
operations, which may be entirely independent of HREADY (i.e. wait
states on the AHB). Therefore HTRANS can change on the next cycle to
any legal value, i.e. SEQ if the burst is to continue, IDLE if the burst has
completed, NONSEQ if a separate burst is to begin.
HRESP = SPLIT/RETRY
As stated in the AHB specification, a master must assert IDLE on HTRANS
during the second cycle of the two-cycle SPLIT or RETRY slave response
so HTRANS will change value from the first cycle to the second cycle of
the response.
HRESP = ERROR
The master is permitted to change HTRANS in reaction to an ERROR
response in the same way as in reaction to a SPLIT/RETRY response and
cancel any further beats in the current burst (even if HBURST is indicating
a defined-length burst). In this case HTRANS changes to IDLE on the
second cycle of the response. Alternatively, the master is permitted to
continue with the current transfers.
ERROR response.
General: Can an AHB master be connected directly to an AHB slave?
Applies to: AHB
Any slave which does not use SPLIT responses can be connected directly to an
AHB master. If the slave does use SPLIT responses then a simplified version of
the arbiter is also required.
If an AHB master is connected directly to an AHB slave it is important to ensure
that the slave drives HREADY high during reset and that the select signal HSEL
for the slave is tied permanently high.
General: Do all slaves have to support the BUSY transfer type?
Applies to: AHB
Yes. All slaves must support the BUSY transfer type to ensure they are
compatible with any bus master.
General: Does the address have to be aligned, even for IDLE transfers?
Applies to: AHB
Yes. The address should be aligned according to the transfer size (HSIZE) even
for IDLE transfers. This will prevent spurious warnings from bus monitors used
during simulation.
General: How many masters can there be in an AHB system?
Applies to: AHB
The AHB specification caters for up to 16 masters. However, allowing for a
dummy bus master means the maximum number of real bus masters is actually
15. By convention bus master number 0 is allocated to the dummy bus master.
General: How should AHB to APB bridges handle accesses that are not
32-bits?
Applies to: AHB, APB
The bridge should simply pass the entire 32-bit data bus through the bridge.
Please note that when transfers less than 32-bits are performed to an APB slave
it is important to ensure that the peripheral is located on the appropriate bits of
the APB data bus.
@(
negedge
(HRESETn)
or
posedge
if
HMASTLOCK
<=
if
HMASTLOCK
<=
(HCLK)
)
begin
((!HRESETn))
1'b0;
else
begin
(HREADY)
HLOCK;
end
end
The following examples show some of the sequences of HTRANS that can occur
on the bus:
A normal burst of four transfers followed by an IDLE.
N-S-S-S-I
A normal burst of four transfers which includes BUSY transfers.
N-S-B-S-B-S-I
A burst of four transfers followed by another burst.
N-S-S-S-N-S-S-S-I
A single transfer followed by a burst of four transfers.
N-N-S-S-S-I
A single transfer followed by an IDLE
N-I
An undefined length burst which concludes with a BUSY transfer.
N-B-S-B-S-B-I
An undefined length burst which concludes with a BUSY transfer and is followed
immediately by another burst.
N-B-S-B-S-B-N-S
How do you connect an AHB slave to an AHB-lite system?
Applies to: AHB
AHB slaves are fully AHB-lite compatible, so can be connected directly, unless
they generate SPLIT or RETRY responses.
If the AHB slave generates RETRY responses, you will need an Ahb2Ahb bridge
(there are several examples in ARM's AMBA Design Kit (ADK)) between the AHB
slave and the AHB-lite system. This Ahb2Ahb bridge will locally service the
RETRY response, while holding HREADY low (1'b0) to the AHB-lite system.
If the AHB slave generates SPLIT responses then in addition to the Ahb2Ahb
bridge required for RETRY responses, you would also need a local Dummy
master and an Arbiter. SPLIT responses require the arbiter to grant a different
master, so we need the dummy master on this local full-AHB bus to drive IDLE
cycles until the slave is able to complete the SPLIT transfer.
How does AHB differ from AHB-lite?
Applies to: AHB
AHB-lite is a simplified version of the full AMBA 2 AHB specification, supporting
only a single Master.
This removes the need for arbitration signals, HBUSREQ and HGRANT, and
HRESP only needs to be 1 bit as SPLIT and RETRY slave responses are only used
for multi-master support.
The removal of any arbitration logic also means the AHB Master HLOCK output
(driven ahead of the LOCKed transfer address phase) needs to be retimed to be
the address phase aligned HMASTLOCK signal (a function usually performed by
the AHB arbiter).
How many clock cycles should the reset signal in an AMBA system be
asserted for?
Applies to: AHB, APB
It is recommended that master and slave components should clearly state if
they have a reset requirement greater than 1 or 2 cycles. It is also
recommended that the system design should hold reset asserted for at least 16
cycles, unless it is known that a master or slave component has a longer reset
requirement.
How does the AHB handle LOCKed SPLITs?
Applies to: AHB
When a transfer is SPLIT the arbiter degrants and removes the SPLIT master out
of the arbitration until the slave indicates that the transfer can complete. When
architecture without defining the architecture itself. This provides the system designer with the
flexibility to create architectures ranging from a simple 'point-to-point' connection through to
complex, high performance architectures. AHB-Lite, a subset of AHB enables further simplification
and increased performance for interconnect with only a single master while the Multi-layer AHB
architecture allows the system designer to dramatically increase the capacity, and hence
performance, of the architecture.
Some of the features..
1.
2.
3.
4.