AXI AHB Interview Notes
AXI AHB Interview Notes
Amba AXI is targeted at high performance , suitable for high-speed submicron connect .
Features:
1.separate address/control and data phases
2.support for unaligned data transfer using byte strobes
3. Its backward compatible with existing AHB and APB interface
Architecture:
1.Axi protocol is burst based ,
2.every transaction has address and control information on the address channel
3. Total 5 channels
I have seen many IP providers e.g. Synopsys supporting burst lengths up to 256 beats in AXI3
I have also seen many IP providers e.g. Synopsys NOT supporting write interleaving in AXI3.
Looks like the industry norm is to use AXI3 with burst lenghts up to 256 beats without support
for write Interleaving.
In this specification,
Axqos:indicates AW Q O S or ARQOS.
The protocol does not specify the exact use of the qos identifier. This specification recommends
that axqos is used as a priority indicator for the associated write or read transaction. A higher
value indicates a higher priority transaction.A default value of 0b0000.indicates that the
interface is not participating in any qos scheme.
Note
Additional interpretations of the qos identifier can be used.
There needs to be a mechanism where a response is required back from the destination.
In case of read, the response can be the data, but it is actually the response that follows
the data on the same read channel, which comes from the destination
In case of write, there is NO data flow from destination to source if there was no response
channel
Now since the response always follows the data, the response channel in case of read is the
same as data channel
But in case of write, the response channel has to be separate as the ONLY channel from
destination to source.
Why there was no Write response for each beat in burst Write. But there is a seperate Read
response for each beat in a Read burst ?
All of the AXI channels pass information in only 1 direction (only the xready signal goes against
the channel direction), so for a slave to give a response back to the master for a write
transaction, would need a separate channel.
RRESP[1:0]=Slave=>data channel
Read response. This signal indicates the status of the read transfer. The allowable responses
Are OKAY, EXOKAY, SLVERR, and DECERR
I guess this channel could have been defined to include a BRESP for each write data item, but
this would increase the bandwidth requirement for this channel, and as in most applications
you will just repeat the complete transaction for a non-OKAY response, few applications would
make use of the additional detail of which transfer in a write burst caused a failure.
You do give a RRESP response for each read data item because the higher bandwidth channel is
already there,
Difference between AHB and AXI?/ Name five special features of AXI?/ How AXI is different
from AHB?
1. AHB is Advanced High-performance Bus and AXI is Advanced extensible Interface.
2. When the Advanced High-performance Bus is a single channel Bus, the Advanced extensible
Interface is a multi- channel Bus.
3. In AHB, each of the bus masters will connect to a single-channel shared bus. On the other
hand, the bus master in AXI will connect to a Read data channel, Read address channel, Write
data channel, Write address channel and Write response channel.
4. The AHB is also a shared Bus whereas the AXI is a read/write optimized bus.
5. Bus latencies in AHB starts lower than the AXI.
6. The Advanced extensible Interface uses around 50 per cent more power, which means that
AHB has an edge over it.
7. AHB Bus utilization is higher than AXI utilization
8.In AXI - once you initiate a transaction, unless you get a response back, you cannot initiate
next transaction.In AHB - hope split-retry mechanism is available, with which the next
transaction can be initiated, without responding for the first transaction
which means that as the both the masters are accessing the same slave, when Master1 is in idle
state during the transaction then interconnect will perform the Master2 transaction.
This happens only in AXI3 where as in AXI4 the Data interleaving is removed as there is no WID
for the Data channel.
How to terminate A read/write burst ? Specification says we can not stop bursts
intermittently.
Answer : Simple answer, you cannot.
AXI=>As soon as the AXI master indicates that it will perform X number of transfers in a
transaction, it must complete X transfers. There is no "Early Burst Termination" concept like
there was in AHB.
For write transactions the master could complete the burst, but driving the WSTRB bits all to
logic '0' (dummy accesses) so that no data is actually being transferred to the slave, but for read
transactions there is no equivalent, and so "real" read accesses will be completed.
WSTRB[3:0]=Master=>Write Data channel signal and their is no similar signal with read data
channel
Write strobes. This signal indicates which byte lanes to update in memory. There is one
Write strobe for each eight bits of the write data bus. Therefore,
WSTRB[n] corresponds to WDATA[(8×n) + 7:(8×n)].
AHB=>In AHB Bursts can be early terminated either as a result of the Arbiter removing the
HGRANT to a master part way through a burst, or after a slave returns a non-OKAY response to
any beat of a burst. Note however that a master cannot decide to terminate a defined length
burst unless prompted to do so by the Arbiter or Slave responses.
All AHB Masters, Slaves and Arbiters must be designed to support Early Burst Termination.
In the same way if slave asserts RLAST before the completion of a busrt read?
If the slave drives RLAST (and RVALID) too early, this too is a protocol violation, and just as for
the WLAST signal, some masters might not be monitoring RLAST, so this illegal use could be
missed anyway.
If WLAST and RLAST can not do the above cases, then what is the special use of WLAST and
RLAST because we are getting individual beat responses anyway?
WLAST and RLAST can be used by masters and slaves that need to be told when the final data in
a burst is being transferred. Most masters and slaves will count the data coming in against how
many transfers were indicated on AWLEN and ARLEN, so in these designs the xlast inputs would
not be required.
AWLEN[3:0]=Master
Burst length. The burst length gives the exact number of transfers in a burst. This
information determines the number of data transfers associated with the address.
ARLEN[3:0]=Master
Burst length. The burst length gives the exact number of transfers in a burst. This
information determines the number of data transfers associated with the address
However to support all master and slave designs, masters must always drive WLAST when
appropriate, and slaves must drive RLAST.
Whats the exact use of Exclusive Read and Write Pair transaction? Where exactly these will
be used?
The basic process for an exclusive access is:
1. A master performs an exclusive read from an address location.
2. At some later time, the master attempts to complete the exclusive operation by performing
an exclusive write to the same address location.
3. The exclusive write access of the master is signalled as:
• Successful if no other master has written to that location between the read and write
accesses.
• Failed if another master has written to that location between the read and write accesses. In
this case the address location is not updated.
Eg:-Now consider a system in which two AXI master devices are using same memory or we can
say in technical term using shared memory. And as a system designer you always will make sure
that at a time your one master does not overwrite your memory written by another master.
Consider AXI Master 1 (M1) has initiated exclusive read transaction for address location
12'h100 to 12'h10F. Now slave will start monitoring these addresses for ARID given by M1. Now
till exclusive write operation is performed slave monitors that address and if that address is
changed by another master M2 it will give indication of exclusive access failure during the
exclusive write transaction and memory is dose not get updated by M1.
What happened in above scenario is that Slave has reserved some memory resource for M1
virtually by given exclusive read request from master. When master comes for write transaction
for that memory location slave will allow to write that memory resource if only if another
master device is not using that memory resource other wise data is not written to memory
resource.
This way we can avoid memory overwrite problem for shared memory using EXCLUSIVE Access
in AXI.
or
I have directly written advantage of EXCLUSIVE ACCESS in AXI to know more how Exclusive
Access
If you have a shared area of memory used for passing control information between masters (or
processes running on a master), you want to make sure that you complete the READ/WRITE
sequence without another master changing the shared location.
If your master read the shared memory location, and it was changed by another master before
your master could complete the subsequent write to that location, the interim write from the
other master would be lost, which could have an impact on how your system works (control
information lost)
So Exclusive Accesses are a hardware mechanism to support the software, indicating to the
master when it did have uninterrupted access to the shared location, meaning that no write
accesses from other masters will be accidentally overwritten.
If ARREADY is initially low when an address is signaled on ARVALID, it will take one clock cycle
for the slave to sample this ARVALID and then assert ARREADY (if it can accept the address),
and the address handshake then completes on the next clock rising edge (when both ARREADY
and ARVALID are high). So 2 clock cycles just to pass the address from master to slave if
ARREADY defaults to LOW.
It would then take at least a further clock cycle before the read data could be returned to the
master.
"By using AXI IDs, a master can issue transactions without waiting for earlier transactions to
complete".
"When asserted, AWVALID must remain asserted until the rising clock edge after the slave
asserts AWREADY".
Can someone explain how these two are possible? Say for example, the slave doesn't assert
AWREADY?
In this case, can the master sill issue transactions without waiting for earlier transactions to
complete? I DONT think so!!!
Only one command on one channel(read/write/write data/read data/cmpl) may be issued at
a time. Unless this command
is accepted by the Slave, No command on the same channel may be issued, with or without
AXI ID?
Here is an example what this actually means:
If a master wants 2 kinds of data, and if there were no ID facility in AXI, then the master would
not be able to issue say read transactions in a read,read,read,read fashion, without worrying
about the return data. I.e. The Master would not be able to pipeline reads to facilitate
continuous data stream. This is because, the master would have no way
to identify which return data belongs to which 'kind'. However by attaching ID the master can
issue read0,read1,read0,read0,read1, and pipeline the 2 kinds of data to form a continuous
read data stream.
When the data comes back it will have a ID which will identify the data as of kind0 or kind1.
The two kinds of data can be say, 'data descriptor fetch' and 'data fetch'.
INFO:
Once VALID signal is asserted, it must remain asserted until the handshake occurs, at a rising
clock edge at which VALID and READY are both asserted.
If READY is asserted, the destination is permitted to de-assert the READY signal before VALID is
asserted. Even if a slave has only one source of read-data, it must assert the RVALID signal only
in response to a request for data.
For a write transaction, a single response is signaled for the entire burst, and not for each data
transfer within the burst.While, in a read transfer, the slave can signal diff responses for
different transfers in a burst. For example, in a burst of 16 read transfers, the slave might return
an OKAY response for 15 of the transfers and a SLVERR response for one of the transfers.
Slaves are required to reflect on the appropriate BID or RID response an AXI ID received from a
master.
The interconnect appends additional bits to the ARID, AWID and WID identifiers that are unique
to that master port.
This means:
1). A masters on a fabric need not worry about what ID the other masters(s) would use, as the
ID will be uniquified by the fabric
2). ID width at slave will be larger than the ID width at Master.
ORDERING:
A AXI4 Master(i.e. Without any WID signal in its write data channel), MUST issue the write data
"in the same order in which it issues the transaction addresses".
The slave must ensure that the RID value of any returned data matches the ARID value of the
address to which it is responding.
___________________
Explain the AXI response types?
The AXI protocol allows response signalling for both read and write transactions. For
read transactions the response information from the slave is passed alongside the read
data itself, however for writes the response information is conveyed along the write
response channel.
The AXI protocol responses are:
•OKAY
•EXOKAY
•SLVERR
•DECERR.
________________
______________________________________________________________________________
AHB
Terminology
The following terms are used throughout this specification.
Bus cycle: A bus cycle is a basic unit of one bus clock period and for the purpose of AMBA AHB
or APB protocol descriptions is defined from rising-edge to rising-edge transitions. An ASB bus
cycle is defined from falling-edge to falling-edge transitions. Bus signal timing is referenced to
the bus cycle clock.
Bus transfer: An AMBA ASB or AHB bus transfer is a read or write operation of a data object,
which may take one or more bus cycles. The bus transfer is terminated by a completion
response from the addressed slave. The transfer sizes supported by AMBA ASB include byte (8-
bit), halfword (16-bit) and word (32-bit). AMBA AHB additionally supports wider data transfers,
including 64-bit and 128-bit transfers. An AMBA APB bus transfer is a read or write operation of
a data object, which always requires two bus cycles.
Burst operation: A burst operation is defined as one or more data transactions, initiated by a
bus master, which have a consistent width of transaction to an incremental region of address
space. The increment step per transaction is determined by the width of transfer (byte, half
word, word). No burst operation is supported on the APB.
APB:APB signal prefixes P indicates an APB signal. For example, PCLK is the main clock used by
the APB.
How AHB is pipelined architecture?
APB protocol will required clock cycles to transfer bytes in total (4 bytes in each tx)
APB does not have concept of overlap
AHB protocl will requires 26 clock cycles to transfer 100 bytes in total(4 bytes in each tx)
1)1st clock:1st tx address phase (no data transferres yet)
2)2st clock:2st tx address phase+1st tx data phase
3)3st clock:3st tx address phase +2nd tx data phase
4)4st clock:4st tx address phase +3rd tx data phase
5)26st clock:No addres sphase + 25th tx data phase
Above concept of data phase,aligned with next address phase :pipelining
AXI also does same ,AXI in addition has ID
Only an OKAY response can be given in a single cycle. The ERROR, SPLIT and RETRY responses
require at least two cycles. To complete with any of these responses then in the penultimate
(one before last) cycle the slave drives HRESP[1:0] to indicate ERROR, RETRY or SPLIT while
driving HREADY LOW to extend the transfer for an extra cycle. In the final cycle HREADY is
driven HIGH to end the transfer, while HRESP[1:0] remains driven to indicate ERROR, RETRY or
SPLIT.
If the slave needs more than two cycles to provide the ERROR, SPLIT or RETRY response then
additional wait states may be inserted at the start of the transfer. During this time the HREADY
signal will be LOW and the response must be set to OKAY.
The two-cycle response is required because of the pipelined nature of the bus. By the time a
slave starts to issue either an ERROR, SPLIT or RETRY response then the address for the
following transfer has already been broadcast onto the bus. The twocycle response allows
sufficient time for the master to cancel this address and drive HTRANS[1:0] to IDLE before the
start of the next transfer.
For the SPLIT and RETRY response the following transfer must be cancelled because it must not
take place before the current transfer has completed. However, for the ERROR response, where
the current transfer is not repeated, completion of the following transfer is optional.
What if the slave gets the address out of range?
default slave will be selected
Round robin arbitration is a scheduling scheme which gives to each requestor its share of using
a common resource for a limited time or data elements. The basic algorithm implies that once a
requestor has been serves he would “go around” to the end of the line and be the last to be
served again. The simplest form of round robin arbiter is based on assignment of a fixed time
slot per requestor; this can be implemented using a circular counter. Alternatively, the
weighted round robin arbiter is defined to allow a specific number X of data elements per each
requestor, in which case X data elements from each requestor would be processed before
moving to the next one. Round robin arbiters are typically used for arbitration for shared
resources, load balancing, queuing systems, and resource allocation. Any application requiring a
minimal fairness where none of the requestors is suffering from starvation is a valid application
for a round robin arbiter.
Explain the split-retry concept?
Calculate boundary?
Boundary size =8*2=16 bytes will be transfered in total
Boundaries will be multiple of 16
O 0,16,32,48,64
O 0x1004=>which boundary does it fall it in?
-> Lower boundary:4096(0x1000)
->Upper boundary:4096+15(0x100f)
1st beat:0x1004,0x1005
2st beat:0x1006,0x1007
3st beat:0x1008,0x1009
4st beat:0x100a,0x100b
5st beat:0x100c,0x100d
6st beat:0x100e,0x100f
7st beat:0x1000,0x1001(INCR8:0x1010,0x1011)
8st beat:0x1002,0x1003(INCR8:0x1012,0x1013)
Answer
Wrap boundary depends on both Hsize and the No of beats(4 ,8,16)
"For wrapping bursts, if the start address of the transfer is not aligned to the total number of
bytes in the burst (size x beats) then the address of the transfers in the burst will wrap when
the boundary is reached"
Case1: Start Address is 0x4,Wrap4,Hsize is 2.
0000 0100 - beat1 - 0x4
0000 1000 - beat2 - 0x8
0000 1100 - beat3 - 0xc
0000 0000 - beat4 - 0x0
Here as Hsize is 2,it means 4 bytes are to be transfered. As it is Wrap4 no of beats are 4. Total
no of bytes is 16(beats*Hsize in bytes). Therefore 4bit alignment is to be done.
In beat3 the address is 0000 1100.Now as Hsize is 2,address shld be incremented by 4.
0000 1100
+0000 0100
---------------
0000 1110
+0000 0010
---------------
//-------------------------------------------------------
// wrap4_beat_info()
//-------------------------------------------------------
Task wrap4_beat_info (logic [2:0] hburst,logic [31:0] haddr,logic [2:0] hsize);
If(hsize==3'b010 && hburst==`AHB_WRAP4 )
Begin
If(haddr[3:2]==2'b00) wrap4_boundry_location=0 ; // No Wrap
Else if(haddr[3:2]==2'b01) wrap4_boundry_location=3 ; // Wrap at 3rd Beat
Else if(haddr[3:2]==2'b10) wrap4_boundry_location=2 ; // Wrap at 2nd Beat
Else if(haddr[3:2]==2'b11) wrap4_boundry_location=1 ; // Wrap at 1st Beat
End
Endtask : wrap4_at_info
//--------------------------------------------------------
// wrap8_beat_info()
//--------------------------------------------------------
Task wrap8_beat_info (logic[2:0] hburst,logic[31:0] haddr,logic[2:0] hsize);
If(hsize==3'b010 && hburst==`AHB_WRAP8 )
Begin
If(haddr[5:3]==3'b000) wrap8_boundry_location=0 ;
Else if(haddr[5:3]==3'b001) wrap8_boundry_location=7 ;
Else if(haddr[5:3]==3'b010) wrap8_boundry_location=6 ;
Else if(haddr[5:3]==3'b011) wrap8_boundry_location=5 ;
Else if(haddr[5:3]==3'b100) wrap8_boundry_location=4 ;
Else if(haddr[5:3]==3'b101) wrap8_boundry_location=3 ;
Else if(haddr[5:3]==3'b110) wrap8_boundry_location=2 ;
Else if(haddr[5:3]==3'b110) wrap8_boundry_location=1 ;
End
Endtask : wrap8_beat_info
//---------------------------------------------------------
// wrap16_at_info()
//---------------------------------------------------------
Task wrap16_beat_info (logic[2:0] hburst, logic[31:0] haddr,logic[2:0] hsize);
If(hsize==3'b010 && hburst==`AHB_WRAP16 )
Begin
If(haddr[7:4]==4'b0000) wrap8_boundry_location=0 ;
Else if(haddr[7:4]==4'b0001) wrap8_boundry_location=15 ;
Else if(haddr[7:4]==4'b0010) wrap8_boundry_location=14 ;
Else if(haddr[7:4]==4'b0011) wrap8_boundry_location=13 ;
Else if(haddr[7:4]==4'b0100) wrap8_boundry_location=12 ;
Else if(haddr[7:4]==4'b0101) wrap8_boundry_location=11 ;
Else if(haddr[7:4]==4'b0110) wrap8_boundry_location=10 ;
Else if(haddr[7:4]==4'b0111) wrap8_boundry_location=9 ;
Else if(haddr[7:4]==4'b1000) wrap8_boundry_location=8 ;
Else if(haddr[7:4]==4'b1001) wrap8_boundry_location=7 ;
Else if(haddr[7:4]==4'b1010) wrap8_boundry_location=6 ;
Else if(haddr[7:4]==4'b1011) wrap8_boundry_location=5 ;
Else if(haddr[7:4]==4'b1100) wrap8_boundry_location=4 ;
Else if(haddr[7:4]==4'b1101) wrap8_boundry_location=3 ;
Else if(haddr[7:4]==4'b1110) wrap8_boundry_location=2 ;
Else if(haddr[7:4]==4'b1111) wrap8_boundry_location=1 ;
End
Endtask : wrap16_beat_info
AXI TX:
AWADDR=32'h1000_1000
AWLEN = 6 (+1)
AWSIZE= 3 (2**3)
AWBURST=INCR
AWID=8
INCR:
56 bytes will written from 32'h1000_1000 to 32'h1000_1038
WRAP:
- wrap uses boundaries
- all boundaries lower range is multiple of tx_size (in this case 56)
- ex: boundaries
1st boundary : 0 - 55
2nd boundary : 56 - 111
3rd boundary : 112 - 167
4th boundary : 168 - 223
-------
Simplified version of above example:
AWADDR = 'h102 (258)
AWLEN = 2 (+1)
AWSIZE= 2 (2**2) => 4 bytes per transfer
AWBURST=WRAP
TX_SIZE = (2+1) * (2^^2) = 12
Bounraries: (0..11), (12..23), (24..35)....
AWADDR falls in to => (252, 263) bounary
Aligned, unlaiged
Wrap, INCR
-------
FIXED:
- all bytes will be written to same adddress location
AWADDR = 100
-----
WRAP will be used by L1/L2 cache when they write/read data to/from main memory
INCR will be used by processor when accessing a main memory
FIXED will be used when a write/read happens to FIFO type storage
------
For a connectin where databus width is 32 bits => awsize can never be more than '2'
o if we use 3 => 2^^3 = 8 bytes/transfer = 64 bits
o it is posisble to do awsize=0 => 1 bytes /transfer
WSTRB=4'b1000 => wdata[31:24] is valid
WSTRB=4'b0100 => wdata[23:16] is valid
WSTRB=4'b0010 => wdata[15:8] is valid
WSTRB=4'b0001 => wdata[7:0] is valid
--------------
awsize=2
data bus width=64 bits
awlen=3 (4 transfers)
how many transferred(tx) = (3+1) * (2^^awsize) = 4*4 = 16 bytes in 4 beats
1st transfer => wstrb = 8'b0000_1111 (wdata[31:0] is valid)
2nd transfer => wstrb = 8'b1111_0000 (wdata[63:32] is valid) (wdata won't be same as 1st
transfer)
3rd transfer => wstrb = 8'b0000_1111 (wdata[31:0] is valid) (wdata won't be same as 2nd
transfer)
4th transfer => wstrb = 8'b1111_0000 (wdata[63:32] is valid) (wdata won't be same as 3rd
transfer)
Normally the arbiter will not hand over the bus to a new master until the end of a burst of
transfers. However, if the arbiter determines that the burst must be terminated early in order
to prevent excessive access time to the bus then it may transfer the grant to another bus
master before a burst has completed.
If a master loses ownership of the bus in the middle of a burst it must re-arbitrate for the bus in
order to complete the burst. The master must ensure that the HBURST and HTRANS signals are
adapted to reflect the fact that it no longer has to perform a complete 4, 8 or 16-beat burst.
For example, if a master is only able to complete 3 transfers of an 8-beat burst, then when it
regains the bus it must use a legal burst encoding to complete the remaining 5 transfers. Any
legal combination can be used, so either a 5-beat undefined length burst or a 4-beat fixed
length burst followed by a single-beat undefined length burst would be acceptable.
__
or
Bursts can be early terminated either as a result of the Arbiter removing the HGRANT to a
master part way through a burst, or after a slave returns a non-OKAY response to any beat of a
burst.
Note however that a master cannot decide to terminate a defined length burst unless
prompted to do so by the Arbiter or Slave responses.
All AHB Masters, Slaves and Arbiters must be designed to support Early Burst Termination.
When should a master assert and deassert the HLOCK signal for a locked transfer?
or
Explain the LOCKED transfer?
Arbitration signal=>hlockx Locked transfers=>Master When HIGH this signal indicates that the
master requires locked access to the bus and no other master should be granted the bus until
this signal is LOW.
The HLOCK signal must be asserted at least one cycle before the start of the address phase of a
locked transfer. This is required so that the arbiter can sample the HLOCK signal as high at the
start of the address phase.The master should deassert the HLOCK signal when the address
phase of the last transfer in the locked sequence has started.
when will the arbiter grant another master after a locked transfer?
The arbiter will always grant the master an extra transfer at the end of a locked sequence, so
the master is guaranteed to perform one transfer with the HMASTLOCK signal low at the end of
the locked sequence. This coincides with the data phase of the last transfer in the locked
sequence.
During this time the arbiter can change the HGRANT signals to a new bus master, but if the data
phase of the last locked transfer receives either a SPLIT or RETRY response then the arbiter will
drive the HGRANT signals to ensure that either the master performing the locked sequence
remains granted on the bus for a RETRY response, or the Dummy master is granted the bus for
the SPLIT response.
or
What is the difference between a dummy bus master and a default bus master?
The term default bus master is used to describe the master that is granted when none of the
masters in the system are requesting access to the bus. Usually the bus master which is most
likely to request the bus is made the default master.
The dummy bus master is a master which only performs IDLE transfers. It is required in a
system so the arbiter can grant a master which is guaranteed not to perform any real transfers.
The two cases when the arbiter would
need to do this are when a SPLIT response is given to a locked transfer and when a SPLIT
response is given and all other masters have already been SPLIT.
How slave will detects the end of INCR type burst transfer?
______________________________________________________________________________
______________________________________________________________________________
What is the relationship between the HLOCK signal and the HMASTLOCK signal?
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.
The dummy master will only perform IDLE transfers (i.e. no data transfers), so cannot corrupt
the LOCKed sequence that is ongoing.
When the original slave is able to complete the SPLIT transfer, it will signal this to the arbiter on
HSPLIT and the arbiter can then re-grant the original master, and the LOCKed sequence can
then continue.
However as the slave has an HMASTLOCK input telling it that the current transfer is part of a
LOCKed sequence, it should know that there is no system advantage in returning a SPLIT.
So yes, a slave can return a SPLIT response to a LOCKed transfer, and the arbiter must then
grant the dummy master, but the slave should use the HMASTLOCK input to see that a SPLIT
response is not useful at this time.
What are the different bursts used for?
Typically a master would use wrapping bursts for cache line fills where the master wants to
access the data it requires first and then it completes the burst to fetch the remaining data it
requires for the cache line fill. Incrementing bursts are used by masters, such as DMA
controllers, that are filling a buffer in memory which may not be aligned to a particular address
boundary.
What default state should be used for the HREADY and HRESP outputs from a slave?
It is recommended that the default value for HREADY is high and the default value for HRESP is
OKAY. This combination ensures that the slave will respond correctly to IDLE transfers to the
slave, even if the slave is in some form of power saving mode.
When a master rebuilds a burst which has been terminated early are there any limitations on
how it rebuilds the burst?
The only limitation is that the master uses legal burst combinations to rebuild the burst. For
example, if a master was performing an 8 beat burst, but had only completed 3 transfers before
losing control of the bus, then the remaining 5 transfers could be performed either by using a 1
beat SINGLE burst followed by a 4 beat INCR4 burst, or it could be performed using a 5 beat
undefined length INCR burst.
For simplicity it is recommended that masters use INCR bursts to rebuild the remaining
transfers
Split/Retry: Can a SPLIT or RETRY response be given at any point during a burst?
Yes. A SPLIT, RETRY or ERROR response can be given by a slave to any transfer during a burst.
The slave is not restricted to only giving these responses to the first transfer.
General: What default state should be used for the HREADY and HRESP outputs from a slave?
Applies to: AHB
It is recommended that the default value for HREADY is high and the default value for HRESP is
OKAY. This combination ensures that the slave will respond correctly to IDLE transfers to the
slave, even if the slave is in some form of power saving mode.
Split/Retry: Will a master always lose the bus after a SPLIT response?
Applies to: AHB
Yes. A slave must not assert the relevant bit of the HSPLIT bus in the same cycle that it gives the
SPLIT response and therefore the master will always lose the bus.
Undefined length INCR bursts cannot have their end point predicted, so there is no efficient
way that an Arbiter design can allow the burst to complete before granting another master.
INCR bursts must be arbitrated on a cycle by cycle basis.
Defined length incrx and wrapx bursts can have their beats counted, and so allowed to
complete by the Arbiter. However because of the AHB arbitration synchronous timing, there is
no way to avoid possibly terminating a burst immediately after the first transfer of the burst has
been indicated.
The Arbiter only knows that a defined length burst is in progress by sampling the HBURST bus.
However the first point at which HBURST can be sampled is after the first clock cycle of the first
burst beat, by which time the Arbiter may already have decided to grant another master and
will have changed the HGRANT outputs accordingly. Only a combinatorial path from HBURST to
HGRANT would allow the burst to be detected in time to avoid early termination in this
scenario, but combinatorial paths in the AHB bus are not allowed. Ask ARM
For a defined length burst the master can deassert the HBUSREQ signal once the master has
been granted the bus for the first transfer. This can be done because the arbiter is able to count
the transfers in the burst and keep the master granted until the burst completes.
However it is not a mandatory requirement for an Arbiter to allow a burst to complete, so the
master will have to re-assert HBUSREQ if the Arbiter removes HGRANT before the burst has
been completed.
If a master is currently granted the bus by default, how many cycles before starting an non-
IDLE transfer does it have to assert HBUSREQ?
None. It can start a non IDLE transfer immediately.
Can a master perform transfers other than IDLE when the bus was granted to it, but not
requested by the master?
Yes. A master can perform transfers other than IDLE when it had not requested the bus. Please
note that in this case it is still recommended that the master asserts its request signal so that
the arbiter does not change ownership of the bus to a lower priority master while the transfers
are in progress.
The specification recommends that only 16 wait states are used. What should you do if more
than 16 cycles are needed?
For some slaves it is acceptable to insert more than 16 wait states. For example, a serial boot
ROM which is only ever accessed at initial power up could insert a larger number of wait states
and it would not affect the calculation of the system performance and latency once system
power up has been completed.
For other slaves a number of options exist. A SPLIT or RETRY response could be used to indicate
that the slave is not yet able to perform the requested data transfer, or the slave could be
accessed either in response to interrupts or after polling a status register, in either case
indicating that the slave is now able to respond in an acceptable number of cycles.
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.
Is it specified that HPROT, HSIZE and HWRITE remain constant throughout a burst?
Yes, the control signals must remain constant throughout the duration of a burst.
What default state should be used for the HREADY and HRESP outputs from a slave?
It is recommended that the default value for HREADY is high and the default value for HRESP is
OKAY. This combination ensures that the slave willrespond correctly to IDLE transfers to the
slave, even if the slave is in some form of power saving mode.
What system support is required if a slave can be powered down or have its clock stopped?
If a slave access is attempted while that slave is in a power down state or has had its clock
stopped, you must ensure that an access will cause the power/clock to be restored, or else
configure the AHB decoder up to redirect any such accesses to the dummy slave so that the
system does not hang forever when an access to the device is made when it is disabled.
Redirecting the access in this way will ensure that random "IDLE" addresses are treated with
the HREADY high and HRESP=OKAY default response, but real accesses (NONSEQ or SEQ) will be
detected with an ERROR response.
How should AHB to APB bridges handle accesses that are not 32-bits?
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.
What value should be used for HTRANS when an AHB master gets a RETRY response from a
slave in the middle of burst?
Whenever a transfer is restarted it must use HTRANS set to NONSEQ and it may also be
necessary to adjust the HBURST information (usually just to indicate INCR).
What address should be on the bus during the IDLE cycle after a SPLIT or RETRY?
It does not matter what address is driven onto the bus during this cycle.The slave selected by
the driven address should not take any action and must respond with a zero wait state OKAY
response.
In many cases it will be simpler for the master to leave the address unaltered during this cycle,
so that it remains at the address of the next transfer that the master wishes to perform and
only in the following cycle does the master return the address to that of the transfer that must
be
repeated because of the SPLIT or RETRY response.
In some designs it may be possible for the master to return the address to that required to
repeat the previous transfer during the IDLE cycle and this behaviour is also perfectly
acceptable.
A SPLIT response is more complicated to implement than a RETRY, but has the advantage that it
allows the maximum efficiency to be made of the bus bandwidth.
The master behaviour is identical to both SPLIT and RETRY responses, the master has to cancel
the next access and re-attempt the current failedaccess.
How should AHB to APB bridges handle accesses that are not 32-bits?
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
AHB vs AXI
AHB is Advanced High-performance Bus and AXI is Advanced extensible Interface. Both the ABH
and AXI are Bus masters, which are really different in many aspects.
When the Advanced High-performance Bus is a single channel Bus, the Advanced extensible
Interface is a multi- channel Bus. The AHB is also a shared Bus whereas the AXI is a read/write
optimized bus.
In AHB, each of the bus masters will connect to a single-channel shared bus. On the other hand,
the bus master in AXI will connect to a Read data channel, Read address channel, Write data
channel, Write address channel and Write response channel.
Another difference that is noticed is that the Bus latencies in AHB start lower than the AXI. The
AHB starts at 16 Byte transactions where as the AXI starts at 64 Byte transactions. It can also be
seen that the AHB Bus utilization is higher than AXI utilization. Moreover, The Advanced
extensible Interface uses around 50 per cent more power, which means that AHB has an edge
over it.
Advanced extensible Interface is the third generation of Advanced Microprocessor Bus
Architecture interface. Some of the features of AXI incude separate address/control and data
phases, burst based transactions with start address issued, support for unaligned data transfers
using byte strobes, easy addition of register stages to provide timing closure and issuing of
multiple outstanding addresses. The AXI, which suits high speed sub-micrometer interconnect,
mainly targets high clock frequency system designs and high performance.
Some of the features of Advanced High-performance Bus includes single edge clock protocol,
several bus masters, split transactions, pipelined operations, burst transfers, non-tristate
implementation and large bus-widths.
Summary
1. AHB is Advanced High-performance Bus and AXI is Advanced extensible Interface.
2. When the Advanced High-performance Bus is a single channel Bus, the Advanced extensible
Interface is a multi- channel Bus.
3. In AHB, each of the bus masters will connect to a single-channel shared bus. On the other
hand, the bus master in AXI will connect to a Read data channel, Read address channel, Write
data channel, Write address channel and Write response channel.
4. The AHB is also a shared Bus whereas the AXI is a read/write optimized bus.
5. Bus latencies in AHB starts lower than the AXI.
6. The Advanced extensible Interface uses around 50 per cent more power, which means that
AHB has an edge over it.
7. AHB Bus utilization is higher than AXI utilization
What is the wrap burst transaction in AXI? How to calculate start & wrap boundary address ?
Ans. 1.A wrapping burst is similar to an incrementing burst, except that the address wraps
around to a lower address if an upper address limit is reached. The following restrictions apply
to wrapping bursts:
The start address must be aligned to the size of each transfer
The length of the burst must be 2, 4, 8, or 16 transfers.
2.wrap boundary is decided by total bytes in the burst. Lets take the following example.
Suppose a transaction with address 8(in decimal) has burst of length 4 with 32-bit bus.then
access
will be like 8->12->0->4. Address 16 is the wrap boundary in this case.
Must a read after a write to the same address return the newly written data?
Scenario
When there is an AHB write followed by a read from the same address, should the read return
the old or the new data when the read address phase is in same cycle of the write data phase?
Answer
The answer to this question is dependent on the design of the slave.
A simple slave will not be buffering any data, so the returned read data will be the latest. A
more complex slave could implement buffering for write data (if allowed by HPROT[2]) and so it
could "snoop" the write buffer contents before returning read data, or it might just return the
previously stored data regardless of what might be buffered.
In conclusion, all the AHB specification requires is that data is returned.
What system support is required if a slave can be powered down or have its clock stopped?
If a slave access is attempted while that slave is in a power down state or has had its clock
stopped, you must ensure that an access will cause the power/clock to be restored, or else
configure the AHB decoder up to redirect any such accesses to the dummy slave so that the
system does not hang forever when an access to the device is made when it is disabled.
Redirecting the access in this way will ensure that random "IDLE" addresses are treated with
the HREADY high and HRESP=OKAY default response, but real accesses (NONSEQ or SEQ) will be
detected with an ERROR response.
Is it specified that HPROT, HSIZE and HWRITE remain constant throughout a burst?
Yes, the control signals must remain constant throughout the duration of a burst.
The specification recommends that only 16 wait states are used. What should you do if more
than 16 cycles are needed?
For some slaves it is acceptable to insert more than 16 wait states. For example, a serial boot
ROM which is only ever accessed at initial power up could insert a larger number of wait states
and it would not affect the calculation of the system performance and latency once system
power up has been completed.
For other slaves a number of options exist. A SPLIT or RETRY response could be used to indicate
that the slave is not yet able to perform the requested data transfer, or the slave could be
accessed either in response to interrupts or after polling a status register, in either case
indicating that the slave is now able to respond in an acceptable number of cycles.
When a master rebuilds a burst which has been terminated early are there any limitations on
how it rebuilds the burst?
The only limitation is that the master uses legal burst combinations to rebuild the burst. For
example, if a master was performing an 8 beat burst, but had only completed 3 transfers before
losing control of the bus, then the remaining 5 transfers could be performed either by using a 1
beat SINGLE burst followed by a 4 beat INCR4 burst, or it could be performed using a 5 beat
undefined length INCR burst.
For simplicity it is recommended that masters use INCR bursts to rebuild the remaining
transfers.
How many clock cycles should the reset signal in an AMBA system be asserted for?
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.
Is it legal for an AHB wrapping burst to be aligned with respect to the total number bytes in
the burst, such that it does not wrap?
Yes, this behavior is compliant with the AHB protocol.
Consider a four-beat wrapping burst of word (4-byte) transfers (which will wrap at 16-byte
boundaries).
If the start address of the transfer is 0x30, then the burst consists of four transfers to addresses
0x30, 0x34, 0x38, and 0x3c.
Again, although HBURST is set to WRAP4, the burst will not actually wrap, which is allowed.
Can a master perform transfers other than IDLE when the bus was granted to it, but not
requested by the master?
Yes. A master can perform transfers other than IDLE when it had not requested the bus. Please
note that in this case it is still recommended that the master asserts its request signal so that
the arbiter does not change ownership of the bus to a lower priority master while the transfers
are in progress.
If a master is currently granted the bus by default, how many cycles before starting an non-
IDLE transfer does it have to assert HBUSREQ?
None. It can start a non IDLE transfer immediately.
When a master initiates a transaction on the AMBA bus, if the target detects that the transfer
will take a large number of cycles to perform, it can issue a SPLIT signal. What happens now is
that the arbiter can grant the bus to other masters even before the SPLIT transaction is
complete. The master to which the SPLIT has been issued has to then wait and complete the
entire transaction.
During the address phase of a transfer the arbiter generates a tag, or bus master number, on
HMASTER[3:0] which identifies the master that is performing the transfer. Any slave issuing a
SPLIT response must be capable of indicating that it can complete the transfer, and it does this
by making a note of the master number on the HMASTER[3:0] signals.
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. The arbiter then uses
this information to unmask the request signal from the master and in due course the master
will be granted access to the bus to retry the transfer. The arbiter samples the hsplitx bus every
cycle and therefore the slave only needs to assert the appropriate bit for a single cycle in order
for the arbiter to recognize it.
The basic stages of a SPLIT transaction are:
1. The master starts the transfer in an identical way to any other transfer and
issues address and control information
2. If the slave is able to provide data immediately it may do so. If the slave
decides that it may take a number of cycles to obtain the data it gives a SPLIT
transfer response. During every transfer the arbiter broadcasts a number, or
tag, showing which master is using the bus. The slave must record this number,
to use it to restart the transfer at a later time.
3. The arbiter grants other masters use of the bus and the action of the SPLIT
response allows bus master handover to occur. If all other masters have also
received a SPLIT response then the default master is granted.
4. When the slave is ready to complete the transfer it asserts the appropriate bit of
the hsplitx bus to the arbiter to indicate which master should be regranted
access to the bus.
5. The arbiter observes the hsplitx signals on every cycle, and when any bit of
hsplitx is asserted the arbiter restores the priority of the appropriate master.
6. 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.
7. When the transfer eventually takes place the slave finishes with an OKAY
transfer response.
For a SPLIT transfer the arbiter will adjust the priority scheme so that any other
master requesting the bus will get access, even if it is a lower priority. In order
for a SPLIT transfer to complete the arbiter must be informed when the slave has
the data available.
For RETRY the arbiter will continue to use the normal priority scheme and
therefore only masters having a higher priority will gain access to the bus.
What value should be used for HTRANS when an AHB master gets a RETRY
Response from a slave in the middle of burst?
What address should be on the bus during the IDLE cycle after a SPLIT or RETRY?
It does not matter what address is driven onto the bus during this cycle. The slave selected by
the driven address should not take any action and Must respond with a zero wait state OKAY
response.
In many cases it will be simpler for the master to leave the address Unaltered during this cycle,
so that it remains at the address of the next Transfer that the master wishes to perform and
only in the following cycle Does the master return the address to that of the transfer that must
be Repeated because of the SPLIT or RETRY response.
In some designs it may be possible for the master to return the address to That required to
repeat the previous transfer during the IDLE cycle and This behaviour is also perfectly
acceptable.
Can a slave assert hsplitx in the same cycle that it gives a SPLIT Response?
No. The specification requires that hsplitx can only be asserted after the Slave has given a SPLIT
response.
The difference between them is that a SPLIT response tells the Arbiter to give priority to all
other masters until the SPLIT transfer can be completed (effectively ignoring all further requests
from this master until the SPLIT slave indicates it can complete the SPLIT transfer), whereas the
RETRY response only tells the Arbiter to give priority to higher priority masters.
A SPLIT response is more complicated to implement than a RETRY, but has the advantage that it
allows the maximum efficiency to be made of the bus bandwidth.
The master behaviour is identical to both SPLIT and RETRY responses, the master has to cancel
the next access and re-attempt the current failed access.
What address should be on the bus during the IDLE cycle after a SPLIT or RETRY ?
It does not matter what address is driven onto the bus during this cycle. The slave selected by
the driven address should not take any action and must respond with a zero wait state OKAY
response.
In many cases it will be simpler for the master to leave the address unaltered during this cycle,
so that it remains at the address of the next transfer that the master wishes to perform and
only in the following cycle does the master return the address to that of the transfer that must
be repeated because of the SPLIT or RETRY response.
In some designs it may be possible for the master to return the address to that required to
repeat the previous transfer during the IDLE cycle and this behaviour is also perfectly
acceptable.
What value should be used for HTRANS when an AHB master gets a RETRY response from a
slave in the middle of burst ?
Whenever a transfer is restarted it must use HTRANS set to NONSEQ and it may also be
necessary to adjust the HBURST information (usually just to indicate INCR).