Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/220648520

Functional Verification of DMA Controllers

Article  in  Journal of Electronic Testing · August 2011


DOI: 10.1007/s10836-011-5219-6 · Source: DBLP

CITATION READS
1 3,887

7 authors, including:

Michelangelo Grosso Wilson Javier Perez-Holguin


STMicroelectronics Universidad Pedagógica y Tecnológica de Colombia
82 PUBLICATIONS   552 CITATIONS    24 PUBLICATIONS   109 CITATIONS   

SEE PROFILE SEE PROFILE

Ernesto Sanchez Matteo Sonza Reorda


Politecnico di Torino Politecnico di Torino
173 PUBLICATIONS   1,376 CITATIONS    668 PUBLICATIONS   8,761 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

RESCUE: Interdependent Challenges of Reliability, Security and Quality View project

Digital system verification and validation View project

All content following this page was uploaded by Alberto Paolo Tonda on 31 May 2014.

The user has requested enhancement of the downloaded file.


J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

Functional Verification of DMA Controllers


M. Grosso  W.J. Perez H.  D. Ravotto  E. Sanchez  M. Sonza Reorda  A. Tonda 
J. Velasco Medina

Abstract - Today’s SoCs are composed of a wide


variety of modules, such as microprocessor cores,
1 Introduction
memories, peripherals, and customized blocks directly
related to the targeted application. To effectively Most Systems on Chip (SoCs) integrate at least one
perform simulation-based design verification of processor core, some peripheral devices, different logic
peripheral cores embedded in a SoC, it is necessary to modules, and a variable number of memory cores.
stimulate the devices in a broad range of behavior Although the SoC design paradigm may simplify the
possibilities, checking the produced results. Different design phase, it also increases the complexity of the
strategies for generating suitable stimuli have been audit process related to the methods of validation,
proposed by the research community to functionally verification and testing (VV&T), by decreasing the
verify the modules embedded in a SoC and their accessibility of each module into the chip and
interconnection: however, design verification of deeply combining modules from different sources, design
embedded peripherals, e.g., DMA controllers, is really a styles, and test characteristics.
challenging task, since their controllability is typically Until now, the research community has devoted
reduced. In this paper we describe a general approach to considerable efforts to processor core VV&T processes,
develop short and effective test programs aimed to the while integrated peripherals have been less investigated.
design verification of embedded system peripherals, Naturally, processor cores have focused the research
such as DMA controllers embedded in SoCs, which can attention due to their area occupation and their primary
also be exploited in later stages for testing, by adding role in computation and management tasks within the
suitable observability features. Experimental results SoC. However, it must be noted that the increasing
demonstrating the method suitability are reported. number and complexity of embedded peripherals
strongly characterizes most of the current SoCs.
In general, design verification is the process of
Keywords Design verification  Test program  Set
verifying that all modeled behaviors of a design are
stimuli generation  SBST  DMA Controller
consistent with a reference model. The reference model
may represent a set of properties that the system needs
Responsible Editor to fulfill, and usually it is described at a higher
E. Sanchez · M. Grosso · D. Ravotto · M. Sonza Reorda · A. Tonda abstraction level [1].
Dipartimento di Informatica e Automartica, Design verification methodologies have been
CAD Group, Politecnico di Torino,
Turin, Italy developed in a broad spectrum, ranging from manual
E. Sanchez, e-mail: ernesto.sanchez@cad.polito.it verification to formal verification techniques, and
M. Grosso, e-mail: michelangelo.grosso@polito.it including for example random and semi-random
D.Ravotto, e-mail: danilo.ravotto@polito.it
M. Sonza Reorda, e-mail: matteo.sonzareorda@polito.it
approaches. Formal verification uses mathematical
A. Tonda, e-mail: alberto.tonda@polito.it techniques to prove the correctness of the design, but it
W.J. Perez H. · J. Velasco Medina
frequently involves counting on enormous
Bionanoelectronics Group, Universidad del Valle computational resources, even for some simplified
Cali, Colombia models. On the other hand, despite the simulation-based
W.J. Perez H., e-mail: wjperezh@univalle.edu.co
J. Velasco Medina, e-mail: jvelasco@univalle.edu.co
methods can never guarantee the complete conformance
to specification of formal methods, they are widely used
W.J. Perez H. due to the reasonable computational resources required,
GIRA Group, Universidad Pedagógica y Tecnológica de Colombia
Sogamoso, Colombia the grade of details of the circuit behavior that can be
e-mail: wilson.perez@uptc.edu.co simulated and their potential to detect and diagnose
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

