You are on page 1of 4

AMBA AHB Bus Potocol Checker with Efficient

Debugging Mechanism

Yi-Ting Lin, Chien-Chou Wang, and Ing-Jer Huang


Department of Computer Science and Engineering National Sun Yat-sen University
Kaohsiung, 80424 , Taiwan
itlin@esl.cse.nsysu.edu.tw
m933040032@student.nsysu.edu.tw
ijhuang@cse.nsysu.edu.tw

Abstract—Bus-based system-on-chip (SoC) design becomes the


major integration methods for shorting design cycle and time-to-
market, thus how to verify IP functionality on bus protocol is a
challenge. Traditional simulation-based bus protocol monitors
can check bus signals obey bus protocol or not, but they often
lack of efficient debugging mechanisms .We propose a rule-
based bus protocol checker, it contains 73 related bus protocol
rules to check bus signal behavior, and two corresponding
debugging mechanism to shorten debugging times. Error
reference table can summarize design under tests (DUTs) have
been violated; Windowed trace buffer can capture multiple
errors’ history data that helps designer debug efficiently.

I. INTRODUCTION
In recent years, on-chip bus architecture becomes the Fig. 1 AHB Protocol Checker Architecture
major integration method for implementing a SoC. On-chip
bus specification provide a standard interface that enables IPs
can communicate with each others. Designer just integrates checkers can find errors on real-time environment, we need
his own IPs with third party IPs into the system to more efficient ways to debug the system, only violated rules
significantly reduce design cycles. Thus how to efficiently cannot help designer to rapidly find errors.
make sure the IP functionality works correctly after
We propose an AMBA AHB bus protocol checker based
integrating to dedicate bus architecture is a great challenge.
on monitor-based method. There are total 73 rules we have
There are many verification works based on formal that include master, slave, reset, bus components, and
verification [1] [2] [3] [4] [5] [6]. DUTs are modeled as finite performance issue. In order to improve debugging ability, we
state transition and the properties are written by using propose two debugging mechanisms. An error reference table
Computation Tree Logic (CTL) [7], then uses verification can summarize total errors that have been occurred in
tools [8] [9] [10] to verify DUT’s behaviors. Formal simulation. A windowed trace buffer can capture multiple
verification can verify DUT’s behavior thoroughly, but it error bus signals, which designer can find protocol errors
needs to model all environment components not only the according to these waveforms.
DUTs we want to verify. The other verification is monitor-
based approaches [11] [12] [13] [14]. The specification is II. AHB PROTOCOL CHECKER ARCHITECTURE
defined as a set of rules, and then DUT is checked cycle by Fig. 1 shows AHB Protocol Checker (HPChecker)
cycle during simulation to make sure DUT obeys all these architecture, which contains four main function blocks:
rules. This method is efficient when we integrate several IPs Protocol Checker, Configuration Registers, ERROR
into a pre-verification environment. Reference Table, and Windowed Trace Buffer. We will
But many errors may occur in real-time that monitor-based introduce these four blocks individually.
approaches often cannot find errors in simulation environment.
Thus several commercial verification IPs provide hardware
protocol check to solve this problem. Although protocol

978-1-4244-1684-4/08/$25.00 ©2008 IEEE 928


