![](bg6.png)
6 WHEN THE METHOD FAILS
As it can be seen from the description of the algo-
rithm, the situations are possible in which it fails to
generate a test sequence. It happens when there is no
T-invariant x > 0 for the modeling Petri net or when
for the obtained T-invariant the appropriate firing se-
quence does not exist. The second variant means two
possibilities: there is no firing sequence for the ob-
tained T-invariant that starts in empty marking or such
sequence exists, but leads through an unsafe marking.
Three mentioned situations are illustrated in Figure 6.
Figure 6: Examples of nets for which the method fails to
generate the sequence.
The first of them (Figure 6a; there is no T-invariant
without zero entries) corresponds to a case which is
not impossible (however rather untypical) in a correct
design. In this case any sequence of microinstructions
which transfers data from input to output units of the
data path either reads more than once from the same
unit without writing to it between those readings (p
1
),
or writes to an internal unit without reading from it
(p
2
). Then the method described in (Karatkevich and
Baranov, 2010) can be applied.
Two other situations signalize that something is
wrong in the data path structure or in the structure of
microinstructions. If a firing sequence leading from
an empty marking back to itself and covering all tran-
sitions does not exist (Figure 6b), then there is an in-
ternal unit (p
3
) from which data are read before writ-
ing in it. If such firing sequence exists but has to go
through an unsafe marking (Figure 6c), then there is
a unit (p
2
) to which data are written more than once
without reading from it between those writings, which
means that some data are lost.
7 CONCLUSIONS
The proposed method provides possibility of auto-
mated generation of sequences of microinstructions
for testing data path of a digital design constructed
as a composition of a data path and a control unit.
Such sequence is a necessary part of a test bench. The
method we proposetakes into account structure of mi-
croinstructions, which may consist of several micro-
operations. Using Petri net as a model of data path
was found to be suitable for such cases.
However, the method described here at first gener-
ates a long sequence with multiple repetitions of some
transitions and then constructs a sequence of microin-
structions which may be remarkable shorter. Further
research should concentrate on checking whether it
is possible to build a minimized sequence directly,
avoiding constructing a firing sequence correspond-
ing to the T-invariant of the modeling Petri net (as in
this method) or a postman tour in the modeling graph
(as in (Karatkevich and Baranov, 2010)).
ACKNOWLEDGEMENTS
I would like to thank Samary Baranov for inspiration,
fruitful discussions and consultations. The projects of
the processors used for the examples are developed by
him.
REFERENCES
Baranov, S. (2008). Logic and System Design of Digital
Systems. TGU, Tallinn.
Baranov, S. (2009). Asms in high level synthesis of eda
tool abelite. In Preprints of the 4th IFAC Workshop on
Discrete-Event System Design, IFAC, Gandia Beach,
pages 195–200. IFAC. (to appear online in IFAC-
PapersOnLine.net).
Barkalow, A. and Wegrzyn, M. (2006). Design of Con-
trol Units with Programmable Logic. University of
Zielona Gora, Zielona Gora.
Hefferon, J. (2008). Linear Algebra. electronic edition,
Colchester.
Karatkevich, A. and Baranov, S. (2010). Graph based ap-
proach to test bench constructing for datapath. In
IWK’10, 55th Internationales Wissenschaftliches Kol-
loquium, pages 662–667. Technische Universitaet Il-
menau.
Murata, T. (1989). Petri nets: properties, analysis and ap-
plications. Proceedings of the IEEE, 77:541–580.
Peterson, J. L. (1981). Petri net theory and the modeling of
systems. Prentice-Hall.
Vanderbei, R. J. (2008). Linear Programming: Foundations
and Extensions. Springer Verlag, 3rd edition.
Wisniewski, R. (2009). Synthesis of compositional micro-
program control units for programmable devices. Uni-
versity of Zielona Gora, Zielona Gora.
PETRI NET BASED APPROACH TO TEST BENCH CONSTRUCTING FOR DATAPATH
511