faults in different stages of the device VV&T processes only. The generation is backed up by coverage metrics
[2][3]. gathered exploiting the available device description.
In the simulation-based context, it is possible to state The resulting stimuli can be effectively used for the
that a verifying procedure implies to perform a validation and verification of the core design, and later,
simulation-based process in which input data (called set they may represent an effective starting point for the
of stimuli) are applied to a model of the device under development of set of stimuli aimed to device testing.
evaluation (called device under test or DUT). The rest of the paper is organized as follows: Section
Subsequently, the observed and expected behaviors are 2 provides some significant background material in the
compared by mean of a response checker that generates area of SBST techniques for peripheral verification and
pass/fail information regarding the outcome of the test, as well as on the metrics used for evaluating the
comparison [2]. effectiveness of generated stimuli, and outlines the main
Simulation-based methodologies aim at uncovering features of typical DMA controllers. Section 3 describes
design errors by thoroughly exciting the current model the method that we propose for generating proper
of the circuit using suitable sets of stimuli [2], which stimuli for DMA controller verification. A case study is
can be randomly, manually or automatically generated. presented in Section 4, whereas Section 5 reports some
In any case, the objective is to fully excite all functions preliminary experimental results gathered on a
of the DUT by employing a reduced number of representative test case. Finally, Section 6 draws some
appropriate data patterns. This issue is a crucial point of conclusions, and summarizes future research activities
the whole methodology, since it strongly affects the cost in the area.
of the whole VV&T process, and because the simulation
of an exhaustive set of data patterns is generally far too
2 Peripheral verification and test
expensive [3]. However, determining the appropriate
data patterns is a problem-dependent and non-trivial 2.1 Background
task. As mentioned before, most of the available works
In a processor-based SoC, an efficient way to developed by the research community on VV&T issues
generate the set of stimuli is to use the embedded mainly tackle processor cores embedded in SOCs.
processor core to execute a specially designed test These methodologies resort to functional approaches
program whose goal is to make evident the difference based on exciting specific functions and resources of the
between a faulty device and a working one [2]. The processor. Some of the most representative approaches
introduction of this kind of test programs dates back to are briefly described in the following.
the 80s [4], and such techniques have been exploited in Psarakis et al. [6] present a comprehensive study
the functional self-test approach known as Software- about the potential role of software-based self-testing in
Based Self-Test or SBST [5]. The key idea of SBST is the microprocessor test and validation process, as well
to exploit on-chip programmable resources to run as its supplementary role in other classic functional- and
normal programs that suitably stimulate the processor structural-test methods. Additionally, the authors
itself and/or other devices accessible by it. The propose a well structured taxonomy for different SBST
processor generates and applies functional-test patterns methodologies according to their test program
using only its native instruction set, virtually development philosophy.
eliminating the need for additional test specific Alternatively, different approaches to face the test set
hardware. The SBST technique provides an effective generation for embedded processors testing using SBST
alternative to traditional testing and self-testing methodologies, taking into account various processor
approaches, but it can also complement and/or enhance architectures and system environment constraints have
the test quality provided by these approaches [2][3]. been developed in [7 - 13].
This paper aims at extending SBST methods to the Cheng et al. [7] present a technique to test the SoC at
verification of peripherals in charge of providing system the system level using application-based programs. The
services, called system peripherals, instead of pure proposed software application-level verification
communication services. System peripherals such as methodology employs test programs composed of
DMA controllers, interrupt controllers, and timers are dynamic sequences of code segments. The test programs
usually more deeply embedded in the SOC than are automatically generated using a test generator.
peripherals devoted to communications services, called Experiments were conducted applying this methodology
I/O peripherals. to the Altera Nios SoC.
In particular, this paper presents a method for the Shen et al. [8] provide an automatic functional test
generation of suitable stimuli able to thoroughly excite generation method for both manufacturing test and
the different functionalities implemented by a typical design validation. This methodology is implemented in
DMA controller, starting from its functional description, a program that takes as input the instruction set of the
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