period. In early debugging period, there may have many
errors, especially when test bench or real case application has
very long execution time. Such large amount of log messages
or error signals waveform could help designer to debug
limitedly, because that will be hard to read or analyze.
Moreover, we do not care about the timing information when
error occurred in most case. Thus we provide an error
reference table that can summarize what errors have been
occurred.
Fig. 2 shows the concept of error reference table, which
the rows are corresponding to every error; the columns are
corresponding to every ID of master or slave. We total
Fig. 2 Error Reference Table Illustration support 16 masters and 16 slaves, thus the number of column
is 16. We total have 31 master-related rules, 16 slave-related
A. Protocol Checker rules, 11 reset-related rules, and 15 bus components-related
HPChecker is a rule-based protocol checker, thus how to rules. Each master-related and slave-related error needs one
establish a set of well-defined rules is very important. We row due to that every 16 master/slave may occur this error.
reference Synopsys Synopsys verification intellectual property Bus-related and reset-related errors consume one row for
(VIP) to establish 67 rules. Besides, according to our design each other. Thus ERT total has 16 columns and 49 rows.
experiences, we add 6 new rules to increase our error finding D. Windowed Trace Buffer
ability. In conclusion, our protocol checker has total 73 rules,
including 31 master-related rules, 16 slave-related rules, Traditional trace mechanisms are based on forward tracing,
11reset-related rules, and 15 bus components-related rules. which designer set one or more trigger points, the trace will
Bus components include arbiter and decoder. begin when bus signals match trigger value. But sometimes
designers need to understand the signals before some errors
Protocol Checker is the main core of HPChecker, the occurred. Thus we need backward tracing mechanism to
inputs are all AHB bus signals, and the outputs are 73-bit capture the history signals especially in program and protocol
ERROR signals and corresponding master and slave IDs. error debugging.
Every rule has its own corresponded bit because every cycle
maybe occur more than one error. If the ith bit of ERROR is In general backward tracing, as Fig. 3 shows, designers use
set, which indicates current bus signals violate ith rule. The a circular trace buffer to store the trace data until first error
Master/Slave ID is formed by the HMASTER signal. If an occurred, which the trace depth depends on trace buffer size.
error occurs, the HPChecker will output the corresponded Thus, if we have multiple errors to debug, we need to do
master ID number or slave ID number to indicate which multiple backward tracing to debug all errors, which may
master or slave violates the AHB protocol. cause a lot of debugging times. In case of protocol check
debugging, we only need recently few cycles of trace data to
B. Configuration Registers find the error come from. Hence, we propose windowed trace
buffer to address this problem illustrated at Fig. 3. The main
The configuration register can let the designer to set some
idea of windowed trace buffer is that we record recently few
parameters, including mask, protocol checker enable and max cycles trace data while every error occurred. Trace buffer not
waiting cycle. The designer can base on the requirement of only records first error trace data, but also records other error
the system to mask some unnecessary rule checked. The trace data as much as we can.
enable bit can enable or disable the HPChecker. For example,
if we integrate one master IP into pre-verified AHB platform, Fig. 4 shows windowed trace buffer architecture. Trace
we just need to check master-related rules and disable all Data Buffer stores bus signals for debugging and Trace Error
other rules. If we modified an arbiter, we only need to check Buffer stores current ERROR signals to indicate what errors
arbiter related rules. The max waiting cycle is set by the occurred. For our observation, we require capture 192-bit bus
signals and three cycles of trace data for debugging. All the
designer to check the HREADY max waiting cycle.
required signals are summarized in Table I. As Fig. 4 shows,
As Fig. 1 shows, the rule configuration register will mask
192-bit bus signals pass through a three stage shift registers to
the ERROR outputs. If we disable some rules, the
corresponding ERROR bits will be mask. Another applicable
debugging method is that if we want to focus on one target IP TABLE I. TRACED AHB BUS SIGNALS SUMMARY
we want to debug, we can enable corresponding rules and Signals Width Total Bits
disable irrelevant rules, which we can narrow down the HADDR, HWDATA 32 bits 64 bits
problem region. HBUSREQ, HGRANT, HLOCK 16 bits 48 bits
HWRITE, HSEL 16 bits 32 bits
C. Error Reference Table (ERT) HMASTER, HPROT 4 bits 8 bits
Traditional protocol checkers will assert error signals or a HBURST, HSIZE 3 bits 6 bits
printout error message for every error occurs, but this way is HTRANS1~HTRAN15, HRESP 2 bits 32 bits
HREADY, HMASTLOCK 1 bit 2 bits
very inefficiently for early debugging in long simulation

929
Fig. 3 The concept of traditional backward tracing and windowed trace
buffer Fig. 5 AMBA EASY verification environment

AHB Bus
Signals[191:0]

Data
Trace
Data Buffer
Write
DataWrite
Error Flag Trace Buffer
Write Controller
Write
ErrorWrite

