ARM Interview Question
ARM Interview Question
AXI, the third generation of AMBA interface AMBA 3 specification, is targeted at high performance,
high clock frequency system designs and suitable for high speed sub-micrometer interconnect:
• separate address/control and data phases
• support for unaligned data transfers using byte strobes
• burst based transactions with only start address issued & issuing of multiple outstanding addresses
• easy addition of register stages to provide timing closure
Handshake process:
All five channels use the same VALID/READY handshake to transfer data and control information.
This two-way flow control mechanism enables both the master and slave to control the rate at which
the data and control information moves. The source generates the VALID signal to indicate when the
data or control information is available. The destination generates the READY signal to indicate that
it accepts the data or control information. Transfer occurs only when both the VALID and READY
signals are HIGH.
There are three scenarios when the transfer happens as shown below:
Signal Description:
Signal Description:
Master Slave configuration connected via interface through interconnect:
There are different encoding techniques used in AXI for burst length, busrt size, burst type, cache
encoding, protection, atomic access, response,
Timing Diagrams for read burst, overlapping read burst and write burst:
Difference between Exclusive access and Locked access:
When the ARLOCK[1:0] or AWLOCK[1:0] signals for a transaction show that it is a locked transfer
then the interconnect must ensure that only that master is allowed access to the slave region until an
unlocked transfer from the same master completes signalling the release of the locked trasnfer. The
arbiter within the interconenct is used to enforce this restriction.
Burst operation:
In AXI channel, the number of data transfers in a single burst are called as beats.
Normal/Privileged access:
Fixed burst: In a fixed burst, the address remains the same for every transfer in the burst. This
burst type is for repeated accesses to the same location such as when loading or emptying a
peripheral FIFO.
Incrementing burst: In an incrementing burst, the address for each transfer in the burst is an
increment of the previous transfer address. The increment value depends on the size of the transfer.
For example, the address for each transfer in a burst with a size of four bytes is the previous
address plus four.
Wrapping burst: A weapping burst is similar to an incrementing burst, in that the address for each
transfer in the burst is an increment of the previous transfer address. However, in a wrapping burst
the address wraps around to a lower address when a wrap boundary is reached. The wrap boundary
is the size of each transfer in the burst multiplied by the total number of transfers in the burst. There
are two restrictions for wrapping bursts: the start address must be aligned to the size of the transfer
and the length of the burst must be 2, 4, 8, or 16.
AXI Benefits:
• Faster testbench development and more complete verification of AMBA AXI 3.0/4.0 designs
• Easy to use command interface simplifies testbench control and configuration of master and slave
• Simplifies results analysis
• Runs in every major simulation environment
Drawbacks of AXI:
• The AMBA AXI4 has limitations with respect to the burst data and beats of information to be
transferred
• The burst must not cross the 4k boundary. Bursts longer than 16 beats are only supported for the
INCR burst type
• Both WRAP and FIXED burst types remain constrained to a maximum burst length of 16 beats.
These are the drawbacks of AMBA AXI system which need to be overcome
AXI features:
• AMBA AXI 3.0/4.0 Verification IP provides a smart way to verify the AMBA AXI 3.0/4.0 component of
a SOC or a ASIC
• AMBA AXI 3.0/4.0 VIP is supported natively in SystemVerilog, VMM, RVM, AVM, OVM, UVM,
Verilog, SystemC, VERA, Specman E and non-standard verification environment
Summary of AXI:
• Productivity—By standardizing on the AXI interface, developers need to learn only single protocol
for IP
• Flexibility
• AXI4 memory mapped interfaces and allows burst of up to 256 data transfer cycles with just a single
address phase
• AXI4-Stream removes the requirement for an address phase altogether and allows
• unlimited data burst size
• Availability—By moving to an industry-standard, access to a worldwide community of ARM
Partners.
• Many IP providers support the AXI protocol
• A robust collection of third-party AXI tool vendors is available that provide a variety of verification,
system development, and performance characterization tools
Throughput:
• Throughput or network throughput is the average rate of successful message delivery over a
communication channel
• It is closely related to the channel capacity of the system, and is the maximum possible quantity of
data that can be transmitted under ideal circumstances
• The throughput is usually measured in bits per second (bit/s or bps), data packets per second or
data packets per time slot
AXI protocol notes and Interview Questions:
AMBA AXI is targeted at high performance , suitable for high-speed submicron connect .
Features:
1. AXI3 supports burst lengths up to 16 beats only. While AXI4 supports burst lengths of up to 256
beats.
2. AXI3 supports write interleaving. AXI4 does NOT support write interleaving
3. AXI3 supports locked transfers, AXI4 does NOT support locked transfers
4. AXI4 supports QoS, AXI3 does NOT suppor QoS.
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.
1) 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.
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,
2) How to terminate A read/write burst? Specification says we can not stop bursts intermittantly.
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.
No. WLAST can only be asserted while WVALID is high when the final WDATA of a burst is being
transferred. Indicating WLAST (and WVALID) too early in a burst would be a protocol violation.
Also, many slave designs will not use the WLAST input, and will simply count data items coming in,
so this would not be a safe (or legal) method of terminating a burst.
4) in the same way if slave assersts 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.
5) 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.
However to support all master and slave designs, masters must always drive WLAST when
appropriate, and slaves must drive RLAST.
6 ) Whats the exact use of Exclusive Read and Write Pair transaction? Where exactly these will be
used?
A default ARREADY value of LOW is possible but not recommended, because it implies that the
transfer takes at least two cycles, one to assert ARVALID and another to assert ARREADY.
No. It would take a minumum of 1 clock cycle to pass the address from the master to the slave
(assumes ARREADY was high when ARVALID was asserted), and then a minimum of 1 clock cycle
to pass the data from the slave to the master (assumes RREADY was high when RVALID was
asserted). 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.
Are there any issues with exclusive accesses passing from one width
of data bus to another?
Applies to: AXI
Answer
It is recommended that the restrictions listed below are used when
generating exclusive AXI bursts. This ensures that the address transaction
remains as a single transaction even if processed by certain AXI interconnect
blocks such as a downsizer (for connecting a wide bus to a narrower bus)
• If the burst type FIXED is used, then the length must be no greater
than 1 (AxLEN=0). This ensures that any downsizer component will
not split the burst into multiple bursts on the narrower bus.
• If the burst type is WRAP or INCR then it is recommended that the
total size be no greater than 16 bytes (e.g. length 4 for 32-bit bus,
length 2 for 64-bit bus). This ensures that the burst can always be
downsized to a single burst on a narrower bus (the limit being a length
16 burst on an 8-bit bus).
• If the system design is known, then the maximum allowable total size
of an exclusive burst must be defined as 16x the width (in bytes) of
the narrowest bus which will carry exclusive accesses.
Are there any recommendations about the types of accesses that are
used for atomic accesses?
Applies to: AXI
Answer
It is recommended that atomic accesses are performed using single length
bursts and the size of the data transfer is such that the transaction can pass
from source to destination without any need for modification by width
conversion components.
Are there any recommendations for verifying AXI components?
Applies to: AXI
Answer
Verification of AXI components is a significant task which cannot be covered
in full detail here, but one useful hint is to make sure that during simulation
signals (such as address and control signals) are driven with random values
whenever they are not required to be set in a valid state.
This may be best avoided for initial debugging purposes as it can make the
waveforms confusing. However, when dealing with more mature IP, enabling
this feature will enhance any verification performed on an AXI port and may
well give improved RTL code coverage in the process.
At what point can the master consider that the transaction has been
accepted by the slave such that the responsibility for hazard
checking lies with the slave?
Applies to: AXI
Answer
If a master is performing hazard checking, to allow it to issue multiple
outstanding read and write transactions, as described in section 8.6 of the
AXI specification, then at what point can the master consider that the
transaction has been accepted by the slave and the responsibility for hazard
checking now lies with the slave.
According to the specification “In the case of reads the earlier transaction
can be considered complete when the last read data is returned to the
master. In the case of writes the transaction can only be considered
complete when the write response is received by the master, it is not
acceptable to consider the write transaction complete when all the write data
is sent."
The master cannot consider the transaction to have been accepted at the
point at which the address has been acknowledged. The reason for this is
that the address ready signal is simply showing that the address has been
registered, but this may be in the slave or it may be in some intervening
interconnect. Therefore this is no guarantee that the address has reached its
destination.
For a read transaction the guarantee that the address has reached its
destination is obtained when the read data (and associated response) are
returned to the master. The AXI specification requires a relationship between
the channels, as described in section 3.2 of the specification, which ensures
that a read response is only given after the address has been accepted.
For write transactions the situation is slightly more complex. In a similar
manner, the guarantee that a write has reached its final destination is given
by the response. According to the rules of the AXI specification, the only
requirement is that the write response is given after the last item of write
data has been accepted. This is the point at which the master can consider
that the responsibility for hazard checking has been passed to the slave.
There is no actual requirement in the specification that the address must
have been accepted by the slave at the point at which the write response is
given. However, in such a circumstance the slave must still take the
appropriate action to ensure that any subsequent transactions are treated
successfully, such as stalling any further transfers.
It is important to note that the recommended behavior for a slave is to only
gives a write response once both the address and the write data has been
accepted. This would be equivalent to a double headed arrow from AWVALID
to BVALID and also from AWREADY to BVALID.
Can the WVALID signal for a write transfer be active before the
AWVALID? If so, how does the interconnect know which slave the
transfer is for?
Applies to: AXI
Answer
Whilst it is generally expected that WVALID will only be asserted at the same
or after AWVALID, there can be cases when WVALID is asserted before
AWVALID. For example this can occur when the address channel includes a
buffer or when the signals are crossing an asynchronous boundary.
Can write responses be re-ordered in the same way that read data
can be re-ordered?
Applies to: AXI
Answer
Yes. It is acceptable for a slave to re-order write responses, but typically this
would only be done if the slave was able to change the order in which it
completed the write transactions.
What are the allowable byte lane strobes for fixed address burst?
Applies to: AXI
Answer
For the purposes of determining legal write strobes, fixed bursts with an
unaligned start address remain unaligned for the duration of the burst.
What happens if the slave is keeping AWREADY low waiting for the
write response to be accepted while the master is keeping BREADY
low waiting for the address to be accepted by the slave?
Applies to: AXI
Answer
The specification does not require that the write address is accepted by a
slave before the slave gives a write response. If this happens then what
happens if the slave is keeping AWREADY low waiting for the write response
to be accepted while the master is keeping BREADY low waiting for the
address to be accepted by the slave.
The situation described above is not expected to occur. It is generally
expected, and recommended, that a slave accepts the address before giving
a write response. If such a situation were to occur then the AWREADY should
not be dependent on BREADY.
When a master has issued a locked transfer with one ID can it start
a different locked transfer with a different ID?
Applies to: AXI
Answer
No, once a master has started a locked sequence it must complete the
locked sequence, ensuring that all transfers have the same AxID.
Why are the read and write address buses defined with all four bits
of ACACHE. Does a read transaction need to give the write allocate
information and vice versa?
Applies to: AXI
Answer
The reason for including read and write allocation on both read and write
address buses is that it allows a system level cache to optimise it
performance. For example, if a cache sees a read access that is defined as
"write allocate, but not read allocate" then it knows that the address may
actually be stored in the cache (because it could have been allocated on a
previous write) and hence it must do a cache lookup. However, if the cache
sees a read access that is defined as "no write allocate and no read allocate"
then it knows that the address will not have been allocated in the cache and
hence it can avoid the cache lookup and immediately pass the transaction
through to the other side. It can only do this if it knows both the read and
write allocate for every transaction.
It is not a requirement that caches operate in this way, but the protocol is
defined with RA/WA for both reads and writes to allow this mode of
operation if the cache designer wants to implement it.
Why is AXI spec suitable for "high bandwidth" designs ?
Applies to: AXI
Scenario
What is the meaning of the AXI Specification statement that
"The objectives of the latest generation AMBA interface are to
be suitable for high-bandwidth and
low-latency designs."?
Answer
AXI was designed for moving a lot of data round, quickly. 'High
bandwidth' peripherals are those
that do just that - eg memory controllers, DMA controllers etc.
High Bandwidth is a subjective term but generally it refers to
the sort of peripherals
mentioned and the moving around of sizeable quantities of data.