Design and Verification of AMBA AHB
Design and Verification of AMBA AHB
Abstract: The AHB (Advanced High-performance Bus) is range. The bus slave signals back to the active master
a high-performance bus in AMBA (Advanced the success, failure or waiting of the data transfer. Bus
Microcontroller Bus Architecture) family. It is a standard transfer is read/write operation between master and
for intercommunication of modules in a system. AHB slave which may take one or more bus cycles. AHB
standards are defined by ARM and supports the decoder is used to decode the address of each transfer
communication of on-chip memories processors and and provide a select signal for the slave that is involved
interfaces of off-chip external memory. In this paper we in the transfer. A single centralized decoder is required
present, design and perform verification of AHB which in all AHB implementations.
support one master and four slaves. In this work, the
design of the AHB Protocol is developed comprising of the
basic blocks such as Master, Slave, decoder and After designing the AHB supporting one master and
multiplexers. This AMBA-AHB protocol can be used in four slave. We have developed a verification
any application provided the design should be an AHB environment in SV to verify the read/write transactions
compliant. The building blocks of the design master, between the master and slave for randomized address
slaves, decoder and multiplexers are developed in Verilog. and control signals in a given range and constraints so
The verification environment is developed in system that maximum space of the input output combinations
Verilog (SV). QuestaSim (Advanced verification tool from are verified. The intent of functional verification is to
Mentor Graphics) is used to simulate and verify the design make sure that the design is working as intended.
and calculate code and functional coverages. Functional verification is measured using coverage.
There are two coverages in functional verification, they
Keywords- AHB, AMBA-AHB, QuestaSim, ARM are code coverage and functional coverage. Code
I. INTRODUCTION coverage is the amount of code triggered during the
verification. It can help finding dead code and false
Advanced Microcontroller Bus Architecture defines the paths which is not triggered for any given combination
on-chip communication standard for designing high- of the inputs. Functional coverage tells the percentage
performance embedded microcontrollers. Three types of transactions which are successful.
of buses are defined in AHB specification by ARM,
The article is structured as follows. Section II contains
they are Advance High Performance Bus (AHB),
the design of the system. Section III the verification of
Advanced System Bus (ASB) and Advanced Peripheral
the design. Section IV shows the verification results.
Bus (APB). In this paper we limit our discussion to Section V explains the future scope of our system, and
AHB. concludes the article.
An AMBA-based microcontroller contains a high-
II. DESIGN
performance system bus (AMBA AHB or ASB), on-
chip memory, CPU cores, and DMA (Direct Memory A. AMBA AHB master
Access) devices. APB is a secondary bus or peripheral
bus that provide communication between low AMBA AHB master is designed using Finite State
bandwidth devices (peripheral devices). There is a Machines (FSM). It is three states FSM. Address and
bridge between high-performance bus and peripheral control signal information is provided by the master to
bus for translation of signal standards. Figure 1 initiate read/write operation. Since we are considering
represents a generic AMBA-based microcontroller. only single beat transactions in this project. Some of the
signals can neglected. The simplified master interface is
Bus Cycle in the AMBA AHB protocol description is shown in Figure 2. It consist of three states IDLE,
defined from rising edge to rising edge transitions. READ, WRITE Figure 3 shows the state diagram of
AHB master is able to initiate read and write master FSM.
operations by providing an address and control
information. Only one bus master is allowed to actively
use the bus at any one time. AHB slave responds to a
read or write operation within a given address-space
311
Figure 5. Single master AHB system diagram
has to participate in the transaction. The decoder will the address from the master so that the right slave is
decode the last two bits of the address and activates that selected and the multiplexor routes the corresponding
slave with HSELx signal. Once the slave is activated, slave output data back to the master. AHB also supports
based on the control signals (HTRANS and HWRITE) multi-master designs by the use of an interconnect
sent from the master the slave fsm goes to read/write component that provides arbitration and routing signals
state. If it is a read transaction (HTRANS = 1 and from different masters to the appropriate slaves. Figure
HWRITE = 0), the slave will decode the address and 5 shows only the main address and data buses and
sends the data in that address to the master through typical data routing. Not all signals are shown. In our
HRDATA signal and also makes the HREADY signal design we have designed one master four slave system.
high indicating that the data in HRDATA is valid. If it
is a write transaction(HTRANS = 1 and HWRITE = 1) III. VERFICATION
the slave will write the data present in the signal
HWDATA into the address location specified by the In this project Verification Environment is developed
HADDR signal and makes the HREADY signal high using System Verilog language. Verification using
indicating the end of transaction. environment is called as simulation based verification.
Different components of general verification
When master receives data HREADY from slave it environment, depicted in Figure 7 are as follows.
finishes the transaction and makes HRESP high. When
HRESP is made high the slave goes back to IDLE state Packet is an object which carries the values of inputs
from either READ or WRITE state. This FSM should and outputs at a given time. Packet class defines the
be integrated with memory modules like RAM to make type of input output it should carry.
them AHB compatible.
Generator generates the packet with input randomized
to values defined in the constraints and pushes it to the
driver.
312
Figure 7. Generic verification environment
313
Figure 9. Simulation result of one master and four slave system
314
V. CONCLUSION [8] IEEE Draft Standard for System Verilog - Unified Hardware
Design,Specification and Verification Language, IEEE P1800/DS,
February2012 pp.1-1304
AMBA AHB protocol defines the communication [9] Soo Yun Hwang, Dong Soo Kang, Hyeong Jun Park, Kyoung Son
standards for high performance embedded systems. In Jhang, “Implementation of a Self-Motivated Arbitration Scheme for
this work we have design and verified the system the Multilayer AHB Busmatrix”, IEEE Transactions on Very Large
Scale Integration (VLSI) Systems ( Volume: 18 , Issue: 5 , May
depending upon the specifications, data transfer that are
2010 )
supported by AMBA bus architecture. Verification of
AHB Protocol for and Single Master - Four Slaves has
been verified by developing the Verification IP using
system Verilog using constraint random based
verification technique. The simulation and verification
result shows that the communication between master
and slave fsm’s using AHB protocol is as intended. All
of the address and data signals are successfully
transferred from master fsm to slave fsm following
AMBA-AHB protocol. There is no loss of address, data
and control signal information. The master fsm should
be integrated with modules in the system which tend to
initiate the transactions and slave fsm should be
integrated with memory modules in the system to make
the system AHB compatible. The Verification
environment developed using tool Questa and it is sure
that developed VIP is also compatible with other
verification tools from Cadence, Synopsys etc.
REFERENCES
315