ERROR[72:0]
Trace
Error Buffer
Data

Fig. 4 Windowed trace buffer architecture


Fig. 6 3D graphic acceleration system

capture recently three cycle bus signals. Trace Buffer Write 3) Synopsys VIP: The software is available from the
Controller (TBWC) receives Error Flag, when Error Flag Synopsys. It can also verify the IP protocol and also can
asserted, TBWC asserts DataWrite for three cycles that we generate the correct behavior of IP. We use the generated
can store latest three cycle bus signals and ErrorWrite for one correct behavior to correct our HPChecker. This step is used
cycle that we can store what errors occurred. to avoid out misunderstanding on AMBA AHB protocol or
some unconsidered conditions.
In conclusion, we need total 649 (192 * 3 + 73 = 649) bits
per error occurred. If we use 1 KByte memory as trace buffer, We run the simulation on the ARM EASY (Example
we can store up to 20 error occurrences, which can AMBA SYstem) environment like Fig. 5. For every rule, the
significantly reduce the debugging time than traditional constructed case will add to the bus as a master or slave IP and
backward tracing mechanism. then run the simulation.

III. VERIFICATION STRATEGY IV. EXPERIMENTAL REULTS


We use three methods to verify our HPChecker. 1) RTL Firstly we compare Synopsys VIP and LEON3
trigger to generate bus signals. 2) Pre-compiled cycle-level AMBAMON with HPChecker shown as Table II. Synopsys
simulation patterns. 3) Synopsys VIP. The first two VIP and LEON3 AMBAMON are un-synthesizable and only
verification strategies are buggy verification plans. We output error messages when errors occurred. HPChecker is a
construct the wrong condition case by case. If the rule case is synthesizable hardware module and we provide Error
constructed, the protocol checking module will observe these Reference Table and Windowed Trace Buffer to achieve
signals. While the protocol checking module detect that it is a efficient debugging. And Table III shows HPChecker
protocol violation then it will assert a corresponded error flag synthesis results, the total area is 43,432 gate counts.
to tell the reference table and history memory.
We use HPChecker to verify a 3D graphic acceleration
1) RTL trigger to generate bus signals: Behavioral buggy
masters and slaves connect to the bus and then the HPChecker TABLE II. VERIFICATION MONITORS COMPARISON
will observe these signals.
Synopsys LEON3
2) Pre-compiled cycle-level simulation patterns: We use IP Name HPChecker
VIP AMBAMON
software to generate the corresponded condition. The software Synthesizable No No Yes
generates a ROM file and the verification module base on the ERT and
Debugging Error Error
content of the file cycle by cycle output these signals into the Support Messages Messages
Windowed
bus. And then the HPChecker will detect these signals whether Trace Buffer
violate the protocol or not. Number of
67 35 73
Rules

930
TABLE III. SYNTHESIS RESULTS

Max Frequency 203MHz


Total Area 43,432 Gates
Submodule Gate Counts
Protocol Checker 28,825
Error Reference Table 10,172
Windowed Trace Buffer
4,435
(Without Trace Buffer)

simulation, and a windowed trace buffer that we can trace bus


signals for multiple errors. We use HPChecker to verify a real
example of 3D graphic acceleration system, which can find
Fig. 7 An example output picture of 3D graphic system buffer
the errors more efficient.