processor and the operations performed by it in given piece of code is by a test; this goal can be
response to each instruction, and produce a functional achieved by quantifying the capacity of a given set of
test. Kranitis et al. [9] developed a high-level SBST input stimuli to activate specific features of the model
component-oriented methodology which is based on the [20]. Similarly, borrowing the idea from software
knowledge of the ISA and the processor’s register testing [21], coverage metric for validation, verification
transfer level description. They applied this or testing must be defined to assure the adequacy of the
methodology to two MIPS-compatible processors. set of stimuli, and the collected information about
On the other hand, different approaches can be found coverage can be exploited as a useful test criterion [1].
in literature related to peripheral VV&T issues; The selection of the most suitable coverage metric to
however, most of them tackle I/O peripherals, only. For be exploited during the generation process depends on
example, Bolzani et al. in [14] propose a fully the characteristics of the considered model. In this paper
automated methodology for the generation of test we particularly exploit the code coverage and functional
programs for peripheral cores (PIA, UART) embedded metrics, defined below:
in a SoC. The methodology is based on the exploitation  Code coverage metrics derived directly from metrics
of the correlation between high-level metrics (Toggle, used in software testing. These metrics identify
Expression, Condition, Branch and Statement) and the which code structures belonging to the circuit
gate-level fault coverage. Apostolakis et al. [15] present hardware description language (HDL) design are
exercised by the set of stimuli, and whether the
a generic deterministic flow for the application of
control flow graph corresponding to the code
processor-based testing to communication peripheral
description is thoroughly traversed. The structures
cores. In this approach, the test sets for the individual
exploited by code coverage metrics range from a
subcomponents of the communication peripheral core single line of code to if-then-else constructs.
are pre-computed and pre-generated. In [16] the authors  Functional coverage metrics, as the name recalls,
propose a combination of the approaches presented in target design functionalities during the validation,
[14] and [15] and define a new automatic methodology verification and test processes. These metrics are
that has been evaluated on a SoC with three popular composed of a set of very precise test cases that
communication peripherals such as UART, HDLC and exercise the design in well defined or restricted
Ethernet. situations guaranteeing that the design under
Concerning system peripherals, Dushina et al. [17] evaluation complies with some design
introduce a semi-formal based methodology to generate functionalities.
test sets targeting corner cases of the device under test.
The device is modeled in a simplified manner and 2.3 Direct Memory Access Controller description
translated into a Finite State Machine (FSM). Each FSM A Direct Memory Access (DMA) Controller, or
state corresponds to a combination of the coverage DMAC, is designed to allow large blocks of data being
variables. Then, a set of abstract tests containing a transferred between memory and peripherals (or
sequence of states for every case is obtained via a between two memories) without the intervention of the
coverage-driven test generator. Finally, every single microprocessor. Once the DMA registers are
abstract sequence of states is translated in order to programmed by the processor, a transfer can be started
obtain the real test set. This methodology was exploited in order to either relocate data from a memory location
for the validation of a DMA controller embedded in a to another or write data to/from a peripheral depending
RISC-based microcontroller, achieving about 87% of on the application requirements. The inclusion of a
statement coverage and 75% of branch coverage. DMAC into a SoC reduces the microprocessor
Then again, two newer approaches were presented in workload, since different devices are able to transfer
[18] and [19] by Grosso et al. aimed to system data without requiring the microprocessor intervention.
peripherals verification, which can be extended also for During data transfers, the embedded microprocessor
testing. These works propose a method to develop core is allowed to perform other tasks; sometimes, the
functional tests for DMA controllers embedded in SoCs, data transfer is also faster when executed by a DMAC.
and form the basis for the current approach presented Although their size is normally not huge, DMACs
herein. Some preliminary experimental results for an may exhibit a significant complexity. Features
8051 based benchmark SoC with an embedded 8237- supported by DMACs include, among others: different
compliant DMA controller core were reported to data transfer modes, management of several peripheral
demonstrate the method effectiveness. channels, programmable arbitration mechanisms to
2.2 Test Generation and Coverage metrics manage multiple data transfers. In fact, the latter point is
particularly difficult to handle, since it requires taking
Coverage metrics were firstly defined in software into account several specific situations, coming from
testing as the measure of how thoroughly exercised a different arbitration mechanisms and different
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

sequences of DMA requests from peripherals. contain a limited number of configuration sets in order
to be applicable in real scenarios.
AOU
We propose a structured methodology for the
Bus interface T development of an effective and compact verification
Timing program set for system peripherals, based on the
&
Control Ch 3 analysis of a high-level description of the addressed
Ch 2 devices, and providing an operative strategy to
Ch 1
Ch 0 verification engineers. The proposed methodology is
State
Machine Read/Write sketched in figure 2 and aims to reduce the complexity
Count & Address DBOU of the produced verification set, guaranteeing at the
Registers T same time its ability to thoroughly excite the DUT.
The first step of this methodology concerns the
DBIN analysis of the description of the peripheral core, and
Priority Status, Command, has two main objectives: firstly, it allows to identify the
Logic Mode, Mask, Request & AIN main elements devoted to the configuration of the
Temporary Registers device, e.g., the configuration registers; and secondly, it
leads to identify the most suitable coverage metrics,
Fig. 1 DMAC generic architecture. depending on the available description of the DUT.
Figure 1 sketches the architecture of a generic
DMAC. Roughly speaking, a multichannel DMAC is Start
composed of a set of configuration and status registers,
a set of transfer channels, a priority arbiter, and a DMA Peripheral analysis
engine which includes a state machine and a logic
block. The configuration registers provide the whole Identification of shared and
unshared resources
device with the operation settings, including the
necessary information to properly perform all the DMA
Configuration generation
operations. Configuration and status registers can be
accessed by the processor through a system bus. Generation of verification
Depending on the application, it is possible to activate a sequences for shared and
microprocessor interrupt that is activated at the end of a unshared resources

