AMBA Ans
AMBA Ans
Please specify the interface (I/O) of the AMBA AHB Master, Split-capable Slave, and Arbiter.
-1-
Quiz: Advanced Microcontroller Bus Architecture (AMBA) 2. Why is a burst not allowed to cross a 1 Kbyte boundary?
If an AHB slave samples HSELx at the start of a burst transaction, it knows it will be selected for the duration of the burst. Also, a slave which is not selected at the start of a burst will know that it will not become selected until a new burst is started. 1 kilobyte is the smallest area an AHB slave may occupy in the memory map. Therefore, if a burst did cross a 1 kilobyte boundary, the access could start accessing one slave at the beginning of the burst and then switch to another on the boundary, which must not happen for the above reason. The 1 kilobyte boundary has been chosen as it is large enough to allow reasonable length bursts, but small enough that peripherals can be aligned to the 1 kilobyte boundary without using up too much of the available memory map.
3. Please describe the two-cycle response and draw a simple timing diagram.
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 two cycle 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.
-2-
Quiz: Advanced Microcontroller Bus Architecture (AMBA) 4. Slaves on the bus require HREADY as both an input and an output signal, why?
An AHB slave must have the HREADY signal as both an input and an output. HREADY is required as an output from a slave so that the slave can extend the data phase of a transfer. HREADY is also required as an input so that the slave can determine when the previously selected slave has completed its final transfer and the first data phase transfer for this slave is about to commence. Each AHB Slave should have an HREADY output signal (conventionally named HREADYOUT) which is connected to the Slave-to-Master Multiplexer. The output of this multiplexer is the global HREADY signal which is routed to all masters on the AHB and is also fed back to all slaves as the HREADY input. A slave must have the HREADY signal as both an input and an output. The output version of the HREADY signal is used by the slave to extended transfers and is fed via the bus multiplexer to the bus master which is performing the transfer. HREADY is also required as an input to slaves and this signal comes from the output of the bus multiplexer. When the slave is responsible for driving HREADY (when it is being accessed) then this signal will be the same as the HREADY output from the slave. However, when another slave is being accessed, the HREADY signal will indicate if that slave is inserting wait states and this is important when a master changes from one slave to another. It is suggested that the input version of this signal is called HREADY and the output is HREADYOUT.
5. On the APB, what is the different between PSELx and PENABLE signals?
PSELx (APB select) A signal from the secondary decoder, within the peripheral bus bridge unit, to each peripheral bus slave x. This signal indicates that the slave device is selected and a data transfer is required. There is a PSELx signal for each bus slave.
PENABLE (APB strobe) This strobe signal is used to time all accesses on the peripheral bus. The enable signal is used to indicate the second cycle of an APB transfer. The rising edge of PENABLE occurs in the middle of the APB transfer.
-3-
Quiz: Advanced Microcontroller Bus Architecture (AMBA) 6. When can the HGRANT signal change?
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. A master can be granted the bus without requesting it. 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.
-4-
11. 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.
12. What is the difference between a dummy bus master and a default bus master? Is a dummy master really necessary?
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.
-5-
14. When should a master assert and de-assert the HLOCK signal for a locked transfer?
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.
15. 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.
-6-
16. What sequences of transfers types (HTRANS) can occur on the bus? (Note: We do not ask you the HBURST signal)
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-NS
-7-
Quiz: Advanced Microcontroller Bus Architecture (AMBA) 17. Please fill out the address (HADDR) sequence.
18. Draw the timing diagram of APB back-to-back transfer. That means the transfer sequence starts with a write, which is then followed by a read, then a write, then a read.
-8-