time T0 T1 T2 T3 T4 T5 T6 T7 REFERENCES
3D(RM)
HCLK
HMASTER RM
[1] S. V. Aguiar, CamposEdmund, M. Clarke, W. R. Marrero, and M.
HTRANS NONSEQ SEQ Minea, ‘‘Verifying the performance of the PCI local bus using symbolic
HBUSREQ
HBURST INCR16 techniques,’’ in Proceedings of International Conference on Computer
HGRANT Design: VLSI in Computers and Processors. IEEE Computer Society,
Jan. 1995, pp. 72---78.
HMASTER# RM OTHER
HTRANS# NONSEQ [2] E. M. Clarke, E. A. Emerson, and A. P. Sistla, ‘‘Automatic verification
HBUSREQ#
HBURST# INCR16 of finite-state concurrent systems using temporal logic specifications,’’
HGRANT#
ACM Transactions on Programming Languages and Systems
(TOPLAS), vol. 8, pp. 244 --- 263, 1986.
De-asserted too early
to do arbitration
[3] P. Chauhan, E. M. Clark, Y. Lu, and D. Wang, ‘‘Verifying IP-core
based System-On-Chip designs,’’ in Twelfth Annual IEEE International
Fig. 8 An error wrapper design waveform ASIC/SOC Conference, Sept. 1999, pp. 27---31.
[4] A. Roychoudhury, T. Mitra, and S. R. Karri, ‘‘Using formal techniques
system as a case study. The system is shown as Fig. 6. The 3D to debug the AMBA System-on-Chip bus protocol,’’ in Proceeding on
graphic system contains three main modules, geometry engine Conference on Design, Automation and Test in Europe (DATE), 2003.
(GM), tile divider (TD) and rendering engine (RM) and [5] L. Ivanov and R. Nunna, ‘‘Specification and formal verification of
contains a processor, ARM926EJ-S. The system deals with interconnect bus protocols,’’ in 43rd IEEE Midwest Symposium on
Circuits and Systems, vol. 1, Aug. 2000.
graphic computing. We find a case that some IPs violate the
[6] M. Kaufmann, A. Martin, and C. Pixley, ‘‘Design constraints in
AHB protocol but do not cause the system crash. This is an symbolic model checking,’’ in Proceedings of the 10th International
interesting case that we are hardly to find where the problem is. Conference on Computer Aided Verification. Springer-Verlag, 1998.
Fig. 7(a) shows the correct picture after 3D graphic calculation, [7] K. L. McMillan, Symbolic Model Checking, K. L. McMillan, Ed.
which is an intact hexagon. Fig. 7(b) shows the error picture Kluwer Academic Publishers, 1993.
that is a broken hexagon. In the beginning, we do not know [8] I. Ltd., ‘‘Sugar formal property language reference manual.’’ [Online].
this error is com from software or hardware. By using Available: http://www.haifa.il.ibm.com/projects/verification/sugar/
HPChecker, we find one wrapper hardware implementation [9] S. Ltd., OpenVera LRM 2.0. [Online]. Available: http://www.open-
error that cause an INCR8 burst transfer can only transfer one vera.com
beat. The error waveform is shown in Fig. 8. According to the [10] Property Specification Language Reference Manual. [Online].
AMBA AHB specification, for a fixed length burst, the master Available: www.eda.org/vfv/docs/PSL-v1.1.pdf
can de-assert the HBUSREQ signal once the master has been [11] H.-M. Lin, C.-C. Yen, C.-H. Shih, , and J.-Y. Jou, ‘‘On compliance test
of on-chip bus for SOC,’’ in Proceedings of the 2004 conference on
granted the bus for the first transfer. The RM de-asserts the Asia South Pacific design automation, 2004.
HBUSREQ signal as soon as it is granted. This behavior [12] A. Nightingale and J. Goodenough, ‘‘Testing for AMBA compliance,’’
causes RM can only perform one beat in an INCR8 burst. in 14th Annual IEEE International ASIC/SOC Conference, Sept. 2001.
[13] M. T. Oliveira and A. J. Hu, ‘‘High-level specification and automatic
V. CONCLUSION generation of IP interface monitors,’’ in ACM IEEE Design Automation
We propose a AMBA AHB protocol checker (HPChecker), Conference, June 2002, pp. 129 --- 134.
which contains a monitor-based protocol checker with 73 rules, [14] K. Shimizu and D. Dill, ‘‘Deriving a simulation input generator and a
coverage metric from a formal specification,’’ in Proceedings of the
a configuration register that can enable or disable some rules th
39 conference on Design automation, June 2002.
to focus the region we want to debug, a error reference table
(ERT) to summarize the total errors during an application or

931

You might also like