DMA channel transfer.


Logic simulation on the DUT
Every single channel counts on a particular set of
registers that allow the channel to perform independent
data transfers. The elements involved in a data transfer End
are: a source address, a destination address, the number
and dimension of the data words to transfer, and finally, Fig. 2 Proposed methodology flow description.
the transmission mode selected. The second step is devoted to identify shared and
Exploiting the DMA arbiter, it is possible to unshared resources within the peripheral under test. A
implement different priority modes when different shared resource corresponds to some circuitry which is
transfers are required at the same time: two of the most exploited during the management and usage of different
commonly adopted are fixed priority and round robin. channels, while an unshared one participates in the
elaboration related to a single channel, only. A shared
3 Proposed approach resource can be either control shared or elaboration
shared:
When tackling embedded system peripherals,
 Control shared resources are mainly devoted to
devising a stimuli generation technique based on a
drive and coordinate the operation of internal
purely functional approach is a non-trivial task. For peripheral modules;
instance, setting every channel of a DMAC and
 Elaboration shared resources perform specific tasks
checking its correct behaviour in all possible
during data elaboration, and are unique along the
configurations would create a set of stimuli of data path. These modules may receive or send data
prohibitive dimensions. Furthermore, once the device is
to one of a set of internal sub modules (unshared)
configured, there is also a large number of possibilities
that implement an identical function.
for the data and the dimension of the blocks to be
Unshared resources, on the other hand, are mainly
transmitted. While a good verification set for the device
involved in the data path as elaboration resources, and
must be able to thoroughly excite it, it should also
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

are usually present as a set of different modules able to determined by analyzing the configuration registers:
carry out the same function described by the same HDL usually, the upper bound consists of 2n possibilities,
code, often in order to introduce parallelism. where n is the number of bits contained in all the
The labeling of resources as shared or unshared can configuration registers. Not all the 2n configurations,
be easily performed on the basis of a high-level though, are actually useful or valid, and in some cases
description of the DUT. In figure 1, for example, the there are incompatibilities to consider. Impossible
DMA timing & control module would be labeled as configurations do not appear in the configuration graph
elaboration shared because every channel exploit of the device, but this reduction alone is usually not
functionalities performed by it to complete data significant.
transfers, while, on the other hand, the priority arbiter Labeling modules as shared and unshared is then
would be labeled as control shared, for its control exploited to further reduce the number of paths needed
functions. In any case, it is enough to label both to cover the entire configuration graph: since sets of
modules as shared in order to complete the next steps of unshared modules perform the same functions in the
the methodology. All channel modules, on the other DUT, it is not necessary to excite all configurations of
hand, are clearly unshared. all the shared and unshared modules in a set.
In the third step, all possible configurations of the Theoretically, to verify all combinations of the DUT
DUT are subsequently represented by a configuration configurations, at least each arc of the graph should be
graph: the main goal of this graph is to provide the covered by one path; experimental evidence, however,
methodology with a well organized structure that allows suggests that it is sufficient to cover all nodes to obtain
reducing the number of configurations of the device a satisfactory coverage of the chosen metrics, as it will
whereas avoiding unnecessary replications. This step be shown in the experimental results section. This
provides the user with a reduced set of device constraint alone considerably reduces the number of
configurations that intends to support the creation of the paths needed to thoroughly excite the device. An
actual verification programs (performed in the fourth intuitive reason to justify experimental data could be the
step), considering for every program the whole device following: consider two independent options with two
configuration, as well as special requirements for each possible settings each, for example priority (which can
configuration path. be either fixed or rotating) and timing (which can be
Conceptually, the configuration graph is a directed either normal or compressed). Covering the nodes
graph, whose nodes are grouped in levels, where all corresponding to each setting generates two paths, while
nodes in the same level correspond to the same group of covering the arcs between them creates four: since the
configuration bits that control a certain functional two options are independent, the latter approach
characteristic of some device resource; each node in a originates two useless paths.
group represents a value that the group can assume. An Let us, for example, refer to Figure 1: as stated
arc in the graph from node A to node B that belong to above, the priority logic is labeled as shared, while
two different levels, exists iff the device can channel modules are unshared. To exhaustively excite
functionally be configured assigning to the groups of the DUT, it is important to stimulate all configurations
configuration bits the values represented by nodes A and of the DMA engine, but is not necessary to use every
B. Several consecutive levels represent all possibilities channel in every priority logic configuration.
in the configuration register of a given resource. It is
important to notice that a path in the configuration
graph can touch only one node in each level, since
nodes in each level represent mutually exclusive
configurations of an specific device resource. A valid
path in the graph starts at the first level and ends in the
final one, and represents a legal configuration setting for
the device. Figure 3 reports a schematic view of a
configuration graph.
Reducing the number of considered paths is a priority
during stimuli generation, to avoid the explosion of the
number of configurations needed and consequently the
number of verification programs to run.
A first reduction of the configuration graph is
performed exploiting information gathered in the
previous steps. The maximum number of different
configurations available for the device can be
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

