2. Proceedings of 2013 International Conference on Fuzzy Theory and Its Application
National Taiwan University of Science and Technology, Taipei, Taiwan, Dec. 6-8, 2013
III. AMBA APB
The Advanced Peripheral Bus (APB) is part of the
AMBA hierarchy of buses and is optimized for minimal
power consumption and reduced interface complexity.
The AMBA APB appears as a local secondary bus that is
encapsulated as a single ASB slave device. APB pro-
vides a low-power extension to the system bus which
builds on ASB signals directly.
The APB Bridge appears as a slave module which han-
dles the bus handshake and control signal retiming on
behalf of the local peripheral bus. By defining the APB
interface from the starting point of the system bus, the
benefits of the system diagnostics and test methodology
can be exploited. The AMBA APB should be used to
interface to any peripherals which are low bandwidth and
do not require the high performance of a pipelined bus
interface.
IV. IMPLEMENTATION
The implementation technique involves modeling the
following:
1) Arbiter
2) Decoder
3) APB Bridge
4) Reset controller
5) Remap and pause controller
A. Arbiter
The AMBA bus specification is a multi-master bus
standard. As a result, a bus arbiter is needed to ensure
that only one bus master has access to the bus at any
particular point in time. Each bus master can request the
bus, the arbiter decides which has the highest priority and
issues a grant signal accordingly. Every system must
have a default bus master which is granted use of the bus
during reset, or when no other bus master requires the
bus. The ASB arbitration is controlled by the AREQ,
AGNT, BLOK and BWAIT signals. When an ASB
master requires use of the bus, it sets its AREQ output
line HIGH. This is sampled by the arbiter, on the falling
edge of BCLK, and the AGNT outputs change according
to the arbitration priority scheme used by the system. The
BLOK and BWAIT signals are used to extend the
granted period to allow masters to finish transfers before
bus master handover begins. If BLOK is set HIGH by the
current master, and a higher priority master requests the
bus, handover will not start until BLOK is set LOW,
showing that the locked transfer has finished.
The following arbitration priorities (from highest to
lowest) are implemented in the default system: Test in-
terface controller (highest), Bus master 1, Bus master 2,
ARM processor (lowest).
B. Decoder
The decoder performs three functions, it generates the
slave select signals (DSELx) for each of the bus slaves,
indicating that a read or write access to that slave is
Fig. 2. Decoder memory map [2]
Fig. 3. FSM Without decode cycle [2]
Fig. 4. FSM With decode cycle [2]
required, it generates the slave response signals
(BWAIT, BLAST and BERROR) during address-only
transfers, when no slave is selected, it can act as a simple
protection unit which prevents attempts to access a pro-
tected area of the memory map shown in Figure 2.
The decoder can be implemented in two ways with and
without decode cycles as shown in Figure 3 and Figure 4
respectively.
C. APB Bridge
The APB Bridge provides an interface between the
ASB and the APB. It continues the pipelining of the ASB
by inserting wait cycles on the ASB only when they are
needed. It inserts them for burst transfers or read trans-
fers when the ASB must wait for the APB. The imple-
mentation of this block contains: a state machine, which
is independent of the device memory map, ASB address,
and data bus latching, combinatorial address decoding
logic to produce the peripheral select PSELx
Proceedings of 2013 International Conference on Fuzzy Theory and Its Application
National Taiwan University of Science and Technology, Taipei, Taiwan, Dec. 6-8, 2013
235
3. Proceedings of 2013 International Conference on Fuzzy Theory and Its Application
National Taiwan University of Science and Technology, Taipei, Taiwan, Dec. 6-8, 2013
Fig. 5. Peripheral memory map [2]
Fig. 6. APB Bridge state machine [2]
signals. Figure 5 shows the peripheral memory map of
the peripheral bridge. The finite state machine which
controls the working of the peripheral bridge is shown in
Figure 6.
D. Reset Controller
The AMBA specification defines a single reset signal
BnRES which indicates the current reset status of the
system. Assertion (the falling edge) of BnRES is asyn-
chronous to BCLK. De-assertion (the rising edge) of
BnRES is synchronous to the falling edge of BCLK.
BnRES is only asserted during a Power-On Reset con-
dition, caused by the assertion of the POReset signal. The
POReset input is an asynchronous input, and hence a
synchronizing d-type is required to eliminate propaga-
tion of metastable values.
The state machine which controls the working of reset
controller is shown in Figure 7.
E. Remap and Pause Controller
The remap and pause controller has three modes.
Reset status: This enables software to determine whether
the last reset was a Power On Reset (POR) or a soft reset.
Fig. 7. Reset controller state machine [2]
Remap memory: On reset the internal RAM is mapped
out and the external memory is mapped into location
0x00000000 which is the boot location for the ARM
processor. The reset memory map is cancelled by writing
to a register in this peripheral.
Pause mode: The microcontroller only supports one
simple power saving mode called Pause. This halts all
bus activity (but not the system clock) and waits for an
interrupt signal from the interrupt controller before res-
tarting the system.
The Remap output register is used to hold the value of
Remap, which is used to determine the memory map that
is used by the system. It is set LOW on reset, and is set
HIGH when the Remap address is written to with any
value. Once set HIGH, it can only be set LOW by a
system reset.
V. SPECIFICATIONS
The design of AMBA ASB APB Bridge has the fol-
lowing specifications:
• 50 MHz bus clock
• 32 bit address bus
• 32 bit data bus
• Decode and without decode cycles
• Arbitration: Fixed priority [1:4]
• No. of bus masters: 4
• Peripheral: Remap and Pause
VI. SIMULATION RESULTS
Xilinx 13.2 is used for modeling of AMBA ASB APB
Bridge and ISim is used for simulation results. Figure 8
shows the results with the priority based arbitration
scheme and the read and then the write operations
performed on the remap and pause peripheral. PSELx
indicates that the peripheral is chosen and when
BWRITE is low it indicates read operation and when
high a write operation is performed on the peripheral.
The status of remap and pause peripheral is shown in
Figure 9 when no interrupts are coming from the ARM
processor the system stays in a low power mode, when
interrupted the pause signal goes high. The remap signal
indicates if the system has recovered from a power on
reset state and when high divides the internal memory
into internal and external memory.
The RTL schematic is shown in Figure 12. The design
is implemented on SPARTAN 3E and the results are
analyzed using ChipScope Pro which is shown in Figure
10 and 11. The synthesis reports are shown in Table 1
and Table 2.
Proceedings of 2013 International Conference on Fuzzy Theory and Its Application
National Taiwan University of Science and Technology, Taipei, Taiwan, Dec. 6-8, 2013
236
4. Proceedings of 2013 International Conference on Fuzzy Theory and Its Application
National Taiwan University of Science and Technology, Taipei, Taiwan, Dec. 6-8, 2013
Fig. 8. Simulation results of ASB APB Bridge
Fig. 9. Remap and Pause outputs
Fig. 10. Chipscope Pro analysis
Fig. 11. ChipScope Pro analysis with active high power on reset
Table 1. Area report
Instance Cells Cell Area Net Area Wireload
Bridge 234 2141 0 <none> (D)
Table 2. Power report
Instance Cells Leakage
Power (nW)
Dynamic
Power
(nW)
Total
Power
(nW)
Bridge 234 5591.030 32217.318 37808.
347
Fig. 12. RTL Schematic
ARBITER
GRANTS
ARBITER
REQUESTS
READ
WRITE
PERIPHERAL
SELECTED
REMAP
ADDRES
PAUSE
ADDRESS
GRANT
REQUESTS
DEFAULT
MASTER
POWER
ON RESET
RESET
CONTROLLER
APB BRIDGE
DECODER
REMAP AND
PAUSE
ARBITER
Proceedings of 2013 International Conference on Fuzzy Theory and Its Application
National Taiwan University of Science and Technology, Taipei, Taiwan, Dec. 6-8, 2013
237