graph information gathered before.

Bits of a configuration register represented in each level


SM[0]
Unused 1 Pt  compulsory_paths(graph);
configuration
2 If (unvisited_nodes)
Shared Module SM[1,2] 3 p  null;
4 foreach(level)
5 p  choose_node(graph);
SM[3]
6 end;
7 Pt  p;
8 endif;
UM1[0,1]

Unshared Module 1 Fig. 4 Paths compilation algorithm.


UM1[2]
Then, if there are still unvisited nodes in the graph, for
every available level in the graph, a node is selected,
UM2[0,1] and then it is included in the current path. In order to
Unshared Module 2 correctly select nodes to conform the current path p, the
UM2[2]
function choose_node(graph) (line 5) evaluates
prohibited conditions, and updates nodes and arcs
weights. In the case that more than one node is available
in the corresponding level, the function chooses one of
Fig. 3 A sample path in a configuration graph. On the right, the possibilities, taking into account graph constraints,
the bits of the configuration register represented in each level. and graph information.
Corresponding nodes in unshared modules are here shown
In the fourth step, the actual test algorithms are
with the same colors.
defined. Such algorithms are based on the main
Once the aforementioned operations are carried out, a functionalities of each module that have to be identified:
list of configuration paths must be obtained, following a  Firstly, shared modules are analyzed. For example,
suitable algorithm to efficiently visit the nodes. The the priority logic module is devoted to actually
goal of the algorithm is to include each node of the schedule different channels transfer activity
graph in at least one path while keeping the total following the configuration settings. However, as a
number of paths as low as possible. In addition, there shared device, the priority arbiter performs its
could be both compulsory paths specified by the handling activities on the complete set of DMA
verification engineers and prohibited configurations channels regardless of the specific mode of
inherent to the DUT. operation of every one;
Compulsory paths represent specific corner cases or  Secondly, unshared modules are considered. For
configurations with great relevance, whose resulting example, the main activity of the hardware involved
behavior verification engineers desire to check: thus, in every channel module of the DMAC is counting a
they are always included in the list of paths, regardless series of words to transfer, in increasing or
of the algorithm used to visit the nodes. For example, decreasing order, bounded by the limits previously
while tackling a DMAC, a verification expert could be defined in the channel internal registers. Two simple
interested in enabling a memory-to-memory transfer cases can thus be devised for a channel module,
while enabling the channel 0 address hold. thoroughly exciting the counter by making it operate
Prohibited configurations are expressed as rules that in increasing and decreasing order alternatively.
prevent specific nodes in different levels from being This directly descends from the paths derived in the
part of the same path, and they must be taken into previous step.
account each time the algorithm chooses a node
included in one of those rules. For example, if the The verification algorithms defined for unshared
memory-to-memory option is enabled in the command modules may require specific restrictions regarding the
register of a DMAC, the compressed timing option configuration of the complete device; usually, however,
cannot be activated. these test algorithms may be flexibly adapted to comply
Figure XX outlines the algorithm exploited to with different global device configurations, as in the
compile the set of configuration paths. In this algorithm, case of the DMAC.
Pt is the set of configuration paths, whereas p is the Real verification programs and external stimuli are
path under construction. hence developed. Each program originates from a path
Initially, all nodes in the graph are labeled as in the graph, and is composed of a configuration part
unvisited, and every arc is tagged with a 0 value weight. and an operation part. The former directly descends
Compulsory paths are firstly created (line 1) exploiting from the configuration described in the path, and is
mainly composed of instructions to be run by an
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

available embedded microprocessor to write aim is to compute values for the coverage metrics
configuration registers of the addressed system selected in the first step of the workflow, simulating all
peripheral. The latter part is aimed at activating the verification programs created for the paths of the
device under verification with a suitable set of patterns, configuration graph.
which must comply with the selected configuration and It is important to notice that, if the results did not
must be vast and varied enough to thoroughly excite the reach satisfactory levels, a new test case could be easily
components. The operation part can be composed of generated by taking into account previously discarded
processor instructions, data to be preloaded in memory, paths of the configuration graph or inserting compulsory
or direct peripheral stimuli. Since each configuration is paths that cover the missing elements unveiled by the
given in specific terms through the paths derived from device simulation. This need, however, never arose
the previous step, this task is relatively straightforward during the experiments described in the next sections.
and easy to implement, relying on the functional
specification of the addressed device.
4 Case study
In order to assess its effectiveness, the proposed
Memory to memory approach has been tested on a benchmark SoC,
enable/disable containing an 8051 compatible IP core [22], a 64 KB
data RAM block, a 64 KB program ROM, an 8237-
Channel 0 address hold
enable/disable compliant DMA controller, and other peripherals with
DMA transfer capability (see Figure 4). To connect the
Controller processor core to the system bus and provide the DMA
enable/disable
module with the proper bus control signals, a simple
Timing logic module was interposed between the 8051 external
Normal/Compressed memory port and the data bus. The module includes the
Control register required three-state buffers and filters the addresses
(shared) Priority
Fixed/Rotating generated by the processor core, relying on the fact that
the employed processor outputs address 0x00000000
Write when not requiring the control of the data bus.
Late/Extended
The employed 8237-compliant controller provides
dreq active four independently programmable transfer channels.
high/low DMA requests can be activated via hardware or
dack active
software. This module allows to control memory-to-
high/low memory and peripheral-to-memory data transfers and
provides block memory initialization capability.
Mode
Illegal/Read/Write/Verify
Additionally, it offers static read/write or handshake
modes, and includes direct bit set/reset capabilities.
Initialization Table 1 reports the RT-level description of the DMA
Auto / No Auto
Channel 1
controller. The configuration of the DMA controller
(unshared) Address
channels is accomplished by setting each of the bits in
Inc / Dec the mode register, partially depicted in figure 5.
Transfer SoC
Unused/Block/Single/Demand
RAM P1 P2 P3 P4
Mode
Illegal/Read/Write/Verify

Internal Bus
Initialization
Auto / No Auto
Channel 2 Processor DMA
ROM
(unshared) Address core controller
Inc / Dec

Transfer Fig. 6 Benchmark SoC diagram.


Unused/Block/Single/Demand

To effectively visit the configuration graph, a pseudo-


random algorithm is chosen to leverage non-
Fig. 5 Part of a configuration graph, representing the deterministic selection of the paths, following the
modules of an 8237 compliant DMAC. indications given in the previous section. Each node is
In the fifth step, a logic simulation is performed: its associated with a weight which is initially set to 0 and
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

incremented each time the node becomes part of a path. the other resources. This is directly mapped on the
While creating a path in the configuration graph, a node configuration graph.
will be visited if it has the lowest weight value among Theoretically, by analyzing the device configuration
all nodes in the same level. If two or more nodes in the registers, it is possible to identify as many as 232
level share the same value, the node will be chosen possible device configurations, which decreases to
randomly with equal probability among those with the 28∙[22(22-1)]4 considering the illegal modes. On the
lower weight value. The algorithm takes into account other side, exploiting the proposed method, 18
both compulsory paths and prohibited configurations. configuration paths are obtained.
The algorithm was implemented in about 350 lines of From each of these paths, a verification procedure is
Java code, while the configuration files describing obtained, composed of a configuration part, where the
available configuration registers, compulsory path and microprocessor writes suitable data in the DMAC
prohibited configurations were written in extended registers, and an operation part, where either the
markup language (XML) and, in this case, occupy about processor and the testbench act on the device ports to
4.73 KBytes of memory. excite it coherently with the specified configuration.
An example of verification procedure derived from a
configuration path is described in the following:
5 Experimental results
i. The command register is set with values
Exploiting the described methodology a compact test corresponding to:
set for the DMA controller has been generated. Firstly,  memory-to-memory disabled;
the configuration registers, such as the command  channel 0 address hold disabled;
register and mode register, are identified; secondly,  controller enabled;
coverage metrics are chosen. For the available DMAC  normal timing;
model, the most important metrics are statement,  rotating priority;
condition, and branch coverage.
 late write;
All data about coverage metrics have been gathered
 dreq active low;
at the end of the simulation process performed on
 dack active high.
Modelsim SE-64 V.6.5c by Mentor Graphics. All the
The register controlling the four channels is set,
experiments were run on an Intel core2duo processor
so that Channel 1 and Channel 4 are configured
with 2 Gb RAM.
as:
Table 1 DMA controller description at RT-Level  write;
DMAC  auto initialize disabled;
Files 22
 address increment;
Instances 38
VHDL code lines 3,600  single mode.
Statements 2,144 Channel 2 and Channel 3 are configured as:
Branches 628  write;
Conditions 180
Fec conditions 250  auto initialize disabled;
Expressions 7  address decrement;
Fec expressions 10  demand mode.
Toggle nodes 746
ii. The memory area where the DMA will write
In the following step, the shared and unshared data from the peripheral is cleared.
resources within the controller are labeled and the iii. For each channel, the base address register and
configuration graph is built. The main shared resource is word counter are initialized. 16 transfers are set
the DMA engine, followed by the general registers, the for each channel: channels set with address
internal buses and the priority arbiter. The unshared increment will have a base address of 0x0000,
resources are mainly related to the channel control, such while ones with address decrement will have a
as address registers, word count registers and channel base address of 0x0010. This combination of
mode registers. values can toggle the first nibble of both the
By discarding the invalid configurations, we obtained base address register and the word count
a configuration graph composed of 44 nodes. register. The excitation of the other nibbles of
Considering the shared resources in the DMA these registers is addressed by other
description, the data transfer control performed by the verification programs in the set.
DMA priority logic is not directly related to the chosen iv. A loop is then executed, requesting the transfer
channel, neither to the address increment or decrement. on each channel. Control lines are driven by
Thus, each of the transfer modes is linked to only one of the testbench. In each iteration, several
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

channels are activated at the same time, in 1. Pradhan Dhiraj K., Harris Ian G., “Practical Design
order to attest the correctness of the rotating Verification”, Cambridge University Press. June 2009,
priority schedule. ISBN: 9780521859721
2. Ravotto, D.; Sanchez, E.; Sonza Reorda, M.; Squillero, G.;
v. Finally, the memory area where data has been “Design validation of multithreaded architectures using
written is checked by the processor core. concurrent threads evolution”, IEEE 22nd Annual
Symposium on Integrated Circuits and System Design,
By applying the complete method, a verification set 2009. ISBN: 978-1-60558-705-9
of 18 test programs is obtained, counting about 913 3. Bushnell, M.L. and Agrawal, V.D.; “Essentials of
Bytes on the whole; the developing process took about Electronic Testing for Digital, Memory, and Mixed-Signal
VLSI Circuits”. Springer-Verlag, 2000
one week, considering the graph construction and 4. Thatte, S. and Abraham J.; “Test Generation for
analysis and the development of the verification Microprocessors”, IEEE Transactions on Computers, vol.
procedures. 29, n. 6, June 1980, pp. 429-441
The whole verification set needs 7,000 clock cycles 5. Paschalis, A.; Gizopoulos, D.; "Effective software-based
to be completed. self-test strategies for on-line periodic testing of embedded
Table 2 reports the coverage results obtained by the processors," IEEE Trans. on CAD of Integrated Circuits
and Systems, vol.24, no.1, pp. 88- 99, Jan. 2005
application of the complete verification set: all chosen 6. Psarakis, M.; Gizopoulos, D.; Sanchez, E.; Sonza-Reorda,
metrics were completely saturated without the need of M.; "Microprocessor Software-Based Self-Testing",
iterating the process. Some percentages reported do not Design & Test of Computers, IEEE , vol.27, no.3, pp.4-19,
reach 100% only because of dead code blocks (for May-June 2010 doi: 10.1109/MDT.2010.5
example, unreachable conditional branches). 7. Cheng, A.; Parashkevov, A. and Lim, C.C.; “A Software
Test Program Generator for Verifying System-on-Chip”,
Table 2 Coverage results 10th IEEE International High Level Design Validation
Total Covered and Test Workshop, 2005, pp. 79-86
# % 8. Shen, J. and Abraham, J.A.; “Native Mode Functional
Statements 2,144 2,093 97.62 Test Generation for Processors with Applications to Self
Branches 628 605 96.34 Test and Design Validation”, Proceedings International
Conditions 180 162 90.00 Test Conference 1998, pp. 990-999
Fec Conditions 250 219 87.60 9. Kranitis, N.; Paschalis, A.; Gizopoulos, D.; Xenoulis, G.;
Expressions 7 7 100.00
Fec Expressions 10 10 100.00
“Software-Based Self-Testing of embedded processors”,
Toggle Nodes 746 730 97.86 IEEE Trans. on Computers, vol 54, n. 4, April 2005, pp
461-475
10. Chen, L.; Ravi, S.; Raghunathan, A.; Dey, S.; “A Scalable
The results in table 2 show that the proposed method Software-Based Self-Test Methodology for Programmable
improves the outcome reported in [17], and [18], thanks Processors”, Proc. IEEE/ACM Design Automation Conf.,
to the novel techniques introduced in this paper. pp. 548 – 553, 2003
11. Gurumurthy, S.; Vasudevan, S. and Abraham, J.;
“Automated Mapping of Pre-Computed Module-Level
6 Conclusions Test Sequences to Processor Instructions”, Proc. IEEE
Intl. Test Conf. 2005, 12.3, 2005.
This paper presents a functional based approach to
12. Psarakis, M.; Gizopoulos, G.; Hatzimihail, M.; Paschalis,
the generation of stimuli for design validation of DMA A.; Raghunathan, A.; Ravi, S.; “Systematic Software-
controllers embedded in SoCs; the generation is backed Based Self-Testing for Pipelined Processors”, Proc.
up by high-level Code Coverage Metrics (CCMs). IEEE/ACM Design Automation Conf. 2006, pp. 93-398
Experimental results gathered on a sample DMA 13. Sosnowski, J.; “Software-based self-testing of
controller demonstrate the effectiveness of the proposed microprocessors”, Journal of Systems Architecture,
Elsevier, 2005.
methodology. Following the proposed approach, a
14. Bolzani, L.; Sanchez, E.; Schillaci, M.; Sonza Reorda, M.;
verification engineer can develop in a short time an Squillero, G.; "An Automated Methodology for
effective and compact verification set able to saturate Cogeneration of Test Blocks for Peripheral Cores," IEEE
verification metrics, relying only on a high-level Int’l On-Line Testing Symposium, 2007, pp. 265-270
description of the DUT. 15. Apostolakis, A.; Psarakis, M.; Gizopoulos, D.; Paschalis,
Future developments include the application of the A.; "Functional Processor-Based Testing of
Communication Peripherals in Systems-on-Chip," IEEE
proposed methodology to other SoC peripherals and
Transactions on Very Large Scale Integration (VLSI)
exploiting the principles described to enhance testing Systems, vol. 15, n. 8, Aug. 2007, pp. 971-975
techniques, as well as further automation in the 16. Apostolakis, A.; Gizopoulos, D.; Psarakis, M.; Ravotto,
generation of instruction sequences and patterns to D,; Sonza Reorda, M.; “Test Program Generation for
stimulate the peripheral modules. Communication Peripherals in Processor-Based SoC
Devices," IEEE Design & Test of Computers, vol.26, n.2,
March-April 2009, pp.52-63
References
J. Electron Test (2010) xx:xxx-xxx
xxx xx.xxxx/xxxxxx-xxx-xxxx-x

17. Dushina, J.; Benjamin, M.; Geist, D.; “Semi-formal test


generation and resolving a temporal abstraction problem
in practice: industrial application”, IEEE/ACM Design
Automation Conference, 2003, pp. 699-704
18. Grosso, M.; Perez H., W. J.; Ravotto, D.; Sanchez, E.;
Sonza Reorda M; Medina-Velasco J., "Functional test
generation for DMA controllers", 11th Latin American
Test Workshop (LATW 2010), pp.1-6, 28-31 March 2010,
doi: 10.1109/LATW.2010.5550334
19. Grosso, M.; Perez H, W.J.; Ravotto, D.; Sanchez, E.;
Sonza Reorda, M.; Medina-Velasco, J., "A software-based
self-test methodology for system peripherals", 15th IEEE
European Test Symposium (ETS’10), pp.195-200, 24-28
May 2010, doi: 10.1109/ETSYM.2010.5512758
20. Goodenough, J.B. and Gerhart, S.L.; “Toward a Theory of
Testing: Data Selection Criteria, Current trends in
programming methodology”, vol. 2 R. T. Yeh, Ed.
Prentice-Hall. Englewood Cliffs, NJ, 1977, pp. 44-79
21. Tasiran, S. and Keutzer, K.; “Coverage metrics for
functional validation of hardware designs”, IEEE Design
& Test of Computers, vol.18, no.4, Jul/Aug 2001, pp.36-
45
22. 8051 IP Core circuit description (VHDL): Oregano
Systems web site, http://www.oregano.at/eng/
23. Sonza Reorda, M.; Peng, Z. and Violante, M.; “System-
Level Test and Validation of Hardware/Software Systems
(Springer Series in Advanced Microelectronics)”.
Springer-Verlag, New York. 2005

View publication stats

You might also like